score-lib-process/Process/Commands/Properties.hpp
1 #pragma once
2 #include <Process/Commands/ProcessCommandFactory.hpp>
3 #include <Process/Process.hpp>
4 #include <Process/TimeValueSerialization.hpp>
5 
6 #include <score/command/PropertyCommand.hpp>
7 #include <score/model/path/PathSerialization.hpp>
8 #include <score/tools/Unused.hpp>
9 
10 PROPERTY_COMMAND_T(Process, SetLoop, ProcessModel::p_loops, "Set process looping")
11 SCORE_COMMAND_DECL_T(Process::SetLoop)
12 PROPERTY_COMMAND_T(
13  Process, SetStartOffset, ProcessModel::p_startOffset, "Set start offset")
14 SCORE_COMMAND_DECL_T(Process::SetStartOffset)
15 PROPERTY_COMMAND_T(
16  Process, SetLoopDuration, ProcessModel::p_loopDuration, "Set loop duration")
17 SCORE_COMMAND_DECL_T(Process::SetLoopDuration)
18 
19 PROPERTY_COMMAND_T(Process, MoveNode, ProcessModel::p_position, "Move node")
20 SCORE_COMMAND_DECL_T(Process::MoveNode)
21 PROPERTY_COMMAND_T(Process, ResizeNode, ProcessModel::p_size, "Resize node")
22 SCORE_COMMAND_DECL_T(Process::ResizeNode)
23 
24 namespace Process
25 {
26 class MoveNodes final : public score::Command
27 {
28  SCORE_COMMAND_DECL(Process::CommandFactoryName(), MoveNodes, "Move nodes")
29 public:
30  MoveNodes(std::vector<const ProcessModel*> processes, QPointF delta);
31 
32  void undo(const score::DocumentContext& ctx) const override;
33  void redo(const score::DocumentContext& ctx) const override;
34 
35  void update(unused_t, QPointF delta);
36 
37 protected:
38  void serializeImpl(DataStreamInput& s) const override;
39  void deserializeImpl(DataStreamOutput& s) override;
40 
41 private:
42  std::vector<std::pair<Path<ProcessModel>, QPointF>> m_models;
43  QPointF m_delta;
44 };
45 
46 }
Definition: score-lib-process/Process/Commands/Properties.hpp:27
The Command class.
Definition: Command.hpp:34
Base classes and tools to implement processes and layers.
Definition: JSONVisitor.hpp:1324
Definition: DataStreamHelpers.hpp:99
Definition: DataStreamHelpers.hpp:103
Definition: DocumentContext.hpp:18
Definition: Unused.hpp:3