|
Audacity
3.0.3
|
Go to the documentation of this file.
19 #ifndef __AUDACITY_ODMANAGER__
20 #define __AUDACITY_ODMANAGER__
35 EVT_ODTASK_UPDATE, wxCommandEvent);
67 void AddNewTask(std::unique_ptr<ODTask> &&mtask,
bool lockMutex=
true);
78 const std::shared_ptr< WaveTrack > &dependentTrack,
85 const std::shared_ptr< Track > &newTrack);
117 static void Pause(
bool pause =
true);
132 friend std::default_delete < ODManager > ;
144 static std::unique_ptr<ODManager>
pMan;
147 std::vector<std::unique_ptr<ODWaveTrackTaskQueue>>
mQueues;
186 typedef int ExitCode;
195 pthread_join(mThread, NULL);
197 bool TestDestroy() {
return mDestroy; }
199 struct timespec spec;
201 spec.tv_nsec = ms * 1000 * 1000;
202 nanosleep(&spec, NULL);
204 static void *callback(
void *p) {
212 void SetPriority(
int priority)
218 pthread_create(&mThread, NULL, callback,
this);
float GetOverallPercentComplete()
Gets the total percent complete for all tasks combined.
Holds a msgid for the translation catalog; may also bind format arguments.
volatile int mCurrentThreads
Number of threads currently running. Accessed thru multiple threads.
ODLock mCurrentThreadsMutex
volatile bool mTerminated
A Track that contains audio waveform data.
std::vector< std::unique_ptr< ODWaveTrackTaskQueue > > mQueues
void MakeWaveTrackIndependent(const std::shared_ptr< WaveTrack > &track)
if it shares a queue/task, creates a NEW queue/task for the track, and removes it from any previously...
bool MakeWaveTrackDependent(const std::shared_ptr< WaveTrack > &dependentTrack, WaveTrack *masterTrack)
static void Pause(bool pause=true)
void AddNewTask(std::unique_ptr< ODTask > &&mtask, bool lockMutex=true)
Adds a wavetrack, creates a queue member.
static ODManager * InstanceNormal()
Gets the singleton instance.
static bool IsInstanceCreated()
returns whether or not the singleton instance was created yet
static ODManager * InstanceFirstTime()
Gets the singleton instance.
Pauser & operator=(const Pauser &) PROHIBITED
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 AddTask(ODTask *task)
Adds a task to the running queue. Thread-safe.
void SignalTaskQueueLoop()
Wakes the queue loop up by signalling its condition variable.
static void Quit()
Kills the ODMananger Thread.
void FillTipForWaveTrack(const WaveTrack *t, TranslatableString &tip)
fills in the status bar message for a given track
static void MarkLoadedODFlag()
sets a flag that is set if we have loaded some OD blockfiles from PCM.
void RemoveTaskIfInQueue(ODTask *task)
removes a task from the active task queue
ODLock mQueueNotEmptyCondLock
static void UnmarkLoadedODFlag()
resets a flag that is set if we have loaded some OD blockfiles from PCM.
std::vector< ODTask * > mTasks
Pauser(const Pauser &) PROHIBITED
int GetTotalNumTasks()
Get Total Number of Tasks.
std::unique_ptr< ODCondition > mQueueNotEmptyCond
void * Entry()
Executes a part of the task.
static std::unique_ptr< ODManager > pMan
A class representing a modular task to be used with the On-Demand structures.
A class representing a modular task to be used with the On-Demand structures.
void Start()
Start the main loop for the manager.
int CompareNoCaseFileName(const wxString &first, const wxString &second)
wxstring compare function for sorting case, which is needed to load correctly.
Abstract base class for an object holding data associated with points on a time axis.
void Init()
Launches a thread for the manager and starts accepting Tasks.
wxDECLARE_EXPORTED_EVENT(AUDACITY_DLL_API, EVT_ODTASK_UPDATE, wxCommandEvent)
static bool HasLoadedODFlag()
returns a flag that is set if we have loaded some OD blockfiles from PCM.
void DecrementCurrentThreads()
Reduces the count of current threads running. Meant to be called when ODTaskThreads end in their own ...
static ODManager *(* Instance)()
void ReplaceWaveTrack(Track *oldTrack, const std::shared_ptr< Track > &newTrack)
replace the wavetrack whose wavecache the gui watches for updates
A singleton that manages currently running Tasks on an arbitrary number of threads.
int mMaxThreads
Maximum number of threads allowed out.
void UpdateQueues()
Remove references in our array to Tasks that have been completed/Schedule NEW ones.