summaryrefslogtreecommitdiff
path: root/src/music/extmidi.cpp
diff options
context:
space:
mode:
authorNiels Martin Hansen <nielsm@indvikleren.dk>2018-03-17 14:51:30 +0100
committerMichael Lutz <michi@icosahedron.de>2018-06-05 22:58:35 +0200
commitf946b3da56b22c1fc32a9ffc9008374e4fb4f8c8 (patch)
tree3d8b2b0cf0e3931d2e38cce4b822f5b082d0cb92 /src/music/extmidi.cpp
parent1c2d29e1a3b5afdf3933f4cc743dda35c3ebb5fb (diff)
downloadopenttd-f946b3da56b22c1fc32a9ffc9008374e4fb4f8c8.tar.xz
Codechange: Pass a MusicSongInfo struct instead of bare filename to music drivers.
Preparation for later extending the info passed to music drivers.
Diffstat (limited to 'src/music/extmidi.cpp')
-rw-r--r--src/music/extmidi.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/music/extmidi.cpp b/src/music/extmidi.cpp
index d39a050f6..c532e9d44 100644
--- a/src/music/extmidi.cpp
+++ b/src/music/extmidi.cpp
@@ -17,6 +17,7 @@
#include "../video/video_driver.hpp"
#include "../gfx_func.h"
#include "extmidi.h"
+#include "../base_media_base.h"
#include <fcntl.h>
#include <sys/types.h>
#include <sys/wait.h>
@@ -83,9 +84,11 @@ void MusicDriver_ExtMidi::Stop()
this->DoStop();
}
-void MusicDriver_ExtMidi::PlaySong(const char *filename)
+void MusicDriver_ExtMidi::PlaySong(const MusicSongInfo &song)
{
- strecpy(this->song, filename, lastof(this->song));
+ if (song.filetype != MTT_STANDARDMIDI) return;
+
+ strecpy(this->song, song.filename, lastof(this->song));
this->DoStop();
}