Sound Bakery  v0.1.0
Open-source audio middleware for games
Loading...
Searching...
No Matches
system.h
1#pragma once
2
3#include "sound_bakery/core/core_fwd.h"
4#include "sound_bakery/core/database/database.h"
5#include "sound_bakery/core/database/database_ptr.h"
6#include "sound_bakery/core/object/object_tracker.h"
7#include "sound_bakery/util/fmod_pointers.h"
8#include "spdlog/sinks/basic_file_sink.h"
9
10namespace sbk
11{
12 namespace core
13 {
14 class object_owner;
15 }
16
17 namespace editor
18 {
19 class project;
20 } // namespace editor
21
22 namespace engine
23 {
24 namespace Profiling
25 {
26 class VoiceTracker;
27 }
28
29 class bus;
30 class game_object;
31
39 class SB_CLASS system final : public sc_system,
43 public concurrencpp::runtime
44 {
45 REGISTER_REFLECTION(system)
46 NOT_COPYABLE(system)
47
48 public:
49 system();
50 ~system();
51
52 static system* get();
53
54 static system* create();
55 static void destroy();
56
57 static sc_result init();
58 static sc_result update();
59
63 sbk::core::object_owner* current_object_owner();
64
68 static sc_result open_project(const std::filesystem::path& project_file);
69 static sbk::editor::project* get_project();
70
71 std::shared_ptr<concurrencpp::manual_executor> game_thread_executer() const { return m_gameThreadExecuter; }
72
73 [[nodiscard]] sbk::engine::game_object* get_listener_game_object() const { return m_listenerGameObject.get(); }
74 [[nodiscard]] sbk::engine::bus* get_master_bus() const { return m_masterBus.get(); }
75
76 void set_master_bus(const std::shared_ptr<sbk::engine::bus>& masterBus);
77
78 private:
79 bool m_registeredReflection = false;
80
81 std::shared_ptr<sbk::engine::game_object> m_listenerGameObject;
82 std::shared_ptr<sbk::engine::bus> m_masterBus;
83 std::unique_ptr<sbk::editor::project> m_project;
84 std::unique_ptr<Profiling::VoiceTracker> m_voiceTracker;
85 std::shared_ptr<concurrencpp::manual_executor> m_gameThreadExecuter;
86 std::shared_ptr<spdlog::logger> m_logger;
87 };
88 } // namespace engine
89} // namespace sbk
Runtime lookup of objects, using their ID or name.
Definition database.h:15
Creates, owns and tracks objects.
Definition object_owner.h:13
Tracks object categories and types.
Definition object_tracker.h:18
Manages a project file and the objects contained within it.
Definition project.h:21
Definition bus.h:10
Definition gameobject.h:14
Manager of the whole sound Bakery.
Definition system.h:44
Object that manages the node graph, sounds, output etc.
Definition sound_chef_common.h:226