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

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
tracktion::engine::SmartThumbnail Class Reference

SmartThumnail automatically tracks changes to an AudioFile and will update its cache if the file changes. More...

#include "tracktion_SmartThumbnail.h"

Inheritance diagram for tracktion::engine::SmartThumbnail:
juce::AudioThumbnailBase juce::Timer juce::ChangeBroadcaster juce::AudioFormatWriter::ThreadedWriter::IncomingDataReceiver

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 ()
 
- Public Member Functions inherited from juce::ChangeBroadcaster
void addChangeListener (ChangeListener *listener)
 
void removeChangeListener (ChangeListener *listener)
 
void removeAllChangeListeners ()
 
void sendChangeMessage ()
 
void sendSynchronousChangeMessage ()
 
void dispatchPendingMessages ()
 

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
 
Engineengine
 
Edit *const edit
 

Detailed Description

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.

Definition at line 21 of file tracktion_SmartThumbnail.h.

Constructor & Destructor Documentation

◆ SmartThumbnail() [1/2]

tracktion::engine::SmartThumbnail::SmartThumbnail ( Engine e,
const AudioFile f,
juce::Component componentToRepaint,
Edit ed 
)

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.

Definition at line 491 of file tracktion_AudioFile.cpp.

◆ SmartThumbnail() [2/2]

