TracktionEngine
Loading...
Searching...
No Matches
engine::MidiExpression Struct Reference

#include <tracktion_MidiExpression.h>

Public Member Functions

 MidiExpression (const juce::ValueTree &v)
 Creates a MidiExpression interface to an existing MIDI note state.
BeatPosition getBeatPosition () const noexcept
 Returns the beat position relative to the note's start.
void setBeatPosition (BeatPosition newBeat, juce::UndoManager *um)
 Sets the beat position.
float getValue () const noexcept
 Returns the value of the expression.
void setValue (float newValue, juce::UndoManager *um)
 Sets the value with some range validation.

Static Public Member Functions

static bool noteHasExpression (const juce::ValueTree &noteState) noexcept
 Returns true if this MidiNote is an expressive note.
static bool noteHasExpression (const juce::ValueTree &noteState, const juce::Identifier &type) noexcept
 Returns true if this MidiNote is an expressive note of type.
static bool listHasExpression (const MidiList &midiList) noexcept
 Returns true if this MidiList is an expressive note.
static bool isExpression (const juce::Identifier &type) noexcept
static juce::ValueTree createAndAddExpressionToNote (juce::ValueTree &noteState, const juce::Identifier &expressionType, BeatPosition beat, float value, juce::UndoManager *um)

Public Attributes

juce::ValueTree state

Constructor & Destructor Documentation

◆ MidiExpression()

engine::MidiExpression::MidiExpression ( const juce::ValueTree & v)

Creates a MidiExpression interface to an existing MIDI note state.

This can be either a MidiNote or expression tree.

References isExpression(), and state.

Referenced by createAndAddExpressionToNote().

Member Function Documentation

◆ noteHasExpression() [1/2]

bool engine::MidiExpression::noteHasExpression ( const juce::ValueTree & noteState)
staticnoexcept

Returns true if this MidiNote is an expressive note.

◆ noteHasExpression() [2/2]

bool engine::MidiExpression::noteHasExpression ( const juce::ValueTree & noteState,
const juce::Identifier & type )
staticnoexcept

Returns true if this MidiNote is an expressive note of type.

◆ listHasExpression()

bool engine::MidiExpression::listHasExpression ( const MidiList & midiList)
staticnoexcept

Returns true if this MidiList is an expressive note.

◆ isExpression()

bool engine::MidiExpression::isExpression ( const juce::Identifier & type)
staticnoexcept

◆ createAndAddExpressionToNote()

juce::ValueTree engine::MidiExpression::createAndAddExpressionToNote ( juce::ValueTree & noteState,
const juce::Identifier & expressionType,
BeatPosition beat,
float value,
juce::UndoManager * um )
static

◆ getBeatPosition()

BeatPosition engine::MidiExpression::getBeatPosition ( ) const
noexcept

Returns the beat position relative to the note's start.

References state.

◆ setBeatPosition()

void engine::MidiExpression::setBeatPosition ( BeatPosition newBeat,
juce::UndoManager * um )

Sets the beat position.

References state.

Referenced by createAndAddExpressionToNote().

◆ getValue()

float engine::MidiExpression::getValue ( ) const
noexcept

Returns the value of the expression.

N.B. The range will vary depending on the type.

References state.

◆ setValue()

void engine::MidiExpression::setValue ( float newValue,
juce::UndoManager * um )

Sets the value with some range validation.

References state.

Referenced by createAndAddExpressionToNote().

Member Data Documentation

◆ state

juce::ValueTree engine::MidiExpression::state

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