Loading...
Searching...
No Matches
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  AddressAccessorEditWidget
 
class  AddressAccessorLineEdit
 
class  AddressLineEdit
 
class  AddressLineEditBase
 The AddressLineEdit class. More...
 
class  ApplicationPlugin
 
struct  AudioFileChooser
 
class  AudioInlet
 
class  AudioOutlet
 
class  AutomatableFactory
 Factory for processes that work like automations. More...
 
struct  AutomatableFactoryList
 
struct  Bargraph
 
struct  Button
 
class  Cable
 
struct  CableData
 
struct  ChangeListener
 
class  ChangePortSettings
 
struct  ChooserToggle
 
struct  ComboBox
 
class  CompileKeyFilter
 
class  ConsolidateProjectFiles
 
struct  Context
 
class  ControlInlet
 
struct  ControlLayout
 
struct  ControlMessage
 
class  ControlOutlet
 
struct  ControlPage
 Which slice of a node's controls is currently displayed. More...
 
struct  ControlSetup
 
class  DataflowManager
 
struct  default_t
 
struct  DefaultControlLayouts
 
class  DefaultEffectItem
 
class  DefaultFooterDelegate
 
class  DefaultHeaderDelegate
 
class  DefaultLayerPresenter
 
class  DefaultLayerView
 
struct  Descriptor
 
class  DocumentBackgroundPreview
 Paints what the document currently shows behind itself. More...
 
class  EditorOverlayHost
 A code editor drawn over a live preview of what it edits. More...
 
class  EffectLayerFactory_Base
 
class  EffectLayerFactory_T
 
class  EffectLayerPresenter
 
class  EffectLayerView
 
class  EffectProcessFactory_T
 
struct  EnableWhenFocusedProcessIs
 
struct  Enum
 
class  ExternalFileMap
 Collects — and in the same pass rewrites — the files a document references. More...
 
struct  ExternalFileRef
 One external file referenced by a document. More...
 
struct  FileChooser
 
struct  FileChooserBase
 
struct  FileEntry
 
class  FileIndex
 An index of the files under a folder, used to relink by name. More...
 
struct  FileReport
 
class  FileReportView
 The table every file operation shows its report in. More...
 
struct  FloatKnob
 
struct  FloatRangeSlider
 
struct  FloatRangeSpinBox
 
struct  FloatSlider
 
struct  FloatSpinBox
 
struct  FolderChooser
 
class  FooterDelegate
 
class  GenericProcessComponent_T
 
class  GraphicsShapeItem
 
class  HeaderDelegate
 
struct  HSVSlider
 
struct  ImpulseButton
 
class  Inlet
 
struct  Inlets
 
class  InspectorWidgetDelegate_T
 
class  InspectorWidgetDelegateFactory
 
class  InspectorWidgetDelegateFactory_T
 
struct  IntRangeSlider
 
struct  IntRangeSpinBox
 
struct  IntSlider
 
struct  IntSpinBox
 
struct  LayerContext
 
class  LayerContextMenu
 
class  LayerContextMenuManager
 
class  LayerFactory
 
class  LayerFactory_T
 
class  LayerFactory_T< Model_T, default_t, default_t, default_t >
 
class  LayerFactoryList
 
class  LayerPresenter
 
class  LayerView
 
struct  LayoutBuilderBase
 
struct  LineEdit
 
class  LoadPresetCommandFactory
 
class  LoadPresetCommandFactoryList
 
struct  LogFloatSlider
 
struct  MagneticInfo
 
class  MagnetismAdjuster
 
struct  MediaRange
 
class  MediaTrimDialog
 Shows what trimming would remove, and asks before removing it. More...
 
class  MediaTrimmer
 Writes the used part of a media file into a new one. More...
 
class  MediaTrimmerList
 
class  MetaContextMenu
 
class  MidiInlet
 
class  MidiOutlet
 
class  MiniLayer
 
