Loading...
Searching...
No Matches
EditPort.hpp
1#pragma once
2#include <State/Address.hpp>
3
4#include <Device/Address/AddressSettings.hpp>
5
6#include <Process/Commands/ProcessCommandFactory.hpp>
7#include <Process/Dataflow/Port.hpp>
8#include <Process/Process.hpp>
9
10#include <score/command/Command.hpp>
11#include <score/command/PropertyCommand.hpp>
12#include <score/model/path/Path.hpp>
13
14namespace Process
15{
16
17class SCORE_LIB_PROCESS_EXPORT ChangePortSettings final : public score::Command
18{
19 SCORE_COMMAND_DECL(
20 Process::CommandFactoryName(), ChangePortSettings, "Edit a node port")
21public:
23
24 void undo(const score::DocumentContext& ctx) const override;
25 void redo(const score::DocumentContext& ctx) const override;
26
27protected:
28 void serializeImpl(DataStreamInput& s) const override;
29 void deserializeImpl(DataStreamOutput& s) override;
30
31private:
32 Path<Process::Port> m_model;
33
35};
36
37}
38
39PROPERTY_COMMAND_T(
40 Process, SetPropagate, AudioOutlet::p_propagate, "Set port propagation")
41SCORE_COMMAND_DECL_T(Process::SetPropagate)
42
43namespace Process
44{
46class SCORE_LIB_PROCESS_EXPORT ChangePortAddress final
47 : public score::PropertyCommand_T<Port::p_address>
48{
49 SCORE_COMMAND_DECL(Process::CommandFactoryName(), ChangePortAddress, "Set port address")
50public:
51 using PropertyCommand_T::PropertyCommand_T;
52 ChangePortAddress(const Port& port, State::AddressAccessor address);
53};
54}
55namespace score
56{
57template <>
58template <>
59struct PropertyCommand_T<Process::Port::p_address>::command<void>
60{
61 using type = Process::ChangePortAddress;
62};
63}
64
65PROPERTY_COMMAND_T(Process, SetValue, ControlInlet::p_value, "Set port value")
66SCORE_COMMAND_DECL_T(Process::SetValue)
67
68PROPERTY_COMMAND_T(
69 Process, SetPortScriptable, Port::p_scriptable, "Set port scriptable")
70SCORE_COMMAND_DECL_T(Process::SetPortScriptable)
71
72PROPERTY_COMMAND_T(
73 Process, SetPortScriptingName, Port::p_exposed, "Set port scripting name")
74SCORE_COMMAND_DECL_T(Process::SetPortScriptingName)
75
76PROPERTY_COMMAND_T(Process, SetGain, AudioOutlet::p_gain, "Set port gain")
77SCORE_COMMAND_DECL_T(Process::SetGain)
78
79PROPERTY_COMMAND_T(Process, SetPan, AudioOutlet::p_pan, "Set port pan")
80SCORE_COMMAND_DECL_T(Process::SetPan)
The Path class is a typesafe wrapper around ObjectPath.
Definition Path.hpp:52
Definition EditPort.hpp:18
Definition Port.hpp:106
The Command class.
Definition Command.hpp:34
Definition PropertyCommand.hpp:58
Base classes and tools to implement processes and layers.
Definition JSONVisitor.hpp:1115
Utilities for OSSIA data structures.
Definition DeviceInterface.hpp:35
Base toolkit upon which the software is built.
Definition Application.cpp:83
Definition DataStreamHelpers.hpp:99
Definition DataStreamHelpers.hpp:103
Definition AddressSettings.hpp:131
Definition DocumentContext.hpp:18