3 #include "engine/component.h"
4 #include "engine/system.h"
5 #include "engine/touchable.h"
71 float maxDistance = 25.0f;
72 float rolloffFactor = 0.4f;
73 float referenceDistance = 5.0f;
158 std::string m_filename;
168 COMPONENT(SoundSource)
188 static luabind::scope
296 std::list<Sound*> m_addedSounds;
298 std::list<Sound*> m_removedSounds;
300 Sound* m_autoActiveSound =
nullptr;
301 Sound* m_queuedSound =
nullptr;
302 int m_autoSoundCountdown = 0;
303 bool m_isTransitioningAuto =
false;
304 bool m_shouldInteruptPlaying =
false;
306 std::unordered_map<std::string, std::unique_ptr<Sound>> m_sounds;
326 static luabind::scope
359 void update(
int,
int)
override;
363 struct Implementation;
364 std::unique_ptr<Implementation> m_impl;
TouchableValue< bool > m_autoLoop
Whether this source auto loops.
Definition: sound_source_system.h:284
StorageContainer storage() const override
Serializes the component.
Definition: sound_source_system.cpp:285
Properties m_properties
Properties.
Definition: sound_source_system.h:150
Helper class for keeping track of changing data.
Definition: touchable.h:18
PlayState
Play mode of the sound.
Definition: sound_source_system.h:58
void load(const StorageContainer &storage) override
Loads the component.
Definition: sound_source_system.cpp:265
TouchableValue< float > m_volumeMultiplier
Volume multiplier that is applied to all associated sounds.
Definition: sound_source_system.h:289
void playSound(std::string name)
Plays a sound This is equivalent to playing the sound directly.
Definition: sound_source_system.cpp:236
Sound()
Default constructor for loading.
Definition: sound_source_system.cpp:57
static luabind::scope luaBindings()
Lua bindings.
Definition: sound_source_system.cpp:190
void stop()
Stops the sound during the next frame.
Definition: sound_source_system.cpp:117
void shutdown() override
Shuts the system down.
Definition: sound_source_system.cpp:503
Base class for components.
Definition: component.h:31
SoundSourceSystem()
Constructor.
Definition: sound_source_system.cpp:452
A system handles one specific part of the game.
Definition: system.h:23
void init(GameState *gameState) override
Initializes the system.
Definition: sound_source_system.cpp:493
void activate() override
Called by GameState::activate()
Definition: sound_source_system.cpp:463
void deactivate() override
Called by GameState::deactivate()
Definition: sound_source_system.cpp:478
void pause()
Pauses the sound during the next frame.
Definition: sound_source_system.cpp:110
Definition: sound_emitter.h:19
Definition: bullet_to_ogre_system.h:5
void load(const StorageContainer &storage)
Loads a sound from storage.
Definition: sound_source_system.cpp:79
std::string filename() const
The file that the sound is playing.
Definition: sound_source_system.cpp:73
std::string name() const
The name of the sound.
Definition: sound_source_system.cpp:97
Definition: bullet_ogre_conversion.h:6
A component for sound sources.
Definition: sound_source_system.h:167
Sound * addSound(std::string name, std::string filename)
Adds a new sound.
Definition: sound_source_system.cpp:213
GameState * gameState() const
Returns the system's game state.
Definition: system.cpp:183
StorageContainer storage() const
Constructs a storage container for serialization.
Definition: sound_source_system.cpp:124
Represents a distinct set of active systems and entities.
Definition: game_state.h:41
TouchableValue< bool > m_ambientSoundSource
Whether this source as an ambient soundsource with no 3d position.
Definition: sound_source_system.h:277
Creates, updates and removes sounds.
Definition: sound_source_system.h:314
Sound properties.
Definition: sound_source_system.h:67
void update(int, int) override
Updates the system.
Definition: sound_source_system.cpp:510
Represents a single sound.
Definition: sound_source_system.h:23
~SoundSourceSystem()
Destructor.
Definition: sound_source_system.cpp:459
void interpose(std::string name, int fadeTime)
Interrupts the current ambient sound and interposes a new one Does nothing for non-ambient sound sour...
Definition: sound_source_system.cpp:243
static luabind::scope luaBindings()
Lua bindings.
Definition: sound_source_system.cpp:306
void removeSound(std::string name)
Removes a sound by name.
Definition: sound_source_system.cpp:227
void interruptPlaying()
Stops playing of all songs.
Definition: sound_source_system.cpp:260
static luabind::scope luaBindings()
Lua bindings.
Definition: sound_source_system.cpp:29
void play()
Starts (or resumes) playing the sound.
Definition: sound_source_system.cpp:103
void queueSound(std::string name)
Queues up an ambient sound to be played after the current one Does nothing for non-ambient sound sour...
Definition: sound_source_system.cpp:253
A key-value storage for serialization.
Definition: serialization.h:36
SoundEmitter * m_sound
Pointer to internal sound.
Definition: sound_source_system.h:155