compiling but mouse interaction is dead

This commit is contained in:
Sebastian
2026-01-12 00:16:36 +01:00
parent 77a227f40d
commit d881ef43a3
23 changed files with 374 additions and 257 deletions
+36
View File
@@ -9,6 +9,9 @@
#include "state.h"
#include "vmath.h"
#include "midi-node.h"
#include "config-node.h"
namespace VISEQ::GRAPH::NODES {
void Node::setMode(int _mode) {mode = _mode;}
@@ -70,4 +73,37 @@ namespace VISEQ::GRAPH::NODES {
c->draw();
}
}
void to_json(json& j, const Node& N){
if(N.getNodeType() == NodeType::MIDINODE){
j = dynamic_cast<const MidiNode&>(N);
}
if(N.getNodeType() == NodeType::CONFIGNODE){
j = dynamic_cast<const ConfigNode&>(N);
}
}
void from_json(const json& j, Node& N){
if(j.at("nodeType") == NodeType::MIDINODE){
N = j.template get<MidiNode>();
}
if(j.at("nodeType") == NodeType::CONFIGNODE){
N = j.template get<ConfigNode>();
}
}
void to_json(json& j, const SPTR_Node& N){
j = *N;
}
void from_json(const json& j, std::shared_ptr<Node>& N){
std::cout << "SPTR_Node" << std::endl;
if(N->getNodeType() == NodeType::MIDINODE){
N.reset(new MidiNode(j.get<MidiNode>()));
}
if(N->getNodeType() == NodeType::CONFIGNODE){
N.reset(new ConfigNode(j.get<ConfigNode>()));
}
}
}