Go to the source code of this file.
|
| void | bgm_update_volume (void) |
| |
| void | bgm_set_target_volume (s32 volume) |
| |
| s32 | bgm_get_map_default_variation (s32 songID) |
| | If the given song ID is present in SongsUsingVariationFlag, returns the current map's songVariation & 1 value.
|
| |
| void | bgm_reset_sequence_players (void) |
| |
| void | bgm_reset_volume (void) |
| |
| void | bgm_update_music_control (void) |
| |
| s32 | _bgm_set_song (s32 playerIndex, s32 songID, s32 variation, s32 fadeOutTime, s16 volume) |
| |
| s32 | bgm_set_song (s32 playerIndex, s32 songID, s32 variation, s32 fadeOutTime, s16 volume) |
| |
| b32 | bgm_fade_in_song (s32 playerIndex, s32 songID, s32 variation, s32 fadeInTime, s16 fadeStartVolume, s16 fadeEndVolume) |
| |
| s32 | bgm_adjust_proximity (s32 playerIndex, s32 mix, s16 state) |
| |
| AuResult | bgm_set_track_volumes (s32 playerIndex, s16 trackVolSet) |
| |
| AuResult | bgm_clear_track_volumes (s32 playerIndex, s16 trackVolSet) |
| |
| AuResult | bgm_set_linked_mode (s32 playerIndex, b16 mode) |
| |
| s32 | bgm_init_music_players (void) |
| |
| void | bgm_quiet_max_volume (void) |
| |
| void | bgm_reset_max_volume (void) |
| |
| b32 | bgm_is_any_song_playing (void) |
| |
| void | bgm_pop_song (void) |
| |
| void | bgm_push_song (s32 songID, s32 variation) |
| |
| void | bgm_pop_battle_song (void) |
| |
| void | bgm_push_battle_song (void) |
| |
| void | bgm_set_battle_song (s32 songID, s32 variation) |
| |
| void | bgm_NOOP (void) |
| |
◆ bgm_update_volume()
Definition at line 343 of file bgm_control.c.
343 {
345
348 return;
349 }
350
354 }
355
359 } else {
361 }
364 }
365}
BSS s32 PopupMenu_SelectedIndex
s16 NextVolumeUpdateTimer
BSS s16 MusicCurrentVolume
BSS s16 MusicTargetVolume
void snd_set_bgm_volume(VolumeLevels volume)
Referenced by bgm_update_music_control().
◆ bgm_set_target_volume()
| void bgm_set_target_volume |
( |
s32 | volume | ) |
|
◆ bgm_get_map_default_variation()
| s32 bgm_get_map_default_variation |
( |
s32 | songID | ) |
|
If the given song ID is present in SongsUsingVariationFlag, returns the current map's songVariation & 1 value.
Otherwise, returns -1.
- See also
- SongsUsingVariationFlag
- Returns
- -1: no override; 0: override to variation 0; 1 override to variation 1
Definition at line 50 of file bgm_control.c.
50 {
52
56
58 }
59 }
60
61 return -1;
62}
s32 SongsUsingVariationFlag[]
Lists the songs that are forced to use the variation determined by map.songVariation & 1.
AreaConfig gAreas[29]
Zero-terminated.
GameStatus * gGameStatusPtr
Referenced by _bgm_set_song(), and bgm_fade_in_song().
◆ bgm_reset_sequence_players()
| void bgm_reset_sequence_players |
( |
void | | ) |
|
Definition at line 64 of file bgm_control.c.
64 {
66
69 }
70
75}
MusicControlData gMusicControlData[2]
MusicControlData BlankMusicControlData
Referenced by load_engine_data().
◆ bgm_reset_volume()
◆ bgm_update_music_control()
- Bug
- this is called even if we are trying to fade in, immediately overriding any fade parameters
Definition at line 83 of file bgm_control.c.
83 {
89
91 switch (
music->state) {
93 break;
96 if (
music->fadeOutTime < 250) {
100 }
101 } else {
104 }
105 }
109 }
110 } else {
113 }
114 }
115 } else {
117
119 }
122 }
123 break;
131 }
132 } else {
134 }
135 break;
138 break;
141 break;
145
147 } else {
149
150
151
152
153 if (
music->songName > 0xFFFFU) {
158 } else {
159
161 }
166 }
167 }
168 }
169 } else {
180 }
181 }
182 break;
183 }
184 }
186}
@ MUSIC_STATE_STOP_CURRENT
@ MUSIC_STATE_AWAIT_FADEOUT
@ MUSIC_FLAG_FADE_IN_NEXT
void bgm_update_volume(void)
void bgm_set_target_volume(s32 volume)
BSS s16 MusicDefaultVolume
AuResult snd_song_push_stop(s32 songName)
AuResult snd_song_request_fade_out(s32 songName, s32 fadeTime, AuCallback callback)
AuResult snd_song_request_play(s32 songName, s32 variation)
Called from bgm_control to start playing a particular song + variation.
AuResult snd_song_request_push_fade_out(s32 songName, s32 fadeTime)
AuResult snd_song_load(s32 songID, s32 playerIndex)
return value may be either an AuResult error code OR a valid songName
AuResult snd_song_request_pop(s32 songName)
AuResult snd_song_request_fade_in(s32 songName, s32 variation, s32 fadeInTime, s32 startVolume, s32 endVolume)
Called from bgm_control to fade in a particular song + variation.
AuResult snd_song_is_playing(s32 songName)
AuResult snd_song_stop(s32 songName)
Referenced by step_game_loop().
◆ _bgm_set_song()
| s32 _bgm_set_song |
( |
s32 | playerIndex, |
|
|
s32 | songID, |
|
|
s32 | variation, |
|
|
s32 | fadeOutTime, |
|
|
s16 | volume ) |
Definition at line 188 of file bgm_control.c.
188 {
191
193 return 1;
194 }
195
197
201 return 1;
202 }
203
207 }
208
209 if (
music->requestedSongID == songID &&
music->variation == variation) {
211
215 }
216
217 return 2;
218 }
219
221 music->requestedSongID = songID;
222 music->variation = variation;
223 music->fadeOutTime = fadeOutTime;
226
227 return 1;
228}
s32 bgm_get_map_default_variation(s32 songID)
If the given song ID is present in SongsUsingVariationFlag, returns the current map's songVariation &...
AuResult snd_song_request_snapshot(s32 songName)
Referenced by bgm_pop_battle_song(), bgm_pop_song(), and bgm_set_song().
◆ bgm_set_song()
| s32 bgm_set_song |
( |
s32 | playerIndex, |
|
|
s32 | songID, |
|
|
s32 | variation, |
|
|
s32 | fadeOutTime, |
|
|
s16 | volume ) |
Definition at line 230 of file bgm_control.c.
230 {
232
233 return _bgm_set_song(playerIndex, songID, variation, fadeOutTime, volume);
234}
s32 _bgm_set_song(s32 playerIndex, s32 songID, s32 variation, s32 fadeOutTime, s16 volume)
Referenced by bgm_init_music_players(), bgm_push_battle_song(), bgm_push_song(), btl_state_update_celebration(), btl_state_update_defeat(), btl_state_update_end_training_battle(), btl_state_update_run_away(), btl_state_update_victory(), state_init_exit_file_select(), state_init_title_screen(), and state_step_title_screen().
◆ bgm_fade_in_song()
| b32 bgm_fade_in_song |
( |
s32 | playerIndex, |
|
|
s32 | songID, |
|
|
s32 | variation, |
|
|
s32 | fadeInTime, |
|
|
s16 | fadeStartVolume, |
|
|
s16 | fadeEndVolume ) |
Definition at line 236 of file bgm_control.c.
236 {
239
242 }
243
245
250 }
251
255 }
256
257 music->fadeInTime = fadeInTime;
258 music->fadeStartVolume = fadeStartVolume;
259 music->fadeEndVolume = fadeEndVolume;
260 music->requestedSongID = songID;
261 music->variation = variation;
265
267}
◆ bgm_adjust_proximity()
| s32 bgm_adjust_proximity |
( |
s32 | playerIndex, |
|
|
s32 | mix, |
|
|
s16 | state ) |
Definition at line 269 of file bgm_control.c.
269 {
271
274 }
275
278 }
279
280 switch (state) {
283 break;
286 break;
289 break;
290 }
292}
@ MUSIC_FLAG_ENABLE_PROX_MIX
void snd_song_set_proximity_mix_far(s32 songName, s32 mix)
void snd_song_set_proximity_mix_near(s32 songName, s32 mix)
void snd_song_set_proximity_mix_full(s32 songName, s32 mix)
◆ bgm_set_track_volumes()
Definition at line 294 of file bgm_control.c.
294 {
296
299 }
300
302}
AuResult snd_song_set_track_volumes(s32 songName, MusicTrackVols arg1)
◆ bgm_clear_track_volumes()
Definition at line 304 of file bgm_control.c.
304 {
306
309 }
310
312}
AuResult snd_song_clear_track_volumes(s32 songName, MusicTrackVols arg1)
◆ bgm_set_linked_mode()
Definition at line 314 of file bgm_control.c.
314 {
316
319 }
320
322}
AuResult snd_song_set_linked_mode(s32 songName, b32 mode)
◆ bgm_init_music_players()
| s32 bgm_init_music_players |
( |
void | | ) |
|
Definition at line 324 of file bgm_control.c.
324 {
327
328 return 1;
329}
s32 bgm_set_song(s32 playerIndex, s32 songID, s32 variation, s32 fadeOutTime, s16 volume)
Referenced by state_step_startup().
◆ bgm_quiet_max_volume()
◆ bgm_reset_max_volume()
◆ bgm_is_any_song_playing()
| b32 bgm_is_any_song_playing |
( |
void | | ) |
|
◆ bgm_pop_song()
◆ bgm_push_song()
◆ bgm_pop_battle_song()
◆ bgm_push_battle_song()
◆ bgm_set_battle_song()
| void bgm_set_battle_song |
( |
s32 | songID, |
|
|
s32 | variation ) |
◆ bgm_NOOP()
◆ MusicDefaultVolume
◆ MusicTargetVolume
◆ MusicMaxVolume
◆ MusicCurrentVolume
◆ gMusicControlData
Definition at line 13 of file bgm_control.c.
Referenced by _bgm_set_song(), bgm_adjust_proximity(), bgm_clear_track_volumes(), bgm_fade_in_song(), bgm_is_any_song_playing(), bgm_pop_battle_song(), bgm_pop_song(), bgm_push_battle_song(), bgm_push_song(), bgm_reset_sequence_players(), bgm_set_battle_song(), bgm_set_linked_mode(), bgm_set_song(), bgm_set_track_volumes(), and bgm_update_music_control().
◆ BlankMusicControlData
Initial value:= {
.flags = 0,
.fadeOutTime = -1,
.fadeInTime = 0,
.fadeStartVolume = 0,
.fadeEndVolume = 0,
.variation = -1,
.songName = -1,
.battleSongID = 0,
.battleVariation = 0,
.savedSongID = 0,
.savedVariation = 0,
.savedSongName = 0
}
Definition at line 15 of file bgm_control.c.
15 {
16 .flags = 0,
18 .fadeOutTime = -1,
19 .fadeInTime = 0,
20 .fadeStartVolume = 0,
21 .fadeEndVolume = 0,
23 .variation = -1,
24 .songName = -1,
25 .battleSongID = 0,
26 .battleVariation = 0,
27 .savedSongID = 0,
28 .savedVariation = 0,
29 .savedSongName = 0
30};
Referenced by bgm_reset_sequence_players().
◆ SongsUsingVariationFlag
| s32 SongsUsingVariationFlag[] |
◆ NextVolumeUpdateTimer
| s16 NextVolumeUpdateTimer = 0 |