InitAutomation.hpp
1 #pragma once
2 #include <State/Address.hpp>
3 
4 #include <Curve/Segment/CurveSegmentData.hpp>
5 
6 #include <Automation/Commands/AutomationCommandFactory.hpp>
7 
8 #include <score/command/Command.hpp>
9 #include <score/model/path/Path.hpp>
10 
11 #include <score_plugin_automation_export.h>
12 
13 #include <vector>
14 struct DataStreamInput;
15 struct DataStreamOutput;
18 namespace Automation
19 {
20 class ProcessModel;
21 
22 class SCORE_PLUGIN_AUTOMATION_EXPORT InitAutomation final : public score::Command
23 {
24  SCORE_COMMAND_DECL(CommandFactoryName(), InitAutomation, "InitAutomation")
25 public:
26  // Note : the segments shall be sorted from start to end.
28  const ProcessModel& obj, const State::AddressAccessor& newaddr, double newmin,
29  double newmax, std::vector<Curve::SegmentData>&& segments);
31  const ProcessModel& obj, State::AddressAccessor&& newaddr, double newmin,
32  double newmax, std::vector<Curve::SegmentData>&& segments);
34  const ProcessModel& obj, const State::AddressAccessor& newaddr, double newmin,
35  double newmax);
36 
37 public:
38  void undo(const score::DocumentContext& ctx) const override;
39  void redo(const score::DocumentContext& ctx) const override;
40 
41 protected:
42  void serializeImpl(DataStreamInput&) const override;
43  void deserializeImpl(DataStreamOutput&) override;
44 
45 private:
46  Path<ProcessModel> m_path;
48  double m_newMin{};
49  double m_newMax{};
50  std::vector<Curve::SegmentData> m_segments;
51 };
52 }
Definition: InitAutomation.hpp:23
Definition: AutomationModel.hpp:36
The Command class.
Definition: Command.hpp:34
Namespace related to the Automation process.
Definition: AutomationColors.cpp:8
Definition: DataStreamHelpers.hpp:99
Definition: DataStreamHelpers.hpp:103
Definition: Address.hpp:108
Definition: DocumentContext.hpp:18