ToyMaker Game Engine
0.0.2
ToyMaker is a game engine developed and maintained by Zoheb Shujauddin.
Toggle main menu visibility
Loading...
Searching...
No Matches
system.hpp
1
#ifndef TOYMAKER_SOUNDSYSTEM_H
2
#define TOYMAKER_SOUNDSYSTEM_H
3
4
#include "
../core/ecs_world.hpp
"
5
6
#include "types.hpp"
7
13
14
namespace
ToyMaker
{
15
26
class
SoundSystem
:
public
System
<SoundSystem, std::tuple<>, std::tuple<>> {
27
public
:
28
35
inline
explicit
SoundSystem
(std::weak_ptr<ECSWorld> world):
36
System
<
SoundSystem
,
std
::tuple<>,
std
::tuple<>> { world }
37
{}
38
45
static
std::string
getSystemTypeName
() {
return
"SoundSystem"
; }
46
57
bool
isSingleton
()
const override
{
return
true
; }
58
66
void
onApplicationInitialize
();
67
75
void
onApplicationEnd
();
76
84
std::unique_ptr<SoundChannel>
createChannel
();
85
92
float
getMasterGain
()
const
;
93
100
void
setMasterGain
(
float
newVolume);
101
102
private
:
109
std::unique_ptr<SoundMixer>
mMixer
{};
110
};
111
}
112
113
#endif
ToyMaker::SoundSystem::onApplicationEnd
void onApplicationEnd()
Called during the application shutdown procedure, destroying owned sound mixer device.
Definition
system.cpp:8
ToyMaker::SoundSystem::SoundSystem
SoundSystem(std::weak_ptr< ECSWorld > world)
Constructs a new SoundSystem object.
Definition
system.hpp:35
ToyMaker::SoundSystem::isSingleton
bool isSingleton() const override
Informs this System's ECSWorld that the SoundSystem is a singleton, i.e., there should not be more th...
Definition
system.hpp:57
ToyMaker::SoundSystem::getSystemTypeName
static std::string getSystemTypeName()
The system type string associated with the SoundSystem.
Definition
system.hpp:45
ToyMaker::SoundSystem::mMixer
std::unique_ptr< SoundMixer > mMixer
The sound mixer managed by this system.
Definition
system.hpp:109
ToyMaker::SoundSystem::getMasterGain
float getMasterGain() const
Returns a value from 0 to 1, representing the factor by which the mixed sound is multiplied.
Definition
system.cpp:16
ToyMaker::SoundSystem::onApplicationInitialize
void onApplicationInitialize()
Creates a sound mixer device object to be managed by this system.
Definition
system.cpp:5
ToyMaker::SoundSystem::setMasterGain
void setMasterGain(float newVolume)
Sets the volume of the mixed output sound.
Definition
system.cpp:20
ToyMaker::SoundSystem::createChannel
std::unique_ptr< SoundChannel > createChannel()
Returns a single sound channel, to be managed by the caller, mixed with other channels by this system...
Definition
system.cpp:12
ToyMaker::System
A system template that disables systems with this form of declaration.
Definition
ecs_world.hpp:1085
ecs_world.hpp
ToyMaker Engine's implementation of an ECS system.
ToyMaker
Namespace containing all class definitions and functions related to the ToyMaker engine.
Definition
application.hpp:26
std
STL namespace.
ToyMaker_Main
include
toymaker
engine
sound
system.hpp
Generated on
for ToyMaker Game Engine by
1.17.0