src/music/os2_m.cpp
branchnoai
changeset 9631 8a2d1c2ceb88
parent 6573 7624f942237f
child 10429 1b99254f9607
--- a/src/music/os2_m.cpp	Wed Jun 27 01:01:16 2007 +0000
+++ b/src/music/os2_m.cpp	Sat Jul 07 09:20:52 2007 +0000
@@ -30,7 +30,9 @@
 	return mciSendString(buf, NULL, 0, NULL, 0);
 }
 
-static void OS2MidiPlaySong(const char *filename)
+static FMusicDriver_OS2 iFMusicDriver_OS2;
+
+void MusicDriver_OS2::PlaySong(const char *filename)
 {
 	MidiSendCommand("close all");
 
@@ -40,38 +42,29 @@
 	MidiSendCommand("play song from 0");
 }
 
-static void OS2MidiStopSong()
+void MusicDriver_OS2::StopSong()
 {
 	MidiSendCommand("close all");
 }
 
-static void OS2MidiSetVolume(byte vol)
+void MusicDriver_OS2::SetVolume(byte vol)
 {
 	MidiSendCommand("set song audio volume %d", ((vol/127)*100));
 }
 
-static bool OS2MidiIsSongPlaying()
+bool MusicDriver_OS2::IsSongPlaying()
 {
 	char buf[16];
 	mciSendString("status song mode", buf, sizeof(buf), NULL, 0);
 	return strcmp(buf, "playing") == 0 || strcmp(buf, "seeking") == 0;
 }
 
-static const char *OS2MidiStart(const char * const *parm)
+const char *MusicDriver_OS2::Start(const char * const *parm)
 {
 	return 0;
 }
 
-static void OS2MidiStop()
+void MusicDriver_OS2::Stop()
 {
 	MidiSendCommand("close all");
 }
-
-const HalMusicDriver _os2_music_driver = {
-	OS2MidiStart,
-	OS2MidiStop,
-	OS2MidiPlaySong,
-	OS2MidiStopSong,
-	OS2MidiIsSongPlaying,
-	OS2MidiSetVolume,
-};