Audacity  2.2.2
ODWaveTrackTaskQueue.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  ODWaveTrackTaskQueue.h
6 
7  Created by Michael Chinen (mchinen)
8  Audacity(R) is copyright (c) 1999-2008 Audacity Team.
9  License: GPL v2. See License.txt.
10 
11 ******************************************************************//*******************************************************************/
18 
19 
20 
21 
22 #ifndef __AUDACITY_ODWAVETRACKTASKQUEUE__
23 #define __AUDACITY_ODWAVETRACKTASKQUEUE__
24 
25 #include "../MemoryX.h"
26 #include <vector>
27 #include "ODTaskThread.h"
28 #include <wx/wx.h>
29 class WaveTrack;
30 class ODTask;
33 {
34  public:
35 
36  // Constructor / Destructor
37 
40 
41  virtual ~ODWaveTrackTaskQueue();
42 
43 
44 
46  void AddWaveTrack(WaveTrack* track);
49  void RemoveWaveTrack(WaveTrack* track);
50 
52  void DemandTrackUpdate(WaveTrack* track, double seconds);
53 
55  void ReplaceWaveTrack(WaveTrack* oldTrack,WaveTrack* newTrack);
56 
57  //if the wavetrack is in this queue, and is not the only wavetrack, clones the tasks and schedules it.
59 
61  bool CanMergeWith(ODWaveTrackTaskQueue* otherQueue);
62  void MergeWaveTrack(WaveTrack* track);
63 
64 
65  //returns true if the agrument is in the WaveTrack list.
66  bool ContainsWaveTrack(const WaveTrack* track);
67 
68  //returns the wavetrack at position x.
69  WaveTrack* GetWaveTrack(size_t x);
70 
72  int GetNumWaveTracks();
73 
75  void AddTask(movable_ptr<ODTask> &&mtask);
76 
77  //returns true if either tracks or tasks are empty
78  bool IsEmpty();
79 
80  //returns true if the foremost task exists and is empty.
81  bool IsFrontTaskComplete();
82 
84  void RemoveFrontTask();
85 
88 
90  int GetNumTasks();
91 
93  ODTask* GetTask(size_t x);
94 
96  void FillTipForWaveTrack( const WaveTrack * t, wxString &tip );
97 
98  protected:
99 
100  //because we need to save this around for the tool tip.
101  wxString mTipMsg;
102 
103 
105  std::vector<WaveTrack*> mTracks;
107 
109  std::vector<movable_ptr<ODTask>> mTasks;
111 
112 };
113 
114 #endif
115 
void MergeWaveTrack(WaveTrack *track)
std::unique_ptr< T > movable_ptr
Definition: MemoryX.h:713
ODTask * GetFrontTask()
Schedules the front task for immediate execution.
void AddWaveTrack(WaveTrack *track)
Adds a track to the associated list.
void RemoveFrontTask()
Removes and deletes the front task from the list.
void AddTask(movable_ptr< ODTask > &&mtask)
Add a task to the queue.
int GetNumWaveTracks()
returns the number of wavetracks in this queue.
std::vector< WaveTrack * > mTracks
the list of tracks associated with this queue.
A class representing a modular task to be used with the On-Demand structures.
Definition: ODTask.h:39
bool ContainsWaveTrack(const WaveTrack *track)
returns true if the argument is in the WaveTrack list.
void FillTipForWaveTrack(const WaveTrack *t, wxString &tip)
fills in the status bar message for a given track
WaveTrack * GetWaveTrack(size_t x)
void RemoveWaveTrack(WaveTrack *track)
A Track that contains audio waveform data.
Definition: WaveTrack.h:60
int GetNumTasks()
returns the number of ODTasks in this queue
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 MakeWaveTrackIndependent(WaveTrack *track)
ODWaveTrackTaskQueue()
Constructs an ODWaveTrackTaskQueue.
ODTask * GetTask(size_t x)
returns a ODTask at position x
A class representing a modular task to be used with the On-Demand structures.
bool CanMergeWith(ODWaveTrackTaskQueue *otherQueue)
returns whether or not this queue's task list and another's can merge together, as when we make two m...
void ReplaceWaveTrack(WaveTrack *oldTrack, WaveTrack *newTrack)
replaces all instances of a WaveTrack within this task with another.
std::vector< movable_ptr< ODTask > > mTasks
the list of tasks associated with the tracks. This class owns these tasks.