OpenTTD Source  20241121-master-g67a0fccfad
sound_driver.hpp
Go to the documentation of this file.
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  */
7 
10 #ifndef SOUND_SOUND_DRIVER_HPP
11 #define SOUND_SOUND_DRIVER_HPP
12 
13 #include "../driver.h"
14 
16 class SoundDriver : public Driver {
17 public:
19  virtual void MainLoop() {}
20 
27  virtual bool HasOutput() const
28  {
29  return true;
30  }
31 
36  {
38  }
39 };
40 
41 extern std::string _ini_sounddriver;
42 
43 #endif /* SOUND_SOUND_DRIVER_HPP */
static Driver ** GetActiveDriver(Driver::Type type)
Get the active driver for the given type.
Definition: driver.h:84
A driver for communicating with the user.
Definition: driver.h:21
@ DT_SOUND
A sound driver.
Definition: driver.h:41
Base for all sound drivers.
virtual void MainLoop()
Called once every tick.
static SoundDriver * GetInstance()
Get the currently active instance of the sound driver.
virtual bool HasOutput() const
Whether the driver has an output from which the user can hear sound.
std::string _ini_sounddriver
The sound driver a stored in the configuration file.
Definition: driver.cpp:29