18 : mProject(
project.weak_from_this())
72 return defaultSampleRate;
an object holding per-project preferred sample rate
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
A context in which formatter operates.
static FormatterContext EmptyContext()
static FormatterContext ProjectContext(const AudacityProject &project)
FormatterContext()=default
bool HasProject() const
Returns true if the reference to the project is valid at this moment.
std::optional< double > mProjectRate
static FormatterContext SampleRateContext(double sampleRate)
std::shared_ptr< const AudacityProject > GetProject() const
Returns a potentially null pointer to the project.
std::weak_ptr< const AudacityProject > mProject
double GetSampleRate(double defaultSampleRate=44100.0) const
Returns a sample rate from this context.
bool HasSampleRate() const
Returns true if it is possible to get a sample rate from this context.
static ProjectRate & Get(AudacityProject &project)
constexpr auto sampleRate