2005-07-24 16:12:37 +02:00
|
|
|
/* $Id$ */
|
|
|
|
|
2007-04-17 22:23:13 +02:00
|
|
|
/** @file bemidi.cpp */
|
|
|
|
|
2005-07-25 10:16:05 +02:00
|
|
|
#include "../stdafx.h"
|
|
|
|
#include "../openttd.h"
|
|
|
|
#include "bemidi.h"
|
2004-12-01 20:42:42 +01:00
|
|
|
|
|
|
|
// BeOS System Includes
|
|
|
|
#include <MidiSynthFile.h>
|
|
|
|
|
2005-07-23 17:34:05 +02:00
|
|
|
static BMidiSynthFile midiSynthFile;
|
2004-12-01 20:42:42 +01:00
|
|
|
|
2007-07-05 14:23:54 +02:00
|
|
|
static FMusicDriver_BeMidi iFMusicDriver_BeMidi;
|
|
|
|
|
|
|
|
const char *MusicDriver_BeMidi::Start(const char * const *parm)
|
2004-12-01 20:42:42 +01:00
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2007-07-05 14:23:54 +02:00
|
|
|
void MusicDriver_BeMidi::Stop()
|
2004-12-01 20:42:42 +01:00
|
|
|
{
|
|
|
|
midiSynthFile.UnloadFile();
|
|
|
|
}
|
|
|
|
|
2007-07-05 14:23:54 +02:00
|
|
|
void MusicDriver_BeMidi::PlaySong(const char *filename)
|
2004-12-01 20:42:42 +01:00
|
|
|
{
|
|
|
|
bemidi_stop();
|
|
|
|
entry_ref midiRef;
|
|
|
|
get_ref_for_path(filename, &midiRef);
|
|
|
|
midiSynthFile.LoadFile(&midiRef);
|
|
|
|
midiSynthFile.Start();
|
|
|
|
}
|
|
|
|
|
2007-07-05 14:23:54 +02:00
|
|
|
void MusicDriver_BeMidi::StopSong()
|
2004-12-01 20:42:42 +01:00
|
|
|
{
|
|
|
|
midiSynthFile.UnloadFile();
|
|
|
|
}
|
|
|
|
|
2007-07-05 14:23:54 +02:00
|
|
|
bool MusicDriver_BeMidi::IsSongPlaying()
|
2004-12-01 20:42:42 +01:00
|
|
|
{
|
|
|
|
return !midiSynthFile.IsFinished();
|
|
|
|
}
|
|
|
|
|
2007-07-05 14:23:54 +02:00
|
|
|
void MusicDriver_BeMidi::SetVolume(byte vol)
|
2004-12-01 20:42:42 +01:00
|
|
|
{
|
|
|
|
fprintf(stderr, "BeMidi: Set volume not implemented\n");
|
|
|
|
}
|