diff options
author | Niels Martin Hansen <nielsm@indvikleren.dk> | 2018-03-17 14:51:30 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2018-06-05 22:58:35 +0200 |
commit | f946b3da56b22c1fc32a9ffc9008374e4fb4f8c8 (patch) | |
tree | 3d8b2b0cf0e3931d2e38cce4b822f5b082d0cb92 /src/music/cocoa_m.cpp | |
parent | 1c2d29e1a3b5afdf3933f4cc743dda35c3ebb5fb (diff) | |
download | openttd-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/cocoa_m.cpp')
-rw-r--r-- | src/music/cocoa_m.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/music/cocoa_m.cpp b/src/music/cocoa_m.cpp index 925dc21ab..9dcd12cf0 100644 --- a/src/music/cocoa_m.cpp +++ b/src/music/cocoa_m.cpp @@ -19,6 +19,7 @@ #include "../os/macosx/macos.h" #include "cocoa_m.h" #include "../debug.h" +#include "../base_media_base.h" #define Rect OTTDRect #define Point OTTDPoint @@ -143,8 +144,10 @@ void MusicDriver_Cocoa::Stop() * * @param filename Path to a MIDI file. */ -void MusicDriver_Cocoa::PlaySong(const char *filename) +void MusicDriver_Cocoa::PlaySong(const MusicSongInfo &song) { + if (song.filetype != MTT_STANDARDMIDI) return; + DEBUG(driver, 2, "cocoa_m: trying to play '%s'", filename); this->StopSong(); @@ -158,7 +161,7 @@ void MusicDriver_Cocoa::PlaySong(const char *filename) return; } - const char *os_file = OTTD2FS(filename); + const char *os_file = OTTD2FS(song.filename); CFURLRef url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, (const UInt8*)os_file, strlen(os_file), false); #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) |