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

Holds tempo/beat information about an audio file. More...

Classes

struct  LoopPoint
 

Public Types

enum class  LoopPointType { manual = 0 , automatic }
 Enum to represet the type of loop point. More...
 

Public Member Functions

 LoopInfo (Engine &)
 Creates an empty LoopInfo. More...
 
 LoopInfo (const LoopInfo &)
 Creates a copy of another LoopInfo. More...
 
 LoopInfo (Engine &, const juce::ValueTree &, juce::UndoManager *)
 Creates a LoopInfo from some existing state. More...
 
 LoopInfo (Engine &, const juce::File &)
 Creates a LoopInfo for an audio file. More...
 
 LoopInfo (Engine &, const juce::AudioFormatReader *, const juce::AudioFormat *)
 Creates a LoopInfo for a reader. More...
 
LoopInfooperator= (const LoopInfo &)
 Creates a copy of another LoopInfo. More...
 
double getBpm (const AudioFileInfo &) const
 Returns the tempo of the object. More...
 
double getBeatsPerSecond (const AudioFileInfo &) const
 Returns the tempo of the object. More...
 
void setBpm (double newBpm, const AudioFileInfo &)
 Sets the tempo of the object. More...
 
int getDenominator () const
 Returns the denominator of the object. More...
 
int getNumerator () const
 Returns the numerator of the object. More...
 
void setDenominator (int newDenominator)
 Sets the denominator of the object. More...
 
void setNumerator (int newNumerator)
 Sets the numerator of the object. More...
 
double getNumBeats () const
 Returns the number of beats. More...
 
void setNumBeats (double newNumBeats)
 Sets the number of beats. More...
 
bool isLoopable () const
 Returns true if this can be looped. More...
 
bool isOneShot () const
 Returns true if this can be is a one-shot e.g. More...
 
int getRootNote () const
 Returns the root note of the object. More...
 
void setRootNote (int note)
 Sets the root note of the object. More...
 
SampleCount getInMarker () const
 Returns the sample number used as the start point in the file. More...
 
SampleCount getOutMarker () const
 Returns the sample number used as the end point in the file. More...
 
void setInMarker (SampleCount)
 Sets the sample number to be used as the start point in the file. More...
 
void setOutMarker (SampleCount)
 Sets the sample number to be used as the end point in the file. More...
 
int getNumLoopPoints () const
 Returns the number of loop points in the object. More...
 
LoopPoint getLoopPoint (int index) const
 Returns the loop points at the given index. More...
 
void addLoopPoint (SampleCount, LoopPointType)
 Adds a loop point at the given position. More...
 
void changeLoopPoint (int index, SampleCount, LoopPointType)
 Sets the loop point at the given index to a new position and type. More...
 
void deleteLoopPoint (int index)
 Removes the loop point at the given index. More...
 
void clearLoopPoints ()
 Removes all the loop points. More...
 
void clearLoopPoints (LoopPointType)
 Removes all the loop points of a given type. More...
 
int getNumTags () const
 Returns the number of tags. More...
 
void clearTags ()
 Removes all the tags. More...
 
juce::String getTag (int index) const
 Returns the tag at a given index. More...
 
void addTag (const juce::String &tag)
 Adds a tag. More...
 
void addTags (const juce::StringArray &tags)
 Adds multiple tags. More...
 

Public Attributes

Engineengine
 The engine this belongs to. More...
 
juce::ValueTree state
 

Detailed Description

Holds tempo/beat information about an audio file.

Used by AudioClipBase to sync it to the Edit.

Member Enumeration Documentation

◆ LoopPointType

Enum to represet the type of loop point.

Enumerator
manual 

A manual loop point.

automatic 

An automatoc loop point.

Constructor & Destructor Documentation

◆ LoopInfo() [1/5]

tracktion::engine::LoopInfo::LoopInfo ( Engine )

Creates an empty LoopInfo.

◆ LoopInfo() [2/5]

tracktion::engine::LoopInfo::LoopInfo ( const LoopInfo )

Creates a copy of another LoopInfo.

◆ LoopInfo() [3/5]

tracktion::engine::LoopInfo::LoopInfo ( Engine ,
const juce::ValueTree &  ,
juce::UndoManager *   
)

Creates a LoopInfo from some existing state.

N.B. this references the given state, it doesn't make a deep copy.

◆ LoopInfo() [4/5]

tracktion::engine::LoopInfo::LoopInfo ( Engine ,
const juce::File &   
)

Creates a LoopInfo for an audio file.

◆ LoopInfo() [5/5]

tracktion::engine::LoopInfo::LoopInfo ( Engine ,
const juce::AudioFormatReader *  ,
const juce::AudioFormat *   
)

