SetControlValue.hpp
1 #pragma once
2 #include <State/Value.hpp>
3 #include <State/ValueSerialization.hpp>
4 
5 #include <Process/Commands/ProcessCommandFactory.hpp>
6 #include <Process/Dataflow/Port.hpp>
7 
8 #include <score/model/path/PathSerialization.hpp>
9 
10 namespace Process
11 {
12 class SCORE_LIB_PROCESS_EXPORT SetControlValue final : public score::Command
13 {
14  SCORE_COMMAND_DECL(Process::CommandFactoryName(), SetControlValue, "Set a control")
15 
16 public:
17  SetControlValue(const Process::ControlInlet& obj, ossia::value newval);
18  virtual ~SetControlValue();
19 
20  void undo(const score::DocumentContext& ctx) const final override;
21  void redo(const score::DocumentContext& ctx) const final override;
22  void update(const Process::ControlInlet& obj, ossia::value newval);
23 
24 protected:
25  void serializeImpl(DataStreamInput& stream) const final override;
26  void deserializeImpl(DataStreamOutput& stream) final override;
27 
28 private:
30  ossia::value m_old, m_new;
31 };
32 
33 class SCORE_LIB_PROCESS_EXPORT SetControlOutletValue final : public score::Command
34 {
35  SCORE_COMMAND_DECL(
36  Process::CommandFactoryName(), SetControlOutletValue, "Set a control")
37 
38 public:
39  SetControlOutletValue(const Process::ControlOutlet& obj, ossia::value newval);
40  virtual ~SetControlOutletValue();
41 
42  void undo(const score::DocumentContext& ctx) const final override;
43  void redo(const score::DocumentContext& ctx) const final override;
44  void update(const Process::ControlOutlet& obj, ossia::value newval);
45 
46 protected:
47  void serializeImpl(DataStreamInput& stream) const final override;
48  void deserializeImpl(DataStreamOutput& stream) final override;
49 
50 private:
52  ossia::value m_old, m_new;
53 };
54 }
Definition: Port.hpp:203
Definition: Port.hpp:425
Definition: SetControlValue.hpp:34
Definition: SetControlValue.hpp:13
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