coastline 0.0.4
Loading...
Searching...
No Matches
racemusic.h
Go to the documentation of this file.
1#pragma once
2
3#include <filesystem>
4#include <memory>
5
6namespace coastline {
7
8class N64Audio;
9class RaceMusic;
10
26
32
35public:
47 FrontEndMusic(const FrontEndMusic &) = delete;
50
56 bool Play();
58 void Stop();
64 void SetVolume(unsigned char volume);
71
72private:
73 struct State;
75};
76
88 RaceMusicSource source,
89 int musicTrack = -1);
90
97
100
103
112
120
121} // namespace coastline
FrontEndMusic(const FrontEndMusic &)=delete
Prevent copying playback control and CD resources.
void SetVolume(unsigned char volume)
Apply the menu BGM volume to the CD stream.
void Stop()
Stop front-end music before starting a race.
FrontEndMusic & operator=(const FrontEndMusic &)=delete
Prevent assignment of playback control and CD resources.
void SetSource(RaceMusicSource source)
Stop the previous source before selecting menu music again.
bool Play()
Start menu music, or use XM with a warning when CD audio is unavailable.
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.
The XM player and sample mixers of the Nintendo 64 release, streamed as native stereo PCM.
Definition music.h:44
RaceMusicContext & operator=(const RaceMusicContext &)=delete
Prevent assignment of registered race music resources.
RaceMusicContext()
Register the exclusive race music context before race music API calls.
RaceMusicContext(const RaceMusicContext &)=delete
Prevent copying registered race music resources.
~RaceMusicContext()
Shut down active race music and unregister the context before SDL audio shutdown.
Definition assetimport.h:11
bool StartRaceMusic(const std::filesystem::path &directory, RaceMusicSource source, int musicTrack=-1)
Add a user of the music of the races, as the PC release opens its music device.
RaceMusicSource
Where the music of a race comes from.
Definition racemusic.h:28
@ CdAudio
Definition racemusic.h:30
@ Modules
Definition racemusic.h:29
void ShutdownRaceMusic()
Release all race music resources regardless of active users, before SDL audio shuts down.
void ShareRaceMusicPlayer(N64Audio *audio)
Play the modules of the races through the player of the music of the menus, which mixes the channels ...
std::size_t RenderRaceMusic(std::size_t frames)
Render frames of the track that plays, without a device, for tests.
void RestartRaceMusic()
Play the track of the race from its start, with the device of the music resumed.
void StopRaceMusic()
Drop a user of the music of the races.