Audacity
3.0.3
|
A class representing a modular task to be used with the On-Demand structures. More...
#include <ODComputeSummaryTask.h>
Public Member Functions | |
ODComputeSummaryTask () | |
Constructs an ODTask. More... | |
virtual | ~ODComputeSummaryTask () |
std::unique_ptr< ODTask > | Clone () const override |
unsigned int | GetODType () override |
Subclasses should override to return respective type. More... | |
const char * | GetTaskName () override |
Return the task name. More... | |
TranslatableString | GetTip () override |
bool | UsesCustomWorkUntilPercentage () override |
float | ComputeNextWorkUntilPercentageComplete () override |
void | Terminate () override |
releases memory that the ODTask owns. Subclasses should override. More... | |
Public Member Functions inherited from ODTask | |
ODTask () | |
Constructs an ODTask. More... | |
virtual | ~ODTask () |
void | DoSome (float amountWork=0.0) |
void | DoAll () |
Call DoSome until PercentComplete >= 1.0. More... | |
virtual float | PercentComplete () |
return the amount of the task that has been completed. 0.0 to 1.0 More... | |
virtual bool | CanMergeWith (ODTask *otherTask) |
virtual void | StopUsingWaveTrack (WaveTrack *track) |
virtual void | ReplaceWaveTrack (Track *oldTrack, const std::shared_ptr< Track > &newTrack) |
Replaces all instances to a wavetrack with a NEW one, effectively transferring the task. More... | |
void | AddWaveTrack (const std::shared_ptr< WaveTrack > &track) |
Adds a WaveTrack to do the task for. More... | |
virtual int | GetNumWaveTracks () |
virtual std::shared_ptr< WaveTrack > | GetWaveTrack (int i) |
virtual void | DemandTrackUpdate (WaveTrack *track, double seconds) |
changes the tasks associated with this Waveform to process the task from a different point in the track More... | |
bool | IsComplete () |
return More... | |
void | TerminateAndBlock () |
virtual sampleCount | GetDemandSample () const |
virtual void | SetDemandSample (sampleCount sample) |
virtual void | RecalculatePercentComplete () |
does an od update and then recalculates the data. More... | |
int | GetTaskNumber () |
returns the number of tasks created before this instance. More... | |
void | SetNeedsODUpdate () |
bool | GetNeedsODUpdate () |
void | ResetNeedsODUpdate () |
virtual bool | IsTaskAssociatedWithProject (AudacityProject *proj) |
returns true if the task is associated with the project. More... | |
bool | IsRunning () |
Protected Member Functions | |
void | CalculatePercentComplete () override |
recalculates the percentage complete. More... | |
void | DoSomeInternal () override |
Computes and writes the data for one BlockFile if it still has a refcount. More... | |
void | Update () override |
void | OrderBlockFiles (std::vector< std::weak_ptr< ODPCMAliasBlockFile > > &unorderedBlocks) |
Orders the input as either On-Demand or default layered order. More... | |
void | MarkUpdateRan () |
tells us whether or not Update has been run at least once. More... | |
bool | HasUpdateRan () |
Protected Member Functions inherited from ODTask | |
virtual void | ODUpdate () |
void | SetIsRunning (bool value) |
Protected Attributes | |
ODLock | mBlockFilesMutex |
std::vector< std::weak_ptr< ODPCMAliasBlockFile > > | mBlockFiles |
int | mMaxBlockFiles |
ODLock | mHasUpdateRanMutex |
bool | mHasUpdateRan |
Protected Attributes inherited from ODTask | |
int | mTaskNumber |
volatile float | mPercentComplete |
ODLock | mPercentCompleteMutex |
volatile bool | mDoingTask |
volatile bool | mTaskStarted |
volatile bool | mTerminate |
ODLock | mTerminateMutex |
ODLock | mBlockUntilTerminateMutex |
std::vector< std::weak_ptr< WaveTrack > > | mWaveTracks |
ODLock | mWaveTrackMutex |
sampleCount | mDemandSample |
ODLock | mDemandSampleMutex |
volatile bool | mIsRunning |
ODLock | mIsRunningMutex |
Additional Inherited Members | |
Public Types inherited from ODTask | |
enum | { eODNone = 0x00000000, eODFLAC = 0x00000001, eODMP3 = 0x00000002, eODFFMPEG = 0x00000004, eODPCMSummary = 0x00001000, eODOTHER = 0x10000000 } |
Public Attributes inherited from ODTask | |
enum ODTask:: { ... } | ODTypeEnum |
A class representing a modular task to be used with the On-Demand structures.
Computes the summary data for a PCM (WAV) file and writes it to disk, updating the ODPCMAliasBlockFile and the GUI of the newly available data.
Definition at line 29 of file ODComputeSummaryTask.h.
ODComputeSummaryTask::ODComputeSummaryTask | ( | ) |
Constructs an ODTask.
Creates a NEW task that computes summaries for a wavetrack that needs to be specified through SetWaveTrack()
Definition at line 32 of file ODComputeSummaryTask.cpp.
References mHasUpdateRan, and mMaxBlockFiles.
|
inlinevirtual |
Definition at line 37 of file ODComputeSummaryTask.h.
|
overrideprotectedvirtual |
recalculates the percentage complete.
Implements ODTask.
Definition at line 168 of file ODComputeSummaryTask.cpp.
References HasUpdateRan(), mBlockFiles, mMaxBlockFiles, ODTask::mPercentComplete, and ODTask::mPercentCompleteMutex.
Referenced by DoSomeInternal().
|
overridevirtual |
Implements ODTask.
Definition at line 38 of file ODComputeSummaryTask.cpp.
References ODTask::GetDemandSample().
|
overridevirtual |
compute the next time we should take a break in terms of overall percentage. We want to do a constant number of blockfiles.
Reimplemented from ODTask.
Definition at line 139 of file ODComputeSummaryTask.cpp.
References mMaxBlockFiles, ODTask::mPercentComplete, ODTask::mPercentCompleteMutex, and nBlockFilesPerDoSome.
|
overrideprotectedvirtual |
Computes and writes the data for one BlockFile if it still has a refcount.
Implements ODTask.
Definition at line 58 of file ODComputeSummaryTask.cpp.
References CalculatePercentComplete(), mBlockFiles, mBlockFilesMutex, mMaxBlockFiles, ODTask::mPercentComplete, ODTask::mPercentCompleteMutex, ODTask::mWaveTrackMutex, and ODTask::mWaveTracks.
|
inlineoverridevirtual |
Subclasses should override to return respective type.
Reimplemented from ODTask.
Definition at line 42 of file ODComputeSummaryTask.h.
References ODTask::eODPCMSummary.
|
inlineoverridevirtual |
Return the task name.
Reimplemented from ODTask.
Definition at line 45 of file ODComputeSummaryTask.h.
|
inlineoverridevirtual |
|
protected |
Definition at line 159 of file ODComputeSummaryTask.cpp.
References mHasUpdateRan, and mHasUpdateRanMutex.
Referenced by CalculatePercentComplete().
|
protected |
tells us whether or not Update has been run at least once.
Definition at line 152 of file ODComputeSummaryTask.cpp.
References mHasUpdateRan, and mHasUpdateRanMutex.
Referenced by Update().
|
protected |
Orders the input as either On-Demand or default layered order.
Computes the summary calculation queue order of the blockfiles.
Definition at line 256 of file ODComputeSummaryTask.cpp.
References ODTask::GetDemandSample(), ODPCMAliasBlockFile::GetGlobalEnd(), ODPCMAliasBlockFile::GetGlobalStart(), mBlockFiles, and mMaxBlockFiles.
Referenced by Update().
|
overridevirtual |
releases memory that the ODTask owns. Subclasses should override.
Reimplemented from ODTask.
Definition at line 48 of file ODComputeSummaryTask.cpp.
References mBlockFiles, and mBlockFilesMutex.
|
overrideprotectedvirtual |
Readjusts the blockfile order in the default manner. If we have had an ODRequest Then it updates in the OD manner.
creates the order of the wavetrack to load. by default left to right, or frome the point the user has clicked.
Reimplemented from ODTask.
Definition at line 182 of file ODComputeSummaryTask.cpp.
References ODPCMAliasBlockFile::GetClipOffset(), ODPCMAliasBlockFile::GetStart(), MarkUpdateRan(), mBlockFilesMutex, ODTask::mWaveTrackMutex, ODTask::mWaveTracks, OrderBlockFiles(), and SeqBlock::start.
|
inlineoverridevirtual |
Reimplemented from ODTask.
Definition at line 50 of file ODComputeSummaryTask.h.
|
protected |
Definition at line 77 of file ODComputeSummaryTask.h.
Referenced by CalculatePercentComplete(), DoSomeInternal(), OrderBlockFiles(), and Terminate().
|
protected |
Definition at line 76 of file ODComputeSummaryTask.h.
Referenced by DoSomeInternal(), Terminate(), and Update().
|
protected |
Definition at line 80 of file ODComputeSummaryTask.h.
Referenced by HasUpdateRan(), MarkUpdateRan(), and ODComputeSummaryTask().
|
protected |
Definition at line 79 of file ODComputeSummaryTask.h.
Referenced by HasUpdateRan(), and MarkUpdateRan().
|
protected |
Definition at line 78 of file ODComputeSummaryTask.h.
Referenced by CalculatePercentComplete(), ComputeNextWorkUntilPercentageComplete(), DoSomeInternal(), ODComputeSummaryTask(), and OrderBlockFiles().