From 0f8bd14d3487c35280c33bbfd133dd9e37c8f07e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 28 Nov 2020 15:58:38 +0100 Subject: Index clients and ports by ID --- src/PatchageCanvas.hpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/PatchageCanvas.hpp') diff --git a/src/PatchageCanvas.hpp b/src/PatchageCanvas.hpp index 349512b..7f68b9c 100644 --- a/src/PatchageCanvas.hpp +++ b/src/PatchageCanvas.hpp @@ -45,15 +45,12 @@ class PatchageCanvas : public Ganv::Canvas public: PatchageCanvas(Connector& connector, int width, int height); - PatchageModule* find_module(const std::string& name, ModuleType type); + PatchageModule* find_module(const ClientID& id, ModuleType type); PatchagePort* find_port(const PortID& id); - void remove_module(const std::string& name); + void remove_module(const ClientID& id); void remove_module(PatchageModule* module); - PatchagePort* find_port_by_name(const std::string& client_name, - const std::string& port_name); - void index_port(const PortID& id, PatchagePort* port) { _port_index.insert(std::make_pair(id, port)); @@ -61,7 +58,7 @@ public: void remove_ports(bool (*pred)(const PatchagePort*)); - void add_module(const std::string& name, PatchageModule* module); + void add_module(const ClientID& id, PatchageModule* module); bool make_connection(Ganv::Node* tail, Ganv::Node* head); @@ -71,7 +68,7 @@ public: private: using PortIndex = std::map; - using ModuleIndex = std::multimap; + using ModuleIndex = std::multimap; friend void disconnect_edge(GanvEdge*, void*); -- cgit v1.2.1