1#ifndef COASTLINE_AUDIOMIX_H
2#define COASTLINE_AUDIOMIX_H
17#define AUDIO_RING_BYTES 0x4000
24#if TGR_PLATFORM == TGR_PLATFORM_N64
39#define MIXER_CHANNELS 16
42#define SOUND_EFFECT_CHANNELS 6
44#if TGR_PLATFORM == TGR_PLATFORM_SDL
61#define g_wAudioBufferWritePos (GetSdlMixerState()->writePosition)
63#define g_aMixerChannels (GetSdlMixerState()->musicChannels)
65#define g_qwSoundEffectSampleMask (GetSdlMixerState()->soundEffectSampleMask)
67#define g_aSoundEffectChannels (GetSdlMixerState()->soundEffectChannels)
69#define g_dwSoundEffectEchoOffset (GetSdlMixerState()->soundEffectEchoOffset)
91#if TGR_PLATFORM == TGR_PLATFORM_N64
100extern s32 g_nSoundEffectSampleMaskUpper;
110extern u32 g_dwSoundEffectSampleMaskLower;
127#if TGR_PLATFORM == TGR_PLATFORM_N64
136extern s32 g_dwAmbientChannel3Volume;
#define SOUND_EFFECT_CHANNELS
The channels of the sound effect mixer.
Definition audiomix.h:42
void MixSoundEffectChannels(s16 *ring, u32 bytes, u32 offset)
Add the sound effect channels to the ring buffer from an offset.
void CopyVec4(void *dst, const void *src)
Copy 16 bytes between 8-byte aligned addresses.
#define g_qwSoundEffectSampleMask
Definition audiomix.h:65
#define g_wAudioBufferWritePos
Definition audiomix.h:61
#define g_dwSoundEffectEchoOffset
Definition audiomix.h:69
void MemFill64Aligned(void *dst, u32 size, s32 value)
Fill a byte count rounded up to 64 with a 32-bit value.
#define g_aMixerChannels
Definition audiomix.h:63
void MixAudioSamples(s16 *ring, u32 bytes)
Mix six channels into the ring buffer, replacing what it held.
#define g_aSoundEffectChannels
Definition audiomix.h:67
void MixAudioStereoSamples(s16 *ring, u32 bytes, u32 pairOffset)
Add a pair of channels to the ring buffer.
SdlMixerState * GetSdlMixerState(void)
#define MIXER_CHANNELS
The channels of the music mixer.
Definition audiomix.h:39
A channel of a mixer.
Definition audiomix.h:23
u32 fraction
Definition audiomix.h:32
unsigned long sampleAddress
Definition audiomix.h:27
u64 step
Definition audiomix.h:33
s32 mixVolume
Definition audiomix.h:34
u32 volume
Definition audiomix.h:35
s8 * sample
Definition audiomix.h:26
Mixer channels and write position for one SDL audio context.
Definition audiomix.h:46
MixerChannel musicChannels[MIXER_CHANNELS]
Definition audiomix.h:48
u64 soundEffectSampleMask
Definition audiomix.h:49
MixerChannel soundEffectChannels[SOUND_EFFECT_CHANNELS]
Definition audiomix.h:50
s32 soundEffectEchoOffset
Definition audiomix.h:51
u16 writePosition
Definition audiomix.h:47
The integer and floating-point types of the console, for headers shared with Windows.
unsigned int u32
Definition ultratypes.h:20
signed char s8
Definition ultratypes.h:23
short s16
Definition ultratypes.h:24
unsigned short u16
Definition ultratypes.h:19
int s32
Definition ultratypes.h:25
unsigned long long u64
Definition ultratypes.h:21