Audacity  3.0.3
ProjectSelectionManager.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3 Audacity: A Digital Audio Editor
4 
5 ProjectSelectionManager.cpp
6 
7 Paul Licameli split from ProjectManager.cpp
8 
9 **********************************************************************/
10 
11 #ifndef __AUDACITY_PROJECT_SELECTION_MANAGER__
12 #define __AUDACITY_PROJECT_SELECTION_MANAGER__
13 
14 #include "ClientData.h" // to inherit
15 #include "toolbars/SelectionBarListener.h" // to inherit
16 #include "toolbars/SpectralSelectionBarListener.h" // to inherit
18 
19 class AudacityProject;
20 
21 class AUDACITY_DLL_API ProjectSelectionManager final
22  : public ClientData::Base
23  , public SelectionBarListener
25  , public TimeToolBarListener
26 {
27 public:
28  static ProjectSelectionManager &Get( AudacityProject &project );
29  static const ProjectSelectionManager &Get( const AudacityProject &project );
30 
31  explicit ProjectSelectionManager( AudacityProject &project );
34  const ProjectSelectionManager & ) PROHIBITED;
36 
37  // SelectionBarListener callback methods
38  double AS_GetRate() override;
39  void AS_SetRate(double rate) override;
40  int AS_GetSnapTo() override;
41  void AS_SetSnapTo(int snap) override;
42  const NumericFormatSymbol & AS_GetSelectionFormat() override;
43  void AS_SetSelectionFormat(const NumericFormatSymbol & format) override;
44  const NumericFormatSymbol & TT_GetAudioTimeFormat() override;
45  void TT_SetAudioTimeFormat(const NumericFormatSymbol & format) override;
46  void AS_ModifySelection(double &start, double &end, bool done) override;
47 
48  // SpectralSelectionBarListener callback methods
49  double SSBL_GetRate() const override;
52  const NumericFormatSymbol & formatName) override;
55  const NumericFormatSymbol & formatName) override;
57  double &bottom, double &top, bool done) override;
58 
59 private:
60  bool SnapSelection();
61 
63 };
64 
65 #endif
ProjectSelectionManager
Definition: ProjectSelectionManager.h:26
SelectionBarListener::AS_ModifySelection
virtual void AS_ModifySelection(double &start, double &end, bool done)=0
SelectionBarListener::AS_GetSnapTo
virtual int AS_GetSnapTo()=0
SpectralSelectionBarListener::SSBL_SetFrequencySelectionFormatName
virtual void SSBL_SetFrequencySelectionFormatName(const NumericFormatSymbol &formatName)=0
SpectralSelectionBarListener::SSBL_SetBandwidthSelectionFormatName
virtual void SSBL_SetBandwidthSelectionFormatName(const NumericFormatSymbol &formatName)=0
SpectralSelectionBarListener.h
ClientData::Base
A convenient default parameter for class template Site.
Definition: ClientData.h:28
ComponentInterfaceSymbol.h
ClientData.h
Utility ClientData::Site to register hooks into a host class that attach client data.
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterfaceSymbol.h:27
SelectionBarListener::AS_SetRate
virtual void AS_SetRate(double rate)=0
SelectionBarListener::AS_GetSelectionFormat
virtual const NumericFormatSymbol & AS_GetSelectionFormat()=0
SelectionBarListener::AS_SetSelectionFormat
virtual void AS_SetSelectionFormat(const NumericFormatSymbol &format)=0
SpectralSelectionBarListener
A class used to forward events to do with changes in the SpectralSelectionBar.
Definition: SpectralSelectionBarListener.h:17
SpectralSelectionBarListener::SSBL_GetRate
virtual double SSBL_GetRate() const =0
BasicUI::Get
Services * Get()
Fetch the global instance, or nullptr if none is yet installed.
Definition: BasicUI.cpp:26
ProjectSelectionManager::operator=
ProjectSelectionManager & operator=(const ProjectSelectionManager &) PROHIBITED
SelectionBarListener.h
format
int format
Definition: ExportPCM.cpp:56
TimeToolBarListener
Definition: SelectionBarListener.h:35
TimeToolBarListener::TT_SetAudioTimeFormat
virtual void TT_SetAudioTimeFormat(const NumericFormatSymbol &format)=0
SpectralSelectionBarListener::SSBL_GetBandwidthSelectionFormatName
virtual const NumericFormatSymbol & SSBL_GetBandwidthSelectionFormatName()=0
SelectionBarListener
A parent class of SelectionBar, used to forward events to do with changes in the SelectionBar.
Definition: SelectionBarListener.h:19
ProjectSelectionManager::~ProjectSelectionManager
~ProjectSelectionManager() override
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:92
SelectionBarListener::AS_GetRate
virtual double AS_GetRate()=0
SpectralSelectionBarListener::SSBL_GetFrequencySelectionFormatName
virtual const NumericFormatSymbol & SSBL_GetFrequencySelectionFormatName()=0
ProjectSelectionManager::mProject
AudacityProject & mProject
Definition: ProjectSelectionManager.h:62
SpectralSelectionBarListener::SSBL_ModifySpectralSelection
virtual void SSBL_ModifySpectralSelection(double &bottom, double &top, bool done)=0
ProjectSelectionManager::ProjectSelectionManager
ProjectSelectionManager(const ProjectSelectionManager &) PROHIBITED
TimeToolBarListener::TT_GetAudioTimeFormat
virtual const NumericFormatSymbol & TT_GetAudioTimeFormat()=0
SelectionBarListener::AS_SetSnapTo
virtual void AS_SetSnapTo(int snap)=0