mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-11 09:31:13 +02:00
More const qualifiers and mutable members for drawing of tracks
This commit is contained in:
parent
d097c7fad4
commit
6f63226291
@ -72,7 +72,7 @@ class AUDACITY_DLL_API Track /* not final */ : public XMLTagHandler
|
|||||||
bool mMinimized;
|
bool mMinimized;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxSize vrulerSize;
|
mutable wxSize vrulerSize;
|
||||||
|
|
||||||
// This just returns a constant and can be overriden by subclasses
|
// This just returns a constant and can be overriden by subclasses
|
||||||
// to specify a different height for the case that the track is minimized.
|
// to specify a different height for the case that the track is minimized.
|
||||||
|
@ -506,7 +506,7 @@ void TrackArtist::DrawTrack(const Track * t,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrackArtist::DrawVRuler(Track *t, wxDC * dc, wxRect & rect)
|
void TrackArtist::DrawVRuler(const Track *t, wxDC * dc, wxRect & rect)
|
||||||
{
|
{
|
||||||
int kind = t->GetKind();
|
int kind = t->GetKind();
|
||||||
|
|
||||||
@ -584,7 +584,7 @@ void TrackArtist::DrawVRuler(Track *t, wxDC * dc, wxRect & rect)
|
|||||||
rect.height -= 1;
|
rect.height -= 1;
|
||||||
|
|
||||||
//int bottom = GetBottom((NoteTrack *) t, rect);
|
//int bottom = GetBottom((NoteTrack *) t, rect);
|
||||||
NoteTrack *track = (NoteTrack *) t;
|
const NoteTrack *track = (NoteTrack *) t;
|
||||||
track->PrepareIPitchToY(rect);
|
track->PrepareIPitchToY(rect);
|
||||||
|
|
||||||
wxPen hilitePen;
|
wxPen hilitePen;
|
||||||
@ -666,7 +666,7 @@ void TrackArtist::DrawVRuler(Track *t, wxDC * dc, wxRect & rect)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrackArtist::UpdateVRuler(Track *t, wxRect & rect)
|
void TrackArtist::UpdateVRuler(const Track *t, wxRect & rect)
|
||||||
{
|
{
|
||||||
// Label tracks do not have a vruler
|
// Label tracks do not have a vruler
|
||||||
if (t->GetKind() == Track::Label) {
|
if (t->GetKind() == Track::Label) {
|
||||||
@ -675,7 +675,7 @@ void TrackArtist::UpdateVRuler(Track *t, wxRect & rect)
|
|||||||
|
|
||||||
// Time tracks
|
// Time tracks
|
||||||
if (t->GetKind() == Track::Time) {
|
if (t->GetKind() == Track::Time) {
|
||||||
TimeTrack *tt = (TimeTrack *)t;
|
const TimeTrack *tt = (TimeTrack *)t;
|
||||||
float min, max;
|
float min, max;
|
||||||
min = tt->GetRangeLower() * 100.0;
|
min = tt->GetRangeLower() * 100.0;
|
||||||
max = tt->GetRangeUpper() * 100.0;
|
max = tt->GetRangeUpper() * 100.0;
|
||||||
@ -692,9 +692,9 @@ void TrackArtist::UpdateVRuler(Track *t, wxRect & rect)
|
|||||||
// All waves have a ruler in the info panel
|
// All waves have a ruler in the info panel
|
||||||
// The ruler needs a bevelled surround.
|
// The ruler needs a bevelled surround.
|
||||||
if (t->GetKind() == Track::Wave) {
|
if (t->GetKind() == Track::Wave) {
|
||||||
WaveTrack *wt = static_cast<WaveTrack*>(t);
|
const WaveTrack *wt = static_cast<const WaveTrack*>(t);
|
||||||
const float dBRange =
|
const float dBRange =
|
||||||
static_cast<WaveTrack*>(wt)->GetWaveformSettings().dBRange;
|
wt->GetWaveformSettings().dBRange;
|
||||||
|
|
||||||
const int display = wt->GetDisplay();
|
const int display = wt->GetDisplay();
|
||||||
|
|
||||||
|
@ -63,9 +63,9 @@ class AUDACITY_DLL_API TrackArtist {
|
|||||||
bool drawEnvelope, bool bigPoints, bool drawSliders,
|
bool drawEnvelope, bool bigPoints, bool drawSliders,
|
||||||
bool hasSolo);
|
bool hasSolo);
|
||||||
|
|
||||||
void DrawVRuler(Track *t, wxDC *dc, wxRect & rect);
|
void DrawVRuler(const Track *t, wxDC *dc, wxRect & rect);
|
||||||
|
|
||||||
void UpdateVRuler(Track *t, wxRect & rect);
|
void UpdateVRuler(const Track *t, wxRect & rect);
|
||||||
|
|
||||||
void SetInset(int left, int top, int right, int bottom);
|
void SetInset(int left, int top, int right, int bottom);
|
||||||
|
|
||||||
|
@ -283,12 +283,12 @@ WaveTrack::ValidateWaveTrackDisplay(WaveTrackDisplay display)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaveTrack::SetLastScaleType()
|
void WaveTrack::SetLastScaleType() const
|
||||||
{
|
{
|
||||||
mLastScaleType = GetWaveformSettings().scaleType;
|
mLastScaleType = GetWaveformSettings().scaleType;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaveTrack::SetLastdBRange()
|
void WaveTrack::SetLastdBRange() const
|
||||||
{
|
{
|
||||||
mLastdBRange = GetWaveformSettings().dBRange;
|
mLastdBRange = GetWaveformSettings().dBRange;
|
||||||
}
|
}
|
||||||
@ -299,7 +299,7 @@ void WaveTrack::GetDisplayBounds(float *min, float *max) const
|
|||||||
*max = mDisplayMax;
|
*max = mDisplayMax;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaveTrack::SetDisplayBounds(float min, float max)
|
void WaveTrack::SetDisplayBounds(float min, float max) const
|
||||||
{
|
{
|
||||||
mDisplayMin = min;
|
mDisplayMin = min;
|
||||||
mDisplayMax = max;
|
mDisplayMax = max;
|
||||||
@ -349,7 +349,7 @@ void WaveTrack::GetSpectrumBounds(float *min, float *max) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaveTrack::SetSpectrumBounds(float min, float max)
|
void WaveTrack::SetSpectrumBounds(float min, float max) const
|
||||||
{
|
{
|
||||||
mSpectrumMin = min;
|
mSpectrumMin = min;
|
||||||
mSpectrumMax = max;
|
mSpectrumMax = max;
|
||||||
|
@ -436,19 +436,19 @@ class AUDACITY_DLL_API WaveTrack final : public Track {
|
|||||||
// Handle restriction of range of values of the enum from future versions
|
// Handle restriction of range of values of the enum from future versions
|
||||||
static WaveTrackDisplay ValidateWaveTrackDisplay(WaveTrackDisplay display);
|
static WaveTrackDisplay ValidateWaveTrackDisplay(WaveTrackDisplay display);
|
||||||
|
|
||||||
int GetLastScaleType() { return mLastScaleType; }
|
int GetLastScaleType() const { return mLastScaleType; }
|
||||||
void SetLastScaleType();
|
void SetLastScaleType() const;
|
||||||
|
|
||||||
int GetLastdBRange() { return mLastdBRange; }
|
int GetLastdBRange() const { return mLastdBRange; }
|
||||||
void SetLastdBRange();
|
void SetLastdBRange() const;
|
||||||
|
|
||||||
WaveTrackDisplay GetDisplay() const { return mDisplay; }
|
WaveTrackDisplay GetDisplay() const { return mDisplay; }
|
||||||
void SetDisplay(WaveTrackDisplay display) { mDisplay = display; }
|
void SetDisplay(WaveTrackDisplay display) { mDisplay = display; }
|
||||||
|
|
||||||
void GetDisplayBounds(float *min, float *max) const;
|
void GetDisplayBounds(float *min, float *max) const;
|
||||||
void SetDisplayBounds(float min, float max);
|
void SetDisplayBounds(float min, float max) const;
|
||||||
void GetSpectrumBounds(float *min, float *max) const;
|
void GetSpectrumBounds(float *min, float *max) const;
|
||||||
void SetSpectrumBounds(float min, float max);
|
void SetSpectrumBounds(float min, float max) const;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -468,14 +468,14 @@ class AUDACITY_DLL_API WaveTrack final : public Track {
|
|||||||
// Data that should be part of GUIWaveTrack
|
// Data that should be part of GUIWaveTrack
|
||||||
// and will be taken out of the WaveTrack class:
|
// and will be taken out of the WaveTrack class:
|
||||||
//
|
//
|
||||||
float mDisplayMin;
|
mutable float mDisplayMin;
|
||||||
float mDisplayMax;
|
mutable float mDisplayMax;
|
||||||
float mSpectrumMin;
|
mutable float mSpectrumMin;
|
||||||
float mSpectrumMax;
|
mutable float mSpectrumMax;
|
||||||
|
|
||||||
WaveTrackDisplay mDisplay;
|
WaveTrackDisplay mDisplay;
|
||||||
int mLastScaleType; // last scale type choice
|
mutable int mLastScaleType; // last scale type choice
|
||||||
int mLastdBRange;
|
mutable int mLastdBRange;
|
||||||
mutable std::vector <Location> mDisplayLocationsCache;
|
mutable std::vector <Location> mDisplayLocationsCache;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user