diff options
author | David Robillard <d@drobilla.net> | 2020-11-28 15:58:38 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-11-28 17:39:10 +0100 |
commit | 0f8bd14d3487c35280c33bbfd133dd9e37c8f07e (patch) | |
tree | 701cac49a1e6e34025a8352e53845859566106b3 /src/PatchageCanvas.hpp | |
parent | a872f8b07498c85f0f2eb8b55462ac9df9ce4677 (diff) | |
download | patchage-0f8bd14d3487c35280c33bbfd133dd9e37c8f07e.tar.gz patchage-0f8bd14d3487c35280c33bbfd133dd9e37c8f07e.tar.bz2 patchage-0f8bd14d3487c35280c33bbfd133dd9e37c8f07e.zip |
Index clients and ports by ID
Diffstat (limited to 'src/PatchageCanvas.hpp')
-rw-r--r-- | src/PatchageCanvas.hpp | 11 |
1 files changed, 4 insertions, 7 deletions
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<const PortID, PatchagePort*>; - using ModuleIndex = std::multimap<const std::string, PatchageModule*>; + using ModuleIndex = std::multimap<const ClientID, PatchageModule*>; friend void disconnect_edge(GanvEdge*, void*); |