Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00012 #include "../stdafx.h"
00013 #include "../openttd.h"
00014 #include "bemidi.h"
00015
00016
00017 #include <MidiSynthFile.h>
00018
00019 static BMidiSynthFile midiSynthFile;
00020
00021 static FMusicDriver_BeMidi iFMusicDriver_BeMidi;
00022
00023 const char *MusicDriver_BeMidi::Start(const char * const *parm)
00024 {
00025 return NULL;
00026 }
00027
00028 void MusicDriver_BeMidi::Stop()
00029 {
00030 midiSynthFile.UnloadFile();
00031 }
00032
00033 void MusicDriver_BeMidi::PlaySong(const char *filename)
00034 {
00035 this->Stop();
00036 entry_ref midiRef;
00037 get_ref_for_path(filename, &midiRef);
00038 midiSynthFile.LoadFile(&midiRef);
00039 midiSynthFile.Start();
00040 }
00041
00042 void MusicDriver_BeMidi::StopSong()
00043 {
00044 midiSynthFile.UnloadFile();
00045 }
00046
00047 bool MusicDriver_BeMidi::IsSongPlaying()
00048 {
00049 return !midiSynthFile.IsFinished();
00050 }
00051
00052 void MusicDriver_BeMidi::SetVolume(byte vol)
00053 {
00054 fprintf(stderr, "BeMidi: Set volume not implemented\n");
00055 }