Running again. Next step: making connections work again!

This commit is contained in:
Sebastian
2024-12-05 00:01:42 +01:00
parent 036c6f4723
commit b6c2029386
8 changed files with 56 additions and 58 deletions
+13 -9
View File
@@ -62,30 +62,34 @@ namespace VISEQ::APP {
std::ifstream f("state.json");
json graph = json::parse(f);
for(auto n : graph.at("gm").at("nodes")){
gm->addNodeAndUpdate(n.template get<std::shared_ptr<MidiNode>>());
}
int highest_id = 0;
std::shared_ptr<Node> hid;
for(auto n : graph.at("graphmanager").at("nodes")){
std::shared_ptr<MidiNode> mn = n;
if(mn->id > highest_id) {
highest_id = mn->id;
Node hid;
for(auto n : graph.at("gm").at("nodes")){
MidiNode mn = n.template get<MidiNode>();
if(mn.id > highest_id) {
highest_id = mn.id;
hid = mn;
}
}
for(auto e : graph.at("graphmanager").at("edges")){
for(auto e : graph.at("gm").at("edges")){
if(e.at("id") > highest_id){
highest_id = e.at("id");
}
}
for(auto n : graph.at("graphmanager").at("nodes")){
for(auto n : graph.at("gm").at("nodes")){
std::shared_ptr<MidiNode> mn = n;
gm->addNode(mn);
//app.gm->nodes.push_back(mn);
std::cout << std::format("adding node {}", mn->id) << std::endl;
}
for(auto e : graph.at("graphmanager").at("edges")){
for(auto e : graph.at("gm").at("edges")){
int start_id = e.at("start").get<int>();
int end_id = e.at("end").get<int>();
@@ -103,7 +107,7 @@ namespace VISEQ::APP {
}
gm->lastEdge().lock()->newId(highest_id);
for(auto s : graph.at("signalmanager").at("signals")){
for(auto s : graph.at("sm").at("signals")){
int start_id = s.at("start").get<int>();
int next_id = s.at("next").get<int>();
int last_id = s.at("last").get<int>();