A player, which plays one song: its header and status, its tracks, its tempo and fade. More...
#include <sound/audio_engine_types.h>
Data Fields | |
| const struct SequenceHeader * | header |
| The song playing or last played. | |
| u32 | status |
| bits: 31 paused | 15..0 tracks active after the last tick. | |
| u8 | trackCount |
| Tracks this player owns, at most 16. | |
| u8 | priority |
| The song's priority. | |
| u8 | unk0a |
| The last command run: its byte - 0xB1. | |
| u8 | checkPriority |
| Nonzero: a song of lower priority does not replace a playing one. | |
| u32 | ticks |
| Song ticks played since the song started. | |
| u8 | unk10 [8] |
| Not named by TBS code. | |
| u8 * | workBytes |
| gSound_WorkBytes, which the work-byte command uses. | |
| u16 | tempo |
| Twice the tempo command's byte; 150 at start. | |
| u16 | tempoScale |
| 256 plays at the song's tempo. | |
| u16 | tempoStep |
| tempo * tempoScale / 256, added to tempoCount each frame. | |
| u16 | tempoCount |
| Each 150 in it runs one tick, so a tempoStep of 150 is a tick a frame. | |
| u16 | fadePeriod |
| Frames between fade steps; 0 when not fading. | |
| u16 | fadeCounter |
| Frames left until the next fade step. | |
| u16 | fadeVolume |
| bits: 8..4 level, 0 to 0x100 in steps of 16 | 1 fade in | 0 pause at the end (SoundFadeFlag). | |
| u8 | unk2a [2] |
| Not named by TBS code. | |
| struct SoundTrack * | tracks |
| trackCount tracks. | |
| const struct SoundVoice * | voices |
| The song's voice table. | |
| u32 | lock |
| SOUND_LOCK when free; raised while the player is changed or ticked. | |
| void(*) | nextTick (struct SoundPlayer *player) |
| The tick routine and player that were first in the chain before this player was added; this player's tick runs them first. | |
| struct SoundPlayer * | nextTickPlayer |
| Passed to nextTick. | |
A player, which plays one song: its header and status, its tracks, its tempo and fade.
Definition at line 352 of file audio_engine_types.h.
| const struct SequenceHeader* SoundPlayer::header |
The song playing or last played.
Definition at line 353 of file audio_engine_types.h.
Referenced by Audio_PlayOrResumeSound(), Audio_PlaySoundIfInactive(), Audio_ResumeSound(), Audio_StopSound(), and MusicPlayer_StartSong().
| u32 SoundPlayer::status |
bits: 31 paused | 15..0 tracks active after the last tick.
Set to SOUND_PLAYER_PAUSED alone when no track is left.
Definition at line 356 of file audio_engine_types.h.
Referenced by Audio_PlayOrResumeSound(), Audio_PlaySoundIfInactive(), Audio_ResumePlayer(), MusicPlayer_Initialize(), MusicPlayer_SetFadeParameters(), MusicPlayer_StartSong(), MusicPlayer_StepFade(), MusicPlayer_StepVolumeAndPitchTowardTargets(), and MusicPlayer_Stop().
| u8 SoundPlayer::trackCount |
Tracks this player owns, at most 16.
Definition at line 357 of file audio_engine_types.h.
Referenced by Audio_Initialize(), MusicPlayer_Initialize(), MusicPlayer_ResetActiveTracks(), MusicPlayer_SetLfoSpeed(), MusicPlayer_SetModulationDepth(), MusicPlayer_SetPan(), MusicPlayer_SetPitch(), MusicPlayer_SetVolume(), MusicPlayer_StepFade(), and MusicPlayer_Stop().
| u8 SoundPlayer::priority |
The song's priority.
Definition at line 358 of file audio_engine_types.h.
Referenced by MusicPlayer_StartSong().
| u8 SoundPlayer::unk0a |
The last command run: its byte - 0xB1.
Definition at line 359 of file audio_engine_types.h.
| u8 SoundPlayer::checkPriority |
Nonzero: a song of lower priority does not replace a playing one.
From gSound_PlayerSlots, 0 for every player.
Definition at line 362 of file audio_engine_types.h.
Referenced by Audio_Initialize(), and MusicPlayer_StartSong().
| u32 SoundPlayer::ticks |
Song ticks played since the song started.
Definition at line 363 of file audio_engine_types.h.
Referenced by MusicPlayer_StartSong().
| u8 SoundPlayer::unk10[8] |
Not named by TBS code.
Definition at line 364 of file audio_engine_types.h.
| u8* SoundPlayer::workBytes |
gSound_WorkBytes, which the work-byte command uses.
Definition at line 365 of file audio_engine_types.h.
Referenced by Audio_Initialize(), and MusicTrack_OperateWorkByte().
| u16 SoundPlayer::tempo |
Twice the tempo command's byte; 150 at start.
Definition at line 366 of file audio_engine_types.h.
Referenced by MusicPlayer_SetPitchAndUpdateFrequency(), and MusicPlayer_StartSong().
| u16 SoundPlayer::tempoScale |
256 plays at the song's tempo.
Definition at line 367 of file audio_engine_types.h.
Referenced by MusicPlayer_SetPitchAndUpdateFrequency(), and MusicPlayer_StartSong().
| u16 SoundPlayer::tempoStep |
tempo * tempoScale / 256, added to tempoCount each frame.
Definition at line 369 of file audio_engine_types.h.
Referenced by MusicPlayer_SetPitchAndUpdateFrequency(), and MusicPlayer_StartSong().
| u16 SoundPlayer::tempoCount |
Each 150 in it runs one tick, so a tempoStep of 150 is a tick a frame.
Definition at line 371 of file audio_engine_types.h.
Referenced by MusicPlayer_StartSong().
| u16 SoundPlayer::fadePeriod |
Frames between fade steps; 0 when not fading.
Definition at line 372 of file audio_engine_types.h.
Referenced by MusicPlayer_SetFadeParameters(), MusicPlayer_StartSong(), and MusicPlayer_StepFade().
| u16 SoundPlayer::fadeCounter |
Frames left until the next fade step.
Definition at line 373 of file audio_engine_types.h.
Referenced by MusicPlayer_SetFadeParameters(), and MusicPlayer_StepFade().
| u16 SoundPlayer::fadeVolume |
bits: 8..4 level, 0 to 0x100 in steps of 16 | 1 fade in | 0 pause at the end (SoundFadeFlag).
Definition at line 376 of file audio_engine_types.h.
Referenced by MusicPlayer_SetFadeParameters(), and MusicPlayer_StepFade().
| u8 SoundPlayer::unk2a[2] |
Not named by TBS code.
Definition at line 377 of file audio_engine_types.h.
| struct SoundTrack* SoundPlayer::tracks |
trackCount tracks.
Definition at line 378 of file audio_engine_types.h.
Referenced by Audio_Initialize(), MusicPlayer_Initialize(), MusicPlayer_ResetActiveTracks(), MusicPlayer_SetLfoSpeed(), MusicPlayer_SetModulationDepth(), MusicPlayer_SetPan(), MusicPlayer_SetPitch(), MusicPlayer_SetVolume(), MusicPlayer_StartSong(), MusicPlayer_StepFade(), and MusicPlayer_Stop().
| const struct SoundVoice* SoundPlayer::voices |
The song's voice table.
Definition at line 379 of file audio_engine_types.h.
Referenced by MusicPlayer_StartSong().
| u32 SoundPlayer::lock |
SOUND_LOCK when free; raised while the player is changed or ticked.
Definition at line 381 of file audio_engine_types.h.
Referenced by Audio_ResumePlayer(), MusicPlayer_Initialize(), MusicPlayer_SetFadeParameters(), MusicPlayer_SetLfoSpeed(), MusicPlayer_SetModulationDepth(), MusicPlayer_SetPan(), MusicPlayer_SetPitch(), MusicPlayer_SetPitchAndUpdateFrequency(), MusicPlayer_SetVolume(), MusicPlayer_StartSong(), and MusicPlayer_Stop().
| void(*) SoundPlayer::nextTick(struct SoundPlayer *player) |
The tick routine and player that were first in the chain before this player was added; this player's tick runs them first.
Definition at line 384 of file audio_engine_types.h.
Referenced by MusicPlayer_Initialize().
| struct SoundPlayer* SoundPlayer::nextTickPlayer |
Passed to nextTick.
Definition at line 385 of file audio_engine_types.h.
Referenced by MusicPlayer_Initialize().