47 player->
id.playerIndex = i;
57 manager->
busId = busId;
117 player->
fadeTime = (u32)(time * 10) / 115;
225 player = &manager->
players[index];
230 player->
id.playerIndex = index;
247 track = &player->
tracks[i];
319 if (trackData->
type == 0) {
323 }
else if (trackData->
type == 1) {
334 u8 isVolumeChanged[16];
335 u8 isPitchChanged[16];
351 fadeVolChanged = FALSE;
352 for (i = 0; i < 16U; i++) {
353 isVolumeChanged[i] = FALSE;
354 isPitchChanged[i] = FALSE;
376 fadeVolChanged = TRUE;
381 track = &player->
tracks[trackIdx];
390 temp = player->
id.
all + (trackIdx << 0x10);
394 if ((voiceState->
info.
all & 0xFFFF0000) == temp) {
395 voice = &globals->
voices[i];
408 track = &player->
tracks[trackIdx];
417 temp = player->
id.
all + (trackIdx << 0x10);
421 if ((voiceState->
info.
all & 0xFFFF0000) == temp) {
422 voice = &globals->
voices[i];
424 track = &player->
tracks[voiceState->
info.trackIndex];
434 if (player->
delay <= 0) {
435 while (player->
delay == 0) {
461 track = &player->
tracks[trackIdx];
467 temp = player->
id.
all + (trackIdx << 0x10) + (arg1 << 8);
471 voice = &globals->
voices[i];
486 voice = &globals->
voices[i];
494 voice = &globals->
voices[i];
504 voice = &globals->
voices[i];
511 if (i < player->lastVoiceIdx) {
516 voiceState->
info.
all = player->
id.
all + (trackIdx << 0x10) + (arg1 << 8);
517 if (track->
flags & 1) {
523 if (track->
flags & 1) {
530 voiceState->
volume = arg2 & 0x7F;
545 voiceState->
volume = ((arg2 & 0x7F) * drum->
volume) >> 7;
562 track->
pan = arg1 & 0x7F;
563 temp = player->
id.
all + (trackIdx << 0x10);
566 if ((voiceState->
info.
all & 0xFFFF0000) == temp) {
567 voice = &globals->
voices[i];
579 temp = player->
id.
all + (trackIdx << 0x10);
582 if ((voiceState->
info.
all & 0xFFFF0000) == temp) {
583 voice = &globals->
voices[i];
608 count = (arg2 & 0x7C) >> 2;
649 temp = player->
id.
all + (trackIdx << 0x10);
652 if ((voiceState->
info.
all & 0xFFFF0000) == temp) {
653 voice = &globals->
voices[i];
667 if (fadeVolChanged) {
671 if ((voiceState->
info.
all & 0xFF000000) == player->
id.
all) {
672 voice = &globals->
voices[i];
674 track = &player->
tracks[voiceState->
info.trackIndex];
695 if (voiceState->
info.playerIndex == player->
id.playerIndex) {
718 savedVoice->
tune = voiceState->
info.tune;
741 if (savedVoice->
tune != 0) {
746 voice = &globals->
voices[j];
755 voice = &globals->
voices[j];
763 if (j < player->lastVoiceIdx) {
782 savedVoice->
tune = 0;
void au_amb_manager_update(AmbienceManager *manager)
void au_amb_player_stop(AmbienceManager *manager, AmbiencePlayer *player)
void au_amb_set_disabled(s32 index, s32 disable)
void au_amb_player_update(AmbienceManager *manager, AmbiencePlayer *player)
void au_amb_restore_voices(AmbienceManager *manager, AmbiencePlayer *player)
u8 au_amb_read_next(AmbiencePlayer *state)
void au_amb_stop_quick(s32 index)
AuResult au_amb_check_player_index(u32 index)
void au_amb_load_track_fade_info(AmbienceManager *manager, AmbiencePlayer *player)
@ MSEQ_CMD_C0_SET_INSTRUMENT
@ MSEQ_CMD_SUB_68_SET_REVERB
@ MSEQ_CMD_SUB_67_END_LOOP
@ MSEQ_CMD_SUB_69_SET_RESUMABLE
@ MSEQ_CMD_SUB_66_START_LOOP
@ MSEQ_CMD_A0_SET_VOLUME_PAN
void au_amb_save_voices(AmbienceManager *arg0, AmbiencePlayer *player)
void au_amb_manager_init(AmbienceManager *manager, s8 priority, s8 busId, AuGlobals *globals)
AuResult au_amb_is_stopped(s32 index)
void au_amb_load_tracks_fade(s32 arg0, s32 arg1)
void au_amb_fade_setup(AmbiencePlayer *player)
void au_amb_resume(s32 index, s32 time)
void au_amb_set_volume(s32 index, s32 time, s32 volume)
void au_amb_play_sequence(AmbienceManager *manager, MSEQHeader *mseqFile, s32 index)
void au_amb_stop_slow(s32 index, s32 time)
void au_amb_pause(s32 index, s32 time)
AuResult au_amb_start(s32 index, s32 time)
void au_reset_voice(AuVoice *voice, u8 voiceIdx)
Instrument * au_get_instrument(AuGlobals *globals, u32 bank, u32 patch, EnvelopeData *envData)
f32 au_compute_pitch_ratio(s32 pitch)
void au_memset(void *dst, s32 size, u8 value)
MSEQHeader * mseqFiles[4]
Instrument * defaultInstrument
#define AU_FILE_RELATIVE(base, offset)
@ AU_VOICE_SYNC_FLAG_PAN_FXMIX
@ AU_VOICE_SYNC_FLAG_PITCH
AmbienceVoiceState voiceStates[16]
AmbienceSavedVoice savedVoices[4]
AuFilePos loopStartPos[2]
AmbiencePlayer players[4]
@ AU_VOICE_ENV_FLAG_KEY_RELEASED
@ AU_VOICE_ENV_FLAG_VOL_CHANGED
AmbienceManager * gAuAmbienceManager