summaryrefslogtreecommitdiffstats
path: root/src/ClientID.hpp
diff options
context:
space:
mode:
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()) {