class  MissingFilesDialog
 Lists what a document cannot find, and helps point it at the files. More...
 
class  MoveNodes
 
class  MoveNodesMacro
 
class  MultiScriptDialog
 
struct  MultiSlider
 
struct  MultiSliderXY
 
class  NodeItem
 
class  OfflineAction
 Interface for applying an offline editing action to a process. More...
 
class  OfflineActionList
 
class  Outlet
 
struct  Outlets
 
struct  pan_weight
 
struct  PathGeneratorXY
 
struct  Pixmaps
 
class  Port
 
class  PortAddressComboBox
 Address picker for the audio / midi / texture / geometry ports. More...
 
class  PortFactory
 
class  PortFactory_T
 
class  PortFactoryList
 
struct  PortItemLayout
 
class  PortListWidget
 Show the list of ports / addresses. More...
 
class  PortWidgetSetup
 
struct  Preset
 
class  ProcessComponentBase
 
struct  ProcessData
 
class  ProcessDropHandler
 
class  ProcessDropHandlerList
 
class  ProcessFactory_T
 
class  ProcessFactoryList
 
class  ProcessFocusManager
 
struct  ProcessIdentifier
 
class  ProcessModel
 The Process class. More...
 
class  ProcessModelFactory
 The ProcessFactory class. More...
 
class  ProcessMultiScriptEditDialog
 
class  ProcessScriptEditDialog
 
struct  ProcessStateData
 
struct  ProgramEdit
 
class  ProjectConsolidationDialog
 Shows what consolidating the document would do, then does it. More...
 
class  ProjectFilesApplicationPlugin
 
struct  ProjectTarget
 
class  ReanchorProjectFiles
 
class  RelinkProjectFiles
 
class  RelocateFilePath
 Points a QString path property at another file. More...
 
class  RemoteControlInterface
 
class  RemoteControlProvider
 
class  RemoteControlProviderList
 
struct  ScriptChangeResult
 
class  ScriptDialog
 
class  ScriptTabBar
 Tab bar of the script editors. More...
 
class  ScriptTabWidget
 A QTabWidget with a ScriptTabBar. More...
 
class  SetControlOutletValue
 
class  SetControlValue
 
struct  StateNodeData
 
struct  StateNodeValues
 
class  StringListEditor
 
struct  Style
 
struct  TimeChooser
 
struct  Toggle
 
struct  TrimOptions
 How much of a media file to keep when trimming it down. More...
 
class  TrimProjectMedia
 
struct  UIPlacementSettings
 
class  UnusedFilesDialog
 Lists what is in the project folder and no longer used, and removes the ones the user ticks. More...
 
struct  UnusedFilesOptions
 
class  ValueInlet
 
class  ValueOutlet
 
struct  VideoFileChooser
 
struct  XYSlider
 
struct  XYSpinboxes
 
struct  XYZSlider
 
struct  XYZSpinboxes
 

Typedefs

template<typename Model_T , typename ScriptView_T >
using ScriptLayerFactory_T = EffectLayerFactory_T< Model_T, void, ScriptView_T >
 
using MagnetismHandler = std::function< MagneticInfo(const QObject *, TimeVal)>
 
using ExternalFileMapper = std::function< QString(const ExternalFileRef &)>
 
using FilePolicy = std::function< QString(const ExternalFileRef &, FileEntry &)>
 Decides what happens to one reference.
 
template<typename Model_T >
using GenericDefaultLayerFactory = LayerFactory_T< Model_T, default_t, default_t, default_t >
 
using GlyphCache = ossia::hash_map< std::pair< QString, const QPen * >, QPixmap >
 
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  ProcessUIKind { ScriptEditor , ExternalUI }
 
enum class  CableType { ImmediateGlutton , ImmediateStrict , DelayedGlutton , DelayedStrict }
 
enum class  PortType {
  Message , Audio , Midi , Texture ,
  Geometry
}
 
enum class  PortLoadDataFlags { NoFlag = 0 , ReloadValue = (1 << 0) }
 
