Sound Bakery  v0.1.0
Open-source audio middleware for games
Loading...
Searching...
No Matches
voice.h
1#pragma once
2
3#include "sound_bakery/core/core_include.h"
4#include "sound_bakery/voice/node_instance.h"
5
6namespace sbk::engine
7{
8 class container;
9 class game_object;
10 class node_instance;
11
15 class SB_CLASS voice : public sbk::core::object
16 {
17 public:
18 voice() = delete;
19 voice(game_object* owningObject) : m_owningGameObject(owningObject) {}
20
21 void play_container(container* container);
22
23 void update();
24
25 [[nodiscard]] bool playing_container(container* container) const noexcept;
26
27 [[nodiscard]] const std::vector<std::shared_ptr<node_instance>> get_voices() const noexcept;
28 [[nodiscard]] std::size_t num_voices() const;
29 [[nodiscard]] node_instance* node_instance_at(std::size_t index) const;
30
31 [[nodiscard]] bool is_playing() const;
32
33 game_object* get_owning_game_object() const { return m_owningGameObject; }
34
35 private:
36 game_object* m_owningGameObject = nullptr;
37 sbk::core::database_ptr<container> m_playingContainer;
38 };
39} // 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 gameobject.h:14
NodeInstances represent runtime versions of Nodes, either containers or busses.
Definition node_instance.h:104
A runtime graph of nodes and busses, playing a sound or many.
Definition voice.h:16