Running again. Next step: making connections work again!
This commit is contained in:
+13
-9
@@ -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>();
|
||||
|
||||
Reference in New Issue
Block a user