Process Namespace Reference

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 :

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 :

Classes

class  DefaultEffectItem
 
struct  LayoutBuilderBase
 
class  EffectProcessFactory_T
 
class  EffectLayerFactory_T
 
class  EffectLayerView
 
class  EffectLayerPresenter
 
struct  ControlSetup
 
struct  MagneticInfo
 
class  MagnetismAdjuster
 
struct  EnableWhenFocusedProcessIs
 
class  ApplicationPlugin
 
class  AutomatableFactory
 Factory for processes that work like automations. More...
 
struct  AutomatableFactoryList
 
class  ChangePortSettings
 
class  LoadPreset
 
class  MoveNodes
 
class  SetControlValue
 
class  SetControlOutletValue
 
struct  ControlMessage
 
class  AudioPortComboBox
 
class  Cable
 
struct  CableData
 
struct  DefaultControlLayouts
 
class  NodeItem
 
struct  PortItemLayout
 
class  Port
 
class  Inlet
 
class  ControlInlet
 
class  Outlet
 
class  AudioInlet
 
class  AudioOutlet
 
class  MidiInlet
 
class  MidiOutlet
 
class  ControlOutlet
 
class  ValueInlet
 
class  ValueOutlet
 
struct  ControlLayout
 
class  PortFactory
 
class  PortFactoryList
 
class  PortFactory_T
 
struct  Inlets
 
struct  Outlets
 
struct  pan_weight
 
class  PortWidgetSetup
 
class  PortListWidget
 Show the list of ports / addresses. More...
 
class  DataflowManager
 
class  ProcessDropHandler
 
class  ProcessDropHandlerList
 
struct  default_t
 
class  ProcessFactory_T
 
class  LayerFactory_T
 
class  LayerFactory_T< Model_T, default_t, default_t, default_t >
 
class  HeaderDelegate
 
class  DefaultHeaderDelegate
 
class  FooterDelegate
 
class  DefaultFooterDelegate
 
class  InspectorWidgetDelegate_T
 
class  InspectorWidgetDelegateFactory
 
class  InspectorWidgetDelegateFactory_T
 
class  MetaContextMenu
 
class  LayerContextMenu
 
class  LayerContextMenuManager
 
class  GraphicsShapeItem
 
class  LayerPresenter
 
class  LayerView
 
class  MiniLayer
 
class  OfflineAction
 Interface for applying an offline editing action to a process. More...
 
class  OfflineActionList
 
struct  ProcessIdentifier
 
struct  Preset
 
class  ProcessModel
 The Process class. More...
 
class  ProcessComponentBase
 
class  GenericProcessComponent_T
 
struct  Context
 
struct  LayerContext
 
class  DefaultLayerView
 
class  DefaultLayerPresenter
 
class  ProcessModelFactory
 The ProcessFactory class. More...
 
class  LayerFactory
 
class  ProcessFactoryList
 
class  LayerFactoryList
 
struct  Descriptor
 
struct  ProcessData
 
class  MultiScriptDialog
 
class  ProcessMultiScriptEditDialog
 
class  ScriptDialog
 
class  ProcessScriptEditDialog
 
struct  ScriptChangeResult
 
struct  ProcessStateData
 
struct  StateNodeValues
 
struct  StateNodeData
 
struct  Pixmaps
 
struct  Style
 
class  ProcessFocusManager
 

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::QGraphicsDraggablePixmapmakePresetButton (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 CommandGroupKeyCommandFactoryName ()
 
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< Inletmake_value_inlet (const Id< Process::Port > &c, QObject *parent)
 
std::unique_ptr< Outletmake_value_outlet (const Id< Process::Port > &c, QObject *parent)
 
std::unique_ptr< MidiInletmake_midi_inlet (const Id< Process::Port > &c, QObject *parent)
 
std::unique_ptr< MidiOutletmake_midi_outlet (const Id< Process::Port > &c, QObject *parent)
 
std::unique_ptr< AudioInletmake_audio_inlet (const Id< Process::Port > &c, QObject *parent)
 
std::unique_ptr< AudioOutletmake_audio_outlet (const Id< Process::Port > &c, QObject *parent)
 
std::unique_ptr< Inletload_inlet (DataStreamWriter &wr, QObject *parent)
 
std::unique_ptr< Inletload_inlet (JSONWriter &wr, QObject *parent)
 
std::unique_ptr< Outletload_outlet (DataStreamWriter &wr, QObject *parent)
 
std::unique_ptr< Outletload_outlet (JSONWriter &wr, QObject *parent)
 
template<typename T , typename W >
auto load_port_t (W &wr, QObject *parent)
 
std::unique_ptr< ValueInletload_value_inlet (DataStreamWriter &wr, QObject *parent)
 
std::unique_ptr< ValueInletload_value_inlet (JSONWriter &wr, QObject *parent)
 
std::unique_ptr< ValueOutletload_value_outlet (DataStreamWriter &wr, QObject *parent)
 
std::unique_ptr< ValueOutletload_value_outlet (JSONWriter &wr, QObject *parent)
 
std::unique_ptr< ControlInletload_control_inlet (DataStreamWriter &wr, QObject *parent)
 
std::unique_ptr< ControlInletload_control_inlet (JSONWriter &wr, QObject *parent)
 
std::unique_ptr< ControlOutletload_control_outlet (DataStreamWriter &wr, QObject *parent)
 
std::unique_ptr< ControlOutletload_control_outlet (JSONWriter &wr, QObject *parent)
 
std::unique_ptr< AudioInletload_audio_inlet (DataStreamWriter &wr, QObject *parent)
 
std::unique_ptr< AudioInletload_audio_inlet (JSONWriter &wr, QObject *parent)
 
std::unique_ptr< AudioOutletload_audio_outlet (DataStreamWriter &wr, QObject *parent)
 
std::unique_ptr< AudioOutletload_audio_outlet (JSONWriter &wr, QObject *parent)
 
std::unique_ptr< MidiInletload_midi_inlet (DataStreamWriter &wr, QObject *parent)
 
std::unique_ptr< MidiInletload_midi_inlet (JSONWriter &wr, QObject *parent)
 
std::unique_ptr< MidiOutletload_midi_outlet (DataStreamWriter &wr, QObject *parent)
 
std::unique_ptr< MidiOutletload_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::BrushportBrush (Process::PortType type)
 
const score::BrushlabelBrush ()
 
const score::BrushSetlabelBrush (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
 
ProcessModelparentProcess (QObject *obj) noexcept
 
const ProcessModelparentProcess (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::MessageNodetry_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.

Enumerator
SupportsTemporal 

Can be loaded as a process of an interval.

TimeIndependent 

The process won't change if the parent duration changes (eg it's a filter)

SupportsState 

Can be loaded in a state.

RequiresCustomData 

Action from the user required upon creation.

PutInNewSlot 

When created in an interval, go on the top slot or in a new slot.

HandlesLooping 

The presenter / view already handles rendering when the model loops.

ControlSurface 

The process supports being exposed to the ControlSurface.

FullyCustomItem 

The process's item handles all the decoration (won't be title, etc)

CanCreateControls 

The process supports adding new controls (for audio plug-ins, LV2 etc): this will show the UI in the inspector

CreateControls 

The process is currently creating new controls (the runtime state changed by the user)

Snapshottable 

The process is snapshottable.

Recordable 

The process is recordable.

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.