AudioOutletItem.hpp
1 #pragma once
2 #include <Process/Dataflow/MinMaxFloatPort.hpp>
3 
4 #include <Dataflow/PortItem.hpp>
5 
6 #include <score/graphics/ArrowDialog.hpp>
7 
8 #include <QPointer>
9 
10 #include <score_plugin_dataflow_export.h>
11 namespace Dataflow
12 {
13 class SCORE_PLUGIN_DATAFLOW_EXPORT AudioOutletItem : public AutomatablePortItem
14 {
15 public:
16  AudioOutletItem(Process::Port& p, const Process::Context& ctx, QGraphicsItem* parent);
17  ~AudioOutletItem() override;
18 
19  void mousePressEvent(QGraphicsSceneMouseEvent* event) override;
20  void mouseMoveEvent(QGraphicsSceneMouseEvent* event) override;
21  void mouseReleaseEvent(QGraphicsSceneMouseEvent* event) override;
22  QVariant itemChange(GraphicsItemChange change, const QVariant& value) override;
23 
24  QPointer<score::ArrowDialog> m_subView{};
25 };
26 
27 struct SCORE_PLUGIN_DATAFLOW_EXPORT AudioOutletFactory final
28  : public AutomatablePortFactory
29 {
31  UuidKey<Process::Port> concreteKey() const noexcept override
32  {
34  }
35 
36  Model_T* load(const VisitorVariant& vis, QObject* parent) override
37  {
38  return score::deserialize_dyn(vis, [&](auto&& deserializer) {
39  return new Model_T{deserializer, parent};
40  });
41  }
42 
43  void setupOutletInspector(
44  const Process::Outlet& port, const score::DocumentContext& ctx, QWidget* parent,
45  Inspector::Layout& lay, QObject* context) override;
46 
47  PortItem* makePortItem(
48  Process::Outlet& port, const Process::Context& ctx, QGraphicsItem* parent,
49  QObject* context) override
50  {
51  return new Dataflow::AudioOutletItem{port, ctx, parent};
52  }
53 };
54 
55 class SCORE_PLUGIN_DATAFLOW_EXPORT MinMaxFloatOutletItem : public AutomatablePortItem
56 {
57 public:
59  Process::Port& p, const Process::Context& ctx, QGraphicsItem* parent);
60  ~MinMaxFloatOutletItem() override;
61 
62  void mousePressEvent(QGraphicsSceneMouseEvent* event) override;
63  void mouseMoveEvent(QGraphicsSceneMouseEvent* event) override;
64  void mouseReleaseEvent(QGraphicsSceneMouseEvent* event) override;
65  QVariant itemChange(GraphicsItemChange change, const QVariant& value) override;
66 
67  QPointer<score::ArrowDialog> m_subView{};
68 };
69 
70 struct SCORE_PLUGIN_DATAFLOW_EXPORT MinMaxFloatOutletFactory final
71  : public AutomatablePortFactory
72 {
73  using Model_T = Process::MinMaxFloatOutlet;
74  UuidKey<Process::Port> concreteKey() const noexcept override
75  {
77  }
78 
79  Model_T* load(const VisitorVariant& vis, QObject* parent) override
80  {
81  return score::deserialize_dyn(vis, [&](auto&& deserializer) {
82  return new Model_T{deserializer, parent};
83  });
84  }
85 
86  void setupOutletInspector(
87  const Process::Outlet& port, const score::DocumentContext& ctx, QWidget* parent,
88  Inspector::Layout& lay, QObject* context) override;
89 
90  PortItem* makePortItem(
91  Process::Outlet& port, const Process::Context& ctx, QGraphicsItem* parent,
92  QObject* context) override
93  {
94  return new Dataflow::MinMaxFloatOutletItem{port, ctx, parent};
95  }
96 };
97 
98 }
Definition: AudioOutletItem.hpp:14
Definition: score-plugin-dataflow/Dataflow/PortItem.hpp:38
Definition: score-plugin-dataflow/Dataflow/PortItem.hpp:22
Definition: AudioOutletItem.hpp:56
Definition: score-lib-process/Process/Dataflow/PortItem.hpp:39
Definition: lib/score/widgets/Layout.hpp:29
Definition: Port.hpp:323
Definition: Port.hpp:273
Definition: Port.hpp:102
Definition: UuidKey.hpp:343
Definition: AudioOutletItem.hpp:29
Definition: AudioOutletItem.hpp:72
Static metadata implementation.
Definition: lib/score/tools/Metadata.hpp:36
Definition: ProcessContext.hpp:12
The VisitorVariant struct.
Definition: VisitorInterface.hpp:26
Definition: DocumentContext.hpp:18