Audacity  3.0.3
ProjectRate.h
Go to the documentation of this file.
1 /*!********************************************************************
2 
3 Audacity: A Digital Audio Editor
4 
5 @file ProjectRate.h
6 @brief an object holding per-project preferred sample rate
7 
8 Paul Licameli split from ProjectSettings.h
9 
10 **********************************************************************/
11 
12 #ifndef __AUDACITY_PROJECT_RATE__
13 #define __AUDACITY_PROJECT_RATE__
14 
15 class AudacityProject;
16 
17 #include "ClientData.h"
18 #include <wx/event.h> // to declare custom event type
19 
20 // Sent to the project when the rate changes
21 wxDECLARE_EXPORTED_EVENT(PROJECT_RATE_API,
22  EVT_PROJECT_RATE_CHANGE, wxEvent);
23 
25 class PROJECT_RATE_API ProjectRate final
26  : public ClientData::Base
27 {
28 public:
29  static ProjectRate &Get( AudacityProject &project );
30  static const ProjectRate &Get( const AudacityProject &project );
31 
32  explicit ProjectRate(AudacityProject &project);
33  ProjectRate( const ProjectRate & ) PROHIBITED;
34  ProjectRate &operator=( const ProjectRate & ) PROHIBITED;
35 
36  void SetRate(double rate);
37  double GetRate() const;
38 
39 private:
41  double mRate;
42 };
43 
44 #endif
45 
ProjectRate::mRate
double mRate
Definition: ProjectRate.h:41
ClientData::Base
A convenient default parameter for class template Site.
Definition: ClientData.h:28
ProjectRate::ProjectRate
ProjectRate(const ProjectRate &) PROHIBITED
ClientData.h
Utility ClientData::Site to register hooks into a host class that attach client data.
ProjectRate
Holds project sample rate.
Definition: ProjectRate.h:27
BasicUI::Get
Services * Get()
Fetch the global instance, or nullptr if none is yet installed.
Definition: BasicUI.cpp:26
ProjectRate::operator=
ProjectRate & operator=(const ProjectRate &) PROHIBITED
anonymous_namespace{TimeTrack.cpp}::GetRate
double GetRate()
Definition: TimeTrack.cpp:175
ProjectRate::mProject
AudacityProject & mProject
Definition: ProjectRate.h:40
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
wxDECLARE_EXPORTED_EVENT
wxDECLARE_EXPORTED_EVENT(PROJECT_RATE_API, EVT_PROJECT_RATE_CHANGE, wxEvent)