# bemidi.cpp

Go to the documentation of this file.

    00001 /* $Id: bemidi.cpp 19097 2010-02-11 17:13:57Z rubidium $ */
    00002
    00003 /*
    00004  * This file is part of OpenTTD.
    00005  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
    00006  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    00007  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
    00008  */
    00009
    00012 #include "../stdafx.h"
    00013 #include "../openttd.h"
    00014 #include "bemidi.h"
    00015
    00016 /* BeOS System Includes */
    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 }