Sound Bakery  v0.1.0
Open-source audio middleware for games
Loading...
Searching...
No Matches
gameobject.h
1#pragma once
2
3#include "sound_bakery/core/core_include.h"
4#include "sound_bakery/parameter/parameter.h"
5#include "sound_bakery/voice/voice.h"
6
7namespace sbk::engine
8{
9 class container;
10 class event;
11 class voice;
12
13 class SB_CLASS game_object : public sbk::core::object
14 {
15 REGISTER_REFLECTION(game_object, sbk::core::object)
16
17 public:
18 game_object() = default;
19
20 voice* play_container(container* container);
21 void post_event(event* event);
22
23 void stop_voice(voice* voice);
24 void stop_container(container* container);
25 void stop_all();
26
27 void update();
28
29 [[nodiscard]] bool is_playing() const noexcept;
30
31 [[nodiscard]] std::size_t voice_count() const noexcept;
32 [[nodiscard]] voice* get_voice(std::size_t index) const;
33
41 [[nodiscard]] float get_float_parameter_value(const sbk::core::database_ptr<float_parameter>& parameter) const;
42
50 [[nodiscard]] sbk_id get_int_parameter_value(const sbk::core::database_ptr<named_parameter>& parameter) const;
51
52 void set_float_parameter(const float_parameter::local_parameter_value_pair& parameterValue);
53 void set_int_parameter_value(const named_parameter::local_parameter_value_pair& parameterValue);
54
55 [[nodiscard]] local_parameter_list get_local_parameters() const { return m_parameters; }
56
57 private:
58 std::vector<std::unique_ptr<voice>> m_voices;
59 local_parameter_list m_parameters;
60 };
61} // namespace sbk::engine
Definition database_ptr.h:23
Base object that all sound Bakery objects should inherit from.
Definition object.h:21
Base container type. Inherited types include sounds, random, sequence etc.
Definition container.h:49
Definition event.h:22
Definition gameobject.h:14
Defines a database object with a changeable property.
Definition parameter.h:18
A runtime graph of nodes and busses, playing a sound or many.
Definition voice.h:16
Holds a list of parameters and their local value.
Definition parameter.h:236