|
stmm-games-doc
0.32.0
|
Sound event. More...

Classes | |
| struct | Init |
| struct | LocalInit |
Public Member Functions | |
| SoundEvent (Init &&oInit) noexcept | |
| Constructor. More... | |
| void | trigger (int32_t nMsg, int32_t nValue, Event *p0TriggeringEvent) noexcept override |
| The triggered function. More... | |
Public Member Functions inherited from stmg::Event | |
| virtual | ~Event () noexcept=default |
| virtual void | addMsgFilter (int32_t nInFromMsg, int32_t nInToMsg, int32_t nInFromValue, int32_t nInToValue, bool bOutMsgDefined, int32_t nOutMsg, MSG_FILTER_VALUE_OP eOutValueOperator, int32_t nOutValueOperand, int32_t nOutValueAdd) noexcept |
| Add a message filter. More... | |
| virtual void | addListener (int32_t nGroupId, Event *p0ListenerEvent, int32_t nMsg) noexcept |
| Adds a listener to the event. More... | |
| bool | isActive () const noexcept |
| Tells whether the event is active. More... | |
| int32_t | getTriggerTime () const noexcept |
| The triggering time. More... | |
| int32_t | getPriority () const noexcept |
| The priority. More... | |
| int32_t | getDebugTag () const noexcept |
| The debug tag. More... | |
Protected Member Functions | |
| void | reInit (Init &&oInit) noexcept |
| Reinitialization. More... | |
Protected Member Functions inherited from stmg::Event | |
| Event (Init &&oInit) noexcept | |
| Constructor. More... | |
| void | reInit (Init &&oInit) noexcept |
| Reinitialization. More... | |
| virtual void | informListeners (int32_t nGroupId, int32_t nValue) noexcept |
| Calls the trigger function of a group of listeners. More... | |
| const Level & | level () const noexcept |
| The level this event belongs to. More... | |
| Level & | level () noexcept |
| The level this event belongs to. More... | |
Sound event.
Instances of this class create a sound and optionally pause, resume, stop, change the position and change the volume of it.
The sound listener is the center of the show area or, in subshow mode, the center of the subshow area.
This class can also play a sound passed as nValue to the trigger function. The value is the index into Named::sounds(). Free sounds can also ignore the LocalInit::m_bLooping value and be played once.
| anonymous enum |
| Enumerator | |
|---|---|
| MESSAGE_SET_SOUND_IDX | Sets the sound to play. nValue is the index into Named::sounds(). |
| MESSAGE_PRELOAD | Preloads the sound so that when MESSAGE_PLAY or MESSAGE_PLAY_FREE are triggered it's faster. |
| MESSAGE_PLAY | Plays the sound if not already playing. |
| MESSAGE_PLAY_FREE | Plays the sound without keeping a reference to it (cannot pause, set position, etc.). |
| MESSAGE_PLAY_FREE_ONCE | Plays the sound without keeping a reference to it (cannot pause, set position, etc.) without (potential) looping. |
| MESSAGE_PLAY_FREE_IDX | Plays the sound identified by nValue without keeping a reference to it (cannot pause, set position, etc.). |
| MESSAGE_PLAY_FREE_IDX_ONCE | Plays the sound identified by nValue without keeping a reference to it (cannot pause, set position, etc.) without (potential) looping. |
| MESSAGE_PAUSE | Pauses the sound if not already paused. |
| MESSAGE_RESUME | Resumes the sound if it was paused. |
| MESSAGE_STOP | Stops the sound. |
| MESSAGE_SET_VOL | Sets the volume of the sound the sound. The nValue 0 is inaudible, 1000 max volume. |
| MESSAGE_SET_POS_X | The sound x position is set to nValue. |
| MESSAGE_SET_POS_Y | The sound y position is set to nValue. |
| MESSAGE_SET_POS_Z | The sound z position is set to nValue. |
| MESSAGE_SET_POS_XY | The sound xy position is set to Util::unpackPointFromInt32(nValue). |
| MESSAGE_ADD_TO_POS_X | Add nValue to the current x position. |
| MESSAGE_ADD_TO_POS_Y | Add nValue to the current y position. |
| MESSAGE_ADD_TO_POS_Z | Add nValue to the current y position. |
| MESSAGE_ADD_PERC_TO_POS_X | Add nValue divided by 100 to the current x position. |
| MESSAGE_ADD_PERC_TO_POS_Y | Add nValue divided by 100 to the current y position. |
| MESSAGE_ADD_PERC_TO_POS_Z | Add nValue divided by 100 to the current y position. |
| MESSAGE_RESTART | Restarts the sound. |
| MESSAGE_RESTART_RESET | Restarts the sound by resetting the initial values for position and volume. |
|
explicitnoexcept |
Constructor.
| oInit | The initialization data. |
|
protectednoexcept |
Reinitialization.
| oInit | The initialization data. |
|
overridevirtualnoexcept |
The triggered function.
| nMsg | If one MESSAGE_OP_TYPE_ENUM then operation is performed otherwise nDefaultIncBy (see constructor). |
| nValue | The triggered add value. Is only used if nMsg is MESSAGE_OP_TYPE_ENUM. |
| p0TriggeringEvent | The triggering event or null if event activated itself. |
Implements stmg::Event.
1.8.13