|
Thrive
|
A component for sound sources. More...
#include <sound_source_system.h>
Public Member Functions | |
| Sound * | addSound (std::string name, std::string filename) |
| Adds a new sound. More... | |
| void | removeSound (std::string name) |
| Removes a sound by name. More... | |
| void | playSound (std::string name) |
| Plays a sound This is equivalent to playing the sound directly. More... | |
| void | interpose (std::string name, int fadeTime) |
| Interrupts the current ambient sound and interposes a new one Does nothing for non-ambient sound sources. More... | |
| void | queueSound (std::string name) |
| Queues up an ambient sound to be played after the current one Does nothing for non-ambient sound sources. More... | |
| void | interruptPlaying () |
| Stops playing of all songs. | |
| void | load (const StorageContainer &storage) override |
| Loads the component. More... | |
| StorageContainer | storage () const override |
| Serializes the component. More... | |
Public Member Functions inherited from thrive::Component | |
| virtual | ~Component ()=0 |
| Destructor. | |
| bool | isVolatile () const |
| A volatile component is not serialized during a save. More... | |
| EntityId | owner () const |
| The entity this component belongs to. More... | |
| void | setVolatile (bool isVolatile) |
| Sets the volatile flag. More... | |
| void | setOwner (EntityId owner) |
| Sets the component's owner. More... | |
| virtual ComponentTypeId | typeId () const =0 |
| The component's type id. | |
| virtual std::string | typeName () const =0 |
| The component's type name. | |
Static Public Member Functions | |
| static luabind::scope | luaBindings () |
| Lua bindings. More... | |
Static Public Member Functions inherited from thrive::Component | |
| static luabind::scope | luaBindings () |
| Lua bindings. More... | |
Public Attributes | |
| TouchableValue< bool > | m_ambientSoundSource = false |
| Whether this source as an ambient soundsource with no 3d position. | |
| TouchableValue< bool > | m_autoLoop = false |
| Whether this source auto loops. More... | |
| TouchableValue< float > | m_volumeMultiplier = 1.0f |
| Volume multiplier that is applied to all associated sounds. | |
Friends | |
| class | SoundSourceSystem |
A component for sound sources.
| Sound * SoundSourceComponent::addSound | ( | std::string | name, |
| std::string | filename | ||
| ) |
Adds a new sound.
| name | The name of the sound (must be unique) |
| filename | The file to play |
| void SoundSourceComponent::interpose | ( | std::string | name, |
| int | fadeTime | ||
| ) |
Interrupts the current ambient sound and interposes a new one Does nothing for non-ambient sound sources.
| name | The name of the song that is to interpose |
| fadeTime | The time the transition should take |
|
overridevirtual |
|
static |
Lua bindings.
Exposes:
| void SoundSourceComponent::playSound | ( | std::string | name | ) |
Plays a sound This is equivalent to playing the sound directly.
| name | The name of the sound |
| void SoundSourceComponent::queueSound | ( | std::string | name | ) |
Queues up an ambient sound to be played after the current one Does nothing for non-ambient sound sources.
| name | The name of the song to queue up |
| void SoundSourceComponent::removeSound | ( | std::string | name | ) |
Removes a sound by name.
| name |
|
overridevirtual |
| TouchableValue<bool> thrive::SoundSourceComponent::m_autoLoop = false |
Whether this source auto loops.
Auto looping sound sources will automatically keep playing sounds from the added sounds and fade between them
1.8.10