1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-07 07:12:34 +02:00

Vary the appearance of the time ruler's play indicator for scrubbing.

This commit is contained in:
Paul Licameli 2016-04-19 14:04:39 -04:00
commit 88025ba613

View File

@ -82,6 +82,7 @@ array of Ruler::Label.
#include "../NumberScale.h" #include "../NumberScale.h"
#include "../Prefs.h" #include "../Prefs.h"
#include "../Snap.h" #include "../Snap.h"
#include "../tracks/ui/Scrubbing.h"
using std::min; using std::min;
using std::max; using std::max;
@ -2598,19 +2599,39 @@ void AdornedRulerPanel::DrawIndicator( double time, bool rec )
// Draws the play/recording position indicator. // Draws the play/recording position indicator.
void AdornedRulerPanel::DoDrawIndicator(wxDC * dc) void AdornedRulerPanel::DoDrawIndicator(wxDC * dc)
{ {
int indsize = 6; enum {
indsize = 6,
height = ( indsize * 3 ) / 2 + 1,
offset = 1,
};
const int x = Time2Pos(mIndTime); const int x = Time2Pos(mIndTime);
AColor::IndicatorColor( dc, ( mIndType ? true : false ) );
wxPoint tri[ 3 ]; wxPoint tri[ 3 ];
if (mProject->GetScrubber().HasStartedScrubbing()) {
// Double headed, left-right
tri[ 0 ].x = x - offset;
tri[ 0 ].y = 1;
tri[ 1 ].x = x - offset;
tri[ 1 ].y = height;
tri[ 2 ].x = x - indsize;
tri[ 2 ].y = height / 2;
dc->DrawPolygon( 3, tri );
tri[ 0 ].x = tri[ 1 ].x = x + offset;
tri[ 2 ].x = x + indsize;
dc->DrawPolygon( 3, tri );
}
else {
// Down pointing triangle
tri[ 0 ].x = x - indsize; tri[ 0 ].x = x - indsize;
tri[ 0 ].y = 1; tri[ 0 ].y = 1;
tri[ 1 ].x = x + indsize; tri[ 1 ].x = x + indsize;
tri[ 1 ].y = 1; tri[ 1 ].y = 1;
tri[ 2 ].x = x; tri[ 2 ].x = x;
tri[ 2 ].y = ( indsize * 3 ) / 2 + 1; tri[ 2 ].y = height;
AColor::IndicatorColor( dc, ( mIndType ? true : false ) );
dc->DrawPolygon( 3, tri ); dc->DrawPolygon( 3, tri );
}
} }
QuickPlayIndicatorOverlay *AdornedRulerPanel::GetOverlay() QuickPlayIndicatorOverlay *AdornedRulerPanel::GetOverlay()