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 sound_driver.hpp Base for all sound drivers. */
10 #ifndef SOUND_SOUND_DRIVER_HPP
11 #define SOUND_SOUND_DRIVER_HPP
13 #include "../driver.h"
15 /** Base for all sound drivers. */
16 class SoundDriver
: public Driver
{
18 /** Called once every tick */
19 virtual void MainLoop() {}
22 * Whether the driver has an output from which the user can hear sound.
23 * Or in other words, whether we should warn the user if no soundset is
24 * loaded and that loading one would fix the sound problems.
25 * @return True for all drivers except null.
27 virtual bool HasOutput() const
33 * Get the currently active instance of the sound driver.
35 static SoundDriver
*GetInstance()
37 return static_cast<SoundDriver
*>(*DriverFactoryBase::GetActiveDriver(Driver::DT_SOUND
));
41 extern std::string _ini_sounddriver
;
43 #endif /* SOUND_SOUND_DRIVER_HPP */