OpenTTD Source 20260815-master-gdf55704e7d
soundresampler_type.h
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
9
10#ifndef SOUNDRESAMPLER_TYPE_H
11#define SOUNDRESAMPLER_TYPE_H
12
13#include "provider_manager.h"
14#include "sound_type.h"
15
17class SoundResampler : public PriorityBaseProvider<SoundResampler> {
18public:
21 {
22 ProviderManager<SoundResampler>::Register(*this);
23 }
24
27 {
28 ProviderManager<SoundResampler>::Unregister(*this);
29 }
30
37 virtual bool Resample(SoundEntry &sound, uint32_t play_rate) const = 0;
38};
39
40#endif /* SOUNDRESAMPLER_TYPE_H */
const std::string_view name
const std::string_view description
constexpr PriorityBaseProvider(std::string_view name, std::string_view description, int priority)
SoundResampler(std::string_view name, std::string_view description, int priority)
Create the provider.
virtual bool Resample(SoundEntry &sound, uint32_t play_rate) const =0
Resample a loaded sound.
virtual ~SoundResampler()
Unregister this sound resampler.
Definition of the ProviderManager.
Types related to sounds.