CreateCurveFromStates.hpp
1 #pragma once
2 #include <State/Address.hpp>
3 
4 #include <Process/ProcessList.hpp>
5 
6 #include <Curve/CurveModel.hpp>
7 
8 #include <Scenario/Commands/Interval/AddOnlyProcessToInterval.hpp>
9 #include <Scenario/Commands/Interval/Rack/Slot/AddLayerModelToSlot.hpp>
10 #include <Scenario/Commands/ScenarioCommandFactory.hpp>
11 #include <Scenario/Document/Interval/IntervalModel.hpp>
12 
13 #include <Automation/AutomationProcessMetadata.hpp>
14 
15 #include <score/application/ApplicationContext.hpp>
16 #include <score/command/Command.hpp>
17 #include <score/model/Identifier.hpp>
18 
19 //#include <Interpolation/InterpolationProcess.hpp>
20 
21 #include <utility>
22 #include <vector>
23 
24 struct DataStreamInput;
25 struct DataStreamOutput;
26 
27 namespace Process
28 {
29 class ProcessModel;
30 }
31 template <typename Object>
32 class Path;
33 
34 namespace Scenario
35 {
36 class IntervalModel;
37 namespace Command
38 {
39 
40 // MOVEME
41 class SCORE_PLUGIN_SCENARIO_EXPORT CreateProcessAndLayers : public score::Command
42 {
43 public:
44  CreateProcessAndLayers() = default;
45 
47  const IntervalModel& interval, const std::vector<SlotPath>& slotList,
49 
50  void undo(const score::DocumentContext& ctx) const final override;
51  const Id<Process::ProcessModel>& processId() const
52  {
53  return m_addProcessCmd.processId();
54  }
55 
56 protected:
57  void serializeImpl(DataStreamInput& s) const override;
58  void deserializeImpl(DataStreamOutput& s) override;
59 
60  AddOnlyProcessToInterval m_addProcessCmd;
61  std::vector<Scenario::Command::AddLayerModelToSlot> m_slotsCmd;
62 };
63 
64 class SCORE_PLUGIN_SCENARIO_EXPORT CreateAutomationFromStates final
65  : public CreateProcessAndLayers
66 {
67  SCORE_COMMAND_DECL(
68  CommandFactoryName(), CreateAutomationFromStates, "CreateAutomationFromStates")
69 public:
71  const IntervalModel& interval, const std::vector<SlotPath>& slotList,
73  const Curve::CurveDomain&, bool tween = false);
74 
75  void redo(const score::DocumentContext& ctx) const override;
76 
77 protected:
78  void serializeImpl(DataStreamInput& s) const override;
79  void deserializeImpl(DataStreamOutput&) override;
80 
81 private:
82  State::AddressAccessor m_address;
83 
84  Curve::CurveDomain m_dom{};
85  bool m_tween{};
86 };
87 
88 class SCORE_PLUGIN_SCENARIO_EXPORT CreateGradient final : public CreateProcessAndLayers
89 {
90  SCORE_COMMAND_DECL(CommandFactoryName(), CreateGradient, "CreateGradientFromStates")
91 public:
93  const IntervalModel& interval, const std::vector<SlotPath>& slotList,
94  Id<Process::ProcessModel> curveId, State::AddressAccessor address, QColor start,
95  QColor end, bool tween = false);
96 
97  void redo(const score::DocumentContext& ctx) const override;
98 
99 protected:
100  void serializeImpl(DataStreamInput& s) const override;
101  void deserializeImpl(DataStreamOutput&) override;
102 
103 private:
104  State::AddressAccessor m_address;
105  QColor m_start{}, m_end{};
106  bool m_tween{};
107 };
108 /*
109 class SCORE_PLUGIN_SCENARIO_EXPORT CreateInterpolationFromStates final
110  : public CreateProcessAndLayers
111 {
112  SCORE_ COMMAND_DECL(
113  CommandFactoryName(),
114  CreateInterpolationFromStates,
115  "CreateInterpolationFromStates")
116 public:
117  CreateInterpolationFromStates(
118  const IntervalModel& interval,
119  const std::vector<SlotPath>& slotList,
120  Id<Process::ProcessModel> curveId,
121  State::AddressAccessor address,
122  ossia::value start,
123  ossia::value end,
124  bool tween = false);
125 
126  void redo(const score::DocumentContext& ctx) const override;
127 
128 protected:
129  void serializeImpl(DataStreamInput& s) const override;
130  void deserializeImpl(DataStreamOutput&) override;
131 
132 private:
133  State::AddressAccessor m_address;
134  ossia::value m_start{}, m_end{};
135  bool m_tween{};
136 };
137 */
138 }
139 }
The Path class is a typesafe wrapper around ObjectPath.
Definition: Path.hpp:52
Create a new process in a interval.
Definition: AddOnlyProcessToInterval.hpp:30
Definition: CreateCurveFromStates.hpp:66
Definition: CreateCurveFromStates.hpp:89
Definition: CreateCurveFromStates.hpp:42
Definition: IntervalModel.hpp:50
The id_base_t class.
Definition: Identifier.hpp:57
The Command class.
Definition: Command.hpp:34
Base classes and tools to implement processes and layers.
Definition: JSONVisitor.hpp:1324
Main plug-in of score.
Definition: score-plugin-dataflow/Dataflow/PortItem.hpp:14
Definition: CurveModel.hpp:104
Definition: DataStreamHelpers.hpp:99
Definition: DataStreamHelpers.hpp:103
Definition: Address.hpp:108
Definition: DocumentContext.hpp:18