Sound Bakery  v0.1.0
Open-source audio middleware for games
Loading...
Searching...
No Matches
ProjectManager.h
1#pragma once
2
3#include "Manager.h"
4#include "sound_bakery/system.h"
5#include "sound_bakery/core/database/database_object.h"
6
7#include "yaml-cpp/yaml.h"
8
9namespace SB::Engine
10{
11 class SoundContainer;
12}
13
15{
16 Selection() = default;
17
18 void SelectObject(SB::Core::Object* object) { m_selected = object; }
19
20 std::optional<rttr::type> SelectedType() const
21 {
22 if (m_selected)
23 {
24 return m_selected->getType();
25 }
26 return std::nullopt;
27 }
28
29 SB::Core::Object* GetSelected() const { return m_selected; }
30
31private:
32 SB::Core::Object* m_selected = nullptr;
33};
34
35class ProjectManager : public Manager
36{
37public:
38 ProjectManager(App* appOwner) : Manager(appOwner) {}
39
40public:
41 void Init(const std::filesystem::path& projectFile);
42 virtual void Tick(double deltaTime) override;
43 virtual void Exit() override;
44
45 void SaveProject() const;
46
47 Selection& GetSelection() { return m_selection; }
48 SB::Engine::SoundContainer* GetPreviewSoundContainer() const;
49
50private:
51 Selection m_selection;
52};
Definition App.h:10
Manager class that can handle application operations or project operations. For example,...
Definition Manager.h:14
Definition ProjectManager.h:36
virtual void Tick(double deltaTime) override
Called every frame regardless of if the app is closing.
Definition ProjectManager.cpp:37
virtual void Exit() override
Called when closing the app.
Definition ProjectManager.cpp:42
Simple base Object that all Sound Bakery objects should inherit from.
Definition object.h:33
Definition sound_container.h:10
Definition ProjectManager.h:15