Audacity  2.2.0
ODWaveTrackTaskQueue Class Referencefinal

A class representing a modular task to be used with the On-Demand structures. More...

#include <ODWaveTrackTaskQueue.h>

Public Member Functions

 ODWaveTrackTaskQueue ()
 Constructs an ODWaveTrackTaskQueue. More...
 
virtual ~ODWaveTrackTaskQueue ()
 
void AddWaveTrack (WaveTrack *track)
 Adds a track to the associated list. More...
 
void RemoveWaveTrack (WaveTrack *track)
 
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...
 
void ReplaceWaveTrack (WaveTrack *oldTrack, WaveTrack *newTrack)
 replaces all instances of a WaveTrack within this task with another. More...
 
void MakeWaveTrackIndependent (WaveTrack *track)
 
bool CanMergeWith (ODWaveTrackTaskQueue *otherQueue)
 returns whether or not this queue's task list and another's can merge together, as when we make two mono tracks stereo. More...
 
void MergeWaveTrack (WaveTrack *track)
 
bool ContainsWaveTrack (const WaveTrack *track)
 returns true if the argument is in the WaveTrack list. More...
 
WaveTrackGetWaveTrack (size_t x)
 
int GetNumWaveTracks ()
 returns the number of wavetracks in this queue. More...
 
void AddTask (movable_ptr< ODTask > &&mtask)
 Add a task to the queue. More...
 
bool IsEmpty ()
 
bool IsFrontTaskComplete ()
 
void RemoveFrontTask ()
 Removes and deletes the front task from the list. More...
 
ODTaskGetFrontTask ()
 Schedules the front task for immediate execution. More...
 
int GetNumTasks ()
 returns the number of ODTasks in this queue More...
 
ODTaskGetTask (size_t x)
 returns a ODTask at position x More...
 
void FillTipForWaveTrack (const WaveTrack *t, wxString &tip)
 fills in the status bar message for a given track More...
 

Protected Attributes

wxString mTipMsg
 
std::vector< WaveTrack * > mTracks
 the list of tracks associated with this queue. More...
 
ODLock mTracksMutex
 
std::vector< movable_ptr
< ODTask > > 
mTasks
 the list of tasks associated with the tracks. This class owns these tasks. More...
 
ODLock mTasksMutex
 

Detailed Description

A class representing a modular task to be used with the On-Demand structures.

watches over all to be done (not yet started and started but not finished) tasks associated with a WaveTrack.

Constructor & Destructor Documentation

ODWaveTrackTaskQueue::ODWaveTrackTaskQueue ( )

Constructs an ODWaveTrackTaskQueue.

ODWaveTrackTaskQueue::~ODWaveTrackTaskQueue ( )
virtual

Member Function Documentation

void ODWaveTrackTaskQueue::AddTask ( movable_ptr< ODTask > &&  mtask)
void ODWaveTrackTaskQueue::AddWaveTrack ( WaveTrack track)

Adds a track to the associated list.

References mTracks, and mTracksMutex.

Referenced by MergeWaveTrack().

bool ODWaveTrackTaskQueue::CanMergeWith ( ODWaveTrackTaskQueue otherQueue)

returns whether or not this queue's task list and another's can merge together, as when we make two mono tracks stereo.

References GetNumTasks(), GetTask(), mTasks, and mTasksMutex.

Referenced by ODManager::MakeWaveTrackDependent().

bool ODWaveTrackTaskQueue::ContainsWaveTrack ( const WaveTrack track)

returns true if the argument is in the WaveTrack list.

References mTracks, and mTracksMutex.

Referenced by FillTipForWaveTrack().

void ODWaveTrackTaskQueue::DemandTrackUpdate ( WaveTrack track,
double  seconds 
)

changes the tasks associated with this Waveform to process the task from a different point in the track

changes the tasks associated with this Waveform to process the task from a different point in the track

Parameters
trackthe track to update
secondsthe point in the track from which the tasks associated with track should begin processing from.

References mTasks, and mTracksMutex.

void ODWaveTrackTaskQueue::FillTipForWaveTrack ( const WaveTrack t,
wxString &  tip 
)

fills in the status bar message for a given track

References _(), ContainsWaveTrack(), GetFrontTask(), GetNumTasks(), and mTipMsg.

ODTask * ODWaveTrackTaskQueue::GetFrontTask ( )

Schedules the front task for immediate execution.

gets the front task for immediate execution

References mTasks, and mTasksMutex.

Referenced by FillTipForWaveTrack(), and ODManager::UpdateQueues().

int ODWaveTrackTaskQueue::GetNumTasks ( )

returns the number of ODTasks in this queue

References mTasks, and mTasksMutex.

Referenced by CanMergeWith(), and FillTipForWaveTrack().

int ODWaveTrackTaskQueue::GetNumWaveTracks ( )

returns the number of wavetracks in this queue.

References mTracks, and mTracksMutex.

ODTask * ODWaveTrackTaskQueue::GetTask ( size_t  x)

returns a ODTask at position x

References mTasks, and mTasksMutex.

Referenced by CanMergeWith().

WaveTrack * ODWaveTrackTaskQueue::GetWaveTrack ( size_t  x)

References mTracks, and mTracksMutex.

bool ODWaveTrackTaskQueue::IsEmpty ( )

References mTasks, mTasksMutex, mTracks, and mTracksMutex.

bool ODWaveTrackTaskQueue::IsFrontTaskComplete ( )

References mTasks, and mTasksMutex.

void ODWaveTrackTaskQueue::MakeWaveTrackIndependent ( WaveTrack track)
void ODWaveTrackTaskQueue::MergeWaveTrack ( WaveTrack track)

add track to the masterTrack's queue - this will allow future ODScheduling to affect them together. sets the NeedODUpdateFlag since we don't want the head task to finish without haven't dealt with the depednent

Parameters
trackthe track to bring into the tasks AND tracklist for this queue

References AddWaveTrack(), mTasks, and mTasksMutex.

Referenced by ODManager::MakeWaveTrackDependent().

void ODWaveTrackTaskQueue::RemoveFrontTask ( )

Removes and deletes the front task from the list.

References mTasks, and mTasksMutex.

void ODWaveTrackTaskQueue::RemoveWaveTrack ( WaveTrack track)

Removes a track from the list. Also notifies mTasks to stop using references to the instance in a thread-safe manner (may block)

References mTasks, mTasksMutex, mTracks, and mTracksMutex.

Referenced by MakeWaveTrackIndependent().

void ODWaveTrackTaskQueue::ReplaceWaveTrack ( WaveTrack oldTrack,
WaveTrack newTrack 
)

replaces all instances of a WaveTrack within this task with another.

References mTasks, mTasksMutex, mTracks, and mTracksMutex.

Member Data Documentation

std::vector<movable_ptr<ODTask> > ODWaveTrackTaskQueue::mTasks
protected
wxString ODWaveTrackTaskQueue::mTipMsg
protected

Referenced by FillTipForWaveTrack().

std::vector<WaveTrack*> ODWaveTrackTaskQueue::mTracks
protected

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