OpenTTD
music_driver.hpp
Go to the documentation of this file.
1 /* $Id: music_driver.hpp 26538 2014-04-28 21:06:51Z rubidium $ */
2 
3 /*
4  * This file is part of OpenTTD.
5  * 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.
6  * 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.
7  * 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  */
9 
12 #ifndef MUSIC_MUSIC_DRIVER_HPP
13 #define MUSIC_MUSIC_DRIVER_HPP
14 
15 #include "../driver.h"
16 
18 class MusicDriver : public Driver {
19 public:
24  virtual void PlaySong(const char *filename) = 0;
25 
29  virtual void StopSong() = 0;
30 
35  virtual bool IsSongPlaying() = 0;
36 
41  virtual void SetVolume(byte vol) = 0;
42 
48  }
49 };
50 
51 extern char *_ini_musicdriver;
52 
53 #endif /* MUSIC_MUSIC_DRIVER_HPP */
static Driver ** GetActiveDriver(Driver::Type type)
Get the active driver for the given type.
Definition: driver.h:87
A music driver, needs to be before sound to properly shut down extmidi forked music players...
Definition: driver.h:43
virtual void SetVolume(byte vol)=0
Set the volume, if possible.
static MusicDriver * GetInstance()
Get the currently active instance of the music driver.
virtual bool IsSongPlaying()=0
Are we currently playing a song?
A driver for communicating with the user.
Definition: driver.h:24
char * _ini_musicdriver
The music driver a stored in the configuration file.
Definition: driver.cpp:29
virtual void StopSong()=0
Stop playing the current song.
virtual void PlaySong(const char *filename)=0
Play a particular song.
Driver for all music playback.