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/ClientID.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/ClientID.hpp')
-rw-r--r-- | src/ClientID.hpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/ClientID.hpp b/src/ClientID.hpp index 43b56ec..639cbbf 100644 --- a/src/ClientID.hpp +++ b/src/ClientID.hpp @@ -86,6 +86,24 @@ operator<<(std::ostream& os, const ClientID& id) } static inline bool +operator==(const ClientID& lhs, const ClientID& rhs) +{ + if (lhs.type() != rhs.type()) { + return false; + } + + switch (lhs.type()) { + case ClientID::Type::jack: + return lhs.jack_name() == rhs.jack_name(); + case ClientID::Type::alsa: + return lhs.alsa_id() == rhs.alsa_id(); + } + + assert(false); + return false; +} + +static inline bool operator<(const ClientID& lhs, const ClientID& rhs) { if (lhs.type() != rhs.type()) { |