RhythmGame 1.4.3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
sounds::MultiSound Class Reference

A sound that plays multiple underlying sounds simultaneously. More...

#include <MultiSound.h>

Inheritance diagram for sounds::MultiSound:
Inheritance graph
[legend]
Collaboration diagram for sounds::MultiSound:
Collaboration graph
[legend]

Public Member Functions

 MultiSound (std::vector< std::shared_ptr< Sound > > sounds)
 
void play () override
 Plays the sound.
 
void stop () override
 Stops the sound.
 
void setVolume (float volume) override
 Sets the volume of the sound.
 
auto isPlaying () const -> bool override
 Is the sound playing right now?
 
auto getVolume () const -> float override
 Gets the volume of the sound.
 
- Public Member Functions inherited from sounds::Sound
virtual ~Sound ()=default
 

Detailed Description

A sound that plays multiple underlying sounds simultaneously.

Used for bmson note fusion: when notes from different sound channels share the same (x, y) position, their slices are combined into a single MultiSound. Playing this sound plays all of them at once.

Constructor & Destructor Documentation

◆ MultiSound()

sounds::MultiSound::MultiSound ( std::vector< std::shared_ptr< Sound > >  sounds)
explicit

Member Function Documentation

◆ getVolume()

auto sounds::MultiSound::getVolume ( ) const -> float
overridevirtual

Gets the volume of the sound.

Returns
The volume. 1 is normal, 0 is silent, 2 is twice as loud.

Implements sounds::Sound.

◆ isPlaying()

auto sounds::MultiSound::isPlaying ( ) const -> bool
overridevirtual

Is the sound playing right now?

Implements sounds::Sound.

◆ play()

void sounds::MultiSound::play ( )
overridevirtual

Plays the sound.

This does not block, obviously. Make sure the sound object stays alive.

Implements sounds::Sound.

◆ setVolume()

void sounds::MultiSound::setVolume ( float  volume)
overridevirtual

Sets the volume of the sound.

Parameters
volumeThe volume. 1 is normal, 0 is silent, 2 is twice as loud.

Implements sounds::Sound.

◆ stop()

void sounds::MultiSound::stop ( )
overridevirtual

Stops the sound.

Does not block. The sound can be played again.

Implements sounds::Sound.


The documentation for this class was generated from the following files: