|
Audacity
3.0.3
|
Go to the documentation of this file.
23 #ifndef __AUDACITY_ODTASK__
24 #define __AUDACITY_ODTASK__
26 #include "../BlockFile.h"
36 EVT_ODTASK_COMPLETE, wxCommandEvent);
58 virtual std::unique_ptr<ODTask>
Clone()
const = 0;
68 void DoSome(
float amountWork=0.0);
88 const std::shared_ptr< Track > &newTrack);
91 void AddWaveTrack(
const std::shared_ptr< WaveTrack > &track);
93 virtual std::shared_ptr< WaveTrack >
GetWaveTrack(
int i);
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.
Holds a msgid for the translation catalog; may also bind format arguments.
A Track that contains audio waveform data.
virtual void DemandTrackUpdate(WaveTrack *track, double seconds)
changes the tasks associated with this Waveform to process the task from a different point in the tra...
int GetTaskNumber()
returns the number of tasks created before this instance.
virtual const char * GetTaskName()
virtual TranslatableString GetTip()=0
void AddWaveTrack(const std::shared_ptr< WaveTrack > &track)
Adds a WaveTrack to do the task for.
virtual std::unique_ptr< ODTask > Clone() const =0
enum ODTask::@0 ODTypeEnum
virtual bool IsTaskAssociatedWithProject(AudacityProject *proj)
returns true if the task is associated with the project.
virtual bool UsesCustomWorkUntilPercentage()
wxDECLARE_EXPORTED_EVENT(AUDACITY_DLL_API, EVT_ODTASK_COMPLETE, wxCommandEvent)
virtual void RecalculatePercentComplete()
does an od update and then recalculates the data.
ODLock mDemandSampleMutex
virtual float PercentComplete()
return the amount of the task that has been completed. 0.0 to 1.0
ODLock mPercentCompleteMutex
std::vector< std::weak_ptr< WaveTrack > > mWaveTracks
virtual float ComputeNextWorkUntilPercentageComplete()
virtual void CalculatePercentComplete()=0
calculates the percentage complete from existing data.
virtual bool CanMergeWith(ODTask *otherTask)
volatile bool mTaskStarted
void DoAll()
Call DoSome until PercentComplete >= 1.0.
virtual void Terminate()
releases memory that the ODTask owns. Subclasses should override.
volatile bool mNeedsODUpdate
A class representing a modular task to be used with the On-Demand structures.
ODTask()
Constructs an ODTask.
void ResetNeedsODUpdate()
Abstract base class for an object holding data associated with points on a time axis.
virtual void Update()
virtual method called before DoSomeInternal is used from DoSome.
Positions or offsets within audio files need a wide type.
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
volatile float mPercentComplete
virtual int GetNumWaveTracks()
virtual sampleCount GetDemandSample() const
void SetIsRunning(bool value)
virtual void SetDemandSample(sampleCount sample)
virtual std::shared_ptr< WaveTrack > GetWaveTrack(int i)
virtual void DoSomeInternal()=0
virtual void StopUsingWaveTrack(WaveTrack *track)
sampleCount mDemandSample
ODLock mBlockUntilTerminateMutex
ODLock mNeedsODUpdateMutex
void DoSome(float amountWork=0.0)
virtual unsigned int GetODType()
Subclasses should override to return respective type.