Loading...
Searching...
No Matches
LocalTree Namespace Reference

Local tree provides a way to extend the tree given through the Engine::Network::LocalDevice. More...

Detailed Description

Local tree provides a way to extend the tree given through the Engine::Network::LocalDevice.

It is a device tree used to access to score's internal data structures from the outside, or use it in automations, etc.

For instance, it allows to do conditions based on the advancement of each Scenario::IntervalModel.

It is possible to extend the tree for Process::ProcessModels, or other polymorphic types.

Classes

class  AutomationComponent
 
class  BaseCallbackWrapper
 
struct  BaseProperty
 
class  Component
 
class  DefaultProcessComponent
 
class  DocumentPlugin
 
class  Event
 
struct  GetPropertyWrapper
 
struct  GivenName
 
class  Interval
 
class  IntervalBase
 
class  MappingComponent
 
class  MetadataNamePropertyWrapper
 
struct  ParameterBinding
 Does not remove the node, so that it can be retired. More...
 
class  ProcessComponent
 
class  ProcessComponentFactory
 
class  ProcessComponentFactory_T
 
class  ProcessComponentFactoryList
 
struct  PropertyWrapper
 
class  ReferenceIndex
 
class  ReferencesDialog
 Lists the broken references of a document, to locate or retarget them. More...
 
class  ScenarioComponentBase
 
class  ScriptableEvent
 score:/conditions/<name>: a boolean for the event's expression to read. More...
 
class  ScriptableInterval
 Tracks the processes of an interval, and the hierarchy below a scenario. More...
 
class  ScriptableProcessBase
 
class  ScriptableProcessComponent
 
class  ScriptableProcessFactory
 For processes containing other processes; others use ScriptableProcessComponent. More...
 
class  ScriptableProcessFactoryList
 
class  ScriptableProcessGroup
 
struct  ScriptableRoots
 
class  ScriptableScenarioBase
 
class  ScriptableScenarioFactory
 
struct  ScriptableSnapshot
 Copy of the namespace for scripts on other threads, rebuilt on the GUI thread. More...
 
class  ScriptableState
 Registers the state in the ReferenceIndex, since it holds messages. More...
 
class  ScriptableTimeSync
 score:/triggers/<name>: an impulse that fires the sync. More...
 
class  ScriptableTreeBase
 Publishes the scriptable namespace and maps addresses to objects and back. More...
 
struct  SetPropertyWrapper
 
class  State
 
struct  StateRecall
 Scope of a state played from the UI: an undoable edit while stopped. More...
 
class  TimeSync
 

Typedefs

using CommonComponent = Component< score::GenericComponent< const score::DocumentContext > >
 
template<typename T >
using qt_property_converter_T = ossia::qt_property_converter< std::remove_const_t< std::remove_reference_t< T > > >
 
template<typename Process_T >
using ProcessComponent_T = Process::GenericProcessComponent_T< ProcessComponent, Process_T >
 
using AnchorMapping = std::function< std::shared_ptr< const ::State::Anchor >(const std::shared_ptr< const ::State::Anchor > &)>
 
using AddressMapping = std::function< std::optional<::State::AddressAccessor >(const ::State::AddressAccessor &)>
 
using AutomationComponentFactory = ProcessComponentFactory_T< AutomationComponent >
 
using MappingComponentFactory = ProcessComponentFactory_T< MappingComponent >
 
using ScenarioComponent = HierarchicalScenarioComponent< ScenarioComponentBase, Scenario::ProcessModel, Interval, Event, TimeSync, State >
 
using ScenarioComponentFactory = LocalTree::ProcessComponentFactory_T< ScenarioComponent >
 
using ScriptableScenario = HierarchicalScenarioComponent< ScriptableScenarioBase, Scenario::ProcessModel, ScriptableInterval, ScriptableEvent, ScriptableTimeSync, ScriptableState >
 

Enumerations

enum class  ControlWrites { Edit , Execution , Record , Drop }
 What a value written into a published control does. More...
 
