summaryrefslogtreecommitdiffstats
path: root/src/ClientID.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-11-28 15:58:38 +0100
committerDavid Robillard <d@drobilla.net>2020-11-28 17:39:10 +0100
commit0f8bd14d3487c35280c33bbfd133dd9e37c8f07e (patch)
tree701cac49a1e6e34025a8352e53845859566106b3 /src/ClientID.hpp
parenta872f8b07498c85f0f2eb8b55462ac9df9ce4677 (diff)
downloadpatchage-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.hpp18
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()) {