Loading...
Searching...
No Matches
LoadPresetCommandFactory.hpp
1#pragma once
2#include <Process/Preset.hpp>
3
4#include <score/command/Command.hpp>
5#include <score/document/DocumentContext.hpp>
6#include <score/plugins/Interface.hpp>
7#include <score/plugins/InterfaceList.hpp>
8#include <score/tools/Unused.hpp>
9
10#include <ossia/network/value/value.hpp>
11
12#include <score_lib_process_export.h>
13
14namespace Process
15{
16class ProcessModel;
17class ControlInlet;
18class SCORE_LIB_PROCESS_EXPORT LoadPresetCommandFactory : public score::InterfaceBase
19{
20 SCORE_INTERFACE(LoadPresetCommandFactory, "4a1a228c-16af-4647-917e-09cdf63fe167")
21public:
23 virtual bool matches(
24 const Process::ProcessModel& obj, unused_t newval,
25 const score::DocumentContext& ctx) const noexcept
26 = 0;
27 virtual score::Command* make(
28 const Process::ProcessModel& obj, Process::Preset newval,
29 const score::DocumentContext& ctx) const
30 = 0;
31};
32
33class SCORE_LIB_PROCESS_EXPORT LoadPresetCommandFactoryList final
34 : public score::MatchingFactory<LoadPresetCommandFactory>
35{
36public:
38};
39
42class SCORE_LIB_PROCESS_EXPORT ChangePortsCommand : public score::Command
43{
44public:
45 using score::Command::Command;
46 ~ChangePortsCommand() override;
47 virtual void setNewValue(ossia::value v) = 0;
48};
49
50class SCORE_LIB_PROCESS_EXPORT ChangePortsCommandFactory : public score::InterfaceBase
51{
52 SCORE_INTERFACE(ChangePortsCommandFactory, "0f5dcb0e-7e8a-4a4e-9a86-3a0b8d3c52e1")
53public:
55 virtual bool matches(
56 const Process::ControlInlet& obj, unused_t newval,
57 const score::DocumentContext& ctx) const noexcept
58 = 0;
59 virtual ChangePortsCommand* make(
60 const Process::ControlInlet& obj, ossia::value newval,
61 const score::DocumentContext& ctx) const
62 = 0;
63};
64
65class SCORE_LIB_PROCESS_EXPORT ChangePortsCommandFactoryList final
66 : public score::MatchingFactory<ChangePortsCommandFactory>
67{
68public:
70};
71
73SCORE_LIB_PROCESS_EXPORT ChangePortsCommand* makeChangePortsCommand(
74 const Process::ControlInlet& obj, ossia::value newval,
75 const score::DocumentContext& ctx);
76
78SCORE_LIB_PROCESS_EXPORT score::Command* makeSetControlCommand(
79 const Process::ControlInlet& obj, ossia::value newval,
80 const score::DocumentContext& ctx);
81}
Definition LoadPresetCommandFactory.hpp:51
Definition LoadPresetCommandFactory.hpp:67
Definition LoadPresetCommandFactory.hpp:43
Definition Port.hpp:247
Definition LoadPresetCommandFactory.hpp:19
Definition LoadPresetCommandFactory.hpp:35
The Process class.
Definition score-lib-process/Process/Process.hpp:82
The Command class.
Definition Command.hpp:34
Base class for plug-in interfaces.
Definition Interface.hpp:52
Utility class for making a factory interface list.
Definition InterfaceList.hpp:173
Base classes and tools to implement processes and layers.
Definition JSONVisitor.hpp:1115
score::Command * makeSetControlCommand(const Process::ControlInlet &obj, ossia::value newval, const score::DocumentContext &ctx)
A ChangePortsCommand when the control changes the ports of its process.
Definition LoadPresetCommandFactory.cpp:26
ChangePortsCommand * makeChangePortsCommand(const Process::ControlInlet &obj, ossia::value newval, const score::DocumentContext &ctx)
Null unless the control changes the ports of its process and a factory matches.
Definition LoadPresetCommandFactory.cpp:16
Definition Preset.hpp:32
Definition ObjectMatches.hpp:6
Definition DocumentContext.hpp:18
Definition Unused.hpp:3