1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-05 22:28:57 +02:00

Merge branch 'scrubbing'

* scrubbing:
  Draw the play or record head in the ruler in their former sizes.
This commit is contained in:
Paul Licameli 2016-04-27 12:42:48 -04:00
commit bf6abc8f6c
2 changed files with 11 additions and 10 deletions

View File

@ -1934,6 +1934,7 @@ void AdornedRulerPanel::OnCapture(wxCommandEvent & evt)
enum : int { enum : int {
IndicatorSmallWidth = 9, IndicatorSmallWidth = 9,
IndicatorMediumWidth = 13,
IndicatorOffset = 1, IndicatorOffset = 1,
}; };
@ -1986,8 +1987,9 @@ void AdornedRulerPanel::OnPaint(wxPaintEvent & WXUNUSED(evt))
if (mIndType >= 0) if (mIndType >= 0)
{ {
DoDrawIndicator(&mBackDC, mIndTime, mIndType != 0, const bool scrub = mProject->GetScrubber().HasStartedScrubbing();
IndicatorBigWidth()); auto width = scrub ? IndicatorBigWidth() : IndicatorMediumWidth;
DoDrawIndicator(&mBackDC, mIndTime, mIndType != 0, width, scrub);
} }
if (mViewInfo->selectedRegion.isPoint()) if (mViewInfo->selectedRegion.isPoint())
@ -2763,18 +2765,15 @@ void AdornedRulerPanel::DrawIndicator( double time, bool rec )
} }
// Draws the play/recording position indicator. // Draws the play/recording position indicator.
void AdornedRulerPanel::DoDrawIndicator(wxDC * dc, double time, bool playing, int width) void AdornedRulerPanel::DoDrawIndicator
(wxDC * dc, double time, bool playing, int width, bool scrub)
{ {
const int x = Time2Pos(time); const int x = Time2Pos(time);
AColor::IndicatorColor( dc, playing ); AColor::IndicatorColor( dc, playing );
wxPoint tri[ 3 ]; wxPoint tri[ 3 ];
if (playing && // Don't ever draw the double-head if recording! if (scrub) {
(mPrevInScrubZone ||
mProject->GetScrubber().HasStartedScrubbing())) {
// Always draw big
width = IndicatorBigWidth();
auto height = IndicatorHeightForWidth(width); auto height = IndicatorHeightForWidth(width);
const int IndicatorHalfWidth = width / 2; const int IndicatorHalfWidth = width / 2;
@ -2855,7 +2854,9 @@ void AdornedRulerPanel::DrawQuickPlayIndicator(wxDC * dc)
DoEraseIndicator(dc, mLastQuickPlayX); DoEraseIndicator(dc, mLastQuickPlayX);
mLastQuickPlayX = x; mLastQuickPlayX = x;
DoDrawIndicator(dc, mQuickPlayPos, true, IndicatorSmallWidth); auto scrub = mPrevInScrubZone || mProject->GetScrubber().HasStartedScrubbing();
auto width = scrub ? IndicatorBigWidth() : IndicatorSmallWidth;
DoDrawIndicator(dc, mQuickPlayPos, true, width, scrub);
} }
void AdornedRulerPanel::SetPlayRegion(double playRegionStart, void AdornedRulerPanel::SetPlayRegion(double playRegionStart,

View File

@ -334,7 +334,7 @@ private:
void DoDrawMarks(wxDC * dc, bool /*text */ ); void DoDrawMarks(wxDC * dc, bool /*text */ );
void DoDrawCursor(wxDC * dc); void DoDrawCursor(wxDC * dc);
void DoDrawSelection(wxDC * dc); void DoDrawSelection(wxDC * dc);
void DoDrawIndicator(wxDC * dc, double time, bool recording, int width); void DoDrawIndicator(wxDC * dc, double time, bool playing, int width, bool scrub);
void DoEraseIndicator(wxDC *dc, int x); void DoEraseIndicator(wxDC *dc, int x);
QuickPlayIndicatorOverlay *GetOverlay(); QuickPlayIndicatorOverlay *GetOverlay();
void DrawQuickPlayIndicator(wxDC * dc /*NULL to DELETE old only*/); void DrawQuickPlayIndicator(wxDC * dc /*NULL to DELETE old only*/);