14 #include "../stdafx.h" 19 #include "../safeguards.h" 22 static MIDI *
_midi = NULL;
28 extern int _allegro_instance_count;
32 if (_allegro_instance_count == 0 && install_allegro(SYSTEM_AUTODETECT, &errno, NULL)) {
33 DEBUG(driver, 0,
"allegro: install_allegro failed '%s'", allegro_error);
34 return "Failed to set up Allegro";
36 _allegro_instance_count++;
39 if (install_sound(DIGI_AUTODETECT, MIDI_AUTODETECT, NULL) != 0) {
40 DEBUG(driver, 0,
"allegro: install_sound failed '%s'", allegro_error);
41 return "Failed to set up Allegro sound";
45 if (midi_card == MIDI_NONE) {
46 DEBUG(driver, 0,
"allegro: no midi card found");
47 return "No sound card found";
58 if (--_allegro_instance_count == 0) allegro_exit();
64 _midi = load_midi(filename);
65 play_midi(
_midi,
false);
void Stop()
Stop this driver.
Factory for allegro's music player.
void SetVolume(byte vol)
Set the volume, if possible.
Base support for playing music via allegro.
void PlaySong(const char *filename)
Play a particular song.
bool IsSongPlaying()
Are we currently playing a song?
#define DEBUG(name, level,...)
Output a line of debugging information.
const char * Start(const char *const *param)
Start this driver.
static struct @24 _midi
Metadata about the midi we're playing.
void StopSong()
Stop playing the current song.