Audacity 3.2.0
ProjectTimeSignature.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/**********************************************************************
3
4 Audacity: A Digital Audio Editor
5
6 @file ProjectTimeSignature.h
7
8 Dmitry Vedenko
9
10 **********************************************************************/
11#pragma once
12
13#include "ClientData.h"
14#include "Observer.h"
15
16class AudacityProject;
17
19{
20 double newTempo {};
23};
24
25class NUMERIC_FORMATS_API ProjectTimeSignature final :
26 public ClientData::Base,
27 public Observer::Publisher<TimeSignatureChangedMessage>
28{
29public:
31 static const ProjectTimeSignature& Get(const AudacityProject& project);
32
35
36 double GetTempo() const;
37 void SetTempo(double tempo);
38
39 int GetUpperTimeSignature() const;
40 void SetUpperTimeSignature(int upperTimeSignature);
41
42 int GetLowerTimeSignature() const;
43 void SetLowerTimeSignature(int lowerTimeSignature);
44
45 double GetQuarterDuration() const;
46 double GetBeatDuration() const;
47 double GetBarDuration() const;
48
49private:
50 void PublishSignatureChange();
51
52 double mTempo;
55};
56
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
~ProjectTimeSignature() override
Services * Get()
Fetch the global instance, or nullptr if none is yet installed.
Definition: BasicUI.cpp:201
A convenient default parameter for class template Site.
Definition: ClientData.h:29