coastline 0.0.4
Loading...
Searching...
No Matches
coastline::FrontEndMusic Class Reference

Front-end music with independent CD resources and the shared native XM player. More...

#include <racemusic.h>

Public Member Functions

 FrontEndMusic (N64Audio &audio, const std::filesystem::path &directory, RaceMusicSource source)
 Prepare front-end playback without starting music.
 ~FrontEndMusic ()
 Stop shared XM playback and release independent CD resources.
 FrontEndMusic (const FrontEndMusic &)=delete
 Prevent copying playback control and CD resources.
FrontEndMusic & operator= (const FrontEndMusic &)=delete
 Prevent assignment of playback control and CD resources.
bool Play ()
 Start menu music, or use XM with a warning when CD audio is unavailable.
void Stop ()
 Stop front-end music before starting a race.
void SetVolume (unsigned char volume)
 Apply the menu BGM volume to the CD stream.
void SetSource (RaceMusicSource source)
 Stop the previous source before selecting menu music again.

Detailed Description

Front-end music with independent CD resources and the shared native XM player.

Constructor & Destructor Documentation

◆ FrontEndMusic() [1/2]

coastline::FrontEndMusic::FrontEndMusic ( N64Audio & audio,
const std::filesystem::path & directory,
RaceMusicSource source )

Prepare front-end playback without starting music.

Parameters
audioThe shared XM player, whose lifetime must exceed this music controller's.
directoryThe directory with menu.xm and converted CD tracks.
sourceThe preferred menu music source, with XM fallback for unavailable CD audio.

◆ ~FrontEndMusic()

coastline::FrontEndMusic::~FrontEndMusic ( )

Stop shared XM playback and release independent CD resources.

◆ FrontEndMusic() [2/2]

coastline::FrontEndMusic::FrontEndMusic ( const FrontEndMusic & )
delete

Prevent copying playback control and CD resources.

Member Function Documentation

◆ operator=()

FrontEndMusic & coastline::FrontEndMusic::operator= ( const FrontEndMusic & )
delete

Prevent assignment of playback control and CD resources.

◆ Play()

bool coastline::FrontEndMusic::Play ( )

Start menu music, or use XM with a warning when CD audio is unavailable.

Returns
Whether CD playback starts or the XM module can be read and submitted.

◆ Stop()

void coastline::FrontEndMusic::Stop ( )

Stop front-end music before starting a race.

◆ SetVolume()

void coastline::FrontEndMusic::SetVolume ( unsigned char volume)

Apply the menu BGM volume to the CD stream.

Parameters
volumeThe console BGM volume, from 0 through 48, with 0 suspending CD processing.

◆ SetSource()

void coastline::FrontEndMusic::SetSource ( RaceMusicSource source)

Stop the previous source before selecting menu music again.

Parameters
sourceThe replacement preference; an unchanged source does not restart playback.

The documentation for this class was generated from the following file: