OpenTTD Source: src/soundloader_type.h Source File

OpenTTD Source 15.3

soundloader_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 <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
10#ifndef SOUNDLOADER_TYPE_H
11#define SOUNDLOADER_TYPE_H
12
13#include "provider_manager.h"
14#include "sound_type.h"
15
17 class SoundLoader : public PriorityBaseProvider<SoundLoader> {
18public:
19 SoundLoader(std::string_view name, std::string_view description, int priority) : PriorityBaseProvider<SoundLoader>(name, description, priority)
20 {
21 ProviderManager<SoundLoader>::Register(*this);
22 }
23
24 virtual ~SoundLoader()
25 {
26 ProviderManager<SoundLoader>::Unregister(*this);
27 }
28
29 virtual bool Load(SoundEntry &sound, bool new_format, std::vector<std::byte> &data) const = 0;
30};
31
32#endif /* SOUNDLOADER_TYPE_H */
PriorityBaseProvider
Definition provider_manager.h:82
ProviderManager
The ProviderManager manages a single Provider-type.
Definition provider_manager.h:21
SoundLoader
Base interface for a SoundLoader implementation.
Definition soundloader_type.h:17
provider_manager.h
Definition of the ProviderManager.
sound_type.h
Types related to sounds.
SoundEntry
Definition sound_type.h:19