enum class  FileUsage { Input , Output }
 Whether the process reads the file or writes to it. More...
 
enum class  FileAction {
  Unchanged , Collect , AlreadyThere , KeptInLibrary ,
  Relinked , Trimmed , Unused , Removed ,
  Missing , Unsupported , Skipped , Failed
}
 What an operation decided about one file reference. More...
 
enum class  FileOperationKind { Consolidate , Reanchor , Relink , Trim }
 
enum class  FoldMode : int8_t { Auto , Folded , Unfolded }
 
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 ) ,
  ItemRequiresUniqueFocus = (1 << 12 ) , DynamicPorts = (1 << 13 ) , PolyphonySupported = (1 << 14 ) , PolyphonyEnabled = (1 << 15 ) ,
  ScriptEditingSupported = (1 << 16 ) , ExternalUISupported = (1 << 17 ) , ExternalUIAvailable = (1 << 18 ) , NodeHasNoBackground = (1 << 19 ) ,
  Deprecated = (1 << 20 ) , ExternalUIEmbeddable = (1 << 21 ) , 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
}
 
enum class  PriorityPolicy { User , Previous , Following }
 
enum class  UIPlacement { Window , SidePanel , Central }
 Where the UIs attached to a process get shown. More...
 
enum class  PreviewSource { Background , None }
 How a script editor looks in the central view. More...
 
enum class  UnusedDisposal { MoveAside , Delete }
 Where the leftovers go. More...
 

Functions

QGraphicsItem * makeScriptButton (ProcessModel &effect, const score::DocumentContext &context, QObject *self, QGraphicsItem *root)
 
void setupScriptUI (Process::ProcessModel &proc, const Process::LayerFactory &fact, const score::DocumentContext &ctx, bool show)
 
void setupExternalUI (Process::ProcessModel &proc, const Process::LayerFactory &fact, const score::DocumentContext &ctx, bool show)
 
void moveProcessUI (Process::ProcessModel &proc, const score::DocumentContext &ctx, ProcessUIKind kind, const QString &placement)
 
void fillPlacementMenu (QMenu &menu, Process::ProcessModel &proc, const score::DocumentContext &ctx, ProcessUIKind kind)
 Menu entries to pick the placement of this process's editor / UI.
 
void setupScriptUI (Process::ProcessModel &proc, const score::DocumentContext &ctx, bool show)
 
void setupExternalUI (Process::ProcessModel &proc, const score::DocumentContext &ctx, bool show)
 
QGraphicsItem * makeExternalUIButton (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)
 
const CommandGroupKeyCommandFactoryName ()
 
bool operator== (const CableData &lhs, const CableData &rhs)
 
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< 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.
 
Device::NodeKind nodeKindOf (PortType type, bool inlet) noexcept
 The kind of device node a port of that type binds to.
 
std::vector< State::AddresslistPortAddresses (Device::DeviceInterface &device, PortType type, bool inlet)
 The addresses of a device that a port of that type can bind to.
 
std::vector< State::AddresslistPortAddresses (Device::DeviceList &devices, PortType type, bool inlet)
 
QComboBox * makePortAddressCombo (const Process::Port &port, const score::DocumentContext &ctx, QWidget *parent)
 A PortAddressComboBox bound to a port: follows the port's address and submits a ChangePortAddress command when the user picks another one.
 
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)
 
bool isControlPort (const Process::Port &port) noexcept
 True for the ports whose value is edited through a widget in the node body.
 
bool isVisibleWhenFolded (const Process::Port &port) noexcept
 
ControlPage nodeControlPage (int controlCount, int requestedPage, int gridOffset) noexcept
 
bool looksLikeExistingFile (const QString &value, const score::DocumentContext &ctx) noexcept
 
void mapDocumentExternalFiles (const score::DocumentContext &ctx, ExternalFileMap &map)
 Walk every process of the document and let it report its files.
 
QString toString (FileAction a) noexcept
 
