From f946b3da56b22c1fc32a9ffc9008374e4fb4f8c8 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Sat, 17 Mar 2018 14:51:30 +0100 Subject: Codechange: Pass a MusicSongInfo struct instead of bare filename to music drivers. Preparation for later extending the info passed to music drivers. --- src/music/os2_m.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/music/os2_m.cpp') diff --git a/src/music/os2_m.cpp b/src/music/os2_m.cpp index d7fb97d2d..e308bac0d 100644 --- a/src/music/os2_m.cpp +++ b/src/music/os2_m.cpp @@ -12,6 +12,7 @@ #include "../stdafx.h" #include "../openttd.h" #include "os2_m.h" +#include "../base_media_base.h" #define INCL_DOS #define INCL_OS2MM @@ -49,11 +50,13 @@ static long CDECL MidiSendCommand(const char *cmd, ...) /** OS/2's music player's factory. */ static FMusicDriver_OS2 iFMusicDriver_OS2; -void MusicDriver_OS2::PlaySong(const char *filename) +void MusicDriver_OS2::PlaySong(const MusicSongInfo &song) { + if (song.filetype != MTT_STANDARDMIDI) return; + MidiSendCommand("close all"); - if (MidiSendCommand("open %s type sequencer alias song", filename) != 0) { + if (MidiSendCommand("open %s type sequencer alias song", song.filename) != 0) { return; } -- cgit v1.2.3-54-g00ecf