summaryrefslogtreecommitdiffstats
path: root/src/event_to_string.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-11-29 00:35:02 +0100
committerDavid Robillard <d@drobilla.net>2020-11-29 00:35:02 +0100
commitfb54982c5ade5bee05b8d4a817d258ba89df701b (patch)
tree287934e43f3e0dfab6bc6cf9295a0b080bd7f707 /src/event_to_string.cpp
parent395362edbd8cd4ff08f3c29f3ae36d7d20229f21 (diff)
downloadpatchage-fb54982c5ade5bee05b8d4a817d258ba89df701b.tar.gz
patchage-fb54982c5ade5bee05b8d4a817d258ba89df701b.tar.bz2
patchage-fb54982c5ade5bee05b8d4a817d258ba89df701b.zip
Replace attached and detached signals with events
Diffstat (limited to 'src/event_to_string.cpp')
-rw-r--r--src/event_to_string.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/event_to_string.cpp b/src/event_to_string.cpp
index 83455bf..503144c 100644
--- a/src/event_to_string.cpp
+++ b/src/event_to_string.cpp
@@ -16,6 +16,7 @@
#include "event_to_string.hpp"
+#include "ClientType.hpp"
#include "PatchageEvent.hpp"
#include "warnings.hpp"
@@ -34,6 +35,26 @@ struct EventPrinter
{
using result_type = std::string; ///< For boost::apply_visitor
+ std::string operator()(const ClientType type)
+ {
+ switch (type) {
+ case ClientType::jack:
+ return "JACK";
+ case ClientType::alsa:
+ return "ALSA";
+ }
+ }
+
+ std::string operator()(const DriverAttachmentEvent& event)
+ {
+ return fmt::format("Attached to {}", (*this)(event.type));
+ }
+
+ std::string operator()(const DriverDetachmentEvent& event)
+ {
+ return fmt::format("Detached from {}", (*this)(event.type));
+ }
+
std::string operator()(const ClientCreationEvent& event)
{
return fmt::format(