39 lines
732 B
C++
39 lines
732 B
C++
|
|
#pragma once
|
||
|
|
|
||
|
|
#include "vmath.h"
|
||
|
|
#include <memory>
|
||
|
|
|
||
|
|
namespace VISEQ::APP{
|
||
|
|
|
||
|
|
struct AppSettings{
|
||
|
|
int mode = 0;
|
||
|
|
int width;
|
||
|
|
int height;
|
||
|
|
float grid;
|
||
|
|
float bpm;
|
||
|
|
float fps;
|
||
|
|
float speed = 16.0f;
|
||
|
|
int gui_selected_midi_out;
|
||
|
|
};
|
||
|
|
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(AppSettings, mode, width, height, grid, bpm, fps, speed, gui_selected_midi_out)
|
||
|
|
|
||
|
|
class State{
|
||
|
|
public:
|
||
|
|
State(){}
|
||
|
|
State(State &state) = delete;
|
||
|
|
void operator=(const State &) = delete;
|
||
|
|
|
||
|
|
AppSettings settings;
|
||
|
|
Vec2Df raw_mouse;
|
||
|
|
Vec2Df mod_mouse;
|
||
|
|
|
||
|
|
inline static std::shared_ptr<State> instance;
|
||
|
|
static std::shared_ptr<State> get() {
|
||
|
|
if(!instance){
|
||
|
|
instance.reset(new State());
|
||
|
|
}
|
||
|
|
return instance;
|
||
|
|
}
|
||
|
|
};
|
||
|
|
}
|