Skip to content

Commit

Permalink
ci: multiple build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Dec 27, 2024
1 parent eb855c0 commit 1321e8f
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,59 @@

#include <wobjectimpl.h>

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) { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<RemoteControl> make(const score::DocumentContext& ctx) = 0;
virtual void release(const score::DocumentContext& ctx, std::shared_ptr<RemoteControl>)
virtual std::shared_ptr<RemoteControlInterface> make(const score::DocumentContext& ctx)
= 0;
virtual void
release(const score::DocumentContext& ctx, std::shared_ptr<RemoteControlInterface>)
= 0;
};

Expand Down
58 changes: 30 additions & 28 deletions src/plugins/score-plugin-protocols/Protocols/MCU/MCUDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <score/document/DocumentContext.hpp>
#include <score/serialization/MimeVisitor.hpp>

#include <ossia/detail/fmt.hpp>
#include <ossia/network/base/device.hpp>
#include <ossia/network/context.hpp>
#include <ossia/network/generic/generic_device.hpp>
Expand All @@ -29,6 +30,8 @@
#include <QTimer>

#include <RemoteControl/RemoteControlProvider.hpp>

#include <memory>
// clang-format off
#include <libremidi/libremidi.hpp>
#include <libremidi/backends.hpp>
Expand All @@ -37,8 +40,6 @@

// clang-format on

#include <memory>

namespace Protocols
{
class mcu_protocol
Expand All @@ -48,14 +49,15 @@ class mcu_protocol
public:
const score::DocumentContext& doc;
mcu_protocol(
const score::DocumentContext& doc, std::shared_ptr<Process::RemoteControl> rc,
const score::DocumentContext& doc,
std::shared_ptr<Process::RemoteControlInterface> 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);
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -701,7 +703,7 @@ class mcu_protocol
break;
}
}
std::shared_ptr<Process::RemoteControl> m_rc;
std::shared_ptr<Process::RemoteControlInterface> m_rc;
ossia::net::network_context_ptr m_context;
std::shared_ptr<libremidi::midi_out> m_output;
std::shared_ptr<libremidi::remote_control_processor> m_rcp;
Expand All @@ -714,14 +716,14 @@ class mcu_protocol
bool m_scrub{};
std::bitset<9> m_fader_grab{};

std::vector<Process::RemoteControl::ControllerHandle> m_knob_handles;
std::vector<Process::RemoteControl::ControllerHandle> m_knob_button_handles;
std::vector<Process::RemoteControl::ControllerHandle> m_fader_handles;
std::vector<Process::RemoteControl::ControllerHandle> m_f_handles;
std::vector<Process::RemoteControl::ControllerHandle> m_rec_handles;
std::vector<Process::RemoteControl::ControllerHandle> m_mute_handles;
std::vector<Process::RemoteControl::ControllerHandle> m_solo_handles;
std::vector<Process::RemoteControl::ControllerHandle> m_select_handles;
std::vector<Process::RemoteControlInterface::ControllerHandle> m_knob_handles;
std::vector<Process::RemoteControlInterface::ControllerHandle> m_knob_button_handles;
std::vector<Process::RemoteControlInterface::ControllerHandle> m_fader_handles;
std::vector<Process::RemoteControlInterface::ControllerHandle> m_f_handles;
std::vector<Process::RemoteControlInterface::ControllerHandle> m_rec_handles;
std::vector<Process::RemoteControlInterface::ControllerHandle> m_mute_handles;
std::vector<Process::RemoteControlInterface::ControllerHandle> m_solo_handles;
std::vector<Process::RemoteControlInterface::ControllerHandle> m_select_handles;

bool pull(ossia::net::parameter_base&) override { return true; }
bool push(const ossia::net::parameter_base&, const ossia::value& v) override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ void DocumentPlugin::nextChannel(RemoteControlImpl& b)
updateDisplay();
}