FileReport runFileOperation (const score::DocumentContext &ctx, const FilePolicy &policy, bool dryRun, FileOperationKind kind=FileOperationKind::Consolidate)
 Run policy over every external file reference of a document.
 
QPixmap makeGlyphs (const QString &glyph, const QPen &pen)
 
FileReport analyzeMediaTrim (const score::DocumentContext &ctx, const TrimOptions &opts)
 Plan trimming every media file down to the part the document reads.
 
FileReport trimProjectMedia (const score::DocumentContext &ctx, const TrimOptions &opts)
 Perform the trim planned by analyzeMediaTrim.
 
FileReport scanMissingFiles (const score::DocumentContext &ctx)
 Everything the document references and cannot find right now.
 
FileReport relinkFiles (const score::DocumentContext &ctx, const QHash< QString, QString > &chosen)
 Repoint references at the files they were found at.
 
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
 
QString processLocalTreeAddress (const ProcessModel &proc)
 
constexpr ProcessFlags operator| (ProcessFlags a, ProcessFlags b) noexcept
 
constexpr ProcessFlags operator|= (ProcessFlags &a, ProcessFlags b) noexcept
 
std::vector< score::ZipEntryprojectArchiveContents (const score::DocumentContext &ctx, const FileReport &report)
 The files that make up a project, ready to be archived.
 
qint64 archiveContentsSize (const std::vector< score::ZipEntry > &entries) noexcept
 Total size on disk of an archive's contents, before compression.
 
ProjectTarget projectTarget (const score::DocumentContext &ctx, QString projectFolder)
 
FileReport analyzeProjectFiles (const score::DocumentContext &ctx, const score::ConsolidateOptions &opts, QString projectFolder={})
 Plan the consolidation of a document into its own folder.
 
FileReport consolidateProjectFiles (const score::DocumentContext &ctx, const score::ConsolidateOptions &opts, QString projectFolder={})
 Perform the consolidation planned by analyzeProjectFiles.
 
int countProjectRelativeFiles (const score::DocumentContext &ctx)
 
int reanchorProjectFiles (const score::DocumentContext &ctx)
 Turn every project-relative reference into the absolute file it currently points at.
 
void setEditorTransparent (QWidget *editor, bool transparent)
 Removes the background of an editor widget's text areas (false restores it).
 
void setEditorChromeless (QWidget *editor, bool chromeless)
 
QSyntaxStyle * scriptStyle ()
 The editors' colour theme.
 
QSyntaxStyle * overlayScriptStyle ()
 
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)
 
QString unusedFolderName () noexcept
 Name of the folder MoveAside puts things in, directly under the project.
 
FileReport analyzeUnusedFiles (const score::DocumentContext &ctx, const UnusedFilesOptions &opts)
 Files sitting in the project folder that nothing in the document points at any more.
 
QStringList unusedFilesWarnings (const score::DocumentContext &ctx, const FileReport &scan)
 Reasons to think twice before acting on that report, in plain words.
 
FileReport removeUnusedFiles (const score::DocumentContext &ctx, const std::vector< QString > &absolutePaths, const UnusedFilesOptions &opts)
 Move aside or delete exactly the files named.
 
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)
 

Typedef Documentation

◆ ExternalFileMapper

using Process::ExternalFileMapper = typedef std::function<QString(const ExternalFileRef&)>

Called for every reference found. Return the path it should be rewritten to, or an empty string to leave it alone.

◆ FilePolicy

using Process::FilePolicy = typedef std::function<QString(const ExternalFileRef&, FileEntry&)>

Decides what happens to one reference.

Fills entry (action, destination, sizes, note) and returns the path the reference must be rewritten to, or an empty string to leave it alone.

Enumeration Type Documentation

◆ FileAction

enum class Process::FileAction
strong

What an operation decided about one file reference.

Shared by every operation that walks a document's files – consolidating, re-anchoring, scanning for missing media, relinking, trimming, archiving – so that they all produce a report the same widgets can display and the same code can summarize.

