mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-17 16:40:07 +02:00
more const arguments in TrackArtist
This commit is contained in:
parent
c101cf3b32
commit
e9d1dfb2dd
@ -503,7 +503,7 @@ void TrackArtist::DrawTrack(TrackPanelDrawingContext &context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TrackArtist::DrawVRuler
|
void TrackArtist::DrawVRuler
|
||||||
(TrackPanelDrawingContext &context, const Track *t, wxRect & rect)
|
(TrackPanelDrawingContext &context, const Track *t, const wxRect & rect_)
|
||||||
{
|
{
|
||||||
auto dc = &context.dc;
|
auto dc = &context.dc;
|
||||||
bool highlight = false;
|
bool highlight = false;
|
||||||
@ -516,6 +516,7 @@ void TrackArtist::DrawVRuler
|
|||||||
// But give it a beveled area
|
// But give it a beveled area
|
||||||
t->TypeSwitch(
|
t->TypeSwitch(
|
||||||
[&](const LabelTrack *) {
|
[&](const LabelTrack *) {
|
||||||
|
const wxRect &rect = rect_;
|
||||||
wxRect bev = rect;
|
wxRect bev = rect;
|
||||||
bev.Inflate(-1, 0);
|
bev.Inflate(-1, 0);
|
||||||
bev.width += 1;
|
bev.width += 1;
|
||||||
@ -523,6 +524,7 @@ void TrackArtist::DrawVRuler
|
|||||||
},
|
},
|
||||||
|
|
||||||
[&](const TimeTrack *) {
|
[&](const TimeTrack *) {
|
||||||
|
const wxRect &rect = rect_;
|
||||||
wxRect bev = rect;
|
wxRect bev = rect;
|
||||||
bev.Inflate(-1, 0);
|
bev.Inflate(-1, 0);
|
||||||
bev.width += 1;
|
bev.width += 1;
|
||||||
@ -544,6 +546,7 @@ void TrackArtist::DrawVRuler
|
|||||||
},
|
},
|
||||||
|
|
||||||
[&](const WaveTrack *) {
|
[&](const WaveTrack *) {
|
||||||
|
const wxRect &rect = 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.
|
||||||
wxRect bev = rect;
|
wxRect bev = rect;
|
||||||
@ -569,6 +572,8 @@ void TrackArtist::DrawVRuler
|
|||||||
#ifdef USE_MIDI
|
#ifdef USE_MIDI
|
||||||
,
|
,
|
||||||
[&](const NoteTrack *track) {
|
[&](const NoteTrack *track) {
|
||||||
|
wxRect rect = rect_;
|
||||||
|
|
||||||
// The note track draws a vertical keyboard to label pitches
|
// The note track draws a vertical keyboard to label pitches
|
||||||
UpdateVRuler(t, rect);
|
UpdateVRuler(t, rect);
|
||||||
|
|
||||||
@ -664,7 +669,7 @@ void TrackArtist::DrawVRuler
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrackArtist::UpdateVRuler(const Track *t, wxRect & rect)
|
void TrackArtist::UpdateVRuler(const Track *t, const wxRect & rect)
|
||||||
{
|
{
|
||||||
auto update = t->TypeSwitch<bool>(
|
auto update = t->TypeSwitch<bool>(
|
||||||
[] (const LabelTrack *) {
|
[] (const LabelTrack *) {
|
||||||
@ -3307,7 +3312,7 @@ void TrackArtist::UpdatePrefs()
|
|||||||
// 5x5 box.
|
// 5x5 box.
|
||||||
//
|
//
|
||||||
// There may be a better way to do this, or a more appealing pattern.
|
// There may be a better way to do this, or a more appealing pattern.
|
||||||
void TrackArtist::DrawSyncLockTiles(wxDC *dc, wxRect rect)
|
void TrackArtist::DrawSyncLockTiles(wxDC *dc, const wxRect &rect)
|
||||||
{
|
{
|
||||||
wxBitmap syncLockBitmap(theTheme.Image(bmpSyncLockSelTile));
|
wxBitmap syncLockBitmap(theTheme.Image(bmpSyncLockSelTile));
|
||||||
|
|
||||||
@ -3415,7 +3420,7 @@ void TrackArtist::DrawSyncLockTiles(wxDC *dc, wxRect rect)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TrackArtist::DrawBackgroundWithSelection(wxDC *dc, const wxRect &rect,
|
void TrackArtist::DrawBackgroundWithSelection(wxDC *dc, const wxRect &rect,
|
||||||
const Track *track, wxBrush &selBrush, wxBrush &unselBrush,
|
const Track *track, const wxBrush &selBrush, const wxBrush &unselBrush,
|
||||||
const SelectedRegion &selectedRegion, const ZoomInfo &zoomInfo)
|
const SelectedRegion &selectedRegion, const ZoomInfo &zoomInfo)
|
||||||
{
|
{
|
||||||
//MM: Draw background. We should optimize that a bit more.
|
//MM: Draw background. We should optimize that a bit more.
|
||||||
|
@ -69,9 +69,9 @@ class AUDACITY_DLL_API TrackArtist {
|
|||||||
bool hasSolo);
|
bool hasSolo);
|
||||||
|
|
||||||
void DrawVRuler(TrackPanelDrawingContext &context,
|
void DrawVRuler(TrackPanelDrawingContext &context,
|
||||||
const Track *t, wxRect & rect);
|
const Track *t, const wxRect & rect);
|
||||||
|
|
||||||
void UpdateVRuler(const Track *t, wxRect & rect);
|
void UpdateVRuler(const Track *t, const wxRect & rect);
|
||||||
|
|
||||||
void SetMargins(int left, int top, int right, int bottom);
|
void SetMargins(int left, int top, int right, int bottom);
|
||||||
|
|
||||||
@ -86,11 +86,11 @@ class AUDACITY_DLL_API TrackArtist {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Helper: draws the "sync-locked" watermark tiled to a rectangle
|
// Helper: draws the "sync-locked" watermark tiled to a rectangle
|
||||||
static void DrawSyncLockTiles(wxDC *dc, wxRect rect);
|
static void DrawSyncLockTiles(wxDC *dc, const wxRect &rect);
|
||||||
|
|
||||||
// Helper: draws background with selection rect
|
// Helper: draws background with selection rect
|
||||||
static void DrawBackgroundWithSelection(wxDC *dc, const wxRect &rect,
|
static void DrawBackgroundWithSelection(wxDC *dc, const wxRect &rect,
|
||||||
const Track *track, wxBrush &selBrush, wxBrush &unselBrush,
|
const Track *track, const wxBrush &selBrush, const wxBrush &unselBrush,
|
||||||
const SelectedRegion &selectedRegion, const ZoomInfo &zoomInfo);
|
const SelectedRegion &selectedRegion, const ZoomInfo &zoomInfo);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user