enum class  Recall : uint8_t { None , Stop , State }
 Which state sent outside of a scenario run the values of published controls come from. More...
 
enum class  AddressStatus { Found , Unpublished , NoDevice , NoNode }
 

Functions

template<typename Property , typename Object >
auto add_getProperty (ossia::net::node_base &n, Object &obj, QObject *context)
 
template<typename Property , typename Object >
auto add_property (ossia::net::node_base &n, Object &obj, QObject *context)
 
template<typename Property , typename Object >
auto add_property (ossia::net::node_base &n, Object &obj, const std::string &name, QObject *context)
 
template<typename T , typename Callback >
auto make_setProperty (ossia::net::parameter_base &addr, Callback prop)
 
template<typename T , typename Callback >
auto add_setProperty (ossia::net::node_base &n, const std::string &name, Callback cb)
 
::State::Address addressOfNode (const ossia::net::node_base &n)
 
void giveName (GivenName &given, score::ModelMetadata &metadata, const QString &own, const QString &name)
 
void giveName (GivenName &given, Process::Port &port, const QString &name)
 
::State::Address scriptableAddress (const Process::ProcessModel &)
 score:/controls/<process>[/<port>|/preset]; empty when not published.
 
::State::Address scriptableAddress (const Process::Port &port)
 
bool publishedWithProcess (const Process::Port &) noexcept
 Controls of a scriptable process are published whether or not flagged.
 
bool wantsPublished (const Process::Port &port) noexcept
 
::State::Address scriptableStateAddress (const Process::ProcessModel &proc)
 
ScriptableProcessBase * makeScriptableProcess (ScriptableRoots roots, Process::ProcessModel &proc, const score::DocumentContext &ctx, QObject *parent)
 
void announceReferrer (const ScriptableRoots &roots, QObject &object)
 
void tagNode (const ScriptableRoots &roots, ossia::net::node_base &node, const QObject &object, const QString &member={})
 
void retireNode (const ScriptableRoots &roots, ossia::net::node_base &node)
 
template<typename F >
ossia::net::node_base * createScriptableNode (const ScriptableRoots &roots, ossia::net::node_base &parent, const QString &name, F &&writeBack)
 writeBack gets the name the device picked when it differs, e.g. on collision
 
template<typename F >
void renameScriptableNode (ossia::net::node_base &node, const QString &name, F &&writeBack)
 
bool anchor (::State::Address &a, const score::DocumentContext &ctx)
 Anchors a local-device address to the object published there; returns whether it has an anchor.
 
bool anchor (::State::AddressAccessor &a, const score::DocumentContext &ctx)
 
void anchor (::State::Expression &e, const score::DocumentContext &ctx)
 Every address inside the expression.
 
void settle (::State::Address &a, const score::DocumentContext &ctx)
 
void settle (::State::AddressAccessor &a, const score::DocumentContext &ctx)
 
void settle (::State::Expression &e, const score::DocumentContext &ctx)
 Every address inside the expression.
 
bool settle (Process::MessageNode &node, const score::DocumentContext &ctx)
 Every message of the tree; returns whether an anchor changed.
 
std::optional< bool > published (const ::State::Address &a, const score::DocumentContext &ctx)
 
AddressStatus addressStatus (const ::State::Address &a, const score::DocumentContext &ctx)
 
QString describe (AddressStatus s)
 What to tell the user about a status that is not Found.
 
QObject * publishedObject (const ::State::Address &a, const score::DocumentContext &ctx, QString &member)
 member receives which of the object's parameters the address is
 
bool isProcessState (const ::State::Address &a, const score::DocumentContext &ctx)
 
bool broken (const ::State::Address &a, const score::DocumentContext &ctx)
 
void mapAnchors (Process::MessageNode &n, const AnchorMapping &f)
 
void mapAnchors (::State::Expression &e, const AnchorMapping &f)
 
void mapAddresses (::State::Expression &e, const AddressMapping &map, bool &changed)
 Replaces each address of the expression with the mapping's result, if any.
 
