state save/load working! signal pause/play button added, and speed control is now better.
This commit is contained in:
+27
-1
@@ -56,6 +56,7 @@ namespace VISEQ::GRAPH::NODES {
|
||||
{"distributionMode", N.distributionMode},
|
||||
{"nodeType", N.nodeType},
|
||||
{"midi_note_channel",N.midi_note_channel},
|
||||
{"midi_note",N.midi_note},
|
||||
{"midi_velocity",N.midi_velocity},
|
||||
{"midi_gate",N.midi_gate},
|
||||
{"midi_cc_channel",N.midi_cc_channel},
|
||||
@@ -76,6 +77,7 @@ namespace VISEQ::GRAPH::NODES {
|
||||
j.at("distributionMode").get_to(N.distributionMode);
|
||||
j.at("nodeType").get_to(N.nodeType);
|
||||
j.at("midi_note_channel").get_to(N.midi_note_channel);
|
||||
j.at("midi_note").get_to(N.midi_note);
|
||||
j.at("midi_velocity").get_to(N.midi_velocity);
|
||||
j.at("midi_gate").get_to(N.midi_gate);
|
||||
j.at("midi_cc_channel").get_to(N.midi_cc_channel);
|
||||
@@ -164,10 +166,34 @@ namespace VISEQ::BASE{
|
||||
|
||||
namespace VISEQ::SIGNAL{
|
||||
inline void to_json(json& j, const Signal& G){
|
||||
j = json{{"position", G.position},{"start",G.start->id},{"speed",G.speed}};
|
||||
std::map<std::string, int> fc = {{"r",G.color.r},{"g",G.color.g},{"b",G.color.b},{"a",G.color.a}};
|
||||
j = json{{"color",fc},{"position", G.position},{"radius",G.radius},{"start",G.start->id},{"next",G.next->id},{"last",G.last->id},{"speed",G.speed},{"midi_note_offset",G.midi_note_offset},{"midi_cc_offset",G.midi_cc_offset},{"multiplier",G.multiplier}};
|
||||
}
|
||||
|
||||
inline void from_json(const json& j, Signal& S){
|
||||
|
||||
Color c;
|
||||
c.r = j.at("color")["r"].get<int>();
|
||||
c.g = j.at("color")["g"].get<int>();
|
||||
c.b = j.at("color")["b"].get<int>();
|
||||
c.a = j.at("color")["a"].get<int>();
|
||||
|
||||
j.at("position").get_to<Vec2Df>(S.position);
|
||||
j.at("speed").get_to<float>(S.speed);
|
||||
j.at("radius").get_to<float>(S.radius);
|
||||
j.at("midi_note_offset").get_to(S.midi_note_offset);
|
||||
j.at("midi_cc_offset").get_to(S.midi_cc_offset);
|
||||
|
||||
S.color = c;
|
||||
}
|
||||
|
||||
inline void to_json(json& j, const std::shared_ptr<Signal>& G){
|
||||
j = *G;
|
||||
}
|
||||
|
||||
inline void from_json(const json& j, std::shared_ptr<Signal>& S){
|
||||
S.reset(new Signal(j.get<Signal>()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user