From a4c4f7bcd6621b4ff0ef3e949b979845379f837d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Mon, 3 Feb 2025 21:54:35 -0500 Subject: [PATCH] ci: compatibility fixes for spout, syphon, wasm --- 3rdparty/libossia | 2 +- .../score-plugin-gfx/Gfx/GfxContext.cpp | 10 +++++----- .../score-plugin-gfx/Gfx/GfxContext.hpp | 18 +++++++++--------- src/plugins/score-plugin-gfx/Gfx/GfxDevice.cpp | 1 + .../score-plugin-gfx/Gfx/GfxExecContext.hpp | 6 +++--- .../Gfx/GfxExecutionAction.cpp | 2 +- .../score-plugin-gfx/Gfx/Spout/SpoutOutput.cpp | 2 +- .../score-plugin-gfx/Gfx/Syphon/SyphonInput.mm | 4 +++- .../score-plugin-gfx/Gfx/TexturePort.cpp | 2 +- 9 files changed, 25 insertions(+), 22 deletions(-) diff --git a/3rdparty/libossia b/3rdparty/libossia index aebd70f728..8c94670718 160000 --- a/3rdparty/libossia +++ b/3rdparty/libossia @@ -1 +1 @@ -Subproject commit aebd70f72822a5d33ccd2d8b6106f333b2a2afa5 +Subproject commit 8c94670718ebf10f60a1661b5c1ebd95d2d1e560 diff --git a/src/plugins/score-plugin-gfx/Gfx/GfxContext.cpp b/src/plugins/score-plugin-gfx/Gfx/GfxContext.cpp index 6340ac1eb6..fb9a33e608 100644 --- a/src/plugins/score-plugin-gfx/Gfx/GfxContext.cpp +++ b/src/plugins/score-plugin-gfx/Gfx/GfxContext.cpp @@ -82,17 +82,17 @@ void GfxContext::unregister_preview_node(int32_t idx) tick_commands.enqueue(NodeCommand{NodeCommand::REMOVE_PREVIEW_NODE, idx, {}}); } -void GfxContext::connect_preview_node(Edge e) +void GfxContext::connect_preview_node(EdgeSpec e) { tick_commands.enqueue(EdgeCommand{EdgeCommand::CONNECT_PREVIEW_NODE, e}); } -void GfxContext::disconnect_preview_node(Edge e) +void GfxContext::disconnect_preview_node(EdgeSpec e) { tick_commands.enqueue(EdgeCommand{EdgeCommand::DISCONNECT_PREVIEW_NODE, e}); } -void GfxContext::add_edge(Edge edge) +void GfxContext::add_edge(EdgeSpec edge) { auto source_node_it = this->nodes.find(edge.first.node); if(source_node_it != this->nodes.end()) @@ -118,7 +118,7 @@ void GfxContext::add_edge(Edge edge) } } -void GfxContext::remove_edge(Edge edge) +void GfxContext::remove_edge(EdgeSpec edge) { auto source_node_it = this->nodes.find(edge.first.node); if(source_node_it != this->nodes.end()) @@ -318,7 +318,7 @@ void GfxContext::run_commands() auto n = dynamic_cast(node.get()); SCORE_ASSERT(n); { - auto it = ossia::find_if(this->preview_edges, [idx = cmd.index](Edge e) { + auto it = ossia::find_if(this->preview_edges, [idx = cmd.index](EdgeSpec e) { return e.second.node == idx; }); if(it != this->preview_edges.end()) diff --git a/src/plugins/score-plugin-gfx/Gfx/GfxContext.hpp b/src/plugins/score-plugin-gfx/Gfx/GfxContext.hpp index c7dc465d2e..094ef05cf9 100644 --- a/src/plugins/score-plugin-gfx/Gfx/GfxContext.hpp +++ b/src/plugins/score-plugin-gfx/Gfx/GfxContext.hpp @@ -26,7 +26,7 @@ namespace Gfx { using port_index = ossia::gfx::port_index; -using Edge = std::pair; +using EdgeSpec = std::pair; class GfxExecutionAction; class SCORE_PLUGIN_GFX_EXPORT GfxContext : public QObject { @@ -40,8 +40,8 @@ class SCORE_PLUGIN_GFX_EXPORT GfxContext : public QObject int32_t register_node(NodePtr node); int32_t register_preview_node(NodePtr node); - void connect_preview_node(Edge e); - void disconnect_preview_node(Edge e); + void connect_preview_node(EdgeSpec e); + void disconnect_preview_node(EdgeSpec e); void unregister_node(int32_t idx); void unregister_preview_node(int32_t idx); @@ -61,8 +61,8 @@ class SCORE_PLUGIN_GFX_EXPORT GfxContext : public QObject void run_commands(); void add_preview_output(score::gfx::OutputNode& out); void remove_preview_output(); - void add_edge(Edge e); - void remove_edge(Edge e); + void add_edge(EdgeSpec e); + void remove_edge(EdgeSpec e); void remove_node(std::vector>& nursery, int32_t id); void timerEvent(QTimerEvent*) override; @@ -94,7 +94,7 @@ class SCORE_PLUGIN_GFX_EXPORT GfxContext : public QObject CONNECT_PREVIEW_NODE, DISCONNECT_PREVIEW_NODE } cmd{}; - Edge edge; + EdgeSpec edge; }; using Command = ossia::variant; @@ -102,9 +102,9 @@ class SCORE_PLUGIN_GFX_EXPORT GfxContext : public QObject moodycamel::ConcurrentQueue tick_messages; std::mutex edges_lock; - ossia::flat_set new_edges TS_GUARDED_BY(edges_lock); - ossia::flat_set edges; - ossia::flat_set preview_edges; + ossia::flat_set new_edges TS_GUARDED_BY(edges_lock); + ossia::flat_set edges; + ossia::flat_set preview_edges; std::atomic_bool edges_changed{}; int m_timer{-1}; diff --git a/src/plugins/score-plugin-gfx/Gfx/GfxDevice.cpp b/src/plugins/score-plugin-gfx/Gfx/GfxDevice.cpp index b7ddab2012..cacfddc457 100644 --- a/src/plugins/score-plugin-gfx/Gfx/GfxDevice.cpp +++ b/src/plugins/score-plugin-gfx/Gfx/GfxDevice.cpp @@ -8,6 +8,7 @@ #include +#include W_OBJECT_IMPL(Gfx::GfxInputDevice) W_OBJECT_IMPL(Gfx::GfxOutputDevice) namespace Gfx diff --git a/src/plugins/score-plugin-gfx/Gfx/GfxExecContext.hpp b/src/plugins/score-plugin-gfx/Gfx/GfxExecContext.hpp index 1da8add88d..2b36fe21e5 100644 --- a/src/plugins/score-plugin-gfx/Gfx/GfxExecContext.hpp +++ b/src/plugins/score-plugin-gfx/Gfx/GfxExecContext.hpp @@ -26,9 +26,9 @@ class SCORE_PLUGIN_GFX_EXPORT GfxExecutionAction final void endTick(const ossia::audio_tick_state& st) override; GfxContext* ui{}; - std::vector prev_edges; - std::vector edges_cache; - using edge_queue = moodycamel::ConcurrentQueue; + std::vector prev_edges; + std::vector edges_cache; + using edge_queue = moodycamel::ConcurrentQueue; edge_queue incoming_edges; }; diff --git a/src/plugins/score-plugin-gfx/Gfx/GfxExecutionAction.cpp b/src/plugins/score-plugin-gfx/Gfx/GfxExecutionAction.cpp index bbb5349646..edb4df8088 100644 --- a/src/plugins/score-plugin-gfx/Gfx/GfxExecutionAction.cpp +++ b/src/plugins/score-plugin-gfx/Gfx/GfxExecutionAction.cpp @@ -72,7 +72,7 @@ void GfxExecutionAction::endTick(const ossia::audio_tick_state& st) edges_cache.clear(); edges_cache.reserve(std::max(prev_edges.size(), incoming_edges.size_approx())); - Edge e; + EdgeSpec e; while(incoming_edges.try_dequeue(e)) { edges_cache.push_back(e); diff --git a/src/plugins/score-plugin-gfx/Gfx/Spout/SpoutOutput.cpp b/src/plugins/score-plugin-gfx/Gfx/Spout/SpoutOutput.cpp index ee12fcec85..5179d9989c 100644 --- a/src/plugins/score-plugin-gfx/Gfx/Spout/SpoutOutput.cpp +++ b/src/plugins/score-plugin-gfx/Gfx/Spout/SpoutOutput.cpp @@ -153,7 +153,7 @@ struct SpoutNode final : score::gfx::OutputNode void init(score::gfx::RenderList& renderer, QRhiResourceUpdateBatch& res) override { } void update( score::gfx::RenderList& renderer, QRhiResourceUpdateBatch& res, - Edge* edge) override + score::gfx::Edge* edge) override { } void release(score::gfx::RenderList&) override { } diff --git a/src/plugins/score-plugin-gfx/Gfx/Syphon/SyphonInput.mm b/src/plugins/score-plugin-gfx/Gfx/Syphon/SyphonInput.mm index 7b0c6fe01c..04843704ca 100644 --- a/src/plugins/score-plugin-gfx/Gfx/Syphon/SyphonInput.mm +++ b/src/plugins/score-plugin-gfx/Gfx/Syphon/SyphonInput.mm @@ -107,7 +107,9 @@ void openServer(QRhi& rhi) } score::gfx::TextureRenderTarget renderTargetForInput(const score::gfx::Port& p) override { return { }; } - void init(score::gfx::RenderList& renderer, QRhiResourceUpdateBatch& res) override + void init(score::gfx::RenderList &renderer, + QRhiResourceUpdateBatch &res, + score::gfx::Edge *edge) override { // Initialize our rendering structures auto& rhi = *renderer.state.rhi; diff --git a/src/plugins/score-plugin-gfx/Gfx/TexturePort.cpp b/src/plugins/score-plugin-gfx/Gfx/TexturePort.cpp index fb01dc98a1..39fddbfc56 100644 --- a/src/plugins/score-plugin-gfx/Gfx/TexturePort.cpp +++ b/src/plugins/score-plugin-gfx/Gfx/TexturePort.cpp @@ -117,7 +117,7 @@ class GraphPreviewWidget : public QWidget QPointer outlet_p; QPointer plug; score::gfx::ScreenNode* node{}; - std::optional e; + std::optional e; std::shared_ptr window;