Skip to content

Commit

Permalink
ci: compatibility fixes for spout, syphon, wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Feb 6, 2025
1 parent 84a6918 commit bfdc3a3
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 21 deletions.
10 changes: 5 additions & 5 deletions src/plugins/score-plugin-gfx/Gfx/GfxContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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())
Expand Down Expand Up @@ -318,7 +318,7 @@ void GfxContext::run_commands()
auto n = dynamic_cast<score::gfx::OutputNode*>(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())
Expand Down
18 changes: 9 additions & 9 deletions src/plugins/score-plugin-gfx/Gfx/GfxContext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace Gfx
{
using port_index = ossia::gfx::port_index;

using Edge = std::pair<port_index, port_index>;
using EdgeSpec = std::pair<port_index, port_index>;
class GfxExecutionAction;
class SCORE_PLUGIN_GFX_EXPORT GfxContext : public QObject
{
Expand All @@ -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);

Expand All @@ -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<std::unique_ptr<score::gfx::Node>>& nursery, int32_t id);

void timerEvent(QTimerEvent*) override;
Expand Down Expand Up @@ -94,17 +94,17 @@ class SCORE_PLUGIN_GFX_EXPORT GfxContext : public QObject
CONNECT_PREVIEW_NODE,
DISCONNECT_PREVIEW_NODE
} cmd{};
Edge edge;
EdgeSpec edge;
};

using Command = ossia::variant<NodeCommand, EdgeCommand>;
moodycamel::ConcurrentQueue<Command> tick_commands;
moodycamel::ConcurrentQueue<score::gfx::Message> tick_messages;

std::mutex edges_lock;
ossia::flat_set<Edge> new_edges TS_GUARDED_BY(edges_lock);
ossia::flat_set<Edge> edges;
ossia::flat_set<Edge> preview_edges;
ossia::flat_set<EdgeSpec> new_edges TS_GUARDED_BY(edges_lock);
ossia::flat_set<EdgeSpec> edges;
ossia::flat_set<EdgeSpec> preview_edges;
std::atomic_bool edges_changed{};

int m_timer{-1};
Expand Down
1 change: 1 addition & 0 deletions src/plugins/score-plugin-gfx/Gfx/GfxDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <QMimeData>

#include <wobjectimpl.h>
W_OBJECT_IMPL(Gfx::GfxInputDevice)
W_OBJECT_IMPL(Gfx::GfxOutputDevice)
namespace Gfx
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/score-plugin-gfx/Gfx/GfxExecContext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class SCORE_PLUGIN_GFX_EXPORT GfxExecutionAction final
void endTick(const ossia::audio_tick_state& st) override;

GfxContext* ui{};
std::vector<Edge> prev_edges;
std::vector<Edge> edges_cache;
using edge_queue = moodycamel::ConcurrentQueue<Edge>;
std::vector<EdgeSpec> prev_edges;
std::vector<EdgeSpec> edges_cache;
using edge_queue = moodycamel::ConcurrentQueue<EdgeSpec>;
edge_queue incoming_edges;
};

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/score-plugin-gfx/Gfx/GfxExecutionAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/score-plugin-gfx/Gfx/Spout/SpoutOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 { }
Expand Down
4 changes: 3 additions & 1 deletion src/plugins/score-plugin-gfx/Gfx/Syphon/SyphonInput.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/score-plugin-gfx/Gfx/TexturePort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class GraphPreviewWidget : public QWidget
QPointer<const TextureOutlet> outlet_p;
QPointer<Gfx::DocumentPlugin> plug;
score::gfx::ScreenNode* node{};
std::optional<Gfx::Edge> e;
std::optional<Gfx::EdgeSpec> e;

std::shared_ptr<score::gfx::Window> window;

Expand Down

0 comments on commit bfdc3a3

Please sign in to comment.