Change: DOS music loading for non-Windows music drivers

This commit is contained in:
Niels Martin Hansen
2018-03-21 17:12:29 +01:00
committed by Michael Lutz
parent 458e441a4c
commit a8080f14a9
10 changed files with 111 additions and 28 deletions

View File

@@ -18,6 +18,7 @@
#include "../gfx_func.h"
#include "extmidi.h"
#include "../base_media_base.h"
#include "midifile.hpp"
#include <fcntl.h>
#include <sys/types.h>
#include <sys/wait.h>
@@ -86,10 +87,11 @@ void MusicDriver_ExtMidi::Stop()
void MusicDriver_ExtMidi::PlaySong(const MusicSongInfo &song)
{
if (song.filetype != MTT_STANDARDMIDI) return;
strecpy(this->song, song.filename, lastof(this->song));
this->DoStop();
std::string filename = MidiFile::GetSMFFile(song);
if (!filename.empty()) {
strecpy(this->song, filename.c_str(), lastof(this->song));
this->DoStop();
}
}
void MusicDriver_ExtMidi::StopSong()