Loading...
Searching...
No Matches
Dataflow::WaveformInlet Struct Reference
Inheritance diagram for Dataflow::WaveformInlet:
Process::ControlInlet Process::Inlet Process::Port IdentifiedObject< Port > score::SerializableInterface< Port > IdentifiedObjectAbstract Dataflow::WavetableInlet

Detailed Description

A single periodic frame of samples for sample-backed oscillators; see WavetableInlet for an ordered bank of frames.

The value is the canonical form of Process::WavetableData (a list of frame lists) and is the only persisted content; wavetable() is updated before observers receive valueChanged. setValue takes its canonical value as it is, and any other shape execution takes (Process::waveformFrame) adapted to the port: a flat list is one frame, a single frame port keeps the first frame of a bank, samples are clamped, then resampled to the frame size constraint and put on the amplitude levels. A value that holds no list of numbers is ignored with a warning.

The editor, in the scene and in the inspector, draws samples with optional amplitude quantization; its context menu generates and transforms frames, resamples them and adds, removes and reorders the frames of a bank, each edit being an undoable SetControlValue command.

Editor gestures: drag draws, Shift-drag draws a straight line; on a continuous port the pen catches the zero, half and full amplitude lines unless Alt is held. With keyboard focus (click the editor): Up and Down move the hovered or last edited sample by one level (one 64th of the range when continuous; Shift for an eighth), a held key being one undo step; Left and Right rotate the frame, Page Up and Page Down choose the frame of a bank, Delete clears, and Copy and Paste exchange the frame as text (see waveformFrameText). In a bank's frame strip, drag a thumbnail to move the frame, double-click to duplicate it, and use the wheel to choose.

Like any control inlet, these ports take cables and addresses and are registered for execution: a list of numbers arriving there is one frame, a list of lists a bank (Process::waveformFrame). A node resamples what it receives into its fixed native arrays with Process::prepareWaveform, which reads the value in place. Values execution sends back to the UI through setExecutionValue are drawn over the edited frame, as other controls show theirs, without changing the document.

Public Member Functions

SCORE_SERIALIZE_FRIENDS WaveformInlet (Id< Process::Port > id, QObject *parent)
 
 WaveformInlet (DataStream::Deserializer &vis, QObject *parent)
 
 WaveformInlet (JSONObject::Deserializer &vis, QObject *parent)
 
 WaveformInlet (DataStream::Deserializer &&vis, QObject *parent)
 
 WaveformInlet (JSONObject::Deserializer &&vis, QObject *parent)
 
void setValue (const ossia::value &value) override
 
void setWaveform (const Process::WavetableData &waveform)
 
const Process::WavetableData & wavetable () const noexcept
 
void setAmplitudeLevels (int levels)
 Zero means continuous; otherwise painting and preview use this many levels.
 
int amplitudeLevels () const noexcept
 
void setFrameSizeConstraint (std::size_t size)
 Zero permits explicit resampling to any supported frame size.
 
std::size_t frameSizeConstraint () const noexcept
 
bool supportsFrames () const noexcept
 
void constraintsChanged ()
 
- Public Member Functions inherited from Process::ControlInlet
 ControlInlet (const ControlInlet &)=delete
 
 ControlInlet (const QString &name, Id< Process::Port > c, QObject *parent)
 
 ControlInlet (DataStream::Deserializer &vis, QObject *parent, bool skip_this=false)
 
 ControlInlet (JSONObject::Deserializer &vis, QObject *parent, bool skip_this=false)
 
 ControlInlet (DataStream::Deserializer &&vis, QObject *parent, bool skip_this=false)
 
 ControlInlet (JSONObject::Deserializer &&vis, QObject *parent, bool skip_this=false)
 
PortType type () const noexcept override
 
const ossia::value & value () const noexcept
 
const ossia::value & init () const noexcept
 
const State::Domain & domain () const noexcept
 
QByteArray saveData () const noexcept override
 
void loadData (const QByteArray &arr, PortLoadDataFlags={}) noexcept override
 
void valueChanged (const ossia::value &v)
 
void initChanged (const ossia::value &v)
 
void executionValueChanged (const ossia::value &v)
 
void domainChanged (const State::Domain &d)
 
void setInit (const ossia::value &value)
 
void setExecutionValue (const ossia::value &value)
 
void setDomain (const State::Domain &d)
 
- Public Member Functions inherited from Process::Inlet
 ~Inlet () override
 Inlet.
 
virtual void setupExecution (ossia::inlet &, QObject *exec_context) const noexcept
 
virtual void forChildInlets (const smallfun::function< void(Inlet &)> &) const noexcept
 
virtual void mapExecution (ossia::inlet &, const smallfun::function< void(Inlet &, ossia::inlet &)> &) const noexcept
 
- Public Member Functions inherited from Process::Port
void addCable (const Process::Cable &c)
 
void removeCable (const Path< Process::Cable > &c)
 
void takeCables (Process::Port &&c)
 
const QString & visualName () const noexcept
 The name, or what the port is published as when it has none.
 
const QString & visualDescription () const noexcept
 
const QString & name () const noexcept
 
const State::AddressAccessor & address () const noexcept
 
