compiling but mouse interaction is dead
This commit is contained in:
@@ -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>()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user