summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-05-18 16:50:00 -0400
committerDavid Robillard <d@drobilla.net>2022-05-18 16:50:00 -0400
commit632dd7040c8fe5c12d09c3da6188e0cb83272c07 (patch)
tree2a9acd23e1e30163f7bfbece4eed2ae9def71af4
parent6d53e23c76dc9093fea8958d0ae2328f9f5bcedd (diff)
downloadpatchage-632dd7040c8fe5c12d09c3da6188e0cb83272c07.tar.gz
patchage-632dd7040c8fe5c12d09c3da6188e0cb83272c07.tar.bz2
patchage-632dd7040c8fe5c12d09c3da6188e0cb83272c07.zip
Fix build with fmt 8.1.1
-rw-r--r--src/Reactor.cpp25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/Reactor.cpp b/src/Reactor.cpp
index 858a877..c79fee0 100644
--- a/src/Reactor.cpp
+++ b/src/Reactor.cpp
@@ -19,6 +19,7 @@
#include "Canvas.hpp"
#include "CanvasModule.hpp"
#include "CanvasPort.hpp"
+#include "ClientType.hpp"
#include "Configuration.hpp"
#include "Driver.hpp"
#include "Drivers.hpp"
@@ -31,12 +32,28 @@
PATCHAGE_DISABLE_FMT_WARNINGS
#include <fmt/core.h>
+#include <fmt/ostream.h>
PATCHAGE_RESTORE_WARNINGS
#include <boost/variant/apply_visitor.hpp>
+#include <ostream>
+
namespace patchage {
+inline std::ostream&
+operator<<(std::ostream& os, const ClientType type)
+{
+ switch (type) {
+ case ClientType::jack:
+ return os << "JACK";
+ case ClientType::alsa:
+ return os << "ALSA";
+ }
+
+ return os;
+}
+
Reactor::Reactor(Configuration& conf,
Drivers& drivers,
Canvas& canvas,
@@ -54,10 +71,10 @@ Reactor::operator()(const action::ConnectPorts& action)
if (auto* d = _drivers.driver(action.tail.type())) {
d->connect(action.tail, action.head);
} else {
- _log.error(fmt::format("No driver for port type {}", action.tail.type()));
+ _log.error(fmt::format("No driver for {}", action.tail.type()));
}
} else {
- _log.warning("Unable to connect incompatible port types");
+ _log.warning("Unable to connect incompatible port");
}
}
@@ -92,10 +109,10 @@ Reactor::operator()(const action::DisconnectPorts& action)
if (auto* d = _drivers.driver(action.tail.type())) {
d->disconnect(action.tail, action.head);
} else {
- _log.error(fmt::format("No driver for port type {}", action.tail.type()));
+ _log.error(fmt::format("No driver for {}", action.tail.type()));
}
} else {
- _log.error("Unable to disconnect incompatible port types");
+ _log.error("Unable to disconnect incompatible ports");
}
}