Creates a LoopInfo for a reader.

Member Function Documentation

◆ operator=()

LoopInfo& tracktion::engine::LoopInfo::operator= ( const LoopInfo )

Creates a copy of another LoopInfo.

◆ getBpm()

double tracktion::engine::LoopInfo::getBpm ( const AudioFileInfo ) const

Returns the tempo of the object.

◆ getBeatsPerSecond()

double tracktion::engine::LoopInfo::getBeatsPerSecond ( const AudioFileInfo ) const

Returns the tempo of the object.

◆ setBpm()

void tracktion::engine::LoopInfo::setBpm ( double  newBpm,
const AudioFileInfo  
)

Sets the tempo of the object.

◆ getDenominator()

int tracktion::engine::LoopInfo::getDenominator ( ) const

Returns the denominator of the object.

◆ getNumerator()

int tracktion::engine::LoopInfo::getNumerator ( ) const

Returns the numerator of the object.

◆ setDenominator()

void tracktion::engine::LoopInfo::setDenominator ( int  newDenominator)

Sets the denominator of the object.

◆ setNumerator()

void tracktion::engine::LoopInfo::setNumerator ( int  newNumerator)

Sets the numerator of the object.

◆ getNumBeats()

double tracktion::engine::LoopInfo::getNumBeats ( ) const

Returns the number of beats.

◆ setNumBeats()

void tracktion::engine::LoopInfo::setNumBeats ( double  newNumBeats)

Sets the number of beats.

◆ isLoopable()

bool tracktion::engine::LoopInfo::isLoopable ( ) const

Returns true if this can be looped.

◆ isOneShot()

bool tracktion::engine::LoopInfo::isOneShot ( ) const

Returns true if this can be is a one-shot e.g.

a single drum hit and therefore shouldn't be looped.

◆ getRootNote()

int tracktion::engine::LoopInfo::getRootNote ( ) const

Returns the root note of the object.

◆ setRootNote()

void tracktion::engine::LoopInfo::setRootNote ( int  note)

Sets the root note of the object.

◆ getInMarker()

SampleCount tracktion::engine::LoopInfo::getInMarker ( ) const

Returns the sample number used as the start point in the file.

◆ getOutMarker()

SampleCount tracktion::engine::LoopInfo::getOutMarker ( ) const

Returns the sample number used as the end point in the file.

◆ setInMarker()

void tracktion::engine::LoopInfo::setInMarker ( SampleCount  )

Sets the sample number to be used as the start point in the file.

◆ setOutMarker()

void tracktion::engine::LoopInfo::setOutMarker ( SampleCount  )

Sets the sample number to be used as the end point in the file.

◆ getNumLoopPoints()

int tracktion::engine::LoopInfo::getNumLoopPoints ( ) const

Returns the number of loop points in the object.

◆ getLoopPoint()

LoopPoint tracktion::engine::LoopInfo::getLoopPoint ( int  index) const

Returns the loop points at the given index.

◆ addLoopPoint()

void tracktion::engine::LoopInfo::addLoopPoint ( SampleCount  ,
LoopPointType   
)

Adds a loop point at the given position.

◆ changeLoopPoint()

void tracktion::engine::LoopInfo::changeLoopPoint ( int  index,
SampleCount  ,
LoopPointType   
)

Sets the loop point at the given index to a new position and type.

◆ deleteLoopPoint()

void tracktion::engine::LoopInfo::deleteLoopPoint ( int  index)

Removes the loop point at the given index.

◆ clearLoopPoints() [1/2]

void tracktion::engine::LoopInfo::clearLoopPoints ( )

Removes all the loop points.

◆ clearLoopPoints() [2/2]

void tracktion::engine::LoopInfo::clearLoopPoints ( LoopPointType  )

Removes all the loop points of a given type.

◆ getNumTags()

int tracktion::engine::LoopInfo::getNumTags ( ) const

Returns the number of tags.

◆ clearTags()

void tracktion::engine::LoopInfo::clearTags ( )

Removes all the tags.

◆ getTag()

juce::String tracktion::engine::LoopInfo::getTag ( int  index) const

Returns the tag at a given index.

◆ addTag()

void tracktion::engine::LoopInfo::addTag ( const juce::String &  tag)

Adds a tag.

This could be descriptive info like major/minor etc.

◆ addTags()

void tracktion::engine::LoopInfo::addTags ( const juce::StringArray &  tags)

Adds multiple tags.

See also
addTag

Member Data Documentation

◆ engine

Engine& tracktion::engine::LoopInfo::engine

The engine this belongs to.

◆ state

juce::ValueTree tracktion::engine::LoopInfo::state

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