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);