const std::vector< Path< Cable > > & cables () const noexcept
 
const QString & exposed () const noexcept
 Name published under score:/controls; follows name() unless set explicitly.
 
bool hasOwnExposed () const noexcept
 
bool scriptable () const noexcept
 
const QString & description () const noexcept
 
virtual const State::Unit & unit () const noexcept
 
void setUnit (State::Unit u) noexcept
 
virtual Device::FullAddressAccessorSettings settings () const noexcept
 
virtual void setSettings (const Device::FullAddressAccessorSettings &set) noexcept
 
void setName (const QString &customData)
 
void setExposed (const QString &add)
 
void resetExposed ()
 exposed() follows the port name again
 
void setScriptable (bool b)
 
void setDescription (const QString &add)
 
void setAddress (const State::AddressAccessor &address)
 
void nameChanged (const QString &name)
 
void exposedChanged (const QString &addr)
 
void scriptableChanged (bool b)
 
void descriptionChanged (const QString &txt)
 
void cablesChanged ()
 
void addressChanged (const State::AddressAccessor &address)
 
void executionReset ()
 
- Public Member Functions inherited from IdentifiedObject< Port >
 IdentifiedObject (id_type id, const QString &name, QObject *parent) noexcept
 
 IdentifiedObject (Visitor &&v, QObject *parent) noexcept
 
const id_type & id () const noexcept
 
int32_t id_val () const noexcept final override
 
void setId (const id_type &id) noexcept
 
void setId (id_type &&id) noexcept
 
void resetCache () const noexcept override
 
- Public Member Functions inherited from IdentifiedObjectAbstract
void identified_object_destroying (IdentifiedObjectAbstract *o)
 To be called by subclasses.
 
void identified_object_destroyed (IdentifiedObjectAbstract *o)
 Will be called in the IdentifiedObjectAbstract destructor.
 
- Public Member Functions inherited from score::SerializableInterface< Port >
virtual UuidKey< Port > concreteKey () const noexcept=0
 
virtual void serialize_impl (const VisitorVariant &vis) const
 

Protected Member Functions

 WaveformInlet (Id< Process::Port > id, QObject *parent, bool bank)
 
 WaveformInlet (DataStream::Deserializer &vis, QObject *parent, bool bank)
 
 WaveformInlet (JSONObject::Deserializer &vis, QObject *parent, bool bank)
 
- Protected Member Functions inherited from Process::ControlInlet
void setDomainWithoutNotifying (const State::Domain &d) noexcept
 
- Protected Member Functions inherited from Process::Inlet
 Inlet (const Inlet &)=delete
 
 Inlet (const QString &name, Id< Process::Port > c, QObject *parent)
 
 Inlet (DataStream::Deserializer &vis, QObject *parent)
 
 Inlet (JSONObject::Deserializer &vis, QObject *parent)
 
 Inlet (DataStream::Deserializer &&vis, QObject *parent)
 
 Inlet (JSONObject::Deserializer &&vis, QObject *parent)
 
- Protected Member Functions inherited from Process::Port
void savePublication (DataStreamInput &s) const
 
void loadPublication (DataStreamOutput &s)
 
 Port (const Port &)=delete
 
 Port (Id< Port > c, const QString &name, QObject *parent)
 
 Port (DataStream::Deserializer &vis, QObject *parent)
 
 Port (JSONObject::Deserializer &vis, QObject *parent)
 
 Port (DataStream::Deserializer &&vis, QObject *parent)
 
 Port (JSONObject::Deserializer &&vis, QObject *parent)
 
- Protected Member Functions inherited from IdentifiedObjectAbstract
 IdentifiedObjectAbstract (const QString &name, QObject *parent) noexcept
 

Additional Inherited Members

- Public Types inherited from Process::Inlet
using score_base_type = Inlet
 
- Public Types inherited from IdentifiedObject< Port >
using model_type = Port
 
using id_type = Id< Port >
 
using object_type = IdentifiedObject< Port >
 
- Public Types inherited from score::SerializableInterface< Port >
using key_type = UuidKey< Port >
 
using is_abstract_base_tag = std::integral_constant< bool, true >
 
- Public Attributes inherited from Process::Port
Selectable selection {this}
 
bool displayHandledExplicitly {}
 
bool visibleWhenFolded {}
 
bool noValueChangeOnMove {}
 
bool changesPorts {}
 The value of this control decides which ports the process has.
 
bool stableIdentity {}
 
bool singleCable {}
 
- Public Attributes inherited from IdentifiedObject< Port >
Path< Port > m_path_cache
 
- Static Public Attributes inherited from IdentifiedObject< Port >
static const constexpr bool identified_object_tag
 
- Protected Attributes inherited from Process::Port
std::vector< Path< Cable > > m_cables
 
QString m_name
 
QString m_exposed
 
QString m_description
 
State::AddressAccessor m_address
 
State::Unit m_unit
 
bool m_scriptable {}
 

Member Function Documentation

◆ setValue()

void Dataflow::WaveformInlet::setValue ( const ossia::value &  value)
overridevirtual

Reimplemented from Process::ControlInlet.


The documentation for this struct was generated from the following files: