coastline 0.0.4
Loading...
Searching...
No Matches
soundsystem.h File Reference

The music, the volumes, and the channels of the sound effects of the Boss Rally release, which the race controls. More...

#include <stdbool.h>
#include <stdint.h>
#include "common/soundsample.h"
#include "common/audio.h"
Include dependency graph for soundsystem.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SoundChannelState
 The settings of the buffer of a channel, as requested or as last applied. More...

Macros

#define VOLUME_LEVEL_COUNT   10
 The number of levels of the volumes of the configuration.

Functions

void ApplyAudioVolumeSettings (void)
 Set the volumes of the music and the sound effects from the levels of g_GlobalRallyConfig.
bool SetCurrentMusicTrack (int nModeIndex)
 Play a track of music, through the CD audio in music mode 1 and the EAR library otherwise.
bool DispatchMusicVolumeChange (unsigned char bVolume)
 Give a volume of the music to the CD audio in music mode 1 and to the EAR library otherwise.
int RandomizeMusicTrack (void)
 Choose a track of music at random from track 3 to g_nMusicTrackMax, other than the track that plays when there are more than six tracks.
bool SelectPreviousMusicTrack (void)
 Play the track of music before the current one, staying at the first.
bool SelectNextMusicTrack (void)
 Play the track of music after the current one, staying at the last.
bool PauseMusicPlayback (void)
 Pause the music while the game is paused.
bool UnpauseMusicPlayback (void)
 Resume the music when the game is no longer paused.
bool MuteAllActiveSoundChannels (void)
 Silence every channel of sound that has a buffer, and centre its pan, when DirectSound plays sound effects.
bool StopAudioChannel (int nChannel)
 Stop the buffer of a channel, when sound is on.
bool ResumeLoopingSoundChannels (void)
 Move each channel that plays the sample of the other set to the sample of the current set and play it in a loop again, then record the sample requested for each channel and apply the frequency and the levels requested for it.
bool ResetAudioSubsystem (void)
 Stop and free the list of sound buffers and clear the buffers of the channels of every loaded sample and of the channels that play, when DirectSound plays sound effects.

Variables

const int g_adwBgmVolumeLevels [VOLUME_LEVEL_COUNT]
 The volume of the music of each level of the configuration, from 0 to 255.
const int g_adwSfxVolumeLevels [VOLUME_LEVEL_COUNT]
 The volume of the sound effects of each level of the configuration, from 0 to 255.
struct SoundChannelState g_aSoundChannelRequested [SOUND_CHANNEL_COUNT]
 The settings requested for the buffer of each channel.
int g_bAltLoopingSoundSet
 Whether the channels that play sample 0 move to sample 25, rather than back.

Detailed Description

The music, the volumes, and the channels of the sound effects of the Boss Rally release, which the race controls.

Macro Definition Documentation

◆ VOLUME_LEVEL_COUNT

#define VOLUME_LEVEL_COUNT   10

The number of levels of the volumes of the configuration.

Function Documentation

◆ ApplyAudioVolumeSettings()

void ApplyAudioVolumeSettings ( void )

Set the volumes of the music and the sound effects from the levels of g_GlobalRallyConfig.

Ghidra address:
BRD3D: 0x10060d90
Ghidra address:
BRGlide: 0x10059e00

◆ SetCurrentMusicTrack()

bool SetCurrentMusicTrack ( int nModeIndex)

Play a track of music, through the CD audio in music mode 1 and the EAR library otherwise.

Parameters
nModeIndexThe track.
Returns
Always true.
Ghidra address:
BRD3D: 0x100027c0
Ghidra address:
BRGlide: 0x10002af0

◆ DispatchMusicVolumeChange()

bool DispatchMusicVolumeChange ( unsigned char bVolume)

Give a volume of the music to the CD audio in music mode 1 and to the EAR library otherwise.

Parameters
bVolumeThe volume.
Returns
The result of HandleMusicPauseResume() or SetScaledAudioVolume().
Ghidra address:
BRD3D: 0x100029f0
Ghidra address:
BRGlide: 0x10002d30

◆ RandomizeMusicTrack()

int RandomizeMusicTrack ( void )

Choose a track of music at random from track 3 to g_nMusicTrackMax, other than the track that plays when there are more than six tracks.

Returns
The track.
Ghidra address:
BRD3D: 0x100028d0
Ghidra address:
BRGlide: 0x10002c00

◆ SelectPreviousMusicTrack()

bool SelectPreviousMusicTrack ( void )

Play the track of music before the current one, staying at the first.

Returns
Always true.
Ghidra address:
BRD3D: 0x10002930
Ghidra address:
BRGlide: 0x10002c70

◆ SelectNextMusicTrack()

bool SelectNextMusicTrack ( void )

Play the track of music after the current one, staying at the last.

Returns
Always true.
Ghidra address:
BRD3D: 0x10002970
Ghidra address:
BRGlide: 0x10002cb0

◆ PauseMusicPlayback()

bool PauseMusicPlayback ( void )

Pause the music while the game is paused.

Returns
Whether the music paused, and true when no music plays.
Ghidra address:
BRD3D: 0x10002b70
Ghidra address:
BRGlide: 0x10002eb0

◆ UnpauseMusicPlayback()

bool UnpauseMusicPlayback ( void )

Resume the music when the game is no longer paused.

Returns
Whether the music resumed, and true when no music plays.
Ghidra address:
BRD3D: 0x10002bd0
Ghidra address:
BRGlide: 0x10002f10

◆ MuteAllActiveSoundChannels()

bool MuteAllActiveSoundChannels ( void )

Silence every channel of sound that has a buffer, and centre its pan, when DirectSound plays sound effects.

Returns
Always true.
Ghidra address:
BRD3D: 0x10072e00
Ghidra address:
BRGlide: 0x1006bd70

◆ StopAudioChannel()

bool StopAudioChannel ( int nChannel)

Stop the buffer of a channel, when sound is on.

Parameters
nChannelThe channel.
Returns
Whether the buffer stopped, and true without a buffer or without sound.
Ghidra address:
BRD3D: 0x10072580
Ghidra address:
BRGlide: 0x1006b4f0

◆ ResumeLoopingSoundChannels()

bool ResumeLoopingSoundChannels ( void )

Move each channel that plays the sample of the other set to the sample of the current set and play it in a loop again, then record the sample requested for each channel and apply the frequency and the levels requested for it.

A channel whose requested frequency is not 0 and that no longer plays has the frequency reset to 0.

Returns
Always true.
Ghidra address:
BRD3D: 0x10072e60
Ghidra address:
BRGlide: 0x1006bdd0

◆ ResetAudioSubsystem()

bool ResetAudioSubsystem ( void )

Stop and free the list of sound buffers and clear the buffers of the channels of every loaded sample and of the channels that play, when DirectSound plays sound effects.

Returns
Always true.
Ghidra address:
BRD3D: 0x100734f0
Ghidra address:
BRGlide: 0x1006c460

Variable Documentation

◆ g_adwBgmVolumeLevels

const int g_adwBgmVolumeLevels[VOLUME_LEVEL_COUNT]
extern

The volume of the music of each level of the configuration, from 0 to 255.

Ghidra address:
BRD3D: 0x100adf68
Ghidra address:
BRGlide: 0x100ad770

◆ g_adwSfxVolumeLevels

const int g_adwSfxVolumeLevels[VOLUME_LEVEL_COUNT]
extern

The volume of the sound effects of each level of the configuration, from 0 to 255.

Ghidra address:
BRD3D: 0x100adf90
Ghidra address:
BRGlide: 0x100ad798

◆ g_aSoundChannelRequested

struct SoundChannelState g_aSoundChannelRequested[SOUND_CHANNEL_COUNT]
extern

The settings requested for the buffer of each channel.

Ghidra address:
BRD3D: 0x118ac720
Ghidra address:
BRGlide: 0x118eef40

◆ g_bAltLoopingSoundSet

int g_bAltLoopingSoundSet
extern

Whether the channels that play sample 0 move to sample 25, rather than back.

Ghidra address:
BRD3D: 0x118290f4
Ghidra address:
BRGlide: 0x1184c454