OpenTTD
|
Public Member Functions | |
const char * | Start (const char *const *param) |
Initialized the MIDI player, including QuickTime initialization. More... | |
void | Stop () |
Stops the MIDI player. More... | |
void | PlaySong (const MusicSongInfo &song) |
Starts playing a new song. More... | |
void | StopSong () |
Stops playing the current song, if the player is active. | |
bool | IsSongPlaying () |
Checks whether the player is active. More... | |
void | SetVolume (byte vol) |
Changes the playing volume of the MIDI player. More... | |
const char * | GetName () const |
Get the name of this driver. More... | |
Additional Inherited Members | |
![]() | |
enum | Type { DT_BEGIN = 0, DT_MUSIC = 0, DT_SOUND, DT_VIDEO, DT_END } |
The type of driver. More... | |
![]() | |
static MusicDriver * | GetInstance () |
Get the currently active instance of the music driver. | |
|
inlinevirtual |
|
virtual |
Checks whether the player is active.
This function is called at regular intervals from OpenTTD's main loop, so we call MoviesTask()
from here to let QuickTime do its work.
Implements MusicDriver.
Definition at line 204 of file qtmidi.cpp.
References _quicktime_movie, _quicktime_started, _quicktime_state, QT_STATE_IDLE, QT_STATE_PLAY, and QT_STATE_STOP.
|
virtual |
Starts playing a new song.
filename | Path to a MIDI file. |
Implements MusicDriver.
Definition at line 263 of file qtmidi.cpp.
|
virtual |
Changes the playing volume of the MIDI player.
As QuickTime controls volume in a per-movie basis, the desired volume is stored in _quicktime_volume, and the volume is set here using the VOLUME macro, and when loading new song in PlaySong.
vol | The desired volume, range of the value is 0-127 |
Implements MusicDriver.
Definition at line 326 of file qtmidi.cpp.
References _quicktime_movie, _quicktime_started, _quicktime_state, _quicktime_volume, DEBUG, QT_STATE_IDLE, QT_STATE_PLAY, QT_STATE_STOP, and VOLUME.
|
virtual |
Initialized the MIDI player, including QuickTime initialization.
Gestalt()
and EnterMovies()
. Needs changes in InitQuickTimeIfNeeded. Implements Driver.
Definition at line 191 of file qtmidi.cpp.
References _quicktime_started, and InitQuickTimeIfNeeded().
|
virtual |
Stops the MIDI player.
Stops playing and frees any used resources before returning. As it deinitilizes QuickTime, the _quicktime_started flag is set to false
.
Implements Driver.
Definition at line 234 of file qtmidi.cpp.
References _quicktime_movie, _quicktime_started, _quicktime_state, DEBUG, QT_STATE_IDLE, QT_STATE_PLAY, QT_STATE_STOP, and StopSong().