Audacity 3.2.0
BeatsFormat.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 BeatsFormat.h
6
7 Michael Papadopoulos
8
9**********************************************************************/
10
11#ifndef __AUDACITY_BEATS_FORMAT__
12#define __AUDACITY_BEATS_FORMAT__
13
14#include "RulerFormat.h"
15
17
18class BeatsFormat final : public RulerFormat {
19public:
20 struct Tick final
21 {
22 int upper { 1 };
23 int lower { 1 };
24 // Duration is in seconds
25 double duration {};
26 };
27
28 struct Ticks final
29 {
33 };
34
36 BeatsFormat(const ProjectTimeSignature& timeSignature);
37 BeatsFormat() = delete;
38
39 ~BeatsFormat() override;
40
41 void SetTickSizes(
42 double units, double& major, double& minor, double &minorMinor,
43 int& mDigits
44 ) const override;
45
46 void SetLabelString(
47 wxString& s, double d, double units, double minor, int mDigits, TickType tickType
48 ) const override;
49
56 void SetData(double bpm, int timeSigUpper, int timeSigLower);
57
58 void UpdateSubdivision(double units);
59
60 const Ticks& GetSubdivision() const;
61
62private:
63 double mBpm{ 60.0 };
64 int mTimeSigUpper{ 4 };
65 int mTimeSigLower{ 4 };
66
68};
69
70#endif
void SetLabelString(wxString &s, double d, double units, double minor, int mDigits, TickType tickType) const override
Definition: BeatsFormat.cpp:30
~BeatsFormat() override
void UpdateSubdivision(double units)
Definition: BeatsFormat.cpp:89
double mBpm
Definition: BeatsFormat.h:63
BeatsFormat()=delete
int mTimeSigLower
Definition: BeatsFormat.h:65
int mTimeSigUpper
Definition: BeatsFormat.h:64
Ticks mTicks
Definition: BeatsFormat.h:67
void SetData(double bpm, int timeSigUpper, int timeSigLower)
Definition: BeatsFormat.cpp:70
void SetTickSizes(double units, double &major, double &minor, double &minorMinor, int &mDigits) const override
Definition: BeatsFormat.cpp:16
const Ticks & GetSubdivision() const