::State::Address derive (const ::State::Anchor &a, const score::DocumentContext &ctx)
 The address the anchored object currently publishes; unset if it does not publish.
 
::State::Address derived (const ::State::Address &a, const score::DocumentContext &ctx)
 
::State::AddressAccessor derived (const ::State::AddressAccessor &a, const score::DocumentContext &ctx)
 
Device::DeviceSettings defaultSettings (const score::DocumentContext &ctx)
 
template<typename Property , typename Object >
auto add_value_property (ossia::net::node_base &n, Object &obj, const std::string &name, QObject *context)
 
template<>
Interval * ScenarioComponentBase::make< Interval, Scenario::IntervalModel > (Scenario::IntervalModel &elt)
 
template<>
Event * ScenarioComponentBase::make< Event, Scenario::EventModel > (Scenario::EventModel &elt)
 
template<>
TimeSync * ScenarioComponentBase::make< TimeSync, Scenario::TimeSyncModel > (Scenario::TimeSyncModel &elt)
 
template<>
State * ScenarioComponentBase::make< State, Scenario::StateModel > (Scenario::StateModel &elt)
 
template<>
ScriptableInterval * ScriptableScenarioBase::make< ScriptableInterval, Scenario::IntervalModel > (Scenario::IntervalModel &elt)
 
template<>
ScriptableEvent * ScriptableScenarioBase::make< ScriptableEvent, Scenario::EventModel > (Scenario::EventModel &elt)
 
template<>
ScriptableTimeSync * ScriptableScenarioBase::make< ScriptableTimeSync, Scenario::TimeSyncModel > (Scenario::TimeSyncModel &elt)
 
template<>
ScriptableState * ScriptableScenarioBase::make< ScriptableState, Scenario::StateModel > (Scenario::StateModel &elt)
 
::State::Address scriptableAddress (const Scenario::TimeSyncModel &sync)
 
::State::Address scriptableAddress (const Scenario::EventModel &event)
 

Typedef Documentation

◆ AnchorMapping

using LocalTree::AnchorMapping = typedef std::function<std::shared_ptr<const ::State::Anchor>( const std::shared_ptr<const ::State::Anchor>&)>

Replaces each anchor of the tree or expression with the mapping's result; a null result removes the anchor

Enumeration Type Documentation

◆ AddressStatus

enum class LocalTree::AddressStatus
strong

Whether the document has what an address names. Patterns and addresses of devices not shown in the explorer count as Found.

Enumerator
Unpublished 

On the local device, but nothing is published there.

◆ ControlWrites

enum class LocalTree::ControlWrites
strong

What a value written into a published control does.

Enumerator
Edit 

Undoable command.

Execution 

Sent to the execution only, displayed until stop.

Record 

The whole run becomes one command at stop.

Drop 

Ignored, e.g. the end state sent at stop.

◆ Recall

enum class LocalTree::Recall : uint8_t
strong

Which state sent outside of a scenario run the values of published controls come from.

Enumerator
Stop 

The end state, sent at stop.

State 

A state played while stopped.

Function Documentation

◆ derived()

State::Address LocalTree::derived ( const ::State::Address &  a,
const score::DocumentContext &  ctx 
)

The address updated from its anchor; unchanged when it has no anchor or the anchored object does not publish anymore.

◆ isProcessState()

bool LocalTree::isProcessState ( const ::State::Address &  a,
const score::DocumentContext &  ctx 
)

Whether the address is the state node of a published process, whose value is an opaque blob not meant to be edited by hand

◆ published()

std::optional< bool > LocalTree::published ( const ::State::Address &  a,
const score::DocumentContext &  ctx 
)

Whether something is published at this local-device address; nullopt when the address is not on the local device.

◆ settle()

void LocalTree::settle ( ::State::Address &  a,
const score::DocumentContext &  ctx 
)

Reconciles address and anchor: an anchor publishing elsewhere is dropped, a dangling one yields to the object at the address, a bare address gets anchored.