Sound Bakery  v0.1.0
Open-source audio middleware for games
Loading...
Searching...
No Matches
container.h
1#pragma once
2
3#include "sound_bakery/node/node.h"
4
5namespace sbk::engine
6{
7 class container;
8
13 {
15 {
16 // We're making the rough assumption that each call to gather_children_for_play
17 // will gather, on average, 3 or less sounds.
18 // This should hopefully save some allocation time in most cases.
19 sounds.reserve(3);
20 }
21
25 std::vector<const container*> sounds;
26
33
41 unsigned int numTimesPlayed;
42 };
43
48 class SB_CLASS container : public node
49 {
50 public:
51 container() : node() {}
52
53 bool can_add_child_type(const rttr::type& childType) const override;
54
63 virtual void gather_children_for_play(gather_children_context& context) const = 0;
64
65 REGISTER_REFLECTION(container, node)
66 RTTR_REGISTRATION_FRIEND
67 };
68} // namespace sbk::engine
Base container type. Inherited types include sounds, random, sequence etc.
Definition container.h:49
virtual void gather_children_for_play(gather_children_context &context) const =0
Collects and gathers sounds on this node and its children for play.
Root node that builds the core graph of sounds and busses.
Definition node.h:64
Contains all information required for gathering sounds for runtime playing and selection.
Definition container.h:13
local_parameter_list parameters
List of parameters that are local to this gathering.
Definition container.h:32
std::vector< const container * > sounds
Vector of containers that should play this iteration.
Definition container.h:25
unsigned int numTimesPlayed
How many times the voice/node has played.
Definition container.h:41
Holds a list of parameters and their local value.
Definition parameter.h:236