Config nodes change midi notes. Better would be midi nodes read from config nodes.

This commit is contained in:
Sebastian
2024-12-07 15:28:33 +01:00
parent 36273ba7ac
commit 3b0e7e986f
3 changed files with 98 additions and 42 deletions
+5 -2
View File
@@ -84,11 +84,14 @@ namespace VISEQ::GRAPH {
}
void addConnection(WPTR_Node from, WPTR_Node to){
EdgeType et = EdgeType::MIDIEDGE;
if(from.lock()->getNodeType() == NodeType::CONFIGNODE || to.lock()->getNodeType() == NodeType::CONFIGNODE) et = EdgeType::CONFIGEDGE;
if(from.lock() != to.lock()) {
edges.emplace_back(std::make_shared<Edge>());
edges.back()->edgeType = et;
edges.back()->start = from;
edges.back()->end = to;
edges.back()->start_conn = from.lock()->connectors.back(); // TODO: crashes on start
edges.back()->start_conn = from.lock()->connectors.back();
edges.back()->end_conn = to.lock()->connectors.back();
from.lock()->connections.push_back(edges.back());
to.lock()->connections.push_back(edges.back());
@@ -212,7 +215,7 @@ namespace VISEQ::GRAPH {
WPTR_Node next(WPTR_Node current, WPTR_Node last){
VEC_WPTR_Edge possible_connections = current.lock()->connections | RANGE_FILTER([current](WPTR_Edge c){
return (c.lock()->start.lock() == current.lock() && c.lock()->pass_forward) || (c.lock()->end.lock() == current.lock() && c.lock()->pass_backward);
return (c.lock()->getEdgeType() == EdgeType::MIDIEDGE) && ((c.lock()->start.lock() == current.lock() && c.lock()->pass_forward) || (c.lock()->end.lock() == current.lock() && c.lock()->pass_backward));
}) | std::ranges::to<VEC_WPTR_Edge>();
if(possible_connections.empty()) return SPTR_Node(nullptr);