TracktionEngine
|
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 |
Holds tempo/beat information about an audio file.
Used by AudioClipBase to sync it to the Edit.
|
strong |
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.
tracktion::engine::LoopInfo::LoopInfo | ( | Engine & | , |
const juce::File & | |||
) |
Creates a LoopInfo for an audio file.
tracktion::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
Creates a copy of another LoopInfo.
double tracktion::engine::LoopInfo::getBpm | ( | const AudioFileInfo & | ) | const |
Returns the tempo of the object.
double tracktion::engine::LoopInfo::getBeatsPerSecond | ( | const AudioFileInfo & | ) | const |
Returns the tempo of the object.
void tracktion::engine::LoopInfo::setBpm | ( | double | newBpm, |
const AudioFileInfo & | |||
) |
Sets the tempo of the object.
int tracktion::engine::LoopInfo::getDenominator | ( | ) | const |
Returns the denominator of the object.
int tracktion::engine::LoopInfo::getNumerator | ( | ) | const |
Returns the numerator of the object.
void tracktion::engine::LoopInfo::setDenominator | ( | int | newDenominator | ) |
Sets the denominator of the object.
void tracktion::engine::LoopInfo::setNumerator | ( | int | newNumerator | ) |
Sets the numerator of the object.
double tracktion::engine::LoopInfo::getNumBeats | ( | ) | const |
Returns the number of beats.
void tracktion::engine::LoopInfo::setNumBeats | ( | double | newNumBeats | ) |
Sets the number of beats.
bool tracktion::engine::LoopInfo::isLoopable | ( | ) | const |
Returns true if this can be looped.
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.
int tracktion::engine::LoopInfo::getRootNote | ( | ) | const |
Returns the root note of the object.
void tracktion::engine::LoopInfo::setRootNote | ( | int | note | ) |
Sets the root note of the object.
SampleCount tracktion::engine::LoopInfo::getInMarker | ( | ) | const |
Returns the sample number used as the start point in the file.
SampleCount tracktion::engine::LoopInfo::getOutMarker | ( | ) | const |
Returns the sample number used as the end point in the file.
void tracktion::engine::LoopInfo::setInMarker | ( | SampleCount | ) |
Sets the sample number to be used as the start point in the file.
void tracktion::engine::LoopInfo::setOutMarker | ( | SampleCount | ) |
Sets the sample number to be used as the end point in the file.
int tracktion::engine::LoopInfo::getNumLoopPoints | ( | ) | const |
Returns the number of loop points in the object.
LoopPoint tracktion::engine::LoopInfo::getLoopPoint | ( | int | index | ) | const |
Returns the loop points at the given index.
void tracktion::engine::LoopInfo::addLoopPoint | ( | SampleCount | , |
LoopPointType | |||
) |
Adds a loop point at the given position.
void tracktion::engine::LoopInfo::changeLoopPoint | ( | int | index, |
SampleCount | , | ||
LoopPointType | |||
) |
Sets the loop point at the given index to a new position and type.
void tracktion::engine::LoopInfo::deleteLoopPoint | ( | int | index | ) |
Removes the loop point at the given index.
void tracktion::engine::LoopInfo::clearLoopPoints | ( | ) |
Removes all the loop points.
void tracktion::engine::LoopInfo::clearLoopPoints | ( | LoopPointType | ) |
Removes all the loop points of a given type.
int tracktion::engine::LoopInfo::getNumTags | ( | ) | const |
Returns the number of tags.
void tracktion::engine::LoopInfo::clearTags | ( | ) |
Removes all the tags.
juce::String tracktion::engine::LoopInfo::getTag | ( | int | index | ) | const |
Returns the tag at a given index.
void tracktion::engine::LoopInfo::addTag | ( | const juce::String & | tag | ) |
Adds a tag.
This could be descriptive info like major/minor etc.
void tracktion::engine::LoopInfo::addTags | ( | const juce::StringArray & | tags | ) |
Adds multiple tags.
Engine& tracktion::engine::LoopInfo::engine |
The engine this belongs to.
juce::ValueTree tracktion::engine::LoopInfo::state |