Codechange: Pass a MusicSongInfo struct instead of bare filename to music drivers.

Preparation for later extending the info passed to music drivers.
This commit is contained in:
Niels Martin Hansen
2018-03-17 14:51:30 +01:00
committed by Michael Lutz
parent 1c2d29e1a3
commit f946b3da56
23 changed files with 85 additions and 41 deletions

View File

@@ -12,6 +12,7 @@
#include "../stdafx.h"
#include "../openttd.h"
#include "bemidi.h"
#include "../base_media_base.h"
/* BeOS System Includes */
#include <MidiSynthFile.h>
@@ -34,11 +35,13 @@ void MusicDriver_BeMidi::Stop()
midiSynthFile.UnloadFile();
}
void MusicDriver_BeMidi::PlaySong(const char *filename)
void MusicDriver_BeMidi::PlaySong(const MusicSongInfo &song)
{
if (song.filetype != MTT_STANDARDMIDI) return;
this->Stop();
entry_ref midiRef;
get_ref_for_path(filename, &midiRef);
get_ref_for_path(song.filename, &midiRef);
midiSynthFile.LoadFile(&midiRef);
midiSynthFile.Start();
}