2009-08-21 22:21:05 +02:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* 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.
|
|
|
|
* 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.
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2019-09-29 22:27:32 +02:00
|
|
|
/** @file allegro_s.h Base for playing sound via Allegro. */
|
2008-11-25 22:09:00 +01:00
|
|
|
|
|
|
|
#ifndef SOUND_ALLEGRO_H
|
|
|
|
#define SOUND_ALLEGRO_H
|
|
|
|
|
|
|
|
#include "sound_driver.hpp"
|
|
|
|
|
2011-05-02 18:14:23 +02:00
|
|
|
/** Implementation of the allegro sound driver. */
|
2013-11-25 15:30:22 +01:00
|
|
|
class SoundDriver_Allegro : public SoundDriver {
|
2008-11-25 22:09:00 +01:00
|
|
|
public:
|
2024-04-09 03:47:14 +02:00
|
|
|
std::optional<std::string_view> Start(const StringList ¶m) override;
|
2008-11-25 22:09:00 +01:00
|
|
|
|
2023-04-13 08:23:18 +02:00
|
|
|
void Stop() override;
|
2008-11-25 22:09:00 +01:00
|
|
|
|
2023-04-13 08:23:18 +02:00
|
|
|
void MainLoop() override;
|
2024-04-09 03:47:14 +02:00
|
|
|
std::string_view GetName() const override { return "allegro"; }
|
2008-11-25 22:09:00 +01:00
|
|
|
};
|
|
|
|
|
2011-05-02 18:14:23 +02:00
|
|
|
/** Factory for the allegro sound driver. */
|
2013-11-25 15:26:46 +01:00
|
|
|
class FSoundDriver_Allegro : public DriverFactoryBase {
|
2008-11-25 22:09:00 +01:00
|
|
|
public:
|
2022-11-05 15:42:20 +01:00
|
|
|
FSoundDriver_Allegro() : DriverFactoryBase(Driver::DT_SOUND, 4, "allegro", "Allegro Sound Driver (param hz,samples)") {}
|
2023-04-13 08:23:18 +02:00
|
|
|
Driver *CreateInstance() const override { return new SoundDriver_Allegro(); }
|
2008-11-25 22:09:00 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* SOUND_ALLEGRO_H */
|