TracktionEngine
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
tracktion::engine::TempoSetting Class Reference

A tempo value, as used in a TempoSequence. More...

Inheritance diagram for tracktion::engine::TempoSetting:

Public Types

using Ptr = juce::ReferenceCountedObjectPtr< TempoSetting >
 
- Public Types inherited from tracktion::engine::Selectable
using WeakRef = juce::WeakReference< Selectable >
 

Public Member Functions

 TempoSetting (TempoSequence &, const juce::ValueTree &)
 Constructs a TempoSetting belonging to a given TempoSequence. More...
 
 ~TempoSetting () override
 Destructor. More...
 
EditgetEdit () const
 Returns the Edit this setting belongs to. More...
 
juce::String getSelectableDescription () override
 Returns the description of this Selectable. More...
 
BeatPosition getStartBeat () const
 Returns the start beat of the setting. More...
 
double getBpm () const
 Returns the BPM of the setting. More...
 
float getCurve () const
 Returns the curve of the setting. More...
 
TimePosition getStartTime () const
 Returns the start time in seconds of the tempo setting. More...
 
void set (BeatPosition, double newBpm, float newCurve, bool remapEditPositions)
 Sets the properties of this tempo setting. More...
 
void setBpm (double newBpm)
 Sets the BPM of this tempo setting. More...
 
void setCurve (float curve)
 Sets the curve of this tempo setting. More...
 
void setStartBeat (BeatPosition)
 
void removeFromEdit ()
 Removes the TempoSetting from the sequence. More...
 
TimeDuration getApproxBeatLength () const
 Returns the approximate length of one beat based on the bpm and matching time sig denonimator. More...
 
TempoSettinggetPreviousTempo () const
 Returns the previous tempo setting in the sequence. More...
 
TimeSigSettinggetMatchingTimeSig () const
 Returns the time signature at this tempo's time in the sequence. More...
 
HashCode getHash () const noexcept
 
- Public Member Functions inherited from tracktion::engine::CurveEditorPoint
 CurveEditorPoint () noexcept
 
 CurveEditorPoint (int i, CurveEditor *ed)
 
 ~CurveEditorPoint () override
 
void selectionStatusChanged (bool isNowSelected) override
 Can be overridden to tell this object that it has just been selected or deselected. More...
 
- Public Member Functions inherited from tracktion::engine::Selectable
 Selectable ()
 
virtual ~Selectable ()
 
virtual void changed ()
 This should be called to send a change notification to any SelectableListeners that are registered with this object. More...
 
virtual void selectableAboutToBeDeleted ()
 Called just before the selectable is about to be deleted so any subclasses should still be valid at this point. More...
 
void addSelectableListener (SelectableListener *)
 
void removeSelectableListener (SelectableListener *)
 
void cancelAnyPendingUpdates ()
 If changed() has been called, this will cancel any pending async change notificaions. More...
 
void deselect ()
 
void propertiesChanged ()
 
void notifyListenersOfDeletion ()
 
WeakRef getWeakRef ()
 

Static Public Member Functions

static juce::ValueTree create (BeatPosition startBeat, double bpm, float curve)
 Creates a tree to prepresent a TempoSetting. More...
 
- Static Public Member Functions inherited from tracktion::engine::CurveEditorPoint
static bool arePointsConsecutive (const SelectableList &)
 
static bool arePointsOnSameCurve (const SelectableList &)
 
static TimeRange getPointTimeRange (const SelectableList &)
 
- Static Public Member Functions inherited from tracktion::engine::Selectable
static void initialise ()
 
static bool isSelectableValid (const Selectable *) noexcept
 checks whether this object has been deleted. More...
 

Public Attributes

TempoSequenceownerSequence
 
juce::ValueTree state
 
juce::CachedValue< BeatPosition > startBeatNumber
 
juce::CachedValue< double > bpm
 
juce::CachedValue< float > curve
 
TimePosition startTime
 
- Public Attributes inherited from tracktion::engine::CurveEditorPoint
int index = 0
 
juce::Component::SafePointer< CurveEditoreditor
 
- Public Attributes inherited from tracktion::engine::Selectable
WeakRef::Master masterReference
 

Static Public Attributes

static constexpr double minBPM = 20.0
 Minimum BPM a setting can have. More...
 
static constexpr double maxBPM = 300.0
 Maximum BPM a setting can have. More...
 

Detailed Description

A tempo value, as used in a TempoSequence.

This specifies the BPM, time sig, etc. at a particular time

