diff --git a/src/plugins/score-lib-process/RemoteControl/RemoteControlProvider.cpp b/src/plugins/score-lib-process/RemoteControl/RemoteControlProvider.cpp index c4e1972b0c..6ce0fa53b1 100644 --- a/src/plugins/score-lib-process/RemoteControl/RemoteControlProvider.cpp +++ b/src/plugins/score-lib-process/RemoteControl/RemoteControlProvider.cpp @@ -2,59 +2,59 @@ #include -W_OBJECT_IMPL(Process::RemoteControl) +W_OBJECT_IMPL(Process::RemoteControlInterface) namespace Process { -RemoteControl::RemoteControl() = default; -RemoteControl::~RemoteControl() = default; +RemoteControlInterface::RemoteControlInterface() = default; +RemoteControlInterface::~RemoteControlInterface() = default; RemoteControlProvider::~RemoteControlProvider() = default; -void RemoteControl::left(ControllerAction) { } +void RemoteControlInterface::left(ControllerAction) { } -void RemoteControl::right(ControllerAction) { } +void RemoteControlInterface::right(ControllerAction) { } -void RemoteControl::up(ControllerAction) { } +void RemoteControlInterface::up(ControllerAction) { } -void RemoteControl::down(ControllerAction) { } +void RemoteControlInterface::down(ControllerAction) { } -void RemoteControl::save(ControllerAction) { } +void RemoteControlInterface::save(ControllerAction) { } -void RemoteControl::ok(ControllerAction) { } +void RemoteControlInterface::ok(ControllerAction) { } -void RemoteControl::cancel(ControllerAction) { } +void RemoteControlInterface::cancel(ControllerAction) { } -void RemoteControl::enter(ControllerAction) { } +void RemoteControlInterface::enter(ControllerAction) { } -void RemoteControl::undo(ControllerAction) { } +void RemoteControlInterface::undo(ControllerAction) { } -void RemoteControl::redo(ControllerAction) { } +void RemoteControlInterface::redo(ControllerAction) { } -void RemoteControl::play(ControllerAction) { } +void RemoteControlInterface::play(ControllerAction) { } -void RemoteControl::pause(ControllerAction) { } +void RemoteControlInterface::pause(ControllerAction) { } -void RemoteControl::resume(ControllerAction) { } +void RemoteControlInterface::resume(ControllerAction) { } -void RemoteControl::stop(ControllerAction) { } +void RemoteControlInterface::stop(ControllerAction) { } -void RemoteControl::record(ControllerAction) { } +void RemoteControlInterface::record(ControllerAction) { } -void RemoteControl::solo(ControllerAction) { } +void RemoteControlInterface::solo(ControllerAction) { } -void RemoteControl::mute(ControllerAction) { } +void RemoteControlInterface::mute(ControllerAction) { } -void RemoteControl::select(ControllerAction) { } +void RemoteControlInterface::select(ControllerAction) { } -void RemoteControl::zoom(double, double) { } -void RemoteControl::scroll(double, double) { } -void RemoteControl::scrub(double) { } +void RemoteControlInterface::zoom(double, double) { } +void RemoteControlInterface::scroll(double, double) { } +void RemoteControlInterface::scrub(double) { } -void RemoteControl::prevBank(ControllerAction) { } -void RemoteControl::nextBank(ControllerAction) { } -void RemoteControl::prevChannel(ControllerAction) { } -void RemoteControl::nextChannel(ControllerAction) { } +void RemoteControlInterface::prevBank(ControllerAction) { } +void RemoteControlInterface::nextBank(ControllerAction) { } +void RemoteControlInterface::prevChannel(ControllerAction) { } +void RemoteControlInterface::nextChannel(ControllerAction) { } -void RemoteControl::setControl(ControllerHandle index, const ossia::value& val) { } -void RemoteControl::offsetControl(ControllerHandle index, double val) { } +void RemoteControlInterface::setControl(ControllerHandle index, const ossia::value& val) { } +void RemoteControlInterface::offsetControl(ControllerHandle index, double val) { } } diff --git a/src/plugins/score-lib-process/RemoteControl/RemoteControlProvider.hpp b/src/plugins/score-lib-process/RemoteControl/RemoteControlProvider.hpp index af45508c1c..664bba8d39 100644 --- a/src/plugins/score-lib-process/RemoteControl/RemoteControlProvider.hpp +++ b/src/plugins/score-lib-process/RemoteControl/RemoteControlProvider.hpp @@ -18,12 +18,12 @@ struct DocumentContext; namespace Process { -class SCORE_LIB_PROCESS_EXPORT RemoteControl : public QObject +class SCORE_LIB_PROCESS_EXPORT RemoteControlInterface : public QObject { - W_OBJECT(RemoteControl) + W_OBJECT(RemoteControlInterface) public: - RemoteControl(); - ~RemoteControl(); + RemoteControlInterface(); + ~RemoteControlInterface(); // Device setup enum ControllerHint @@ -115,8 +115,10 @@ class SCORE_LIB_PROCESS_EXPORT RemoteControlProvider : public score::InterfaceBa SCORE_INTERFACE(RemoteControlProvider, "50c57dfc-c31a-11ef-9af3-5ce91ee31bcd") public: ~RemoteControlProvider(); - virtual std::shared_ptr make(const score::DocumentContext& ctx) = 0; - virtual void release(const score::DocumentContext& ctx, std::shared_ptr) + virtual std::shared_ptr make(const score::DocumentContext& ctx) + = 0; + virtual void + release(const score::DocumentContext& ctx, std::shared_ptr) = 0; }; diff --git a/src/plugins/score-plugin-protocols/Protocols/MCU/MCUDevice.cpp b/src/plugins/score-plugin-protocols/Protocols/MCU/MCUDevice.cpp index c92c8ca6f0..d4e0294f29 100644 --- a/src/plugins/score-plugin-protocols/Protocols/MCU/MCUDevice.cpp +++ b/src/plugins/score-plugin-protocols/Protocols/MCU/MCUDevice.cpp @@ -14,6 +14,7 @@ #include #include +#include #include #include #include @@ -29,6 +30,8 @@ #include #include + +#include // clang-format off #include #include @@ -37,8 +40,6 @@ // clang-format on -#include - namespace Protocols { class mcu_protocol @@ -48,14 +49,15 @@ class mcu_protocol public: const score::DocumentContext& doc; mcu_protocol( - const score::DocumentContext& doc, std::shared_ptr rc, + const score::DocumentContext& doc, + std::shared_ptr rc, ossia::net::network_context_ptr ctx, libremidi::API api, const libremidi::input_port& ip, const libremidi::output_port& op) : doc{doc} , m_rc{rc} , m_context{ctx} { - using hint = Process::RemoteControl::ControllerHint; + using hint = Process::RemoteControlInterface::ControllerHint; // Init the handles m_knob_handles = m_rc->registerControllerGroup((hint)(hint::Knob | hint::MapControls), 8); @@ -115,13 +117,13 @@ class mcu_protocol m_input->open_port(ip); QObject::connect( - m_rc.get(), &Process::RemoteControl::controlNameChanged, this, + m_rc.get(), &Process::RemoteControlInterface::controlNameChanged, this, &mcu_protocol::on_control_name_changed); QObject::connect( - m_rc.get(), &Process::RemoteControl::controlValueChanged, this, + m_rc.get(), &Process::RemoteControlInterface::controlValueChanged, this, &mcu_protocol::on_control_value_changed); QObject::connect( - m_rc.get(), &Process::RemoteControl::transportChanged, this, + m_rc.get(), &Process::RemoteControlInterface::transportChanged, this, &mcu_protocol::on_transport_changed); blank(); @@ -182,30 +184,30 @@ class mcu_protocol case 0: break; case 1: - txt = std::format(" {} ", txt); + txt = fmt::format(" {} ", txt); break; case 2: - txt = std::format(" {} ", txt); + txt = fmt::format(" {} ", txt); break; case 3: - txt = std::format(" {} ", txt); + txt = fmt::format(" {} ", txt); break; case 4: - txt = std::format(" {} ", txt); + txt = fmt::format(" {} ", txt); break; case 5: - txt = std::format(" {} ", txt); + txt = fmt::format(" {} ", txt); break; case 6: - txt = std::format("{}", txt); + txt = fmt::format("{}", txt); case 7: - txt = std::format("{}", txt); + txt = fmt::format("{}", txt); break; } } - void - on_control_name_changed(Process::RemoteControl::ControllerHandle index, QString name) + void on_control_name_changed( + Process::RemoteControlInterface::ControllerHandle index, QString name) { if(int idx = ossia::index_in_container(this->m_knob_handles, index); idx != -1) { @@ -226,7 +228,7 @@ class mcu_protocol } void on_control_value_changed( - Process::RemoteControl::ControllerHandle index, const ossia::value& v) + Process::RemoteControlInterface::ControllerHandle index, const ossia::value& v) { if(int idx = ossia::index_in_container(this->m_knob_handles, index); idx != -1) { @@ -275,8 +277,8 @@ class mcu_protocol void on_command(libremidi::remote_control_protocol::mixer_command cmd, bool pressed) { - auto act = pressed ? Process::RemoteControl::ControllerAction::Press - : Process::RemoteControl::ControllerAction::Release; + auto act = pressed ? Process::RemoteControlInterface::ControllerAction::Press + : Process::RemoteControlInterface::ControllerAction::Release; using rcp = libremidi::remote_control_protocol::mixer_command; switch(cmd) { @@ -701,7 +703,7 @@ class mcu_protocol break; } } - std::shared_ptr m_rc; + std::shared_ptr m_rc; ossia::net::network_context_ptr m_context; std::shared_ptr m_output; std::shared_ptr m_rcp; @@ -714,14 +716,14 @@ class mcu_protocol bool m_scrub{}; std::bitset<9> m_fader_grab{}; - std::vector m_knob_handles; - std::vector m_knob_button_handles; - std::vector m_fader_handles; - std::vector m_f_handles; - std::vector m_rec_handles; - std::vector m_mute_handles; - std::vector m_solo_handles; - std::vector m_select_handles; + std::vector m_knob_handles; + std::vector m_knob_button_handles; + std::vector m_fader_handles; + std::vector m_f_handles; + std::vector m_rec_handles; + std::vector m_mute_handles; + std::vector m_solo_handles; + std::vector m_select_handles; bool pull(ossia::net::parameter_base&) override { return true; } bool push(const ossia::net::parameter_base&, const ossia::value& v) override diff --git a/src/plugins/score-plugin-remotecontrol/RemoteControl/Controller/DocumentPlugin.cpp b/src/plugins/score-plugin-remotecontrol/RemoteControl/Controller/DocumentPlugin.cpp index fd525ec64d..9aea94735d 100644 --- a/src/plugins/score-plugin-remotecontrol/RemoteControl/Controller/DocumentPlugin.cpp +++ b/src/plugins/score-plugin-remotecontrol/RemoteControl/Controller/DocumentPlugin.cpp @@ -318,7 +318,7 @@ void DocumentPlugin::nextChannel(RemoteControlImpl& b) updateDisplay(); } -std::shared_ptr DocumentPlugin::acquireRemoteControlInterface() +std::shared_ptr DocumentPlugin::acquireRemoteControlInterface() { auto impl = std::make_shared(*this); m_controllers.push_back({impl}); @@ -328,7 +328,7 @@ std::shared_ptr DocumentPlugin::acquireRemoteControlInte } void DocumentPlugin::releaseRemoteControlInterface( - std::shared_ptr impl) + std::shared_ptr impl) { ossia::remove_erase_if( m_controllers, [&impl](const Controller& e) { return e.controller == impl; }); @@ -438,9 +438,9 @@ void DocumentPlugin::on_execTime() ctl.controller->transportChanged(t, 1., 1., 1., 1.); } } -std::vector +std::vector DocumentPlugin::registerControllerGroup( - RemoteControlImpl& c, Process::RemoteControl::ControllerHint hint, int count) + RemoteControlImpl& c, Process::RemoteControlInterface::ControllerHint hint, int count) { for(auto& ctls : m_controllers) { @@ -448,7 +448,7 @@ DocumentPlugin::registerControllerGroup( { auto range = getIdRange(count, ctls.handles); ctls.handles.insert(ctls.handles.end(), range.begin(), range.end()); - if(hint & Process::RemoteControl::ControllerHint::MapControls) + if(hint & Process::RemoteControlInterface::ControllerHint::MapControls) { for(auto e : range) { diff --git a/src/plugins/score-plugin-remotecontrol/RemoteControl/Controller/DocumentPlugin.hpp b/src/plugins/score-plugin-remotecontrol/RemoteControl/Controller/DocumentPlugin.hpp index 9d026f403c..ab986c4719 100644 --- a/src/plugins/score-plugin-remotecontrol/RemoteControl/Controller/DocumentPlugin.hpp +++ b/src/plugins/score-plugin-remotecontrol/RemoteControl/Controller/DocumentPlugin.hpp @@ -12,6 +12,9 @@ #include #include + +#include + namespace Engine { class ApplicationPlugin; @@ -30,15 +33,16 @@ class RemoteControlProvider; class DocumentPlugin : public score::DocumentPlugin { public: - using ControllerHandle = Process::RemoteControl::ControllerHandle; + using ControllerHandle = Process::RemoteControlInterface::ControllerHandle; DocumentPlugin(const score::DocumentContext& doc, QObject* parent); ~DocumentPlugin(); - std::shared_ptr acquireRemoteControlInterface(); - void releaseRemoteControlInterface(std::shared_ptr); + std::shared_ptr acquireRemoteControlInterface(); + void releaseRemoteControlInterface(std::shared_ptr); std::vector registerControllerGroup( - RemoteControlImpl&, Process::RemoteControl::ControllerHint hint, int count); + RemoteControlImpl&, Process::RemoteControlInterface::ControllerHint hint, + int count); void prevBank(RemoteControlImpl&); void nextBank(RemoteControlImpl&); @@ -77,7 +81,7 @@ class DocumentPlugin : public score::DocumentPlugin int m_current_channel_offset{}; struct Controller { - std::shared_ptr controller; + std::shared_ptr controller; std::vector handles; struct ControlMap { diff --git a/src/plugins/score-plugin-remotecontrol/RemoteControl/Controller/RemoteControlProvider.cpp b/src/plugins/score-plugin-remotecontrol/RemoteControl/Controller/RemoteControlProvider.cpp index 728c805b03..4034f64759 100644 --- a/src/plugins/score-plugin-remotecontrol/RemoteControl/Controller/RemoteControlProvider.cpp +++ b/src/plugins/score-plugin-remotecontrol/RemoteControl/Controller/RemoteControlProvider.cpp @@ -1,6 +1,7 @@ #include #include +#include #include @@ -17,7 +18,7 @@ RemoteControlImpl::RemoteControlImpl(DocumentPlugin& self) { } -std::vector +std::vector RemoteControlImpl::registerControllerGroup(ControllerHint hint, int count) { return doc.registerControllerGroup(*this, hint, count); @@ -163,7 +164,7 @@ void RemoteControlImpl::offsetControl(ControllerHandle index, double val) doc.offsetControl(*this, index, val); } -std::shared_ptr +std::shared_ptr RemoteControlProvider::make(const score::DocumentContext& ctx) { auto* doc = ctx.findPlugin(); @@ -173,7 +174,8 @@ RemoteControlProvider::make(const score::DocumentContext& ctx) } void RemoteControlProvider::release( - const score::DocumentContext& ctx, std::shared_ptr impl) + const score::DocumentContext& ctx, + std::shared_ptr impl) { auto* doc = ctx.findPlugin(); if(!doc) diff --git a/src/plugins/score-plugin-remotecontrol/RemoteControl/Controller/RemoteControlProvider.hpp b/src/plugins/score-plugin-remotecontrol/RemoteControl/Controller/RemoteControlProvider.hpp index 9146621dbf..e4a58fa9ea 100644 --- a/src/plugins/score-plugin-remotecontrol/RemoteControl/Controller/RemoteControlProvider.hpp +++ b/src/plugins/score-plugin-remotecontrol/RemoteControl/Controller/RemoteControlProvider.hpp @@ -4,16 +4,16 @@ namespace RemoteControl::Controller { class DocumentPlugin; -class RemoteControlImpl : public Process::RemoteControl +class RemoteControlImpl : public Process::RemoteControlInterface { public: - using ControllerHandle = Process::RemoteControl::ControllerHandle; - using ControllerAction = Process::RemoteControl::ControllerAction; + using ControllerHandle = Process::RemoteControlInterface::ControllerHandle; + using ControllerAction = Process::RemoteControlInterface::ControllerAction; - DocumentPlugin& doc; + ::RemoteControl::Controller::DocumentPlugin& doc; explicit RemoteControlImpl(Controller::DocumentPlugin& self); - std::vector + std::vector registerControllerGroup(ControllerHint hint, int count) override; void sendKey(ControllerAction act, Qt::Key k, Qt::KeyboardModifiers mods = {}); @@ -55,10 +55,10 @@ class RemoteControlImpl : public Process::RemoteControl class RemoteControlProvider final : public Process::RemoteControlProvider { SCORE_CONCRETE("ac63880f-ce30-489d-a93a-869578ade25a") - std::shared_ptr + std::shared_ptr make(const score::DocumentContext& ctx) override; void release( const score::DocumentContext& ctx, - std::shared_ptr) override; + std::shared_ptr) override; }; }