OpenTTD Source  20241121-master-g67a0fccfad
MusicDriver Class Referenceabstract

Driver for all music playback. More...

#include <music_driver.hpp>

Inheritance diagram for MusicDriver:
Driver MusicDriver_Allegro MusicDriver_BeMidi MusicDriver_Cocoa MusicDriver_DMusic MusicDriver_ExtMidi MusicDriver_FluidSynth MusicDriver_Null MusicDriver_Win32

Public Member Functions

virtual void PlaySong (const MusicSongInfo &song)=0
 Play a particular song. More...
 
virtual void StopSong ()=0
 Stop playing the current song.
 
virtual bool IsSongPlaying ()=0
 Are we currently playing a song? More...
 
virtual void SetVolume (uint8_t vol)=0
 Set the volume, if possible. More...
 
- Public Member Functions inherited from Driver
virtual std::optional< std::string_view > Start (const StringList &parm)=0
 Start this driver. More...
 
virtual void Stop ()=0
 Stop this driver.
 
virtual std::string_view GetName () const =0
 Get the name of this driver. More...
 

Static Public Member Functions

static MusicDriverGetInstance ()
 Get the currently active instance of the music driver.
 

Additional Inherited Members

- Public Types inherited from Driver
enum  Type {
  DT_BEGIN = 0 , DT_MUSIC = 0 , DT_SOUND , DT_VIDEO ,
  DT_END
}
 The type of driver. More...
 

Detailed Description

Driver for all music playback.

Definition at line 18 of file music_driver.hpp.

Member Function Documentation

◆ IsSongPlaying()

virtual bool MusicDriver::IsSongPlaying ( )
pure virtual

Are we currently playing a song?

Returns
True if a song is being played.

Implemented in MusicDriver_Win32, MusicDriver_Null, MusicDriver_FluidSynth, MusicDriver_ExtMidi, MusicDriver_DMusic, MusicDriver_Cocoa, MusicDriver_BeMidi, and MusicDriver_Allegro.

◆ PlaySong()

virtual void MusicDriver::PlaySong ( const MusicSongInfo song)
pure virtual

Play a particular song.

Parameters
songThe information for the song to play.

Implemented in MusicDriver_Win32, MusicDriver_FluidSynth, MusicDriver_ExtMidi, MusicDriver_DMusic, MusicDriver_Cocoa, MusicDriver_BeMidi, MusicDriver_Allegro, and MusicDriver_Null.

◆ SetVolume()

virtual void MusicDriver::SetVolume ( uint8_t  vol)
pure virtual

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