Enumerator
Unchanged 

Seen, nothing to do.

Collect 

Copied into the project folder and repointed.

AlreadyThere 

Already inside the project; only the reference changed.

KeptInLibrary 

Resolves through the user library and was left there.

Relinked 

Was missing, found elsewhere, repointed.

Trimmed 

Rewritten down to the part the document actually reads.

Unused 

Sitting in the project folder with nothing pointing at it.

Removed 

Moved aside or deleted.

Missing 

Not found.

Left untouched.

Unsupported 

A folder, or something score has no way to relocate.

Skipped 

In scope but declined; note says why.

Failed 

Attempted and did not work; note says why.

◆ FileOperationKind

enum class Process::FileOperationKind
strong

Which operation is running, so that the undo entry says what happened rather than naming whichever one was written first.

◆ FileUsage

enum class Process::FileUsage
strong

Whether the process reads the file or writes to it.

Enumerator
Input 

Read by the process: must be collected next to the document.

Output 

Written by the process (recorders, encoders): only the path moves.

◆ FoldMode

enum class Process::FoldMode : int8_t
strong

Whether a node item shows its contents, and whether that was decided by the user or is still left to the "too many ports to draw" heuristic.

Auto is the default so that documents saved before this existed, and freshly created processes, keep behaving the way they always did.

◆ PreviewSource

enum class Process::PreviewSource
strong

How a script editor looks in the central view.

Enumerator
Background 

Without chrome nor background, over what the document shows behind itself (a Background device, a watched texture port) when there is one

None 

A plain editor.

◆ 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.

ItemRequiresUniqueFocus 

The process has an editable widget which must unfocus & unselect other items.

DynamicPorts 

The process has a variable structure, e.g. its ports can change dynamically.

PolyphonySupported 

The process can be used in polyphonic mode. This means that mono DSP processors (e.g. with one channel of audio input and output) will instead be scaled to the actual number of input channels of the object.

PolyphonyEnabled 

Polyphonic mode is enabled.

ScriptEditingSupported 

The process is based on user-editable source code (JS, Faust, etc.)

ExternalUISupported 

The process supports having a custom external UI (VST, etc.). Per-type flag.

ExternalUIAvailable 

The process currently has a custom UI available (not necessarily shown). Can vary, for instance depending on the JS script.

NodeHasNoBackground 

No background will be drawn for the node.

Deprecated 

Process kind is deprecated.

ExternalUIEmbeddable 

The custom UI is made of plain widgets / Qt Quick and can be shown inside the main window (as opposed to plug-ins owning a native window).

◆ UIPlacement

enum class Process::UIPlacement
strong

Where the UIs attached to a process get shown.

Applies to the script / code editors (JS, shaders, DSP...) and to the custom UIs of processes that can be embedded (JS ScriptUI components). Plug-in windows that own a native window (VST, LV2, CLAP...) always open as separate windows.

Enumerator
Window 

A separate top-level window.

SidePanel 

A tab of the right pane, next to the inspector.

Central 

A view of the central area, in place of the score, with the navigation bar staying on top.

◆ UnusedDisposal

enum class Process::UnusedDisposal
strong

Where the leftovers go.

Enumerator
MoveAside 

Into <project>/Unused/, keeping their place in the tree. Reversible with a file manager, which is what makes it the default.

Delete 

Deleted outright.

Function Documentation

◆ analyzeMediaTrim()

FileReport Process::analyzeMediaTrim ( const score::DocumentContext ctx,
const TrimOptions opts 
)

Plan trimming every media file down to the part the document reads.

Side-effect free. Entries come back as FileAction::Trimmed with the size the file would drop to, or FileAction::Skipped with the reason – which matters more than it sounds: the standing complaint about other implementations is that they silently decline to trim and leave the user guessing.

A file used by several processes is planned once, over the union of every region that reads it.

◆ analyzeProjectFiles()

