Audacity 3.2.0
ProjectRate.h
Go to the documentation of this file.
1/*!********************************************************************
2
3Audacity: A Digital Audio Editor
4
5@file ProjectRate.h
6@brief an object holding per-project preferred sample rate
7
8Paul Licameli split from ProjectSettings.h
9
10**********************************************************************/
11
12#ifndef __AUDACITY_PROJECT_RATE__
13#define __AUDACITY_PROJECT_RATE__
14
15class AudacityProject;
16
17#include "ClientData.h"
18#include "Observer.h"
19
21class PROJECT_RATE_API ProjectRate final
22 : public ClientData::Base
23 , public Observer::Publisher<double>
24{
25public:
27 static const ProjectRate &Get( const AudacityProject &project );
28
30 ProjectRate( const ProjectRate & ) = delete;
31 ProjectRate &operator=( const ProjectRate & ) = delete;
32
33 void SetRate(double rate);
34 double GetRate() const;
35
36private:
37 double mRate;
38};
39
40#endif
41
Utility ClientData::Site to register hooks into a host class that attach client data.
const auto project
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
An object that sends messages to an open-ended list of subscribed callbacks.
Definition: Observer.h:108
Holds project sample rate.
Definition: ProjectRate.h:24
ProjectRate & operator=(const ProjectRate &)=delete
ProjectRate(const ProjectRate &)=delete
double mRate
Definition: ProjectRate.h:37
Services * Get()
Fetch the global instance, or nullptr if none is yet installed.
Definition: BasicUI.cpp:196
double GetRate(const Track &track)
Definition: TimeTrack.cpp:182
A convenient default parameter for class template Site.
Definition: ClientData.h:29