MCPcopy Create free account
hub / github.com/audacity/audacity / Impl

Method Impl

src/ProjectTimeRuler.cpp:41–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39struct ProjectTimeRuler::Impl final
40{
41 explicit Impl(AudacityProject& project)
42 : beatsFormat { ProjectTimeSignature::Get(project) }
43 , projectTimeSignatureChanged { ProjectTimeSignature::Get(project)
44 .Subscribe([this](const auto& msg) {
45 beatsFormat.SetData(
46 msg.newTempo,
47 msg.newUpperTimeSignature,
48 msg.newLowerTimeSignature);
49
50 ruler.Invalidate();
51 }) }
52 , timeDisplayModeChanged { TimeDisplayModePreference.Subscribe(
53 [this](TimeDisplayMode newMode) {
54 switch (newMode)
55 {
56 case TimeDisplayMode::BeatsAndMeasures:
57 ruler.SetFormat(&beatsFormat);
58 break;
59 case TimeDisplayMode::MinutesAndSeconds:
60 ruler.SetFormat(&TimeFormat::Instance());
61 break;
62 default:
63 assert(false);
64 break;
65 }
66 }) }
67 {
68 if (mode == TimeDisplayMode::BeatsAndMeasures)
69 ruler.SetFormat(&beatsFormat);
70 }
71
72 TimeDisplayMode mode { TimeDisplayModePreference.ReadEnum() };
73

Callers

nothing calls this directly

Calls 6

GetFunction · 0.85
InstanceClass · 0.50
SubscribeMethod · 0.45
SetDataMethod · 0.45
InvalidateMethod · 0.45
SetFormatMethod · 0.45

Tested by

no test coverage detected