2005-07-24 14:12:37 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
2008-05-06 15:11:33 +00:00
|
|
|
/** @file extmidi.h Base support for playing music via an external application. */
|
|
|
|
|
2005-07-23 15:16:57 +00:00
|
|
|
#ifndef MUSIC_EXTERNAL_H
|
|
|
|
#define MUSIC_EXTERNAL_H
|
|
|
|
|
2007-07-05 12:23:54 +00:00
|
|
|
#include "music_driver.hpp"
|
2005-07-23 15:16:57 +00:00
|
|
|
|
2007-07-05 12:23:54 +00:00
|
|
|
class MusicDriver_ExtMidi: public MusicDriver {
|
2007-07-05 13:19:35 +00:00
|
|
|
private:
|
|
|
|
char song[MAX_PATH];
|
|
|
|
pid_t pid;
|
|
|
|
|
|
|
|
void DoPlay();
|
|
|
|
void DoStop();
|
|
|
|
|
2007-07-05 12:23:54 +00:00
|
|
|
public:
|
|
|
|
/* virtual */ const char *Start(const char * const *param);
|
|
|
|
|
|
|
|
/* virtual */ void Stop();
|
|
|
|
|
|
|
|
/* virtual */ void PlaySong(const char *filename);
|
|
|
|
|
|
|
|
/* virtual */ void StopSong();
|
|
|
|
|
|
|
|
/* virtual */ bool IsSongPlaying();
|
|
|
|
|
|
|
|
/* virtual */ void SetVolume(byte vol);
|
|
|
|
};
|
|
|
|
|
|
|
|
class FMusicDriver_ExtMidi: public MusicDriverFactory<FMusicDriver_ExtMidi> {
|
|
|
|
public:
|
2007-07-07 20:31:23 +00:00
|
|
|
static const int priority = 1;
|
2007-07-05 12:23:54 +00:00
|
|
|
/* virtual */ const char *GetName() { return "extmidi"; }
|
|
|
|
/* virtual */ const char *GetDescription() { return "External MIDI Driver"; }
|
|
|
|
/* virtual */ Driver *CreateInstance() { return new MusicDriver_ExtMidi(); }
|
|
|
|
};
|
2005-07-23 15:16:57 +00:00
|
|
|
|
2007-02-23 12:56:10 +00:00
|
|
|
#endif /* MUSIC_EXTERNAL_H */
|