SetAutoTrigger.hpp
1 #pragma once
2 #include <State/Expression.hpp>
3 
4 #include <Scenario/Commands/ScenarioCommandFactory.hpp>
5 #include <Scenario/Document/TimeSync/TimeSyncModel.hpp>
6 
7 #include <score/command/Command.hpp>
8 #include <score/command/PropertyCommand.hpp>
9 #include <score/model/path/Path.hpp>
10 
11 namespace Scenario
12 {
13 class TimeSyncModel;
14 namespace Command
15 {
16 using TimeSyncModel = ::Scenario::TimeSyncModel;
17 class SCORE_PLUGIN_SCENARIO_EXPORT SetAutoTrigger final : public score::Command
18 {
19  SCORE_COMMAND_DECL(CommandFactoryName(), SetAutoTrigger, "Change a trigger")
20 public:
21  SetAutoTrigger(const TimeSyncModel& tn, bool t);
22 
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<TimeSyncModel> m_path;
32  bool m_old{}, m_new{};
33 };
34 
35 }
36 }
37 
38 PROPERTY_COMMAND_T(
39  Scenario::Command, SetTimeSyncMusicalSync, TimeSyncModel::p_musicalSync, "Set sync")
40 SCORE_COMMAND_DECL_T(Scenario::Command::SetTimeSyncMusicalSync)
41 
42 PROPERTY_COMMAND_T(
43  Scenario::Command, SetTimeSyncIsStartPoint, TimeSyncModel::p_startPoint,
44  "Set start point")
45 SCORE_COMMAND_DECL_T(Scenario::Command::SetTimeSyncIsStartPoint)
The Path class is a typesafe wrapper around ObjectPath.
Definition: Path.hpp:52
Definition: SetAutoTrigger.hpp:18
Definition: TimeSyncModel.hpp:35
The Command class.
Definition: Command.hpp:34
Main plug-in of score.
Definition: score-plugin-dataflow/Dataflow/PortItem.hpp:14
Definition: DataStreamHelpers.hpp:99
Definition: DataStreamHelpers.hpp:103
Definition: DocumentContext.hpp:18