From 632dd7040c8fe5c12d09c3da6188e0cb83272c07 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 18 May 2022 16:50:00 -0400 Subject: Fix build with fmt 8.1.1 --- src/Reactor.cpp | 25 +++++++++++++++++++++---- 1 file 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 +#include PATCHAGE_RESTORE_WARNINGS #include +#include + 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"); } } -- cgit v1.2.1