|
TracktionEngine
|
SmartThumnail automatically tracks changes to an AudioFile and will update its cache if the file changes. More...
#include <tracktion_SmartThumbnail.h>
Inherits juce::AudioThumbnailBase, and juce::Timer.
Public Member Functions | |
| SmartThumbnail (Engine &, const AudioFile &, juce::Component &componentToRepaint, Edit *) | |
| Creates a SmartThumbnail for an AudioFile which will automatically repaint a Component as it it loaded. | |
| SmartThumbnail (Engine &, const AudioFile &, juce::Component &componentToRepaint, Edit *, std::unique_ptr< juce::AudioThumbnailBase > thumbnailToUse) | |
| Creates a SmartThumbnail for an AudioFile which will automatically repaint a Component as it it loaded. | |
| ~SmartThumbnail () override | |
| Destructor. | |
| void | setNewFile (const AudioFile &) |
| Sets a new file to display. | |
| bool | isGeneratingProxy () const noexcept |
| Returns true if this is a proxy file being generated by the AudioProxyGenerator. | |
| float | getProxyProgress () const noexcept |
| Returns the progress of the current proxy file creation. | |
| bool | isOutOfDate () const noexcept |
| Returns true if the file has been changed and a new thumbnail has not yet been generated. | |
| void | drawChannel (juce::Graphics &, juce::Rectangle< int >, TimeRange, int channelNum, float verticalZoomFactor) |
| Draws one of the channels, optionally using a hi-res algorithm. | |
| void | drawChannels (juce::Graphics &, juce::Rectangle< int >, TimeRange, float verticalZoomFactor) |
| Draws all of the channels, optionally using a hi-res algorithm. | |
| double | getProportionComplete () const noexcept |
| Returns the proportion of the thumbnail that has been generated. | |
| void | clear () override |
| bool | setSource (juce::InputSource *) override |
| void | setReader (juce::AudioFormatReader *, juce::int64 hashCode) override |
| bool | loadFrom (juce::InputStream &) override |
| void | saveTo (juce::OutputStream &) const override |
| int | getNumChannels () const noexcept override |
| double | getTotalLength () const noexcept override |
| bool | isFullyLoaded () const noexcept override |
| juce::int64 | getNumSamplesFinished () const noexcept override |
| float | getApproximatePeak () const override |
| void | getApproximateMinMax (double startTime, double endTime, int channelIndex, float &minValue, float &maxValue) const noexcept override |
| juce::int64 | getHashCode () const override |
| void | reset (int numChannels, double sampleRate, juce::int64 totalSamplesInSource) override |
| void | addBlock (juce::int64 sampleNumberInSource, const juce::AudioBuffer< float > &, int startOffsetInBuffer, int numSamples) override |
| void | audioFileChanged () |
| void | releaseFile () |
Static Public Member Functions | |
| static void | setEnabled (bool e) |
| Enable/disable all smart thumbnail generation. | |
| static bool | areThumbnailsFullyLoaded (Engine &) |
| Returns true if any thumbnails are currently being generated for the given Edit. | |
Public Attributes | |
| AudioFile | file |
| Engine & | engine |
| Edit *const | edit = nullptr |
SmartThumnail automatically tracks changes to an AudioFile and will update its cache if the file changes.
Additionally, if this file is a wav proxy file that's being generated, you can use this to find out about its progress.
| tracktion::engine::SmartThumbnail::SmartThumbnail | ( | Engine & | , |
| const AudioFile & | , | ||
| juce::Component & | componentToRepaint, | ||
| Edit * | |||
| ) |
Creates a SmartThumbnail for an AudioFile which will automatically repaint a Component as it it loaded.
You can optionally supply an Edit to use its temporary directory for the thumbnail file storage.
| tracktion::engine::SmartThumbnail::SmartThumbnail | ( | Engine & | , |
| const AudioFile & | , | ||
| juce::Component & | componentToRepaint, | ||
| Edit * | , | ||
| std::unique_ptr< juce::AudioThumbnailBase > | thumbnailToUse | ||
| ) |
Creates a SmartThumbnail for an AudioFile which will automatically repaint a Component as it it loaded.
You can optionally supply an Edit to use its temporary directory for the thumbnail file storage.
| thumbnailToUse | The thumbnail instance to use if you want custom thumbs |
|
override |
Destructor.
|
static |
Enable/disable all smart thumbnail generation.
|
static |
Returns true if any thumbnails are currently being generated for the given Edit.
| void tracktion::engine::SmartThumbnail::setNewFile | ( | const AudioFile & | ) |
Sets a new file to display.
|
noexcept |
Returns true if this is a proxy file being generated by the AudioProxyGenerator.
|
noexcept |
Returns the progress of the current proxy file creation.
|
noexcept |
Returns true if the file has been changed and a new thumbnail has not yet been generated.
| void tracktion::engine::SmartThumbnail::drawChannel | ( | juce::Graphics & | , |
| juce::Rectangle< int > | , | ||
| TimeRange | , | ||
| int | channelNum, | ||
| float | verticalZoomFactor | ||
| ) |
Draws one of the channels, optionally using a hi-res algorithm.
| void tracktion::engine::SmartThumbnail::drawChannels | ( | juce::Graphics & | , |
| juce::Rectangle< int > | , | ||
| TimeRange | , | ||
| float | verticalZoomFactor | ||
| ) |
Draws all of the channels, optionally using a hi-res algorithm.
|
noexcept |
Returns the proportion of the thumbnail that has been generated.
|
override |
.
|
override |
.
|
override |
.
|
override |
.
|
override |
.
|
overridenoexcept |
.
|
overridenoexcept |
.
|
overridenoexcept |
.
|
overridenoexcept |
.
|
override |
.
|
overridenoexcept |
.
|
override |
.
|
override |
.
|
override |
.
| void tracktion::engine::SmartThumbnail::audioFileChanged | ( | ) |
| void tracktion::engine::SmartThumbnail::releaseFile | ( | ) |
| AudioFile tracktion::engine::SmartThumbnail::file |
| Engine& tracktion::engine::SmartThumbnail::engine |
| Edit* const tracktion::engine::SmartThumbnail::edit = nullptr |