mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-16 16:10:06 +02:00
more const in drawing functions
This commit is contained in:
parent
4b950927b5
commit
a5c50a112a
@ -1956,7 +1956,7 @@ void AudacityProject::FixScrollbars()
|
||||
|
||||
auto LastTime = -std::numeric_limits<double>::max();
|
||||
auto &tracks = *GetTracks();
|
||||
for (auto track : tracks) {
|
||||
for (const Track *track : tracks) {
|
||||
// Iterate over pending changed tracks if present.
|
||||
{
|
||||
auto other =
|
||||
|
@ -340,7 +340,7 @@ void TrackArtist::SetMargins(int left, int top, int right, int bottom)
|
||||
}
|
||||
|
||||
void TrackArtist::DrawTracks(TrackPanelDrawingContext &context,
|
||||
TrackList * tracks,
|
||||
const TrackList * tracks,
|
||||
Track * start,
|
||||
const wxRegion & reg,
|
||||
const wxRect & rect,
|
||||
@ -353,8 +353,8 @@ void TrackArtist::DrawTracks(TrackPanelDrawingContext &context,
|
||||
{
|
||||
wxRect trackRect = rect;
|
||||
wxRect stereoTrackRect;
|
||||
TrackListIterator iter(tracks);
|
||||
Track *t;
|
||||
TrackListConstIterator iter(tracks);
|
||||
const Track *t;
|
||||
|
||||
bool hasSolo = false;
|
||||
for (t = iter.First(); t; t = iter.Next()) {
|
||||
|
@ -55,7 +55,7 @@ class AUDACITY_DLL_API TrackArtist {
|
||||
|
||||
void SetColours(int iColorIndex);
|
||||
void DrawTracks(TrackPanelDrawingContext &context,
|
||||
TrackList *tracks, Track *start,
|
||||
const TrackList *tracks, Track *start,
|
||||
const wxRegion & reg,
|
||||
const wxRect & rect, const wxRect & clip,
|
||||
const SelectedRegion &selectedRegion, const ZoomInfo &zoomInfo,
|
||||
|
@ -1192,7 +1192,7 @@ void TrackPanel::DrawEverythingElse(TrackPanelDrawingContext &context,
|
||||
trackRect.height = 0; // for drawing background in no tracks case.
|
||||
|
||||
VisibleTrackIterator iter(GetProject());
|
||||
for (Track *t = iter.First(); t; t = iter.Next()) {
|
||||
for (const Track *t = iter.First(); t; t = iter.Next()) {
|
||||
auto other = GetTracks()->FindPendingChangedTrack(t->GetId());
|
||||
if (other)
|
||||
t = other.get();
|
||||
@ -1215,7 +1215,7 @@ void TrackPanel::DrawEverythingElse(TrackPanelDrawingContext &context,
|
||||
// If the previous track is linked to this one but isn't on the screen
|
||||
// (and thus would have been skipped by VisibleTrackIterator) we need to
|
||||
// draw that track's border instead.
|
||||
Track *borderTrack = t;
|
||||
const Track *borderTrack = t;
|
||||
wxRect borderRect = rect;
|
||||
|
||||
if (l && !t->GetLinked() && trackRect.y < 0)
|
||||
@ -1718,7 +1718,7 @@ void TrackInfo::Status2DrawFunction
|
||||
|
||||
void TrackPanel::DrawOutside
|
||||
(TrackPanelDrawingContext &context,
|
||||
Track * t, const wxRect & rec)
|
||||
const Track * t, const wxRect & rec)
|
||||
{
|
||||
auto dc = &context.dc;
|
||||
bool bIsWave = (t->GetKind() == Track::Wave);
|
||||
@ -1769,7 +1769,7 @@ void TrackPanel::DrawOutside
|
||||
// If linked to a following channel, also paint the separator area, which
|
||||
// overlaps the next track rectangle's top
|
||||
void TrackPanel::DrawOutsideOfTrack
|
||||
(TrackPanelDrawingContext &context, Track * t, const wxRect & rect)
|
||||
(TrackPanelDrawingContext &context, const Track * t, const wxRect & rect)
|
||||
{
|
||||
auto dc = &context.dc;
|
||||
|
||||
@ -2032,7 +2032,7 @@ void TrackPanel::VerticalScroll( float fracPosition){
|
||||
// Given rectangle excludes the insets left, right, and top
|
||||
// Draw a rectangular border and also a vertical separator of track controls
|
||||
// from the rest (ruler and proper track area)
|
||||
void TrackPanel::DrawBordersAroundTrack(Track * t, wxDC * dc,
|
||||
void TrackPanel::DrawBordersAroundTrack(const Track * t, wxDC * dc,
|
||||
const wxRect & rect, const int labelw,
|
||||
const int vrul)
|
||||
{
|
||||
@ -2064,7 +2064,7 @@ void TrackPanel::DrawBordersAroundTrack(Track * t, wxDC * dc,
|
||||
// Given rectangle has insets subtracted left, right, and top
|
||||
// Stroke lines along bottom and right, which are slightly short at
|
||||
// bottom-left and top-right
|
||||
void TrackPanel::DrawShadow(Track * /* t */ , wxDC * dc, const wxRect & rect)
|
||||
void TrackPanel::DrawShadow(const Track * /* t */ , wxDC * dc, const wxRect & rect)
|
||||
{
|
||||
int right = rect.x + rect.width - 1;
|
||||
int bottom = rect.y + rect.height - 1;
|
||||
|
@ -375,14 +375,14 @@ protected:
|
||||
const wxRect & clip);
|
||||
void DrawOutside
|
||||
(TrackPanelDrawingContext &context,
|
||||
Track *t, const wxRect & rec);
|
||||
const Track *t, const wxRect & rec);
|
||||
|
||||
void HighlightFocusedTrack (wxDC* dc, const wxRect &rect);
|
||||
void DrawShadow (Track *t, wxDC* dc, const wxRect & rect);
|
||||
void DrawBordersAroundTrack(Track *t, wxDC* dc, const wxRect & rect, const int labelw, const int vrul);
|
||||
void DrawShadow (const Track *t, wxDC* dc, const wxRect & rect);
|
||||
void DrawBordersAroundTrack(const Track *t, wxDC* dc, const wxRect & rect, const int labelw, const int vrul);
|
||||
void DrawOutsideOfTrack
|
||||
(TrackPanelDrawingContext &context,
|
||||
Track *t, const wxRect & rect);
|
||||
const Track *t, const wxRect & rect);
|
||||
|
||||
public:
|
||||
// Set the object that performs catch-all event handling when the pointer
|
||||
|
@ -137,7 +137,7 @@ std::shared_ptr<Track> TrackPanelAx::SetFocus( std::shared_ptr<Track> track )
|
||||
}
|
||||
|
||||
// Returns TRUE if passed track has the focus
|
||||
bool TrackPanelAx::IsFocused( Track *track )
|
||||
bool TrackPanelAx::IsFocused( const Track *track )
|
||||
{
|
||||
auto focusedTrack = mFocusedTrack.lock();
|
||||
if( !focusedTrack )
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
std::shared_ptr<Track> SetFocus( std::shared_ptr<Track> track = {} );
|
||||
|
||||
// Returns TRUE if passed track has the focus
|
||||
bool IsFocused( Track *track );
|
||||
bool IsFocused( const Track *track );
|
||||
|
||||
// Called to signal changes to a track
|
||||
void Updated();
|
||||
|
Loading…
x
Reference in New Issue
Block a user