Sound Bakery  v0.1.0
Open-source audio middleware for games
Loading...
Searching...
No Matches
project_manager.h
1#pragma once
2
3#include "gluten/managers/manager.h"
4#include "sound_bakery/core/database/database_object.h"
5#include "sound_bakery/system.h"
6
7namespace sbk::engine
8{
9 class sound_container;
10}
11
13{
14 selection() = default;
15
16 void selected_object(sbk::core::object* object) { m_selected = object; }
17
18 std::optional<rttr::type> selected_type() const
19 {
20 if (m_selected)
21 {
22 return m_selected->get_object_type();
23 }
24 return std::nullopt;
25 }
26
27 sbk::core::object* get_selected() const { return m_selected; }
28
29private:
30 sbk::core::object* m_selected = nullptr;
31};
32
33class project_manager : public gluten::manager
34{
35public:
36 project_manager(gluten::app* appOwner) : gluten::manager(appOwner) {}
37
38public:
39 void init_project(const std::filesystem::path& project_file);
40 auto create_project(const std::filesystem::directory_entry& projectDirectory,
41 const std::string& projectName) -> void;
42
43 virtual void tick(double deltaTime) override;
44 virtual void exit() override;
45
46 void save_project() const;
47
48 selection& get_selection() { return m_selection; }
49 sbk::engine::sound_container* get_preview_sound_container() const;
50
51private:
52 void setup_project();
53
54 selection m_selection;
55
56 std::shared_ptr<gluten::widget> m_projectExplorerWidget;
57 std::shared_ptr<gluten::widget> m_playerWidget;
58 std::shared_ptr<gluten::widget> m_detailsWidget;
59 std::shared_ptr<gluten::widget> m_audioMeterWidget;
60};
Definition project_manager.h:34
Base object that all sound Bakery objects should inherit from.
Definition object.h:23
Definition sound_container.h:10
Definition project_manager.h:13