2 #include <Gfx/Graph/Node.hpp>
4 #include <ossia/dataflow/nodes/media.hpp>
5 #include <ossia/dataflow/token_request.hpp>
6 #include <ossia/detail/buffer_pool.hpp>
7 #include <ossia/detail/flat_set.hpp>
8 #include <ossia/detail/hash_map.hpp>
9 #include <ossia/detail/mutex.hpp>
10 #include <ossia/detail/variant.hpp>
11 #include <ossia/gfx/port_index.hpp>
12 #include <ossia/network/value/value.hpp>
14 #include <concurrentqueue.h>
15 #include <score_plugin_gfx_export.h>
23 struct DocumentContext;
27 using port_index = ossia::gfx::port_index;
29 using Edge = std::pair<port_index, port_index>;
30 class GfxExecutionAction;
31 class SCORE_PLUGIN_GFX_EXPORT
GfxContext :
public QObject
36 using NodePtr = std::unique_ptr<score::gfx::Node>;
41 int32_t register_node(NodePtr node);
42 int32_t register_preview_node(NodePtr node);
43 void connect_preview_node(Edge e);
44 void disconnect_preview_node(Edge e);
45 void unregister_node(int32_t idx);
46 void unregister_preview_node(int32_t idx);
48 void recompute_edges();
49 void recompute_graph();
50 void recompute_connections();
57 tick_messages.enqueue(std::move(msg));
63 void remove_preview_output();
64 void add_edge(Edge e);
65 void remove_edge(Edge e);
66 void remove_node(std::vector<std::unique_ptr<score::gfx::Node>>& nursery, int32_t
id);
68 void timerEvent(QTimerEvent*)
override;
71 ossia::hash_map<int32_t, NodePtr> nodes;
87 std::unique_ptr<score::gfx::Node> node;
95 DISCONNECT_PREVIEW_NODE
100 using Command = ossia::variant<NodeCommand, EdgeCommand>;
101 moodycamel::ConcurrentQueue<Command> tick_commands;
102 moodycamel::ConcurrentQueue<score::gfx::Message> tick_messages;
104 std::mutex edges_lock;
105 ossia::flat_set<Edge> new_edges TS_GUARDED_BY(edges_lock);
106 ossia::flat_set<Edge> edges;
107 ossia::flat_set<Edge> preview_edges;
108 std::atomic_bool edges_changed{};
112 ossia::flat_map<int, score::gfx::OutputNode*> m_manualTimers;
114 ossia::object_pool<std::vector<score::gfx::gfx_input>> m_buffers;
Definition: GfxContext.hpp:32
Definition: GfxExecContext.hpp:16
Base class for sink nodes (QWindow, spout, syphon, NDI output, ...)
Definition: OutputNode.hpp:23
Binds the rendering pipeline to ossia processes.
Definition: CameraDevice.cpp:28
Graphics rendering pipeline for ossia score.
Definition: Filter/PreviewWidget.hpp:12
Base toolkit upon which the software is built.
Definition: Application.cpp:90
Definition: DocumentContext.hpp:18
Represents a graph of renderers.
Definition: score-plugin-gfx/Gfx/Graph/Graph.hpp:16
Definition: score-plugin-gfx/Gfx/Graph/Node.hpp:51