Wizard Engine
2D cross-platform game engine built around SDL2
 
Loading...
Searching...
No Matches
audio.hpp
Go to the documentation of this file.
1/*
2 Wizard Engine
3 Copyright (C) 2023-2024 Zana Domán
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20*/
21
22#ifndef WIZARD_ENGINE_AUDIO_HPP
23#define WIZARD_ENGINE_AUDIO_HPP
24
27
28namespace wze {
34class audio final {
35 public:
41 audio() = delete;
42
49 [[nodiscard]] static int8_t volume();
50
57 static void set_volume(int8_t volume);
58
65 [[nodiscard]] static std::vector<std::shared_ptr<speaker>>& speakers();
66
67#ifdef __WIZARD_ENGINE_INTERNAL__
73 static void update();
74#endif /* __WIZARD_ENGINE_INTERNAL__ */
75
76#ifdef __WIZARD_ENGINE_INTERNAL__
84 [[nodiscard]] static int32_t request_channel();
85#endif /* __WIZARD_ENGINE_INTERNAL__ */
86
87#ifdef __WIZARD_ENGINE_INTERNAL__
95 static void drop_channel(int32_t channel);
96#endif /* __WIZARD_ENGINE_INTERNAL__ */
97
103 static void pause();
104
110 static void resume();
111
118 static void stop();
119
120 private:
121 static int32_t _maximum_channel;
122 static std::vector<int32_t> _channels;
123 static std::vector<std::shared_ptr<speaker>> _speakers;
124};
125} /* namespace wze */
126
127#endif /* WIZARD_ENGINE_AUDIO_HPP */
Export header of the Wizard Engine.
Wizard Engine.
Audio component.