Loading...
Searching...
No Matches
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
24struct DataStreamInput;
25struct DataStreamOutput;
26
27namespace Process
28{
29class ProcessModel;
30}
31template <typename Object>
32class Path;
33
34namespace Scenario
35{
36class IntervalModel;
37namespace Command
38{
39
40// MOVEME
41class SCORE_PLUGIN_SCENARIO_EXPORT CreateProcessAndLayers : public score::Command
42{
43public:
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
56protected:
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
64class SCORE_PLUGIN_SCENARIO_EXPORT CreateAutomationFromStates final
66{
67 SCORE_COMMAND_DECL(
68 CommandFactoryName(), CreateAutomationFromStates, "CreateAutomationFromStates")
69public:
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
77protected:
78 void serializeImpl(DataStreamInput& s) const override;
79 void deserializeImpl(DataStreamOutput&) override;
80
81private:
82 State::AddressAccessor m_address;
83
84 Curve::CurveDomain m_dom{};
85 bool m_tween{};
86};
87
88class SCORE_PLUGIN_SCENARIO_EXPORT CreateGradient final : public CreateProcessAndLayers
89{
90 SCORE_COMMAND_DECL(CommandFactoryName(), CreateGradient, "CreateGradientFromStates")
91public:
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
99protected:
100 void serializeImpl(DataStreamInput& s) const override;
101 void deserializeImpl(DataStreamOutput&) override;
102
103private:
104 State::AddressAccessor m_address;
105 QColor m_start{}, m_end{};
106 bool m_tween{};
107};
108/*
109class SCORE_PLUGIN_SCENARIO_EXPORT CreateInterpolationFromStates final
110 : public CreateProcessAndLayers
111{
112 SCORE_ COMMAND_DECL(
113 CommandFactoryName(),
114 CreateInterpolationFromStates,
115 "CreateInterpolationFromStates")
116public:
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
128protected:
129 void serializeImpl(DataStreamInput& s) const override;
130 void deserializeImpl(DataStreamOutput&) override;
131
132private:
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
Definition UuidKey.hpp:343
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:13
Definition CurveModel.hpp:104
Definition DataStreamHelpers.hpp:99
Definition DataStreamHelpers.hpp:103
Definition Address.hpp:108
Definition DocumentContext.hpp:18