14 #include "../stdafx.h" 17 #include "midifile.hpp" 20 #include "../safeguards.h" 23 static MIDI *
_midi = NULL;
29 extern int _allegro_instance_count;
33 if (_allegro_instance_count == 0 && install_allegro(SYSTEM_AUTODETECT, &errno, NULL)) {
34 DEBUG(driver, 0,
"allegro: install_allegro failed '%s'", allegro_error);
35 return "Failed to set up Allegro";
37 _allegro_instance_count++;
40 if (install_sound(DIGI_AUTODETECT, MIDI_AUTODETECT, NULL) != 0) {
41 DEBUG(driver, 0,
"allegro: install_sound failed '%s'", allegro_error);
42 return "Failed to set up Allegro sound";
46 if (midi_card == MIDI_NONE) {
47 DEBUG(driver, 0,
"allegro: no midi card found");
48 return "No sound card found";
59 if (--_allegro_instance_count == 0) allegro_exit();
67 if (!filename.empty()) {
68 _midi = load_midi(filename.c_str());
69 play_midi(
_midi,
false);
Metadata about a music track.
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.
bool IsSongPlaying()
Are we currently playing a song?
#define DEBUG(name, level,...)
Output a line of debugging information.
static std::string GetSMFFile(const MusicSongInfo &song)
Get the name of a Standard MIDI File for a given song.
const char * Start(const char *const *param)
Start this driver.
void PlaySong(const MusicSongInfo &song)
Play a particular song.
static struct @24 _midi
Metadata about the midi we're playing.
void StopSong()
Stop playing the current song.