Member Typedef Documentation

◆ Ptr

using tracktion::engine::TempoSetting::Ptr = juce::ReferenceCountedObjectPtr<TempoSetting>

Constructor & Destructor Documentation

◆ TempoSetting()

tracktion::engine::TempoSetting::TempoSetting ( TempoSequence ,
const juce::ValueTree &   
)

Constructs a TempoSetting belonging to a given TempoSequence.

Don't construct these directly, use the appropriate insert methods of TempoSequence.

◆ ~TempoSetting()

tracktion::engine::TempoSetting::~TempoSetting ( )
override

Destructor.

Member Function Documentation

◆ getEdit()

Edit& tracktion::engine::TempoSetting::getEdit ( ) const

Returns the Edit this setting belongs to.

◆ create()

static juce::ValueTree tracktion::engine::TempoSetting::create ( BeatPosition  startBeat,
double  bpm,
float  curve 
)
static

Creates a tree to prepresent a TempoSetting.

◆ getSelectableDescription()

juce::String tracktion::engine::TempoSetting::getSelectableDescription ( )
overridevirtual

Returns the description of this Selectable.

Implements tracktion::engine::Selectable.

◆ getStartBeat()

BeatPosition tracktion::engine::TempoSetting::getStartBeat ( ) const

Returns the start beat of the setting.

References startBeatNumber.

◆ getBpm()

double tracktion::engine::TempoSetting::getBpm ( ) const

Returns the BPM of the setting.

References bpm.

◆ getCurve()

float tracktion::engine::TempoSetting::getCurve ( ) const

Returns the curve of the setting.

References curve.

◆ getStartTime()

TimePosition tracktion::engine::TempoSetting::getStartTime ( ) const

Returns the start time in seconds of the tempo setting.

◆ set()

void tracktion::engine::TempoSetting::set ( BeatPosition  ,
double  newBpm,
float  newCurve,
bool  remapEditPositions 
)

Sets the properties of this tempo setting.

Parameters
startBeatNumThe new start beat number to set.
newBpmThe new bpm value to set.
newCurveThe new curve to set.
remapEditPositionsIf true, this will adjust any Edit items start/end positions so they fall on the same beat as they currently do.

◆ setBpm()

void tracktion::engine::TempoSetting::setBpm ( double  newBpm)

Sets the BPM of this tempo setting.

◆ setCurve()

void tracktion::engine::TempoSetting::setCurve ( float  curve)

Sets the curve of this tempo setting.

<0.0 is a log curve 0.0 is a linear curve >0.0 is an exponential curve

◆ setStartBeat()

void tracktion::engine::TempoSetting::setStartBeat ( BeatPosition  )

◆ removeFromEdit()

void tracktion::engine::TempoSetting::removeFromEdit ( )

Removes the TempoSetting from the sequence.

◆ getApproxBeatLength()

TimeDuration tracktion::engine::TempoSetting::getApproxBeatLength ( ) const

Returns the approximate length of one beat based on the bpm and matching time sig denonimator.

◆ getPreviousTempo()

TempoSetting* tracktion::engine::TempoSetting::getPreviousTempo ( ) const

Returns the previous tempo setting in the sequence.

◆ getMatchingTimeSig()

TimeSigSetting& tracktion::engine::TempoSetting::getMatchingTimeSig ( ) const

Returns the time signature at this tempo's time in the sequence.

◆ getHash()

HashCode tracktion::engine::TempoSetting::getHash ( ) const
noexcept

Member Data Documentation

◆ minBPM

constexpr double tracktion::engine::TempoSetting::minBPM = 20.0
staticconstexpr

Minimum BPM a setting can have.

◆ maxBPM

constexpr double tracktion::engine::TempoSetting::maxBPM = 300.0
staticconstexpr

Maximum BPM a setting can have.

◆ ownerSequence

TempoSequence& tracktion::engine::TempoSetting::ownerSequence

◆ state

juce::ValueTree tracktion::engine::TempoSetting::state

◆ startBeatNumber

juce::CachedValue<BeatPosition> tracktion::engine::TempoSetting::startBeatNumber

Referenced by getStartBeat().

◆ bpm

juce::CachedValue<double> tracktion::engine::TempoSetting::bpm

Referenced by getBpm().

◆ curve

juce::CachedValue<float> tracktion::engine::TempoSetting::curve

Referenced by getCurve().

◆ startTime

TimePosition tracktion::engine::TempoSetting::startTime

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