Base classes and tools to implement processes and layers. More...
Detailed Description
Base classes and tools to implement processes and layers.
MOVEME process.
This library provides the base building blocks for the processes in score. Examples of processes are Automation::ProcessModel, Scenario::ProcessModel, Mapping::ProcessModel, etc.
The corresponding class in the OSSIA API is ossia::time_process. It is only used for execution.
The main class is Process::ProcessModel : it contains all the data necessary to create, save, reload a process, as well as signals and slots to notify of changes.
All processes in score are contained in a Scenario::IntervalModel.
When modifying a process (or any other model class) from the UI, it is MANDATORY to use a Command for elements that are part of the data model, except for very specific cases : for instance, the execution percentage, since it is not part of the save.
See for instance the addon tutorial (https://github.com/ossia/score-addon-tutorial).
The UI works as follows :
- Process::ProcessModel is the base class for processes.
- Process::LayerPresenter / Process::LayerView do the actual displaying, currently with Qt's Graphics View framework.
- A process can have an inspector widget.
Two different implementations of layers are provided :
- One that only displays the name of the process, useful when starting an implementation.
- One that uses a QWidget for showing information (Process::WidgetLayer).
This plug-in also contains :
- Styling information for the central view of score, with the Process::ScenarioStyle class.
- Utility classes to display a process in the process panel (provided with Scenario::PanelDelegate).
- The implementation of a tree of messages, with Process::MessageNode, to be used in Scenario::StateModel.
score provides extensions for processes through score::Components. Available extensions are :
- Execution of the process, given through Execution::ProcessComponent.
- Local tree, given through LocalTree::ProcessComponent.
Typedefs | |
using | MagnetismHandler = std::function< MagneticInfo(const QObject *, TimeVal)> |
template<typename Model_T > | |
using | GenericDefaultLayerFactory = LayerFactory_T< Model_T, default_t, default_t, default_t > |
using | ContextMenuFun = std::function< void(QMenu &, QPoint, QPointF, const Process::LayerContext &)> |
template<typename Component_T > | |
using | ProcessComponent = ProcessComponentBase< Process::ProcessModel, Component_T > |
template<typename System_T > | |
using | GenericProcessComponent = Process::ProcessComponent< score::GenericComponent< System_T > > |
using | MessageNode = TreeNode< StateNodeData > |
Enumerations | |
enum class | CableType { ImmediateGlutton , ImmediateStrict , DelayedGlutton , DelayedStrict } |
enum class | PortType { Message , Audio , Midi , Texture , Geometry } |
enum | ProcessFlags : int64_t { SupportsTemporal = (1 << 0 ) , TimeIndependent = (1 << 1 ) , SupportsState = (1 << 2 ) , RequiresCustomData = (1 << 3 ) , PutInNewSlot = (1 << 4 ) , HandlesLooping = (1 << 5 ) , ControlSurface = (1 << 6 ) , FullyCustomItem = (1 << 7 ) , CanCreateControls = (1 << 8 ) , CreateControls = (1 << 9 ) , Snapshottable = (1 << 10 ) , Recordable = (1 << 11 ) , SupportsLasting = SupportsTemporal | TimeIndependent , ExternalEffect = SupportsTemporal | TimeIndependent | RequiresCustomData | ControlSurface , SupportsAll = SupportsTemporal | TimeIndependent | SupportsState } |
Various settings for processes. More... | |
enum | ProcessCategory : uint64_t { Other , Automation , Generator , MediaSource , Analyzer , AudioEffect , MidiEffect , Synth , Mapping , Script , Structure , Visual , Deprecated = (1ULL << 63) } |
enum class | PriorityPolicy { User , Previous , Following } |
Functions | |
void | setupExternalUI (const Process::ProcessModel &proc, const Process::LayerFactory &fact, const score::DocumentContext &ctx, bool show) |
void | setupExternalUI (const Process::ProcessModel &proc, const score::DocumentContext &ctx, bool show) |
QGraphicsItem * | makeExternalUIButton (const ProcessModel &effect, const score::DocumentContext &context, QObject *self, QGraphicsItem *root) |
score::QGraphicsDraggablePixmap * | makePresetButton (const ProcessModel &proc, const score::DocumentContext &context, QObject *self, QGraphicsItem *root) |
void | copyProcess (JSONReader &r, const Process::ProcessModel &proc) |
template<typename F > | |
QPointF | currentWidgetPos (int controlIndex, F getControlSize) noexcept(noexcept(getControlSize(0))) |
template<typename... Args> | |
auto | controlSetup (Args &&... args) |
template<typename T > | |
auto | createControl (int i, const auto &setup, T &port, const Process::PortFactoryList &portFactory, const Process::Context &doc, QGraphicsItem *parentItem, QObject *parent) |
const CommandGroupKey & | CommandFactoryName () |
QWidget * | makeAddressCombo (State::Address root, const Device::Node &out_node, const Process::Port &port, const score::DocumentContext &ctx, QWidget *parent) |
QWidget * | makeDeviceCombo (QStringList devices, const Process::Port &port, const score::DocumentContext &ctx, QWidget *parent) |
bool | verifyAndUpdateIfChildOf (ObjectPath &path, const ObjectPath &parent) |
template<typename T > | |
bool | verifyAndUpdateIfChildOf (Process::CableData &path, const std::vector< Path< T >> &vec) |
template<typename T > | |
Dataflow::SerializedCables | cablesToCopy (const std::vector< T * > &array, const std::vector< Path< std::remove_const_t< T >>> &siblings, const score::DocumentContext &ctx) |
template<typename T > | |
Dataflow::SerializedCables | cablesToCopy (const std::vector< T * > &array, const score::DocumentContext &ctx) |
std::unique_ptr< Inlet > | make_value_inlet (const Id< Process::Port > &c, QObject *parent) |
std::unique_ptr< Outlet > | make_value_outlet (const Id< Process::Port > &c, QObject *parent) |
std::unique_ptr< MidiInlet > | make_midi_inlet (const Id< Process::Port > &c, QObject *parent) |
std::unique_ptr< MidiOutlet > | make_midi_outlet (const Id< Process::Port > &c, QObject *parent) |
std::unique_ptr< AudioInlet > | make_audio_inlet (const Id< Process::Port > &c, QObject *parent) |
std::unique_ptr< AudioOutlet > | make_audio_outlet (const Id< Process::Port > &c, QObject *parent) |
std::unique_ptr< Inlet > | load_inlet (DataStreamWriter &wr, QObject *parent) |
std::unique_ptr< Inlet > | load_inlet (JSONWriter &wr, QObject *parent) |
std::unique_ptr< Outlet > | load_outlet (DataStreamWriter &wr, QObject *parent) |
std::unique_ptr< Outlet > | load_outlet (JSONWriter &wr, QObject *parent) |
template<typename T , typename W > | |
auto | load_port_t (W &wr, QObject *parent) |
std::unique_ptr< ValueInlet > | load_value_inlet (DataStreamWriter &wr, QObject *parent) |
std::unique_ptr< ValueInlet > | load_value_inlet (JSONWriter &wr, QObject *parent) |
std::unique_ptr< ValueOutlet > | load_value_outlet (DataStreamWriter &wr, QObject *parent) |
std::unique_ptr< ValueOutlet > | load_value_outlet (JSONWriter &wr, QObject *parent) |
std::unique_ptr< ControlInlet > | load_control_inlet (DataStreamWriter &wr, QObject *parent) |
std::unique_ptr< ControlInlet > | load_control_inlet (JSONWriter &wr, QObject *parent) |
std::unique_ptr< ControlOutlet > | load_control_outlet (DataStreamWriter &wr, QObject *parent) |
std::unique_ptr< ControlOutlet > | load_control_outlet (JSONWriter &wr, QObject *parent) |
std::unique_ptr< AudioInlet > | load_audio_inlet (DataStreamWriter &wr, QObject *parent) |
std::unique_ptr< AudioInlet > | load_audio_inlet (JSONWriter &wr, QObject *parent) |
std::unique_ptr< AudioOutlet > | load_audio_outlet (DataStreamWriter &wr, QObject *parent) |
std::unique_ptr< AudioOutlet > | load_audio_outlet (JSONWriter &wr, QObject *parent) |
std::unique_ptr< MidiInlet > | load_midi_inlet (DataStreamWriter &wr, QObject *parent) |
std::unique_ptr< MidiInlet > | load_midi_inlet (JSONWriter &wr, QObject *parent) |
std::unique_ptr< MidiOutlet > | load_midi_outlet (DataStreamWriter &wr, QObject *parent) |
std::unique_ptr< MidiOutlet > | load_midi_outlet (JSONWriter &wr, QObject *parent) |
QString | displayNameForPort (const Process::Port &outlet, const score::DocumentContext &doc) |
From a port, gives a name suitable for displaying in a process header. More... | |
void | readPorts (DataStreamReader &wr, const Process::Inlets &ins, const Process::Outlets &outs) |
void | writePorts (DataStreamWriter &wr, const Process::PortFactoryList &pl, Process::Inlets &ins, Process::Outlets &outs, QObject *parent) |
void | readPorts (JSONReader &obj, const Process::Inlets &ins, const Process::Outlets &outs) |
void | writePorts (const JSONWriter &obj, const Process::PortFactoryList &pl, Process::Inlets &ins, Process::Outlets &outs, QObject *parent) |
const score::Brush & | portBrush (Process::PortType type) |
const score::Brush & | labelBrush () |
const score::BrushSet & | labelBrush (const Process::Port &p) |
QPixmap | makeGlyphs (const QString &glyph, const QPen &pen) |
template<typename T = Process::ControlInlet> | |
void | saveFixedControls (JSONReader &r, const Process::ProcessModel &proc) |
template<typename T = Process::ControlInlet> | |
void | loadFixedControls (const rapidjson::Document::ConstArray &ctrls, Process::ProcessModel &proc) |
template<typename T > | |
Process::Preset | saveScriptProcessPreset (const T &process, const QString &data) |
template<typename ScriptProperty , typename T > | |
void | loadScriptProcessPreset (T &process, const Process::Preset &preset) |
const QIcon & | getCategoryIcon (const QString &category) noexcept |
ProcessModel * | parentProcess (QObject *obj) noexcept |
const ProcessModel * | parentProcess (const QObject *obj) noexcept |
constexpr ProcessFlags | operator| (ProcessFlags a, ProcessFlags b) noexcept |
constexpr ProcessFlags | operator|= (ProcessFlags &a, ProcessFlags b) noexcept |
QTextEdit * | createScriptWidget (const std::string_view language) |
bool | operator== (const Process::ProcessStateData &lhs, const Process::ProcessStateData &rhs) |
bool | operator== (const Process::StateNodeData &lhs, const Process::StateNodeData &rhs) |
bool | hasMatchingAddress (const MessageNode &root, const std::vector< State::AddressAccessor > &addresses, State::MessageList &msglist, std::vector< QString > &converted_addresses) |
bool | hasMatchingText (const MessageNode &root, const QString &txt, State::MessageList &msglist, std::vector< QString > &converted_addresses) |
State::AddressAccessor | address (const Process::MessageNode &treeNode) |
State::Message | userMessage (const Process::MessageNode &node) |
State::Message | message (const Process::MessageNode &node) |
State::MessageList | flatten (const Process::MessageNode &n) |
State::MessageList | getUserMessages (const MessageNode &n) |
std::vector< Process::MessageNode * > | try_getNodesFromAddress (Process::MessageNode &root, const State::AddressAccessor &addr) |
Process::MessageNode * | try_getNodeFromAddress (Process::MessageNode &root, const State::AddressAccessor &addr) |
QDebug | operator<< (QDebug d, const ProcessStateData &mess) |
QDebug | operator<< (QDebug d, const StateNodeData &mess) |
Enumeration Type Documentation
◆ ProcessFlags
enum Process::ProcessFlags : int64_t |
Various settings for processes.
Function Documentation
◆ displayNameForPort()
SCORE_LIB_PROCESS_EXPORT QString Process::displayNameForPort | ( | const Process::Port & | outlet, |
const score::DocumentContext & | doc | ||
) |
From a port, gives a name suitable for displaying in a process header.
This is useful mainly for processes which are defined by their output, e.g. the automations.