|
Audacity
3.0.3
|
Go to the documentation of this file.
24 #include "../WaveClip.h"
25 #include "../WaveTrack.h"
26 #include "../Project.h"
27 #include "../UndoManager.h"
39 static int sTaskNumber=0;
109 wxThread::This()->Yield();
154 wxCommandEvent event( EVT_ODTASK_COMPLETE );
162 pProject->wxEvtHandler::AddPendingEvent(event);
257 std::shared_ptr< WaveTrack > track;
320 bool demandSampleChanged=
false;
334 if(demandSampleChanged)
353 const std::shared_ptr< Track > &newTrack)
360 mWaveTracks[i] = std::static_pointer_cast<WaveTrack>( newTrack );
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.
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...
void AddWaveTrack(const std::shared_ptr< WaveTrack > &track)
Adds a WaveTrack to do the task for.
virtual bool IsTaskAssociatedWithProject(AudacityProject *proj)
returns true if the task is associated with the project.
virtual bool UsesCustomWorkUntilPercentage()
virtual void RecalculatePercentComplete()
does an od update and then recalculates the data.
ODLock mDemandSampleMutex
void AddTask(ODTask *task)
Adds a task to the running queue. Thread-safe.
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.
volatile bool mTaskStarted
wxDEFINE_EVENT(EVT_ODTASK_COMPLETE, wxCommandEvent)
virtual void Terminate()
releases memory that the ODTask owns. Subclasses should override.
volatile bool mNeedsODUpdate
ODTask()
Constructs an ODTask.
void ResetNeedsODUpdate()
static TrackList & Get(AudacityProject &project)
Abstract base class for an object holding data associated with points on a time axis.
static UndoManager & Get(AudacityProject &project)
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)
static std::mutex & Mutex()
virtual void SetDemandSample(sampleCount sample)
auto Any() -> TrackIterRange< TrackType >
virtual std::shared_ptr< WaveTrack > GetWaveTrack(int i)
static ODManager *(* Instance)()
virtual void DoSomeInternal()=0
virtual void StopUsingWaveTrack(WaveTrack *track)
sampleCount mDemandSample
ODLock mBlockUntilTerminateMutex
ODLock mNeedsODUpdateMutex
void DoSome(float amountWork=0.0)