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

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

#include <tracktion_TempoSetting.h>

Inheritance diagram for engine::TempoSetting:

Public Types

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

Public Member Functions

 TempoSetting (TempoSequence &, const juce::ValueTree &)
 Constructs a TempoSetting belonging to a given TempoSequence.
 ~TempoSetting () override
 Destructor.
Edit & getEdit () const
 Returns the Edit this setting belongs to.
juce::String getSelectableDescription () override
 Returns the description of this Selectable.
BeatPosition getStartBeat () const
 Returns the start beat of the setting.
double getBpm () const
 Returns the BPM of the setting.
float getCurve () const
 Returns the curve of the setting.
TimePosition getStartTime () const
 Returns the start time in seconds of the tempo setting.
void set (BeatPosition, double newBpm, float newCurve, bool remapEditPositions)
 Sets the properties of this tempo setting.
void setBpm (double newBpm)
 Sets the BPM of this tempo setting.
void setCurve (float curve)
 Sets the curve of this tempo setting.
void setStartBeat (BeatPosition)
void removeFromEdit ()
 Removes the TempoSetting from the sequence.
TimeDuration getApproxBeatLength () const
 Returns the approximate length of one beat based on the bpm and matching time sig denonimator.
TempoSetting * getPreviousTempo () const
 Returns the previous tempo setting in the sequence.
TimeSigSetting & getMatchingTimeSig () const
 Returns the time signature at this tempo's time in the sequence.
HashCode getHash () const noexcept
Public Member Functions inherited from 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.
Public Member Functions inherited from 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.
virtual void selectableAboutToBeDeleted ()
 Called just before the selectable is about to be deleted so any subclasses should still be valid at this point.
void addListener (SelectableListener *)
void removeListener (SelectableListener *)
void addSelectableListener (SelectableListener *)
void removeSelectableListener (SelectableListener *)
void cancelAnyPendingUpdates ()
 If changed() has been called, this will cancel any pending async change notificaions.
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.
Static Public Member Functions inherited from engine::CurveEditorPoint
static bool arePointsConsecutive (const SelectableList &)
static bool arePointsOnSameCurve (const SelectableList &)
static EditTimeRange getPointEditPositionRange (const SelectableList &)
Static Public Member Functions inherited from engine::Selectable
static void initialise ()
static bool isSelectableValid (const Selectable *) noexcept
 checks whether this object has been deleted.

Public Attributes

TempoSequence & ownerSequence
juce::ValueTree state
juce::CachedValue< BeatPosition > startBeatNumber
juce::CachedValue< double > bpm
juce::CachedValue< float > curve
TimePosition startTime
Public Attributes inherited from engine::CurveEditorPoint
int index = 0
juce::Component::SafePointer< CurveEditor > editor
Public Attributes inherited from engine::Selectable
WeakRef::Master masterReference

Static Public Attributes

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

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 engine::TempoSetting::Ptr = juce::ReferenceCountedObjectPtr<TempoSetting>

Constructor & Destructor Documentation

◆ TempoSetting()

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.

Referenced by getPreviousTempo().

◆ ~TempoSetting()

engine::TempoSetting::~TempoSetting ( )
override

Destructor.

Member Function Documentation

◆ getEdit()

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

Returns the Edit this setting belongs to.

◆ create()

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

Creates a tree to prepresent a TempoSetting.

References bpm, and curve.

◆ getSelectableDescription()

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

Returns the description of this Selectable.

Implements engine::Selectable.

◆ getStartBeat()

BeatPosition engine::TempoSetting::getStartBeat ( ) const

Returns the start beat of the setting.

References startBeatNumber.

◆ getBpm()

double engine::TempoSetting::getBpm ( ) const

Returns the BPM of the setting.

References bpm.

◆ getCurve()

float engine::TempoSetting::getCurve ( ) const

Returns the curve of the setting.

References curve.

◆ getStartTime()

TimePosition engine::TempoSetting::getStartTime ( ) const

Returns the start time in seconds of the tempo setting.

◆ set()

void 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 engine::TempoSetting::setBpm ( double newBpm)

Sets the BPM of this tempo setting.

◆ setCurve()

void 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

References curve.

◆ setStartBeat()

void engine::TempoSetting::setStartBeat ( BeatPosition )

◆ removeFromEdit()

void engine::TempoSetting::removeFromEdit ( )

Removes the TempoSetting from the sequence.

◆ getApproxBeatLength()

TimeDuration engine::TempoSetting::getApproxBeatLength ( ) const

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

◆ getPreviousTempo()

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

Returns the previous tempo setting in the sequence.

References TempoSetting().

◆ getMatchingTimeSig()

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

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

◆ getHash()

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

Member Data Documentation

◆ minBPM

double engine::TempoSetting::minBPM = 20.0
staticconstexpr

Minimum BPM a setting can have.

◆ maxBPM

double engine::TempoSetting::maxBPM = 300.0
staticconstexpr

Maximum BPM a setting can have.

◆ ownerSequence

TempoSequence& engine::TempoSetting::ownerSequence

◆ state

juce::ValueTree engine::TempoSetting::state

◆ startBeatNumber

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

Referenced by getStartBeat().

◆ bpm

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

Referenced by create(), and getBpm().

◆ curve

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

Referenced by create(), getCurve(), and setCurve().

◆ startTime

TimePosition engine::TempoSetting::startTime

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