score-plugin-scenario/Interpolation/Commands/ChangeAddress.hpp
1 #pragma once
2 #include <Scenario/Commands/ScenarioCommandFactory.hpp>
3 
4 #include <score/command/Dispatchers/CommandDispatcher.hpp>
5 #include <score/command/PropertyCommand.hpp>
6 
7 #include <Interpolation/InterpolationProcess.hpp>
8 
9 namespace Interpolation
10 {
11 class ProcessModel;
12 class ChangeAddress final : public score::Command
13 {
14  SCORE_COMMAND_DECL(
15  Scenario::Command::CommandFactoryName(), ChangeAddress,
16  "Change Interpolation Address")
17 public:
19  const ProcessModel& proc, const State::AddressAccessor& addr,
20  const ossia::value& start, const ossia::value& end, const State::Unit& u);
21 
22 public:
23  void undo(const score::DocumentContext& ctx) const override;
24  void redo(const score::DocumentContext& ctx) const override;
25 
26 protected:
27  void serializeImpl(DataStreamInput&) const override;
28  void deserializeImpl(DataStreamOutput&) override;
29 
30 private:
31  Path<ProcessModel> m_path;
32  State::AddressAccessor m_oldAddr, m_newAddr;
33  State::Unit m_oldUnit, m_newUnit;
34  ossia::value m_oldStart, m_newStart;
35  ossia::value m_oldEnd, m_newEnd;
36 };
37 
38 void ChangeInterpolationAddress(
39  const Interpolation::ProcessModel& proc, const ::State::AddressAccessor& addr,
40  CommandDispatcher<>& disp);
41 
42 // MOVEME && should apply to both Interpolation and Automation
43 class SetTween final : public score::PropertyCommand
44 {
45  SCORE_COMMAND_DECL(
46  Scenario::Command::CommandFactoryName(), SetTween, "Set interpolation tween")
47 public:
48  SetTween(const ProcessModel& path, bool newval)
49  : score::PropertyCommand{std::move(path), "tween", newval}
50  {
51  }
52 };
53 }
The CommandDispatcher class.
Definition: CommandDispatcher.hpp:13
Definition: score-plugin-scenario/Interpolation/Commands/ChangeAddress.hpp:13
Definition: score-plugin-scenario/Interpolation/Commands/ChangeAddress.hpp:44
The Command class.
Definition: Command.hpp:34
The PropertyCommand class.
Definition: PropertyCommand.hpp:21
Definition: DataStreamHelpers.hpp:99
Definition: DataStreamHelpers.hpp:103
Definition: Address.hpp:108
Definition: Unit.hpp:18
Definition: DocumentContext.hpp:18