tracktion::engine::SmartThumbnail::SmartThumbnail ( Engine e,
const AudioFile f,
juce::Component componentToRepaint,
Edit ed,
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.

Parameters
thumbnailToUseThe thumbnail instance to use if you want custom thumbs

Definition at line 499 of file tracktion_AudioFile.cpp.

◆ ~SmartThumbnail()

tracktion::engine::SmartThumbnail::~SmartThumbnail ( )
override

Destructor.

Definition at line 517 of file tracktion_AudioFile.cpp.

Member Function Documentation

◆ addBlock()

void tracktion::engine::SmartThumbnail::addBlock ( juce::int64  sampleNumberInSource,
const juce::AudioBuffer< float > &  buffer,
int  startOffsetInBuffer,
int  numSamples 
)
override

Definition at line 724 of file tracktion_AudioFile.cpp.

◆ areThumbnailsFullyLoaded()

bool tracktion::engine::SmartThumbnail::areThumbnailsFullyLoaded ( Engine engine)
static

Returns true if any thumbnails are currently being generated for the given Edit.

Definition at line 526 of file tracktion_AudioFile.cpp.

◆ audioFileChanged()

void tracktion::engine::SmartThumbnail::audioFileChanged ( )

Definition at line 611 of file tracktion_AudioFile.cpp.

◆ clear()

void tracktion::engine::SmartThumbnail::clear ( )
overridevirtual

Implements juce::AudioThumbnailBase.

Definition at line 631 of file tracktion_AudioFile.cpp.

◆ drawChannel()

void tracktion::engine::SmartThumbnail::drawChannel ( juce::Graphics g,
juce::Rectangle< int r,
TimeRange  time,
int  channelNum,
float  verticalZoomFactor 
)

Draws one of the channels, optionally using a hi-res algorithm.

Definition at line 549 of file tracktion_AudioFile.cpp.

◆ drawChannels()

void tracktion::engine::SmartThumbnail::drawChannels ( juce::Graphics g,
juce::Rectangle< int r,
TimeRange  time,
float  verticalZoomFactor 
)

Draws all of the channels, optionally using a hi-res algorithm.

Definition at line 557 of file tracktion_AudioFile.cpp.

◆ getApproximateMinMax()

void tracktion::engine::SmartThumbnail::getApproximateMinMax ( double  startTime,
double  endTime,
int  channelIndex,
float minValue,
float maxValue 
) const
overridevirtualnoexcept

Implements juce::AudioThumbnailBase.

Definition at line 707 of file tracktion_AudioFile.cpp.

◆ getApproximatePeak()

float tracktion::engine::SmartThumbnail::getApproximatePeak ( ) const
overridevirtual

Implements juce::AudioThumbnailBase.

Definition at line 702 of file tracktion_AudioFile.cpp.

◆ getHashCode()

juce::int64 tracktion::engine::SmartThumbnail::getHashCode ( ) const
overridevirtual

Implements juce::AudioThumbnailBase.

Definition at line 714 of file tracktion_AudioFile.cpp.

◆ getNumChannels()

int tracktion::engine::SmartThumbnail::getNumChannels ( ) const
overridevirtualnoexcept

Implements juce::AudioThumbnailBase.

Definition at line 656 of file tracktion_AudioFile.cpp.

◆ getNumSamplesFinished()

juce::int64 tracktion::engine::SmartThumbnail::getNumSamplesFinished ( ) const
overridevirtualnoexcept

Implements juce::AudioThumbnailBase.

Definition at line 697 of file tracktion_AudioFile.cpp.

◆ getProportionComplete()

double tracktion::engine::SmartThumbnail::getProportionComplete ( ) const
noexcept

Returns the proportion of the thumbnail that has been generated.

Definition at line 565 of file tracktion_AudioFile.cpp.

◆ getProxyProgress()

float tracktion::engine::SmartThumbnail::getProxyProgress ( ) const
noexcept

Returns the progress of the current proxy file creation.

Definition at line 59 of file tracktion_SmartThumbnail.h.

◆ getTotalLength()

double tracktion::engine::SmartThumbnail::getTotalLength ( ) const
overridevirtualnoexcept

Implements juce::AudioThumbnailBase.

Definition at line 661 of file tracktion_AudioFile.cpp.

◆ isFullyLoaded()

bool tracktion::engine::SmartThumbnail::isFullyLoaded ( ) const
overridevirtualnoexcept

Implements juce::AudioThumbnailBase.

Definition at line 692 of file tracktion_AudioFile.cpp.

◆ isGeneratingProxy()

bool tracktion::engine::SmartThumbnail::isGeneratingProxy ( ) const
noexcept

Returns true if this is a proxy file being generated by the AudioProxyGenerator.

Definition at line 56 of file tracktion_SmartThumbnail.h.

◆ isOutOfDate()

bool tracktion::engine::SmartThumbnail::isOutOfDate ( ) const
noexcept

Returns true if the file has been changed and a new thumbnail has not yet been generated.

Definition at line 62 of file tracktion_SmartThumbnail.h.

◆ loadFrom()

bool tracktion::engine::SmartThumbnail::loadFrom ( juce::InputStream stream)
overridevirtual

Implements juce::AudioThumbnailBase.

Definition at line 646 of file tracktion_AudioFile.cpp.

◆ releaseFile()

void tracktion::engine::SmartThumbnail::releaseFile ( )

Definition at line 577 of file tracktion_AudioFile.cpp.

◆ reset()

void tracktion::engine::SmartThumbnail::reset ( int  numChannels,
double  sampleRate,
juce::int64  totalSamplesInSource 
)
override

Definition at line 719 of file tracktion_AudioFile.cpp.

◆ saveTo()

void tracktion::engine::SmartThumbnail::saveTo ( juce::OutputStream stream) const
overridevirtual

Implements juce::AudioThumbnailBase.

Definition at line 651 of file tracktion_AudioFile.cpp.

◆ setEnabled()

static void tracktion::engine::SmartThumbnail::setEnabled ( bool  e)
static

Enable/disable all smart thumbnail generation.

Definition at line 46 of file tracktion_SmartThumbnail.h.

◆ setNewFile()

void tracktion::engine::SmartThumbnail::setNewFile ( const AudioFile newFile)

Sets a new file to display.

Definition at line 537 of file tracktion_AudioFile.cpp.

◆ setReader()

void tracktion::engine::SmartThumbnail::setReader ( juce::AudioFormatReader reader,
juce::int64  hashCode 
)
overridevirtual

Implements juce::AudioThumbnailBase.

Definition at line 641 of file tracktion_AudioFile.cpp.

◆ setSource()

bool tracktion::engine::SmartThumbnail::setSource ( juce::InputSource source)
overridevirtual

Implements juce::AudioThumbnailBase.

Definition at line 636 of file tracktion_AudioFile.cpp.

Member Data Documentation

◆ edit

Edit* const tracktion::engine::SmartThumbnail::edit

Definition at line 117 of file tracktion_SmartThumbnail.h.

◆ engine

Engine& tracktion::engine::SmartThumbnail::engine

Definition at line 116 of file tracktion_SmartThumbnail.h.

◆ file

AudioFile tracktion::engine::SmartThumbnail::file

Definition at line 115 of file tracktion_SmartThumbnail.h.


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