2024-10-25 16:41:37 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
2024-11-30 02:54:40 +01:00
|
|
|
#include "interaction-manager.h"
|
2024-11-26 01:58:09 +01:00
|
|
|
#include "nlohmann/json.hpp"
|
|
|
|
|
#include "canvas.h"
|
2024-10-30 14:55:24 +01:00
|
|
|
#include "graph-manager.h"
|
2024-11-01 02:38:47 +01:00
|
|
|
#include "midi-node.h"
|
2024-10-25 16:41:37 +02:00
|
|
|
#include "signal-manager.h"
|
2024-11-21 02:03:32 +01:00
|
|
|
#include "state.h"
|
2024-10-25 16:41:37 +02:00
|
|
|
#include "ui.h"
|
2024-10-27 00:40:57 +02:00
|
|
|
|
2024-11-01 02:38:47 +01:00
|
|
|
#include <memory>
|
2024-10-25 16:41:37 +02:00
|
|
|
|
2024-11-26 01:58:09 +01:00
|
|
|
using json = nlohmann::json;
|
|
|
|
|
|
2024-11-03 03:48:49 +01:00
|
|
|
namespace VISEQ::APP {
|
2024-11-14 00:55:09 +01:00
|
|
|
class AppManager{
|
2024-11-03 03:48:49 +01:00
|
|
|
public:
|
2026-01-05 02:56:30 +01:00
|
|
|
AppManager() : im(gm->getPtr(), sm->getPtr(), canvas), ui(sm->getPtr(), gm->getPtr()) {}
|
2024-11-26 01:58:09 +01:00
|
|
|
|
2026-01-05 02:56:30 +01:00
|
|
|
std::mutex mutex;
|
2024-10-25 16:41:37 +02:00
|
|
|
|
2026-01-05 02:56:30 +01:00
|
|
|
std::shared_ptr<APP::State> state = APP::State::get();
|
2024-10-25 16:41:37 +02:00
|
|
|
|
2026-01-05 02:56:30 +01:00
|
|
|
std::shared_ptr<CANVAS::Canvas> canvas = std::make_shared<CANVAS::Canvas>();
|
|
|
|
|
std::shared_ptr<GraphManager> gm = std::make_shared<GraphManager>();
|
|
|
|
|
std::shared_ptr<SIGNAL::SignalManager> sm = std::make_shared<SIGNAL::SignalManager>(gm->getPtr(), &mutex);
|
|
|
|
|
VISEQ::INTERACTION::InteractionManager im;
|
2024-11-30 02:54:40 +01:00
|
|
|
|
2026-01-05 02:56:30 +01:00
|
|
|
UI::AppUI ui;
|
2024-10-25 16:41:37 +02:00
|
|
|
|
2026-01-05 02:56:30 +01:00
|
|
|
void init();
|
|
|
|
|
void close();
|
|
|
|
|
void startSignals();
|
|
|
|
|
void loadState();
|
|
|
|
|
void updateMidiPorts();
|
|
|
|
|
void update();
|
|
|
|
|
void draw();
|
|
|
|
|
void drawUI();
|
2024-11-03 03:48:49 +01:00
|
|
|
};
|
2026-01-12 00:16:36 +01:00
|
|
|
|
|
|
|
|
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(AppManager, gm, sm)
|
2024-11-03 03:48:49 +01:00
|
|
|
|
|
|
|
|
}
|