Audacity  2.2.2
ODComputeSummaryTask.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  ODComputeSummaryTask.h
6 
7  Created by Michael Chinen (mchinen) on 6/8/08.
8  Audacity(R) is copyright (c) 1999-2008 Audacity Team.
9  License: GPL v2. See License.txt.
10 
11 ******************************************************************//*******************************************************************/
18 
19 #ifndef __AUDACITY_ODComputeSummaryTask__
20 #define __AUDACITY_ODComputeSummaryTask__
21 
22 #include <vector>
23 #include "ODTask.h"
24 #include "ODTaskThread.h"
26 class WaveTrack;
27 
29 class ODComputeSummaryTask final : public ODTask
30 {
31  public:
32 
33  // Constructor / Destructor
34 
37  virtual ~ODComputeSummaryTask(){};
38 
39  std::unique_ptr<ODTask> Clone() const override;
40 
42  unsigned int GetODType() override { return eODPCMSummary; }
43 
45  const char* GetTaskName() override { return "ODComputeSummaryTask"; }
46 
47  const wxChar* GetTip() override { return _("Import complete. Calculating waveform"); }
48 
49  bool UsesCustomWorkUntilPercentage() override { return true; }
51 
53  void Terminate() override;
54 
55 protected:
57  void CalculatePercentComplete() override;
58 
60  void DoSomeInternal() override;
61 
64  void Update() override;
65 
67  void OrderBlockFiles
68  (std::vector< std::weak_ptr< ODPCMAliasBlockFile > > &unorderedBlocks);
69 
71  void MarkUpdateRan();
72  bool HasUpdateRan();
73 
74  //mBlockFiles is touched on several threads- the OD terminate thread, and the task thread, so we need to mutex it.
76  std::vector< std::weak_ptr< ODPCMAliasBlockFile > > mBlockFiles;
80 };
81 
82 #endif
83 
const char * GetTaskName() override
Return the task name.
bool UsesCustomWorkUntilPercentage() override
An AliasBlockFile that references uncompressed data in an existing file.
std::vector< std::weak_ptr< ODPCMAliasBlockFile > > mBlockFiles
void CalculatePercentComplete() override
recalculates the percentage complete.
float ComputeNextWorkUntilPercentageComplete() override
void MarkUpdateRan()
tells us whether or not Update has been run at least once.
A class representing a modular task to be used with the On-Demand structures.
Definition: ODTask.h:39
void OrderBlockFiles(std::vector< std::weak_ptr< ODPCMAliasBlockFile > > &unorderedBlocks)
Orders the input as either On-Demand or default layered order.
void Terminate() override
releases memory that the ODTask owns. Subclasses should override.
const wxChar * GetTip() override
A Track that contains audio waveform data.
Definition: WaveTrack.h:60
std::unique_ptr< ODTask > Clone() const override
A class representing a modular task to be used with the On-Demand structures.
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
ODComputeSummaryTask()
Constructs an ODTask.
unsigned int GetODType() override
Subclasses should override to return respective type.
void DoSomeInternal() override
Computes and writes the data for one BlockFile if it still has a refcount.