FileReport Process::analyzeProjectFiles ( const score::DocumentContext ctx,
const score::ConsolidateOptions opts,
QString  projectFolder = {} 
)

Plan the consolidation of a document into its own folder.

Pure: reads the document and the filesystem, writes nothing. The result is what the UI shows the user before committing.

projectFolder defaults to the folder holding the document. Passing a different one is how "save a copy into a new project folder" works: the references still resolve against the document's current location, while the destinations are computed for the new one.

◆ analyzeUnusedFiles()

FileReport Process::analyzeUnusedFiles ( const score::DocumentContext ctx,
const UnusedFilesOptions opts 
)

Files sitting in the project folder that nothing in the document points at any more.

Consolidating copies media in and never takes it out, so a project that has been worked on accumulates the samples of every idea that was tried and dropped. This finds them.

Pure: reads the document and the folder, writes nothing. Entries come back as FileAction::Unused with their size, the largest first, because the reason anyone runs this is disk space.

◆ consolidateProjectFiles()

FileReport Process::consolidateProjectFiles ( const score::DocumentContext ctx,
const score::ConsolidateOptions opts,
QString  projectFolder = {} 
)

Perform the consolidation planned by analyzeProjectFiles.

Copies the files, then rewrites the document in a single undoable command. Originals are never moved or deleted, and an existing destination is never overwritten.

The returned report describes what actually happened, entry per entry: a copy that failed comes back as FileAction::Failed with its reason, and its reference is left untouched.

◆ countProjectRelativeFiles()

int Process::countProjectRelativeFiles ( const score::DocumentContext ctx)

How many references the document resolves through its own folder. These are exactly the ones that stop working when the document is saved somewhere else without its media.

◆ 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.

◆ isVisibleWhenFolded()

bool Process::isVisibleWhenFolded ( const Process::Port port)
noexcept

True for the ports a folded node still has to show. A folded node displays the routing only: everything that is not a control, plus the controls that take part in the patch - those with a cable or an exposed address.

◆ listPortAddresses()

std::vector< State::Address > Process::listPortAddresses ( Device::DeviceInterface device,
PortType  type,
bool  inlet 
)

The addresses of a device that a port of that type can bind to.

The device is only walked when its capabilities say it carries nodes of that kind (Device::NodeKind), so an OSC tree is never visited for textures. Audio, texture and geometry nodes are recognized by their parameter type; the audio device's mapped ports by their direction. A MIDI stream is the device or one of its channel nodes: the note / CC leaves are values.

◆ looksLikeExistingFile()

bool Process::looksLikeExistingFile ( const QString &  value,
const score::DocumentContext ctx 
)
noexcept

Processes that accept either a path or the script itself store both in the same string. True when this one is a path to a file that exists.

◆ moveProcessUI()

SCORE_LIB_PROCESS_EXPORT void Process::moveProcessUI ( Process::ProcessModel proc,
const score::DocumentContext ctx,
ProcessUIKind  kind,
const QString &  placement 
)

Changes where this process's editor / UI opens (see UIPlacementSettings::names(), an empty name meaning the user's default), moving it if it is open.

◆ nodeControlPage()

ControlPage Process::nodeControlPage ( int  controlCount,
int  requestedPage,
int  gridOffset = 0 
)
noexcept

Pagination for controlCount controls: everything on a single page below MaxUnpaginatedControls, up to ControlsPerPage per page above it.

gridOffset is the number of non-control items sharing the control grid - the leading audio/midi/message inlets when there are too few of them to get a column of their own. The page is shortened so that it ends on a full column instead of leaving one item alone in the last one.

◆ nodeKindOf()

Device::NodeKind Process::nodeKindOf ( PortType  type,
bool  inlet 
)
noexcept

The kind of device node a port of that type binds to.

An inlet reads what a device produces, an outlet feeds what it consumes.

◆ overlayScriptStyle()

QSyntaxStyle * Process::overlayScriptStyle ( )

