mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-11 01:21:11 +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;
|
||||
|
||||
public:
|
||||
wxSize vrulerSize;
|
||||
mutable wxSize vrulerSize;
|
||||
|
||||
// This just returns a constant and can be overriden by subclasses
|
||||
// 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();
|
||||
|
||||
@ -584,7 +584,7 @@ void TrackArtist::DrawVRuler(Track *t, wxDC * dc, wxRect & rect)
|
||||
rect.height -= 1;
|
||||
|
||||
//int bottom = GetBottom((NoteTrack *) t, rect);
|
||||
NoteTrack *track = (NoteTrack *) t;
|
||||
const NoteTrack *track = (NoteTrack *) t;
|
||||
track->PrepareIPitchToY(rect);
|
||||
|
||||
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
|
||||
if (t->GetKind() == Track::Label) {
|
||||
@ -675,7 +675,7 @@ void TrackArtist::UpdateVRuler(Track *t, wxRect & rect)
|
||||
|
||||
// Time tracks
|
||||
if (t->GetKind() == Track::Time) {
|
||||
TimeTrack *tt = (TimeTrack *)t;
|
||||
const TimeTrack *tt = (TimeTrack *)t;
|
||||
float min, max;
|
||||
min = tt->GetRangeLower() * 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
|
||||
// The ruler needs a bevelled surround.
|
||||
if (t->GetKind() == Track::Wave) {
|
||||
WaveTrack *wt = static_cast<WaveTrack*>(t);
|
||||
const WaveTrack *wt = static_cast<const WaveTrack*>(t);
|
||||
const float dBRange =
|
||||
static_cast<WaveTrack*>(wt)->GetWaveformSettings().dBRange;
|
||||
wt->GetWaveformSettings().dBRange;
|
||||
|
||||
const int display = wt->GetDisplay();
|
||||
|
||||
|
@ -63,9 +63,9 @@ class AUDACITY_DLL_API TrackArtist {
|
||||
bool drawEnvelope, bool bigPoints, bool drawSliders,
|
||||
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);
|
||||
|
||||
|
@ -283,12 +283,12 @@ WaveTrack::ValidateWaveTrackDisplay(WaveTrackDisplay display)
|
||||
}
|
||||
}
|
||||
|
||||
void WaveTrack::SetLastScaleType()
|
||||
void WaveTrack::SetLastScaleType() const
|
||||
{
|
||||
mLastScaleType = GetWaveformSettings().scaleType;
|
||||
}
|
||||
|
||||
void WaveTrack::SetLastdBRange()
|
||||
void WaveTrack::SetLastdBRange() const
|
||||
{
|
||||
mLastdBRange = GetWaveformSettings().dBRange;
|
||||
}
|
||||
@ -299,7 +299,7 @@ void WaveTrack::GetDisplayBounds(float *min, float *max) const
|
||||
*max = mDisplayMax;
|
||||
}
|
||||
|
||||
void WaveTrack::SetDisplayBounds(float min, float max)
|
||||
void WaveTrack::SetDisplayBounds(float min, float max) const
|
||||
{
|
||||
mDisplayMin = min;
|
||||
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;
|
||||
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
|
||||
static WaveTrackDisplay ValidateWaveTrackDisplay(WaveTrackDisplay display);
|
||||
|
||||
int GetLastScaleType() { return mLastScaleType; }
|
||||
void SetLastScaleType();
|
||||
int GetLastScaleType() const { return mLastScaleType; }
|
||||
void SetLastScaleType() const;
|
||||
|
||||
int GetLastdBRange() { return mLastdBRange; }
|
||||
void SetLastdBRange();
|
||||
int GetLastdBRange() const { return mLastdBRange; }
|
||||
void SetLastdBRange() const;
|
||||
|
||||
WaveTrackDisplay GetDisplay() const { return mDisplay; }
|
||||
void SetDisplay(WaveTrackDisplay display) { mDisplay = display; }
|
||||
|
||||
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 SetSpectrumBounds(float min, float max);
|
||||
void SetSpectrumBounds(float min, float max) const;
|
||||
|
||||
|
||||
protected:
|
||||
@ -468,14 +468,14 @@ class AUDACITY_DLL_API WaveTrack final : public Track {
|
||||
// Data that should be part of GUIWaveTrack
|
||||
// and will be taken out of the WaveTrack class:
|
||||
//
|
||||
float mDisplayMin;
|
||||
float mDisplayMax;
|
||||
float mSpectrumMin;
|
||||
float mSpectrumMax;
|
||||
mutable float mDisplayMin;
|
||||
mutable float mDisplayMax;
|
||||
mutable float mSpectrumMin;
|
||||
mutable float mSpectrumMax;
|
||||
|
||||
WaveTrackDisplay mDisplay;
|
||||
int mLastScaleType; // last scale type choice
|
||||
int mLastdBRange;
|
||||
mutable int mLastScaleType; // last scale type choice
|
||||
mutable int mLastdBRange;
|
||||
mutable std::vector <Location> mDisplayLocationsCache;
|
||||
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user