2 #include <Process/Dataflow/PortFactory.hpp>
3 #include <Process/LayerPresenter.hpp>
4 #include <Process/LayerView.hpp>
6 #include <score/graphics/GraphicsLayout.hpp>
7 #include <score/graphics/TextItem.hpp>
8 #include <score/model/Skin.hpp>
25 QGraphicsItem* layout{};
26 std::vector<score::GraphicsLayout*> createdLayouts{};
31 std::pair<Process::ControlInlet*, Process::ControlLayout> makeInlet(
Process::Inlet*);
32 std::pair<Process::ControlOutlet*, Process::ControlLayout>
34 std::vector<std::pair<Process::ControlInlet*, Process::ControlLayout>>
35 makeInlets(std::span<Process::Inlet*>);
36 std::vector<std::pair<Process::ControlOutlet*, Process::ControlLayout>>
37 makeOutlets(std::span<Process::Outlet*>);
38 QGraphicsItem* makeLabel(std::string_view item);
40 void finalizeLayout(QGraphicsItem* rootItem);
45 auto& skin = score::Skin::instance();
47 if constexpr(requires { T::darker; })
49 return skin.Background2.darker300;
52 if constexpr(requires { T::dark; })
54 return skin.Background2.darker;
57 if constexpr(requires { T::mid; })
59 return skin.Background2.main;
62 if constexpr(requires { T::light; })
64 return skin.Background2.lighter;
67 if constexpr(requires { T::lighter; })
69 return skin.Background2.lighter180;
71 return skin.Background2.main;
74 template <
typename Item>
77 if constexpr(requires { Item::background(); })
79 if constexpr(requires { std::string_view{Item::background()}; })
80 item.setBackground(Item::background());
82 item.setBrush(get_brush(Item::background()));
86 requires { Item::width(); } && requires { Item::height(); })
88 item.setRect({0., 0., (qreal)Item::width(), (qreal)Item::height()});
91 requires { Item::width; } && requires { Item::height; })
93 item.setRect({0., 0., (qreal)it.width, (qreal)it.height});
97 template <
typename Item>
98 void setupItem(
const Item& it, QGraphicsItem& item)
100 item.setParentItem(layout);
102 requires { Item::x(); } && requires { Item::y(); })
104 item.setPos(Item::x(), Item::y());
107 requires { Item::x; } && requires { Item::y; })
109 item.setPos(it.x, it.y);
112 if constexpr(requires { Item::scale(); })
114 item.setScale(Item::scale());
116 else if constexpr(requires { Item::scale; })
118 item.setScale(it.scale);
Definition: PortFactory.hpp:74
The Process class.
Definition: score-lib-process/Process/Process.hpp:61
Definition: GraphicsLayout.hpp:8
Base classes and tools to implement processes and layers.
Definition: JSONVisitor.hpp:1324
Definition: ProcessContext.hpp:12
Definition: PortFactory.hpp:21
Definition: PortForward.hpp:23
Definition: plugins/score-lib-process/Control/Layout.hpp:16
Definition: PortForward.hpp:27