diff options
author | David Robillard <d@drobilla.net> | 2020-11-29 00:35:02 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-11-29 00:35:02 +0100 |
commit | fb54982c5ade5bee05b8d4a817d258ba89df701b (patch) | |
tree | 287934e43f3e0dfab6bc6cf9295a0b080bd7f707 /src/event_to_string.cpp | |
parent | 395362edbd8cd4ff08f3c29f3ae36d7d20229f21 (diff) | |
download | patchage-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.cpp | 21 |
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( |