The same theme for an editor drawn over a preview: no background behind the text and the line numbers, a barely visible current line.

◆ projectArchiveContents()

std::vector< score::ZipEntry > Process::projectArchiveContents ( const score::DocumentContext ctx,
const FileReport report 
)

The files that make up a project, ready to be archived.

Built from a consolidation report rather than by listing the project folder: the report knows exactly which files this document uses, so an archive does not sweep up the neighbouring project, last week's backups, or the render someone left in there. It also means trimming shrinks the archive without anything else being aware of it – the untrimmed originals simply stop being referenced.

Everything is placed under one top-level folder named after the document, so that unpacking never scatters files into whatever directory the archive was opened in.

◆ reanchorProjectFiles()

int Process::reanchorProjectFiles ( const score::DocumentContext ctx)

Turn every project-relative reference into the absolute file it currently points at.

The counterpart of consolidating when a document is saved into another folder: rather than let "<PROJECT>:Audio/kick.wav" quietly start meaning a file that is not there, pin it to the one that is. The result is a document that still plays, at the cost of no longer being self-contained.

Returns the number of references that were re-anchored. The change goes on the command stack like any other.

◆ relinkFiles()

FileReport Process::relinkFiles ( const score::DocumentContext ctx,
const QHash< QString, QString > &  chosen 
)

Repoint references at the files they were found at.

chosen maps a reference's stored path to the absolute file it should now use; a stored path used by several processes relinks all of them at once, which is the common case when a whole folder went missing.

The new reference is made project- or library-relative when it can be, so relinking leaves the document more portable than it found it. Everything is committed as one undoable command.

◆ removeUnusedFiles()

FileReport Process::removeUnusedFiles ( const score::DocumentContext ctx,
const std::vector< QString > &  absolutePaths,
const UnusedFilesOptions opts 
)

Move aside or delete exactly the files named.

Takes the list rather than recomputing it: what the user ticked in the dialog is what happens, and this function cannot remove something they never saw. Anything outside the project folder, and any score document, is refused whatever the list says.

◆ runFileOperation()

FileReport Process::runFileOperation ( const score::DocumentContext ctx,
const FilePolicy policy,
bool  dryRun,
FileOperationKind  kind = FileOperationKind::Consolidate 
)

Run policy over every external file reference of a document.

This is the single traversal every file operation in score goes through. dryRun suppresses the rewrites without changing the report by one field, so "show me what would happen" and "do it" cannot describe different things. Otherwise the rewrites are committed as one undoable command.

◆ scanMissingFiles()

FileReport Process::scanMissingFiles ( const score::DocumentContext ctx)

Everything the document references and cannot find right now.

Cheap (one stat per reference) and side-effect free, which is what lets it run on every document load. Entries come back with FileAction::Missing; references that resolve are reported as Unchanged so the caller can also answer "how many files does this project use".

◆ setEditorChromeless()

void Process::setEditorChromeless ( QWidget *  editor,
bool  chromeless 
)

Removes the chrome of an editor widget: frames, scroll bars, margins and the button row (Ctrl+Return compiles). false restores it.

◆ trimProjectMedia()

FileReport Process::trimProjectMedia ( const score::DocumentContext ctx,
const TrimOptions opts 
)

Perform the trim planned by analyzeMediaTrim.

Only files that live inside the project folder are ever touched: a document referencing someone's sample library must not rewrite that library. New files are written beside the originals under fresh names, never over them, and the references are repointed as one undoable command.

◆ unusedFilesWarnings()

QStringList Process::unusedFilesWarnings ( const score::DocumentContext ctx,
const FileReport scan 
)

Reasons to think twice before acting on that report, in plain words.

Empty when there are none. Deciding a file is unused is deciding that nothing score knows about references it, and there are a handful of situations where that is a weaker statement than it sounds – a broken reference the user is about to relink, a second document sharing the folder. The dialog shows these; the caller cannot get the list by accident.