TracktionEngine
Loading...
Searching...
No Matches
engine::QuantisationType Class Reference

#include <tracktion_QuantisationType.h>

Inherits juce::ValueTree::Listener.

Public Member Functions

 QuantisationType ()
 QuantisationType (const juce::ValueTree &, juce::UndoManager *)
 ~QuantisationType () override
 QuantisationType (const QuantisationType &)
QuantisationType & operator= (const QuantisationType &)
bool operator== (const QuantisationType &) const
void applyQuantisationToSequence (juce::MidiMessageSequence &, Edit &, TimePosition sequenceStartOffset)
bool isEnabled () const
 this type may represent "no quantising"
void setType (const juce::String &newTypeName)
juce::String getType (bool translated) const
juce::String getType (bool translated, int timeSigDenominator) const
juce::String getType (bool translated, const Edit &) const
int getTimecodeSnapTypeLevel (bool &isTriplet) const noexcept
 Returns the TimecodeSnapType level for the current quantisation type.
float getProportion () const
 the proportion 0..1 of the amount to quantise stuff by.
void setProportion (float prop)
bool isQuantisingNoteOffs () const
 If false, quantising a note on will keep the note its original length.
void setIsQuantisingNoteOffs (bool isQuantising)
BeatPosition roundBeatToNearest (BeatPosition beatNumber) const
BeatPosition roundBeatUp (BeatPosition beatNumber) const
BeatPosition roundBeatToNearestNonZero (BeatPosition beatNumber) const
TimePosition roundToNearest (TimePosition, const Edit &) const
TimePosition roundUp (TimePosition, const Edit &) const

Static Public Member Functions

static juce::StringArray getAvailableQuantiseTypes (bool translated)
static juce::StringArray getAvailableQuantiseTypes (bool translated, int timeSigDenominator)
 Returns the list of quantise types, annotated with their musical note equivalents to avoid confusion between beat fractions and note names.
static juce::StringArray getAvailableQuantiseTypes (bool translated, const Edit &)
static juce::String beatFractionToNoteName (double beatFraction, bool isTriplet, int timeSigDenominator)
static juce::String getDefaultType (bool translated)

Public Attributes

juce::ValueTree state
juce::CachedValue< juce::String > typeName
juce::CachedValue< float > proportion
juce::CachedValue< bool > quantiseNoteOffs

Constructor & Destructor Documentation

◆ QuantisationType() [1/3]

engine::QuantisationType::QuantisationType ( )

◆ QuantisationType() [2/3]

engine::QuantisationType::QuantisationType ( const juce::ValueTree & ,
juce::UndoManager *  )

◆ ~QuantisationType()

engine::QuantisationType::~QuantisationType ( )
override

◆ QuantisationType() [3/3]

engine::QuantisationType::QuantisationType ( const QuantisationType & )

References QuantisationType().

Member Function Documentation

◆ operator=()

QuantisationType & engine::QuantisationType::operator= ( const QuantisationType & )

References QuantisationType().

◆ operator==()

bool engine::QuantisationType::operator== ( const QuantisationType & ) const

References QuantisationType().

◆ applyQuantisationToSequence()

void engine::QuantisationType::applyQuantisationToSequence ( juce::MidiMessageSequence & ,
Edit & ,
TimePosition sequenceStartOffset )

◆ isEnabled()

bool engine::QuantisationType::isEnabled ( ) const

this type may represent "no quantising"

◆ getAvailableQuantiseTypes() [1/3]

juce::StringArray engine::QuantisationType::getAvailableQuantiseTypes ( bool translated)
static

◆ getAvailableQuantiseTypes() [2/3]

juce::StringArray engine::QuantisationType::getAvailableQuantiseTypes ( bool translated,
int timeSigDenominator )
static

Returns the list of quantise types, annotated with their musical note equivalents to avoid confusion between beat fractions and note names.

◆ getAvailableQuantiseTypes() [3/3]

juce::StringArray engine::QuantisationType::getAvailableQuantiseTypes ( bool translated,
const Edit &  )
static

◆ beatFractionToNoteName()

juce::String engine::QuantisationType::beatFractionToNoteName ( double beatFraction,
bool isTriplet,
int timeSigDenominator )
static

◆ getDefaultType()

juce::String engine::QuantisationType::getDefaultType ( bool translated)
static

◆ setType()

void engine::QuantisationType::setType ( const juce::String & newTypeName)

◆ getType() [1/3]

juce::String engine::QuantisationType::getType ( bool translated) const

◆ getType() [2/3]

juce::String engine::QuantisationType::getType ( bool translated,
int timeSigDenominator ) const

◆ getType() [3/3]

juce::String engine::QuantisationType::getType ( bool translated,
const Edit &  ) const

◆ getTimecodeSnapTypeLevel()

int engine::QuantisationType::getTimecodeSnapTypeLevel ( bool & isTriplet) const
noexcept

Returns the TimecodeSnapType level for the current quantisation type.

Because the TimecodeSnapType level means something different if the time sig is triplets, this also needs to return the triplet type.

◆ getProportion()

float engine::QuantisationType::getProportion ( ) const

the proportion 0..1 of the amount to quantise stuff by.

References proportion.

◆ setProportion()

void engine::QuantisationType::setProportion ( float prop)

◆ isQuantisingNoteOffs()

bool engine::QuantisationType::isQuantisingNoteOffs ( ) const

If false, quantising a note on will keep the note its original length.

If true (the default), note offs will be quantised to the same grid.

References quantiseNoteOffs.

◆ setIsQuantisingNoteOffs()

void engine::QuantisationType::setIsQuantisingNoteOffs ( bool isQuantising)

References quantiseNoteOffs.

◆ roundBeatToNearest()

BeatPosition engine::QuantisationType::roundBeatToNearest ( BeatPosition beatNumber) const

◆ roundBeatUp()

BeatPosition engine::QuantisationType::roundBeatUp ( BeatPosition beatNumber) const

◆ roundBeatToNearestNonZero()

BeatPosition engine::QuantisationType::roundBeatToNearestNonZero ( BeatPosition beatNumber) const

◆ roundToNearest()

TimePosition engine::QuantisationType::roundToNearest ( TimePosition ,
const Edit &  ) const

◆ roundUp()

TimePosition engine::QuantisationType::roundUp ( TimePosition ,
const Edit &  ) const

Member Data Documentation

◆ state

juce::ValueTree engine::QuantisationType::state

◆ typeName

juce::CachedValue<juce::String> engine::QuantisationType::typeName

◆ proportion

juce::CachedValue<float> engine::QuantisationType::proportion

Referenced by getProportion().

◆ quantiseNoteOffs

juce::CachedValue<bool> engine::QuantisationType::quantiseNoteOffs

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