# bemidi.cpp

Go to the documentation of this file.

    00001 /* $Id: bemidi.cpp 22410 2011-05-02 16:14:23Z 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
    00020 static BMidiSynthFile midiSynthFile;
    00021
    00023 static FMusicDriver_BeMidi iFMusicDriver_BeMidi;
    00024
    00025 const char *MusicDriver_BeMidi::Start(const char * const *parm)
    00026 {
    00027   return NULL;
    00028 }
    00029
    00030 void MusicDriver_BeMidi::Stop()
    00031 {
    00032   midiSynthFile.UnloadFile();
    00033 }
    00034
    00035 void MusicDriver_BeMidi::PlaySong(const char *filename)
    00036 {
    00037   this->Stop();
    00038   entry_ref midiRef;
    00039   get_ref_for_path(filename, &midiRef);
    00040   midiSynthFile.LoadFile(&midiRef);
    00041   midiSynthFile.Start();
    00042 }
    00043
    00044 void MusicDriver_BeMidi::StopSong()
    00045 {
    00046   midiSynthFile.UnloadFile();
    00047 }
    00048
    00049 bool MusicDriver_BeMidi::IsSongPlaying()
    00050 {
    00051   return !midiSynthFile.IsFinished();
    00052 }
    00053
    00054 void MusicDriver_BeMidi::SetVolume(byte vol)
    00055 {
    00056   fprintf(stderr, "BeMidi: Set volume not implemented\n");
    00057 }