Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
ALWrapper.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2018 DIVIDE-Studio
3 Copyright (c) 2009 Ionut Cava
4
5 This file is part of DIVIDE Framework.
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software
9 and associated documentation files (the "Software"), to deal in the Software
10 without restriction,
11 including without limitation the rights to use, copy, modify, merge, publish,
12 distribute, sublicense,
13 and/or sell copies of the Software, and to permit persons to whom the
14 Software is furnished to do so,
15 subject to the following conditions:
16
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
19
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 IMPLIED,
22 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
23 PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
25 DAMAGES OR OTHER LIABILITY,
26 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
27 IN CONNECTION WITH THE SOFTWARE
28 OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
30 */
31
32#pragma once
33#ifndef DVD_WRAPPER_AL_H_
34#define DVD_WRAPPER_AL_H_
35
37
38namespace Divide {
39
40class OpenAL_API final : public AudioAPIWrapper {
41public:
43
44 ErrorCode initAudioAPI() noexcept override;
45 void closeAudioAPI() noexcept override;
46
47 void playSound(const Handle<AudioDescriptor> sound) noexcept override;
48 void playMusic(const Handle<AudioDescriptor> music) noexcept override;
49
50 void pauseMusic() noexcept override;
51 void stopMusic() noexcept override;
52 void stopAllSounds() noexcept override;
53
54 void setMusicVolume(I8 value) noexcept override;
55 void setSoundVolume(I8 value) noexcept override;
56
57protected:
58 void musicFinished() noexcept override;
59
60private:
62};
63
64}; // namespace Divide
65
66#endif //DVD_WRAPPER_AL_H_
Audio Programming Interface.
void playSound(const Handle< AudioDescriptor > sound) noexcept override
Definition: ALWrapper.cpp:38
ErrorCode initAudioAPI() noexcept override
Definition: ALWrapper.cpp:15
void playMusic(const Handle< AudioDescriptor > music) noexcept override
Definition: ALWrapper.cpp:40
void pauseMusic() noexcept override
Definition: ALWrapper.cpp:42
void musicFinished() noexcept override
Definition: ALWrapper.cpp:52
void closeAudioAPI() noexcept override
Definition: ALWrapper.cpp:36
void stopAllSounds() noexcept override
Definition: ALWrapper.cpp:46
void stopMusic() noexcept override
Definition: ALWrapper.cpp:44
void setMusicVolume(I8 value) noexcept override
Definition: ALWrapper.cpp:48
U32 buffers[MAX_SOUND_BUFFERS]
Definition: ALWrapper.h:61
void setSoundVolume(I8 value) noexcept override
Definition: ALWrapper.cpp:50
PlatformContext & context() noexcept
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
constexpr U32 MAX_SOUND_BUFFERS
uint32_t U32