tracktion-engine 3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications

« « « Anklang Documentation
Loading...
Searching...
No Matches
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...

#include "tracktion_LoopInfo.h"

Classes

struct  LoopPoint
 

Public Types

enum class  LoopPointType { manual , 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.
 
LoopInfooperator= (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

Engineengine
 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.

Definition at line 18 of file tracktion_LoopInfo.h.

Member Enumeration Documentation

◆ LoopPointType

Enum to represet the type of loop point.

Enumerator
manual 

A manual loop point.

automatic 

An automatoc loop point.

Definition at line 99 of file tracktion_LoopInfo.h.

Constructor & Destructor Documentation

◆ LoopInfo() [1/5]

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

Creates an empty LoopInfo.

Definition at line 14 of file tracktion_LoopInfo.cpp.

◆ LoopInfo() [2/5]

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

Creates a copy of another LoopInfo.

Definition at line 47 of file tracktion_LoopInfo.cpp.

◆ LoopInfo() [3/5]

tracktion::engine::LoopInfo::LoopInfo ( Engine e,
const juce::ValueTree v,
juce::UndoManager u 
)

Creates a LoopInfo from some existing state.

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

Definition at line 41 of file tracktion_LoopInfo.cpp.

◆ LoopInfo() [4/5]

tracktion::engine::LoopInfo::LoopInfo ( Engine e,
const juce::File f 
)

Creates a LoopInfo for an audio file.

Definition at line 20 of file tracktion_LoopInfo.cpp.

◆ LoopInfo() [5/5]

tracktion::engine::LoopInfo::LoopInfo ( Engine e,
const juce::AudioFormatReader afr,
const juce::AudioFormat af,
const juce::File f 
)

Creates a LoopInfo for a reader.

Optionally pass filename to extract metadata from name

Definition at line 35 of file tracktion_LoopInfo.cpp.

Member Function Documentation

◆ addLoopPoint()

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

Adds a loop point at the given position.

Definition at line 168 of file tracktion_LoopInfo.cpp.

◆ addTag()

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

Adds a tag.

This could be descriptive info like major/minor etc.

Definition at line 219 of file tracktion_LoopInfo.cpp.

◆ addTags()

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

Adds multiple tags.

See also
addTag

Definition at line 229 of file tracktion_LoopInfo.cpp.

◆ changeLoopPoint()

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

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

Definition at line 180 of file tracktion_LoopInfo.cpp.

◆ clearLoopPoints() [1/2]

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

Removes all the loop points.

Definition at line 198 of file tracktion_LoopInfo.cpp.

◆ clearLoopPoints() [2/2]

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

Removes all the loop points of a given type.

Definition at line 205 of file tracktion_LoopInfo.cpp.

◆ clearTags()

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

Removes all the tags.

Definition at line 216 of file tracktion_LoopInfo.cpp.

◆ deleteLoopPoint()

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

Removes the loop point at the given index.

Definition at line 190 of file tracktion_LoopInfo.cpp.

◆ getBeatsPerSecond()

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

Returns the tempo of the object.

Definition at line 102 of file tracktion_LoopInfo.cpp.

◆ getBpm()

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

Returns the tempo of the object.

Definition at line 59 of file tracktion_LoopInfo.cpp.

◆ getDenominator()

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

Returns the denominator of the object.

Definition at line 127 of file tracktion_LoopInfo.cpp.

◆ getInMarker()

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

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

Definition at line 143 of file tracktion_LoopInfo.cpp.

◆ getLoopPoint()

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

Returns the loop points at the given index.

Definition at line 156 of file tracktion_LoopInfo.cpp.

◆ getNumBeats()

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

Returns the number of beats.

Definition at line 131 of file tracktion_LoopInfo.cpp.

◆ getNumerator()

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

Returns the numerator of the object.

Definition at line 128 of file tracktion_LoopInfo.cpp.

◆ getNumLoopPoints()

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

Returns the number of loop points in the object.

Definition at line 150 of file tracktion_LoopInfo.cpp.

◆ getNumTags()

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

Returns the number of tags.

Definition at line 215 of file tracktion_LoopInfo.cpp.

◆ getOutMarker()

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

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

Definition at line 144 of file tracktion_LoopInfo.cpp.

◆ getRootNote()

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

Returns the root note of the object.

Definition at line 139 of file tracktion_LoopInfo.cpp.

◆ getTag()

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

Returns the tag at a given index.

Definition at line 217 of file tracktion_LoopInfo.cpp.

◆ isLoopable()

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

Returns true if this can be looped.

Definition at line 135 of file tracktion_LoopInfo.cpp.

◆ 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.

Definition at line 136 of file tracktion_LoopInfo.cpp.

◆ operator=()

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

Creates a copy of another LoopInfo.

Definition at line 53 of file tracktion_LoopInfo.cpp.

◆ setBpm()

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

Sets the tempo of the object.

Definition at line 74 of file tracktion_LoopInfo.cpp.

◆ setDenominator()

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

Sets the denominator of the object.

Definition at line 129 of file tracktion_LoopInfo.cpp.

◆ setInMarker()

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

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

Definition at line 146 of file tracktion_LoopInfo.cpp.

◆ setNumBeats()

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

Sets the number of beats.

Definition at line 132 of file tracktion_LoopInfo.cpp.

◆ setNumerator()

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

Sets the numerator of the object.

Definition at line 130 of file tracktion_LoopInfo.cpp.

◆ setOutMarker()

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

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

Definition at line 147 of file tracktion_LoopInfo.cpp.

◆ setRootNote()

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

Sets the root note of the object.

Definition at line 140 of file tracktion_LoopInfo.cpp.

Member Data Documentation

◆ engine

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

The engine this belongs to.

Definition at line 151 of file tracktion_LoopInfo.h.

◆ state

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

Definition at line 152 of file tracktion_LoopInfo.h.


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