Update: Translations from eints
[openttd-github.git] / src / music / cocoa_m.h
blobdbf58e425e9ec920d6348f247e24ef1f55115606
1 /*
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/>.
6 */
8 /** @file cocoa_m.h Base of music playback via CoreAudio. */
10 #ifndef MUSIC_MACOSX_COCOA_H
11 #define MUSIC_MACOSX_COCOA_H
13 #include "music_driver.hpp"
15 class MusicDriver_Cocoa : public MusicDriver {
16 public:
17 std::optional<std::string_view> Start(const StringList &param) override;
19 void Stop() override;
21 void PlaySong(const MusicSongInfo &song) override;
23 void StopSong() override;
25 bool IsSongPlaying() override;
27 void SetVolume(uint8_t vol) override;
28 std::string_view GetName() const override { return "cocoa"; }
31 class FMusicDriver_Cocoa : public DriverFactoryBase {
32 public:
33 FMusicDriver_Cocoa() : DriverFactoryBase(Driver::DT_MUSIC, 10, "cocoa", "Cocoa MIDI Driver") {}
34 Driver *CreateInstance() const override { return new MusicDriver_Cocoa(); }
37 #endif /* MUSIC_MACOSX_COCOA_H */