diff options
author | peter1138 <peter1138@openttd.org> | 2007-07-05 12:23:54 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2007-07-05 12:23:54 +0000 |
commit | 5e85e8c5e03105e43cf9f2216e993c0596d7dfec (patch) | |
tree | 52e0cc5b1e4eb6cf9aed8556873ee6833662e11f /src/music/win32_m.cpp | |
parent | 7884a07b43fd293a2ca5b39b64df98b700959874 (diff) | |
download | openttd-5e85e8c5e03105e43cf9f2216e993c0596d7dfec.tar.xz |
(svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
Diffstat (limited to 'src/music/win32_m.cpp')
-rw-r--r-- | src/music/win32_m.cpp | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/music/win32_m.cpp b/src/music/win32_m.cpp index 7ec9a945e..470572254 100644 --- a/src/music/win32_m.cpp +++ b/src/music/win32_m.cpp @@ -15,7 +15,9 @@ static struct { char start_song[260]; } _midi; -static void Win32MidiPlaySong(const char *filename) +static FMusicDriver_Win32 iFMusicDriver_Win32; + +void MusicDriver_Win32::PlaySong(const char *filename) { strcpy(_midi.start_song, filename); _midi.playing = true; @@ -23,7 +25,7 @@ static void Win32MidiPlaySong(const char *filename) SetEvent(_midi.wait_obj); } -static void Win32MidiStopSong() +void MusicDriver_Win32::StopSong() { if (_midi.playing) { _midi.stop_song = true; @@ -32,12 +34,12 @@ static void Win32MidiStopSong() } } -static bool Win32MidiIsSongPlaying() +bool MusicDriver_Win32::IsSongPlaying() { return _midi.playing; } -static void Win32MidiSetVolume(byte vol) +void MusicDriver_Win32::SetVolume(byte vol) { _midi.new_vol = vol; SetEvent(_midi.wait_obj); @@ -118,7 +120,7 @@ static DWORD WINAPI MidiThread(LPVOID arg) return 0; } -static const char *Win32MidiStart(const char * const *parm) +const char *MusicDriver_Win32::Start(const char * const *parm) { MIDIOUTCAPS midicaps; DWORD threadId; @@ -146,17 +148,8 @@ static const char *Win32MidiStart(const char * const *parm) return NULL; } -static void Win32MidiStop() +void MusicDriver_Win32::Stop() { _midi.terminate = true; SetEvent(_midi.wait_obj); } - -const HalMusicDriver _win32_music_driver = { - Win32MidiStart, - Win32MidiStop, - Win32MidiPlaySong, - Win32MidiStopSong, - Win32MidiIsSongPlaying, - Win32MidiSetVolume, -}; |