in between working states, switchting to multi midi out per node
This commit is contained in:
@@ -16,17 +16,23 @@ class ConnectionManager{
|
||||
|
||||
Node* next(Node* current, Node* last){
|
||||
std::vector<Connection*> paths;
|
||||
bool last_ok = false;
|
||||
std::vector<Node*> nodes;
|
||||
|
||||
for(auto& p : connections){
|
||||
if(((p.v1 == current && p.v1_v2) || (p.v2 == current && p.v2_v1)) && (p.v1 != last || p.v2 != last)) {
|
||||
if(((p.v1 == current && p.v1_v2) || (p.v2 == current && p.v2_v1))) {
|
||||
p.active = false;
|
||||
paths.push_back(&p);
|
||||
nodes.push_back( p.v1 == current ? p.v2 : p.v1 );
|
||||
}
|
||||
if(((p.v1 == last && p.v2_v1) || (p.v2 == last && p.v1_v2))) last_ok = true;
|
||||
}
|
||||
|
||||
if(paths.size() == 2) {
|
||||
Node* next = nodes[0] == last ? nodes[1] : nodes[0];
|
||||
if(paths[0]->v1 == next || paths[0]->v2 == next) paths[0]->active = true;
|
||||
if(paths[1]->v1 == next || paths[1]->v2 == next) paths[1]->active = true;
|
||||
return next;
|
||||
}
|
||||
|
||||
if(paths.empty() && last_ok) return last;
|
||||
if(paths.empty()) return nullptr;
|
||||
|
||||
int return_path = 0;
|
||||
|
||||
Reference in New Issue
Block a user