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

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

#include <tracktion_LoopInfo.h>

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

Public Attributes

Engine & engine
 The engine this belongs to.
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]

engine::LoopInfo::LoopInfo ( Engine & )

Creates an empty LoopInfo.

Referenced by LoopInfo(), and operator=().

◆ LoopInfo() [2/5]

engine::LoopInfo::LoopInfo ( const LoopInfo & )

Creates a copy of another LoopInfo.

References LoopInfo().

◆ LoopInfo() [3/5]

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]

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

Creates a LoopInfo for an audio file.

◆ LoopInfo() [5/5]

engine::LoopInfo::LoopInfo ( Engine & ,
const juce::AudioFormatReader * ,
const juce::AudioFormat * ,
const juce::File & f )

Creates a LoopInfo for a reader.

Optionally pass filename to extract metadata from name

Member Function Documentation

◆ operator=()

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

Creates a copy of another LoopInfo.

References LoopInfo().

◆ getBpm()

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

Returns the tempo of the object.

◆ getBeatsPerSecond()

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

Returns the tempo of the object.

◆ setBpm()

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

Sets the tempo of the object.

◆ getDenominator()

int engine::LoopInfo::getDenominator ( ) const

Returns the denominator of the object.

◆ getNumerator()

int engine::LoopInfo::getNumerator ( ) const

Returns the numerator of the object.

◆ setDenominator()

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

Sets the denominator of the object.

◆ setNumerator()

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

Sets the numerator of the object.

◆ getNumBeats()

double engine::LoopInfo::getNumBeats ( ) const

Returns the number of beats.

◆ setNumBeats()

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

Sets the number of beats.

◆ isLoopable()

bool engine::LoopInfo::isLoopable ( ) const

Returns true if this can be looped.

◆ isOneShot()

bool 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 engine::LoopInfo::getRootNote ( ) const

Returns the root note of the object.

◆ setRootNote()

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

Sets the root note of the object.

◆ getInMarker()

SampleCount engine::LoopInfo::getInMarker ( ) const

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

◆ getOutMarker()

SampleCount engine::LoopInfo::getOutMarker ( ) const

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

◆ setInMarker()

void engine::LoopInfo::setInMarker ( SampleCount )

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

◆ setOutMarker()

void engine::LoopInfo::setOutMarker ( SampleCount )

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

◆ getNumLoopPoints()

int engine::LoopInfo::getNumLoopPoints ( ) const

Returns the number of loop points in the object.

◆ getLoopPoint()

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

Returns the loop points at the given index.

◆ addLoopPoint()

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

Adds a loop point at the given position.

◆ changeLoopPoint()

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

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

◆ deleteLoopPoint()

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

Removes the loop point at the given index.

◆ clearLoopPoints() [1/2]

void engine::LoopInfo::clearLoopPoints ( )

Removes all the loop points.

◆ clearLoopPoints() [2/2]

void engine::LoopInfo::clearLoopPoints ( LoopPointType )

Removes all the loop points of a given type.

◆ getNumTags()

int engine::LoopInfo::getNumTags ( ) const

Returns the number of tags.

◆ clearTags()

void engine::LoopInfo::clearTags ( )

Removes all the tags.

◆ getTag()

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

Returns the tag at a given index.

◆ addTag()

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

Adds a tag.

This could be descriptive info like major/minor etc.

◆ addTags()

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

Adds multiple tags.

See also
addTag

Member Data Documentation

◆ engine

Engine& engine::LoopInfo::engine

The engine this belongs to.

◆ state

juce::ValueTree engine::LoopInfo::state

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