std::shared_ptr<Process::RemoteControl> DocumentPlugin::acquireRemoteControlInterface()
std::shared_ptr<Process::RemoteControlInterface> DocumentPlugin::acquireRemoteControlInterface()
{
auto impl = std::make_shared<RemoteControlImpl>(*this);
m_controllers.push_back({impl});
Expand All @@ -328,7 +328,7 @@ std::shared_ptr<Process::RemoteControl> DocumentPlugin::acquireRemoteControlInte
}

void DocumentPlugin::releaseRemoteControlInterface(
std::shared_ptr<Process::RemoteControl> impl)
std::shared_ptr<Process::RemoteControlInterface> impl)
{
ossia::remove_erase_if(
m_controllers, [&impl](const Controller& e) { return e.controller == impl; });
Expand Down Expand Up @@ -438,17 +438,17 @@ void DocumentPlugin::on_execTime()
ctl.controller->transportChanged(t, 1., 1., 1., 1.);
}
}
std::vector<Process::RemoteControl::ControllerHandle>
std::vector<Process::RemoteControlInterface::ControllerHandle>
DocumentPlugin::registerControllerGroup(
RemoteControlImpl& c, Process::RemoteControl::ControllerHint hint, int count)
RemoteControlImpl& c, Process::RemoteControlInterface::ControllerHint hint, int count)
{
for(auto& ctls : m_controllers)
{
if(ctls.controller.get() == &c)
{
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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
#include <ossia/detail/flat_map.hpp>

#include <RemoteControl/RemoteControlProvider.hpp>

#include <span>

namespace Engine
{
class ApplicationPlugin;
Expand All @@ -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<Process::RemoteControl> acquireRemoteControlInterface();
void releaseRemoteControlInterface(std::shared_ptr<Process::RemoteControl>);
std::shared_ptr<Process::RemoteControlInterface> acquireRemoteControlInterface();
void releaseRemoteControlInterface(std::shared_ptr<Process::RemoteControlInterface>);

std::vector<ControllerHandle> registerControllerGroup(
RemoteControlImpl&, Process::RemoteControl::ControllerHint hint, int count);
RemoteControlImpl&, Process::RemoteControlInterface::ControllerHint hint,
int count);

void prevBank(RemoteControlImpl&);
void nextBank(RemoteControlImpl&);
Expand Down Expand Up @@ -77,7 +81,7 @@ class DocumentPlugin : public score::DocumentPlugin
int m_current_channel_offset{};
struct Controller
{
std::shared_ptr<Process::RemoteControl> controller;
std::shared_ptr<Process::RemoteControlInterface> controller;
std::vector<ControllerHandle> handles;
struct ControlMap
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <Scenario/Document/ScenarioDocument/ScenarioDocumentView.hpp>

#include <score/application/GUIApplicationContext.hpp>
#include <score/document/DocumentContext.hpp>

#include <core/document/DocumentView.hpp>

Expand All @@ -17,7 +18,7 @@ RemoteControlImpl::RemoteControlImpl(DocumentPlugin& self)
{
}

std::vector<Process::RemoteControl::ControllerHandle>
std::vector<Process::RemoteControlInterface::ControllerHandle>
RemoteControlImpl::registerControllerGroup(ControllerHint hint, int count)
{
return doc.registerControllerGroup(*this, hint, count);
Expand Down Expand Up @@ -163,7 +164,7 @@ void RemoteControlImpl::offsetControl(ControllerHandle index, double val)
doc.offsetControl(*this, index, val);
}

std::shared_ptr<Process::RemoteControl>
std::shared_ptr<Process::RemoteControlInterface>
RemoteControlProvider::make(const score::DocumentContext& ctx)
{
auto* doc = ctx.findPlugin<DocumentPlugin>();
Expand All @@ -173,7 +174,8 @@ RemoteControlProvider::make(const score::DocumentContext& ctx)
}

void RemoteControlProvider::release(
const score::DocumentContext& ctx, std::shared_ptr<Process::RemoteControl> impl)
const score::DocumentContext& ctx,
std::shared_ptr<Process::RemoteControlInterface> impl)
{
auto* doc = ctx.findPlugin<DocumentPlugin>();
if(!doc)
Expand Down
Loading

0 comments on commit 1321e8f

Please sign in to comment.