2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 /** @file extmidi.h Base support for playing music via an external application. */
10 #ifndef MUSIC_EXTERNAL_H
11 #define MUSIC_EXTERNAL_H
13 #include "music_driver.hpp"
15 class MusicDriver_ExtMidi
: public MusicDriver
{
17 std::vector
<std::string
> command_tokens
;
25 std::optional
<std::string_view
> Start(const StringList
¶m
) override
;
29 void PlaySong(const MusicSongInfo
&song
) override
;
31 void StopSong() override
;
33 bool IsSongPlaying() override
;
35 void SetVolume(uint8_t vol
) override
;
36 std::string_view
GetName() const override
{ return "extmidi"; }
39 class FMusicDriver_ExtMidi
: public DriverFactoryBase
{
41 FMusicDriver_ExtMidi() : DriverFactoryBase(Driver::DT_MUSIC
, 3, "extmidi", "External MIDI Driver") {}
42 Driver
*CreateInstance() const override
{ return new MusicDriver_ExtMidi(); }
45 #endif /* MUSIC_EXTERNAL_H */