2 #include <Process/Dataflow/Port.hpp>
3 #include <Process/Dataflow/PortFactory.hpp>
5 #include <Explorer/Explorer/DeviceExplorerModel.hpp>
7 #include <ControlSurface/CommandFactory.hpp>
8 #include <ControlSurface/Process.hpp>
10 #include <score/application/GUIApplicationContext.hpp>
11 #include <score/command/AggregateCommand.hpp>
12 #include <score/document/DocumentContext.hpp>
13 #include <score/model/path/PathSerialization.hpp>
14 #include <score/plugins/SerializableHelpers.hpp>
15 #include <score/plugins/SerializableInterface.hpp>
16 #include <score/tools/IdentifierGeneration.hpp>
23 SCORE_COMMAND_DECL(CommandFactoryName(),
AddControlMacro,
"Add controls")
28 SCORE_COMMAND_DECL(CommandFactoryName(),
AddControl,
"Add a control")
35 , m_addr{Explorer::makeFullAddressAccessorSettings(p.address, ctx, 0., 1., 0.5)}
37 m_addr.value = p.value;
42 auto& proc = m_model.find(ctx);
43 proc.removeControl(m_id);
48 auto& proc = m_model.find(ctx);
49 proc.addControl(m_id, m_addr);
55 s << m_model << m_id << m_addr;
58 void deserializeImpl(
DataStreamOutput& s)
override { s >> m_model >> m_id >> m_addr; }
67 SCORE_COMMAND_DECL(CommandFactoryName(),
RemoveControl,
"Remove a control")
72 , m_addr{proc.outputAddresses().at(p.id().val())}
73 , m_data{DataStreamReader::marshall(p)}
79 auto& proc = m_model.find(ctx);
84 proc.setupControl(safe_cast<Process::ControlInlet*>(ctl), m_addr);
89 auto& proc = m_model.find(ctx);
90 proc.removeControl(m_id);
96 s << m_model << m_id << m_data;
99 void deserializeImpl(
DataStreamOutput& s)
override { s >> m_model >> m_id >> m_data; }
Definition: plugins/score-plugin-controlsurface/ControlSurface/commands.hpp:27
Definition: plugins/score-plugin-controlsurface/ControlSurface/commands.hpp:22
Definition: score-plugin-controlsurface/ControlSurface/Process.hpp:86
Definition: plugins/score-plugin-controlsurface/ControlSurface/commands.hpp:66
Definition: DataStreamVisitor.hpp:202
Definition: PortFactory.hpp:74
The id_base_t class.
Definition: Identifier.hpp:57
Allows for grouping of multiple commands in a single one.
Definition: AggregateCommand.hpp:15
The Command class.
Definition: Command.hpp:34
@ ControlSurface
The process supports being exposed to the ControlSurface.
Definition: ProcessFlags.hpp:37
Definition: DataStreamHelpers.hpp:103
Definition: AddressSettings.hpp:131
Definition: Address.hpp:108
The Message struct.
Definition: Message.hpp:15
Definition: DocumentContext.hpp:18