Audacity 3.2.0
WaveformScale.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3Audacity: A Digital Audio Editor
4
5WaveformScale.cpp
6
7Paul Licameli
8
9***********************************************************************/
10
11#include "WaveformScale.h"
12#include "WaveTrack.h"
13#include <wx/gdicmn.h>
14
16key2{ [](auto &) { return std::make_unique<WaveformScale>(); } };
17
19{
20 auto &mutTrack = const_cast<WaveTrack&>(track);
21 return mutTrack.Attachments::Get<WaveformScale>(key2);
22}
23
25{
26 return Get(channel.GetTrack());
27}
28
30
32{
33 return std::make_unique<WaveformScale>(*this);
34}
35
37{
38 return rect.GetTop() +
39 (int)((mDisplayMax / (mDisplayMax - mDisplayMin)) * rect.height);
40}
static const ChannelGroup::Attachments::RegisteredFactory key2
Client code makes static instance from a factory of attachments; passes it to Get or Find as a retrie...
Definition: ClientData.h:275
WaveTrack & GetTrack()
Definition: WaveTrack.h:841
A Track that contains audio waveform data.
Definition: WaveTrack.h:203
int ZeroLevelYCoordinate(wxRect rect) const
static WaveformScale & Get(const WaveTrack &track)
Mutative access to attachment even if the track argument is const.
PointerType Clone() const override
~WaveformScale() override
Owner< Base > PointerType
Definition: ClientData.h:54