Audacity  2.2.2
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
AdornedRulerPanel Class Referencefinal

This is an Audacity Specific ruler panel which additionally has border, selection markers, play marker. More...

#include <Ruler.h>

Inheritance diagram for AdornedRulerPanel:
OverlayPanel BackedPanel wxPanelWrapper wxTabTraversalWrapper< wxPanel >

Classes

struct  Resetter
 

Public Types

enum  StatusChoice { StatusChoice::EnteringQP, StatusChoice::EnteringScrubZone, StatusChoice::Leaving, StatusChoice::NoChange }
 

Public Member Functions

 AdornedRulerPanel (AudacityProject *project, wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, ViewInfo *viewinfo=NULL)
 
 ~AdornedRulerPanel ()
 
bool AcceptsFocus () const override
 
bool AcceptsFocusFromKeyboard () const override
 
void SetFocusFromKbd () override
 
int GetRulerHeight ()
 
wxRect GetInnerRect () const
 
void SetLeftOffset (int offset)
 
void DrawSelection ()
 
void SetPlayRegion (double playRegionStart, double playRegionEnd)
 
void ClearPlayRegion ()
 
void GetPlayRegion (double *playRegionStart, double *playRegionEnd)
 
void GetMaxSize (wxCoord *width, wxCoord *height)
 
void InvalidateRuler ()
 
void UpdatePrefs ()
 
void ReCreateButtons ()
 
void RegenerateTooltips (StatusChoice choice)
 
void ShowQuickPlayIndicator (bool repaint_all=false)
 
void HideQuickPlayIndicator (bool repaint_all=false)
 
void UpdateQuickPlayPos (wxCoord &mousPosX)
 
bool ShowingScrubRuler () const
 
void OnToggleScrubRuler ()
 
void OnToggleScrubRulerFromMenu (wxCommandEvent &)
 
void SetPanelSize ()
 
void DoDrawIndicator (wxDC *dc, wxCoord xx, bool playing, int width, bool scrub, bool seek)
 
void UpdateButtonStates ()
 
- Public Member Functions inherited from OverlayPanel
 OverlayPanel (wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, long style=wxTAB_TRAVERSAL|wxNO_BORDER)
 
void AddOverlay (Overlay *pOverlay)
 
bool RemoveOverlay (Overlay *pOverlay)
 
void ClearOverlays ()
 
void DrawOverlays (bool repaint_all, wxDC *pDC=nullptr)
 
- Public Member Functions inherited from BackedPanel
 BackedPanel (wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, long style)
 
 ~BackedPanel ()
 
wxDC & GetBackingDC ()
 
wxDC & GetBackingDCForRepaint ()
 
void ResizeBacking ()
 
void RepairBitmap (wxDC &dc, wxCoord x, wxCoord y, wxCoord width, wxCoord height)
 
void DisplayBitmap (wxDC &dc)
 
void OnSize (wxSizeEvent &event)
 
- Public Member Functions inherited from wxPanelWrapper
 wxPanelWrapper ()
 
 wxPanelWrapper (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const wxString &name=_("Panel"))
 
bool Create (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const wxString &name=_("Panel"))
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxPanel >
 wxTabTraversalWrapper (Args &&...args)
 

Static Public Member Functions

static int GetRulerHeight (bool showScrubBar)
 
static TempAllowFocus TemporarilyAllowFocus ()
 

Private Types

enum  MenuChoice { MenuChoice::QuickPlay, MenuChoice::Scrub }
 
enum  MouseEventState {
  mesNone, mesDraggingPlayRegionStart, mesDraggingPlayRegionEnd, mesSelectingPlayRegionClick,
  mesSelectingPlayRegionRange
}
 
using TempAllowFocus = std::unique_ptr< bool, Resetter >
 

Private Member Functions

void OnCapture (wxCommandEvent &evt)
 
void OnPaint (wxPaintEvent &evt)
 
void OnSize (wxSizeEvent &evt)
 
void UpdateRects ()
 
void OnMouseEvents (wxMouseEvent &evt)
 
void HandleQPClick (wxMouseEvent &event, wxCoord mousePosX)
 
void HandleQPDrag (wxMouseEvent &event, wxCoord mousePosX)
 
void HandleQPRelease (wxMouseEvent &event)
 
void StartQPPlay (bool looped, bool cutPreview)
 
void UpdateStatusBarAndTooltips (StatusChoice choice)
 
void OnCaptureLost (wxMouseCaptureLostEvent &evt)
 
void DoDrawBackground (wxDC *dc)
 
void DoDrawEdge (wxDC *dc)
 
void DoDrawMarks (wxDC *dc, bool)
 
void DoDrawSelection (wxDC *dc)
 
QuickPlayIndicatorOverlayGetOverlay ()
 
void ShowOrHideQuickPlayIndicator (bool show, bool repaint_all=false)
 
void DoDrawPlayRegion (wxDC *dc)
 
void ShowContextMenu (MenuChoice choice, const wxPoint *pPosition)
 
double Pos2Time (int p, bool ignoreFisheye=false)
 
int Time2Pos (double t, bool ignoreFisheye=false)
 
bool IsWithinMarker (int mousePosX, double markerTime)
 
void ShowMenu (const wxPoint &pos)
 
void ShowScrubMenu (const wxPoint &pos)
 
void DragSelection ()
 
void HandleSnapping ()
 
void OnToggleQuickPlay (wxCommandEvent &evt)
 
void OnSyncSelToQuickPlay (wxCommandEvent &evt)
 
void OnTimelineToolTips (wxCommandEvent &evt)
 
void OnAutoScroll (wxCommandEvent &evt)
 
void OnLockPlayRegion (wxCommandEvent &evt)
 
void OnContextMenu (wxContextMenuEvent &WXUNUSED(event))
 
void OnTogglePinnedState (wxCommandEvent &event)
 

Private Attributes

wxCursor mCursorDefault
 
wxCursor mCursorHand
 
wxCursor mCursorSizeWE
 
bool mIsWE
 
Ruler mRuler
 
AudacityProject *const mProject
 
ViewInfo *const mViewInfo
 
TrackListmTracks
 
wxRect mOuter
 
wxRect mScrubZone
 
wxRect mInner
 
int mLeftOffset
 
double mIndTime
 
double mQuickPlayPosUnsnapped
 
double mQuickPlayPos
 
std::unique_ptr< SnapManagermSnapManager
 
bool mIsSnapped
 
bool mPlayRegionLock
 
double mPlayRegionStart
 
double mPlayRegionEnd
 
double mOldPlayRegionStart
 
double mOldPlayRegionEnd
 
bool mIsRecording
 
bool mPlayRegionDragsSelection
 
bool mTimelineToolTip
 
bool mQuickPlayEnabled
 
MouseEventState mMouseEventState
 
double mLeftDownClickUnsnapped
 
double mLeftDownClick
 
int mLastMouseX
 
bool mIsDragging
 
std::unique_ptr
< QuickPlayIndicatorOverlay
mOverlay
 
StatusChoice mPrevZone { StatusChoice::NoChange }
 
bool mShowScrubbing { false }
 
friend QuickPlayRulerOverlay
 
wxWindow * mButtons [3]
 
bool mNeedButtonUpdate { true }
 

Static Private Attributes

static bool s_AcceptsFocus { false }
 

Detailed Description

This is an Audacity Specific ruler panel which additionally has border, selection markers, play marker.

Once TrackPanel uses wxSizers, we will derive it from some wxWindow and the GetSize and SetSize functions will then be wxWidgets functions instead.

Definition at line 316 of file Ruler.h.

Member Typedef Documentation

using AdornedRulerPanel::TempAllowFocus = std::unique_ptr<bool, Resetter>
private

Definition at line 398 of file Ruler.h.

Member Enumeration Documentation

enum AdornedRulerPanel::MenuChoice
strongprivate
Enumerator
QuickPlay 
Scrub 

Definition at line 408 of file Ruler.h.

408 { QuickPlay, Scrub };
Enumerator
mesNone 
mesDraggingPlayRegionStart 
mesDraggingPlayRegionEnd 
mesSelectingPlayRegionClick 
mesSelectingPlayRegionRange 

Definition at line 471 of file Ruler.h.

Enumerator
EnteringQP 
EnteringScrubZone 
Leaving 
NoChange 

Definition at line 352 of file Ruler.h.

352  {
353  EnteringQP,
354  EnteringScrubZone,
355  Leaving,
356  NoChange
357  };

Constructor & Destructor Documentation

AdornedRulerPanel::AdornedRulerPanel ( AudacityProject project,
wxWindow *  parent,
wxWindowID  id,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
ViewInfo viewinfo = NULL 
)
AdornedRulerPanel::~AdornedRulerPanel ( )

Definition at line 2045 of file Ruler.cpp.

2046 {
2047  if(HasCapture())
2048  ReleaseMouse();
2049 }

Member Function Documentation

bool AdornedRulerPanel::AcceptsFocus ( ) const
inlineoverride

Definition at line 328 of file Ruler.h.

328 { return s_AcceptsFocus; }
static bool s_AcceptsFocus
Definition: Ruler.h:396
bool AdornedRulerPanel::AcceptsFocusFromKeyboard ( ) const
inlineoverride

Definition at line 329 of file Ruler.h.

329 { return true; }
void AdornedRulerPanel::ClearPlayRegion ( )

Definition at line 3381 of file Ruler.cpp.

References AudacityProject::GetControlToolBar(), HideQuickPlayIndicator(), mPlayRegionEnd, mPlayRegionStart, mProject, and ControlToolBar::StopPlaying().

Referenced by HandleQPRelease().

3382 {
3384  ctb->StopPlaying();
3385 
3386  mPlayRegionStart = -1;
3387  mPlayRegionEnd = -1;
3388 
3390 
3391  Refresh();
3392 }
A ToolBar that has the main Transport buttons.
void StopPlaying(bool stopStream=true)
void HideQuickPlayIndicator(bool repaint_all=false)
Definition: Ruler.cpp:3342
double mPlayRegionStart
Definition: Ruler.h:443
AudacityProject *const mProject
Definition: Ruler.h:424
ControlToolBar * GetControlToolBar()
Definition: Project.cpp:5003
double mPlayRegionEnd
Definition: Ruler.h:444
void AdornedRulerPanel::DoDrawBackground ( wxDC *  dc)
private

Definition at line 3169 of file Ruler.cpp.

References mInner, mScrubZone, mShowScrubbing, and AColor::UseThemeColour().

Referenced by OnPaint().

3170 {
3171  // Draw AdornedRulerPanel border
3172  AColor::UseThemeColour( dc, clrTrackInfo );
3173  dc->DrawRectangle( mInner );
3174 
3175  if (mShowScrubbing) {
3176  // Let's distinguish the scrubbing area by using a themable
3177  // colour and a line to set it off.
3178  AColor::UseThemeColour(dc, clrScrubRuler, clrTrackPanelText );
3179  wxRect ScrubRect = mScrubZone;
3180  ScrubRect.Inflate( 1,0 );
3181  dc->DrawRectangle(ScrubRect);
3182  }
3183 }
wxRect mInner
Definition: Ruler.h:430
bool mShowScrubbing
Definition: Ruler.h:489
wxRect mScrubZone
Definition: Ruler.h:429
static void UseThemeColour(wxDC *dc, int iBrush, int iPen=-1)
Definition: AColor.cpp:289
void AdornedRulerPanel::DoDrawEdge ( wxDC *  dc)
private

Definition at line 3185 of file Ruler.cpp.

References AColor::BevelTrackInfo(), BottomMargin, mOuter, and RightMargin.

Referenced by OnPaint().

3186 {
3187  wxRect r = mOuter;
3188  r.width -= RightMargin;
3189  r.height -= BottomMargin;
3190  AColor::BevelTrackInfo( *dc, true, r );
3191 
3192  // Black stroke at bottom
3193  dc->SetPen( *wxBLACK_PEN );
3194  dc->DrawLine( mOuter.x,
3195  mOuter.y + mOuter.height - 1,
3196  mOuter.x + mOuter.width,
3197  mOuter.y + mOuter.height - 1 );
3198 }
wxRect mOuter
Definition: Ruler.h:428
static void BevelTrackInfo(wxDC &dc, bool up, const wxRect &r, bool highlight=false)
Definition: AColor.cpp:262
void AdornedRulerPanel::DoDrawIndicator ( wxDC *  dc,
wxCoord  xx,
bool  playing,
int  width,
bool  scrub,
bool  seek 
)

Definition at line 3247 of file Ruler.cpp.

References ThemeBase::Bitmap(), TracksPrefs::GetPinnedHeadPreference(), AColor::IndicatorColor(), IndicatorHeightForWidth(), IndicatorOffset, and theTheme.

3248 {
3249  ADCChanger changer(dc); // Undo pen and brush changes at function exit
3250 
3251  AColor::IndicatorColor( dc, playing );
3252 
3253  wxPoint tri[ 3 ];
3254  if (seek) {
3255  auto height = IndicatorHeightForWidth(width);
3256  // Make four triangles
3257  const int TriangleWidth = width * 3 / 8;
3258 
3259  // Double-double headed, left-right
3260  auto yy = mShowScrubbing
3261  ? mScrubZone.y
3262  : (mInner.GetBottom() + 1) - 1 /* bevel */ - height;
3263  tri[ 0 ].x = xx - IndicatorOffset;
3264  tri[ 0 ].y = yy;
3265  tri[ 1 ].x = xx - IndicatorOffset;
3266  tri[ 1 ].y = yy + height;
3267  tri[ 2 ].x = xx - TriangleWidth;
3268  tri[ 2 ].y = yy + height / 2;
3269  dc->DrawPolygon( 3, tri );
3270 
3271  tri[ 0 ].x -= TriangleWidth;
3272  tri[ 1 ].x -= TriangleWidth;
3273  tri[ 2 ].x -= TriangleWidth;
3274  dc->DrawPolygon( 3, tri );
3275 
3276  tri[ 0 ].x = tri[ 1 ].x = xx + IndicatorOffset;
3277  tri[ 2 ].x = xx + TriangleWidth;
3278  dc->DrawPolygon( 3, tri );
3279 
3280 
3281  tri[ 0 ].x += TriangleWidth;
3282  tri[ 1 ].x += TriangleWidth;
3283  tri[ 2 ].x += TriangleWidth;
3284  dc->DrawPolygon( 3, tri );
3285  }
3286  else if (scrub) {
3287  auto height = IndicatorHeightForWidth(width);
3288  const int IndicatorHalfWidth = width / 2;
3289 
3290  // Double headed, left-right
3291  auto yy = mShowScrubbing
3292  ? mScrubZone.y
3293  : (mInner.GetBottom() + 1) - 1 /* bevel */ - height;
3294  tri[ 0 ].x = xx - IndicatorOffset;
3295  tri[ 0 ].y = yy;
3296  tri[ 1 ].x = xx - IndicatorOffset;
3297  tri[ 1 ].y = yy + height;
3298  tri[ 2 ].x = xx - IndicatorHalfWidth;
3299  tri[ 2 ].y = yy + height / 2;
3300  dc->DrawPolygon( 3, tri );
3301  tri[ 0 ].x = tri[ 1 ].x = xx + IndicatorOffset;
3302  tri[ 2 ].x = xx + IndicatorHalfWidth;
3303  dc->DrawPolygon( 3, tri );
3304  }
3305  else {
3306  bool pinned = TracksPrefs::GetPinnedHeadPreference();
3307  wxBitmap & bmp = theTheme.Bitmap( pinned ?
3308  (playing ? bmpPlayPointerPinned : bmpRecordPointerPinned) :
3309  (playing ? bmpPlayPointer : bmpRecordPointer)
3310  );
3311  const int IndicatorHalfWidth = bmp.GetWidth() / 2;
3312  dc->DrawBitmap( bmp, xx - IndicatorHalfWidth -1, mInner.y );
3313 #if 0
3314 
3315  // Down pointing triangle
3316  auto height = IndicatorHeightForWidth(width);
3317  const int IndicatorHalfWidth = width / 2;
3318  tri[ 0 ].x = xx - IndicatorHalfWidth;
3319  tri[ 0 ].y = mInner.y;
3320  tri[ 1 ].x = xx + IndicatorHalfWidth;
3321  tri[ 1 ].y = mInner.y;
3322  tri[ 2 ].x = xx;
3323  tri[ 2 ].y = mInner.y + height;
3324  dc->DrawPolygon( 3, tri );
3325 #endif
3326  }
3327 }
AUDACITY_DLL_API Theme theTheme
Definition: Theme.cpp:209
wxRect mInner
Definition: Ruler.h:430
static void IndicatorColor(wxDC *dc, bool bIsNotRecording)
Definition: AColor.cpp:367
wxBitmap & Bitmap(int iIndex)
Definition: Theme.cpp:1244
bool mShowScrubbing
Definition: Ruler.h:489
int IndicatorHeightForWidth(int width)
Definition: Ruler.cpp:1718
wxRect mScrubZone
Definition: Ruler.h:429
static bool GetPinnedHeadPreference()
Makes temporary drawing context changes that you back out of, RAII style.
Definition: AColor.h:42
void AdornedRulerPanel::DoDrawMarks ( wxDC *  dc,
bool   
)
private

Definition at line 3200 of file Ruler.cpp.

References ThemeBase::Colour(), Ruler::Draw(), mInner, mRuler, Pos2Time(), Ruler::SetRange(), Ruler::SetTickColour(), and theTheme.

Referenced by OnPaint().

3201 {
3202  const double min = Pos2Time(0);
3203  const double hiddenMin = Pos2Time(0, true);
3204  const double max = Pos2Time(mInner.width);
3205  const double hiddenMax = Pos2Time(mInner.width, true);
3206 
3207  mRuler.SetTickColour( theTheme.Colour( clrTrackPanelText ) );
3208  mRuler.SetRange( min, max, hiddenMin, hiddenMax );
3209  mRuler.Draw( *dc );
3210 }
void Draw(wxDC &dc)
Definition: Ruler.cpp:1323
AUDACITY_DLL_API Theme theTheme
Definition: Theme.cpp:209
wxRect mInner
Definition: Ruler.h:430
Ruler mRuler
Definition: Ruler.h:423
int min(int a, int b)
void SetRange(double min, double max)
Definition: Ruler.cpp:236
void SetTickColour(const wxColour &colour)
Definition: Ruler.h:151
wxColour & Colour(int iIndex)
Definition: Theme.cpp:1225
double Pos2Time(int p, bool ignoreFisheye=false)
Definition: Ruler.cpp:2366
void AdornedRulerPanel::DoDrawPlayRegion ( wxDC *  dc)
private

Definition at line 3086 of file Ruler.cpp.

References GetPlayRegion(), AudacityProject::IsPlayRegionLocked(), mInner, mProject, PLAY_REGION_GLOBAL_OFFSET_Y, PLAY_REGION_RECT_HEIGHT, PLAY_REGION_RECT_WIDTH, PLAY_REGION_TRIANGLE_SIZE, AColor::PlayRegionColor(), Time2Pos(), and TopMargin.

Referenced by OnPaint().

3087 {
3088  double start, end;
3089  GetPlayRegion(&start, &end);
3090 
3091  if (start >= 0)
3092  {
3093  const int x1 = Time2Pos(start);
3094  const int x2 = Time2Pos(end)-2;
3095  int y = mInner.y - TopMargin + mInner.height/2;
3096 
3097  bool isLocked = mProject->IsPlayRegionLocked();
3098  AColor::PlayRegionColor(dc, isLocked);
3099 
3100  wxPoint tri[3];
3101  wxRect r;
3102 
3103  tri[0].x = x1;
3104  tri[0].y = y + PLAY_REGION_GLOBAL_OFFSET_Y;
3105  tri[1].x = x1 + PLAY_REGION_TRIANGLE_SIZE;
3106  tri[1].y = y - PLAY_REGION_TRIANGLE_SIZE + PLAY_REGION_GLOBAL_OFFSET_Y;
3107  tri[2].x = x1 + PLAY_REGION_TRIANGLE_SIZE;
3108  tri[2].y = y + PLAY_REGION_TRIANGLE_SIZE + PLAY_REGION_GLOBAL_OFFSET_Y;
3109  dc->DrawPolygon(3, tri);
3110 
3111  r.x = x1;
3112  r.y = y - PLAY_REGION_TRIANGLE_SIZE + PLAY_REGION_GLOBAL_OFFSET_Y;
3113  r.width = PLAY_REGION_RECT_WIDTH;
3114  r.height = PLAY_REGION_TRIANGLE_SIZE*2 + 1;
3115  dc->DrawRectangle(r);
3116 
3117  if (end != start)
3118  {
3119  tri[0].x = x2;
3120  tri[0].y = y + PLAY_REGION_GLOBAL_OFFSET_Y;
3121  tri[1].x = x2 - PLAY_REGION_TRIANGLE_SIZE;
3122  tri[1].y = y - PLAY_REGION_TRIANGLE_SIZE + PLAY_REGION_GLOBAL_OFFSET_Y;
3123  tri[2].x = x2 - PLAY_REGION_TRIANGLE_SIZE;
3124  tri[2].y = y + PLAY_REGION_TRIANGLE_SIZE + PLAY_REGION_GLOBAL_OFFSET_Y;
3125  dc->DrawPolygon(3, tri);
3126 
3127  r.x = x2 - PLAY_REGION_RECT_WIDTH + 1;
3128  r.y = y - PLAY_REGION_TRIANGLE_SIZE + PLAY_REGION_GLOBAL_OFFSET_Y;
3129  r.width = PLAY_REGION_RECT_WIDTH;
3130  r.height = PLAY_REGION_TRIANGLE_SIZE*2 + 1;
3131  dc->DrawRectangle(r);
3132 
3133  r.x = x1 + PLAY_REGION_TRIANGLE_SIZE;
3135  r.width = std::max(0, x2-x1 - PLAY_REGION_TRIANGLE_SIZE*2);
3136  r.height = PLAY_REGION_RECT_HEIGHT;
3137  dc->DrawRectangle(r);
3138  }
3139  }
3140 }
static void PlayRegionColor(wxDC *dc, bool locked)
Definition: AColor.cpp:376
wxRect mInner
Definition: Ruler.h:430
#define PLAY_REGION_RECT_WIDTH
Definition: Ruler.cpp:110
int Time2Pos(double t, bool ignoreFisheye=false)
Definition: Ruler.cpp:2373
#define PLAY_REGION_GLOBAL_OFFSET_Y
Definition: Ruler.cpp:112
AudacityProject *const mProject
Definition: Ruler.h:424
#define PLAY_REGION_TRIANGLE_SIZE
Definition: Ruler.cpp:109
#define PLAY_REGION_RECT_HEIGHT
Definition: Ruler.cpp:111
bool IsPlayRegionLocked()
Definition: Project.h:213
void GetPlayRegion(double *playRegionStart, double *playRegionEnd)
Definition: Ruler.cpp:3394
void AdornedRulerPanel::DoDrawSelection ( wxDC *  dc)
private

Definition at line 3217 of file Ruler.cpp.

References ThemeBase::Colour(), min(), mInner, mViewInfo, ViewInfo::selectedRegion, SelectedRegion::t0(), SelectedRegion::t1(), theTheme, and Time2Pos().

Referenced by OnPaint().

3218 {
3219  // Draw selection
3220  const int p0 = max(1, Time2Pos(mViewInfo->selectedRegion.t0()));
3221  const int p1 = min(mInner.width, Time2Pos(mViewInfo->selectedRegion.t1()));
3222 
3223  dc->SetBrush( wxBrush( theTheme.Colour( clrRulerBackground )) );
3224  dc->SetPen( wxPen( theTheme.Colour( clrRulerBackground )) );
3225 
3226  wxRect r;
3227  r.x = p0;
3228  r.y = mInner.y;
3229  r.width = p1 - p0 - 1;
3230  r.height = mInner.height;
3231  dc->DrawRectangle( r );
3232 }
AUDACITY_DLL_API Theme theTheme
Definition: Theme.cpp:209
double t0() const
SelectedRegion selectedRegion
Definition: ViewInfo.h:160
wxRect mInner
Definition: Ruler.h:430
ViewInfo *const mViewInfo
Definition: Ruler.h:425
double t1() const
int min(int a, int b)
int Time2Pos(double t, bool ignoreFisheye=false)
Definition: Ruler.cpp:2373
wxColour & Colour(int iIndex)
Definition: Theme.cpp:1225
void AdornedRulerPanel::DragSelection ( )
private

Definition at line 3038 of file Ruler.cpp.

References mPlayRegionEnd, mPlayRegionStart, mViewInfo, ViewInfo::selectedRegion, SelectedRegion::setT0(), and SelectedRegion::setT1().

Referenced by HandleQPDrag().

3039 {
3042 }
SelectedRegion selectedRegion
Definition: ViewInfo.h:160
ViewInfo *const mViewInfo
Definition: Ruler.h:425
double mPlayRegionStart
Definition: Ruler.h:443
bool setT1(double t, bool maySwap=true)
bool setT0(double t, bool maySwap=true)
double mPlayRegionEnd
Definition: Ruler.h:444
void AdornedRulerPanel::DrawSelection ( )

Definition at line 3212 of file Ruler.cpp.

Referenced by TrackPanel::UpdateSelectionDisplay().

3213 {
3214  Refresh();
3215 }
wxRect AdornedRulerPanel::GetInnerRect ( ) const
inline

Definition at line 335 of file Ruler.h.

335 { return mInner; }
wxRect mInner
Definition: Ruler.h:430
void AdornedRulerPanel::GetMaxSize ( wxCoord *  width,
wxCoord *  height 
)

Definition at line 3410 of file Ruler.cpp.

References Ruler::GetMaxSize(), and mRuler.

3411 {
3412  mRuler.GetMaxSize(width, height);
3413 }
Ruler mRuler
Definition: Ruler.h:423
void GetMaxSize(wxCoord *width, wxCoord *height)
Definition: Ruler.cpp:1549
QuickPlayIndicatorOverlay * AdornedRulerPanel::GetOverlay ( )
private

Definition at line 3329 of file Ruler.cpp.

References mOverlay, and mProject.

Referenced by ShowOrHideQuickPlayIndicator().

3330 {
3331  if (!mOverlay)
3332  mOverlay = std::make_unique<QuickPlayIndicatorOverlay>(mProject);
3333 
3334  return mOverlay.get();
3335 }
std::unique_ptr< QuickPlayIndicatorOverlay > mOverlay
Definition: Ruler.h:485
AudacityProject *const mProject
Definition: Ruler.h:424
void AdornedRulerPanel::GetPlayRegion ( double *  playRegionStart,
double *  playRegionEnd 
)

Definition at line 3394 of file Ruler.cpp.

References mPlayRegionEnd, and mPlayRegionStart.

Referenced by DoDrawPlayRegion(), and AudacityProject::GetPlayRegion().

3396 {
3397  if (mPlayRegionStart >= 0 && mPlayRegionEnd >= 0 &&
3399  {
3400  // swap values to make sure end > start
3401  *playRegionStart = mPlayRegionEnd;
3402  *playRegionEnd = mPlayRegionStart;
3403  } else
3404  {
3405  *playRegionStart = mPlayRegionStart;
3406  *playRegionEnd = mPlayRegionEnd;
3407  }
3408 }
double mPlayRegionStart
Definition: Ruler.h:443
double mPlayRegionEnd
Definition: Ruler.h:444
int AdornedRulerPanel::GetRulerHeight ( )
inline
int AdornedRulerPanel::GetRulerHeight ( bool  showScrubBar)
static

Definition at line 3234 of file Ruler.cpp.

References ProperRulerHeight, and ScrubHeight.

3235 {
3236  return ProperRulerHeight + (showScrubBar ? ScrubHeight : 0);
3237 }
void AdornedRulerPanel::HandleQPClick ( wxMouseEvent &  event,
wxCoord  mousePosX 
)
private

Definition at line 2588 of file Ruler.cpp.

References IsWithinMarker(), mCursorSizeWE, mesDraggingPlayRegionEnd, mesDraggingPlayRegionStart, mesNone, mesSelectingPlayRegionClick, mLeftDownClick, mLeftDownClickUnsnapped, mMouseEventState, mOldPlayRegionEnd, mOldPlayRegionStart, mPlayRegionEnd, mPlayRegionLock, mPlayRegionStart, mProject, mQuickPlayPos, mQuickPlayPosUnsnapped, AudacityProject::OnUnlockPlayRegion(), and Time2Pos().

Referenced by OnMouseEvents().

2589 {
2590  // Temporarily unlock locked play region
2591  if (mPlayRegionLock && evt.LeftDown()) {
2592  //mPlayRegionLock = true;
2594  }
2595 
2598  bool isWithinStart = IsWithinMarker(mousePosX, mOldPlayRegionStart);
2599  bool isWithinEnd = IsWithinMarker(mousePosX, mOldPlayRegionEnd);
2600 
2601  if (isWithinStart || isWithinEnd) {
2602  // If Quick-Play is playing from a point, we need to treat it as a click
2603  // not as dragging.
2606  // otherwise check which marker is nearer
2607  else {
2608  // Don't compare times, compare positions.
2609  //if (fabs(mQuickPlayPos - mPlayRegionStart) < fabs(mQuickPlayPos - mPlayRegionEnd))
2613  else
2615  }
2616  }
2617  else {
2618  // Clicked but not yet dragging
2620  }
2621 
2622  // Check if we are dragging BEFORE CaptureMouse.
2623  if (mMouseEventState != mesNone)
2624  SetCursor(mCursorSizeWE);
2625  if ( !HasCapture() )
2626  CaptureMouse();
2627 }
double mLeftDownClick
Definition: Ruler.h:481
double mOldPlayRegionStart
Definition: Ruler.h:445
void OnUnlockPlayRegion(const CommandContext &context)
Definition: Menus.cpp:9124
MouseEventState mMouseEventState
Definition: Ruler.h:479
double mPlayRegionStart
Definition: Ruler.h:443
double mQuickPlayPos
Definition: Ruler.h:437
bool IsWithinMarker(int mousePosX, double markerTime)
Definition: Ruler.cpp:2381
int Time2Pos(double t, bool ignoreFisheye=false)
Definition: Ruler.cpp:2373
bool mPlayRegionLock
Definition: Ruler.h:442
AudacityProject *const mProject
Definition: Ruler.h:424
double mQuickPlayPosUnsnapped
Definition: Ruler.h:436
wxCursor mCursorSizeWE
Definition: Ruler.h:420
double mOldPlayRegionEnd
Definition: Ruler.h:446
double mLeftDownClickUnsnapped
Definition: Ruler.h:480
double mPlayRegionEnd
Definition: Ruler.h:444
void AdornedRulerPanel::HandleQPDrag ( wxMouseEvent &  event,
wxCoord  mousePosX 
)
private

Definition at line 2629 of file Ruler.cpp.

References DragSelection(), HideQuickPlayIndicator(), IsWithinMarker(), mesDraggingPlayRegionEnd, mesDraggingPlayRegionStart, mesNone, mesSelectingPlayRegionClick, mesSelectingPlayRegionRange, mIsDragging, mLeftDownClick, mLeftDownClickUnsnapped, mMouseEventState, mOldPlayRegionEnd, mOldPlayRegionStart, mPlayRegionDragsSelection, mPlayRegionEnd, mPlayRegionLock, mPlayRegionStart, and mQuickPlayPos.

Referenced by OnMouseEvents().

2630 {
2631  bool isWithinClick =
2632  (mLeftDownClickUnsnapped >= 0) &&
2634  bool isWithinStart = IsWithinMarker(mousePosX, mOldPlayRegionStart);
2635  bool isWithinEnd = IsWithinMarker(mousePosX, mOldPlayRegionEnd);
2636  bool canDragSel = !mPlayRegionLock && mPlayRegionDragsSelection;
2637 
2638  switch (mMouseEventState)
2639  {
2640  case mesNone:
2641  // If close to either end of play region, snap to closest
2642  if (isWithinStart || isWithinEnd) {
2644 
2647  else
2649  }
2650  break;
2653 
2654  // Don't start dragging until beyond tolerance initial playback start
2655  if (!mIsDragging && isWithinStart)
2657  else
2658  mIsDragging = true;
2659  // avoid accidental tiny selection
2660  if (isWithinEnd)
2663  if (canDragSel) {
2664  DragSelection();
2665  }
2666  break;
2668  if (!mIsDragging && isWithinEnd) {
2670 
2672  }
2673  else
2674  mIsDragging = true;
2675  if (isWithinStart) {
2677 
2679  }
2681  if (canDragSel) {
2682  DragSelection();
2683  }
2684  break;
2686 
2687  // Don't start dragging until mouse is beyond tolerance of initial click.
2688  if (isWithinClick || mLeftDownClick == -1) {
2690 
2694  }
2695  else {
2697  }
2698  break;
2700  if (isWithinClick) {
2702 
2704  }
2705 
2706  if (mQuickPlayPos < mLeftDownClick) {
2709  }
2710  else {
2713  }
2714  if (canDragSel) {
2715  DragSelection();
2716  }
2717  break;
2718  }
2719  Refresh();
2720  Update();
2721 }
bool mIsDragging
Definition: Ruler.h:483
double mLeftDownClick
Definition: Ruler.h:481
bool mPlayRegionDragsSelection
Definition: Ruler.h:467
double mOldPlayRegionStart
Definition: Ruler.h:445
MouseEventState mMouseEventState
Definition: Ruler.h:479
void HideQuickPlayIndicator(bool repaint_all=false)
Definition: Ruler.cpp:3342
double mPlayRegionStart
Definition: Ruler.h:443
double mQuickPlayPos
Definition: Ruler.h:437
bool IsWithinMarker(int mousePosX, double markerTime)
Definition: Ruler.cpp:2381
bool mPlayRegionLock
Definition: Ruler.h:442
double mOldPlayRegionEnd
Definition: Ruler.h:446
void DragSelection()
Definition: Ruler.cpp:3038
double mLeftDownClickUnsnapped
Definition: Ruler.h:480
double mPlayRegionEnd
Definition: Ruler.h:444
void AdornedRulerPanel::HandleQPRelease ( wxMouseEvent &  event)
private

Definition at line 2723 of file Ruler.cpp.

References ClearPlayRegion(), TrackList::GetEndTime(), AudacityProject::GetSel0(), AudacityProject::GetSel1(), TrackList::GetStartTime(), HideQuickPlayIndicator(), mesNone, mIsDragging, mLeftDownClick, mMouseEventState, mOldPlayRegionEnd, mOldPlayRegionStart, mPlayRegionEnd, mPlayRegionLock, mPlayRegionStart, mProject, mTracks, AudacityProject::OnLockPlayRegion(), SetPlayRegion(), and StartQPPlay().

Referenced by OnMouseEvents().

2724 {
2725  if (HasCapture())
2726  ReleaseMouse();
2727  else
2728  return;
2729 
2731 
2733  // Swap values to ensure mPlayRegionStart < mPlayRegionEnd
2734  double tmp = mPlayRegionStart;
2736  mPlayRegionEnd = tmp;
2737  }
2738 
2739  const double t0 = mTracks->GetStartTime();
2740  const double t1 = mTracks->GetEndTime();
2741  const double sel0 = mProject->GetSel0();
2742  const double sel1 = mProject->GetSel1();
2743 
2744  // We want some audio in the selection, but we allow a dragged
2745  // region to include selected white-space and space before audio start.
2746  if (evt.ShiftDown() && (mPlayRegionStart == mPlayRegionEnd)) {
2747  // Looping the selection or project.
2748  // Disable if track selection is in white-space beyond end of tracks and
2749  // play position is outside of track contents.
2750  if (((sel1 < t0) || (sel0 > t1)) &&
2751  ((mPlayRegionStart < t0) || (mPlayRegionStart > t1))) {
2752  ClearPlayRegion();
2753  }
2754  }
2755  // Disable if beyond end.
2756  else if (mPlayRegionStart >= t1) {
2757  ClearPlayRegion();
2758  }
2759  // Disable if empty selection before start.
2760  // (allow Quick-Play region to include 'pre-roll' white space)
2761  else if (((mPlayRegionEnd - mPlayRegionStart) > 0.0) && (mPlayRegionEnd < t0)) {
2762  ClearPlayRegion();
2763  }
2764 
2766  mIsDragging = false;
2767  mLeftDownClick = -1;
2768 
2769  auto cleanup = finally( [&] {
2770  if (mPlayRegionLock) {
2771  // Restore Locked Play region
2774  // and release local lock
2775  mPlayRegionLock = false;
2776  }
2777  } );
2778 
2779  StartQPPlay(evt.ShiftDown(), evt.ControlDown());
2780 }
bool mIsDragging
Definition: Ruler.h:483
double mLeftDownClick
Definition: Ruler.h:481
double GetSel0() const
Definition: Project.h:204
double GetStartTime() const
Definition: Track.cpp:1413
double mOldPlayRegionStart
Definition: Ruler.h:445
void OnLockPlayRegion(const CommandContext &context)
Definition: Menus.cpp:9110
double GetEndTime() const
Definition: Track.cpp:1418
MouseEventState mMouseEventState
Definition: Ruler.h:479
void HideQuickPlayIndicator(bool repaint_all=false)
Definition: Ruler.cpp:3342
double mPlayRegionStart
Definition: Ruler.h:443
void StartQPPlay(bool looped, bool cutPreview)
Definition: Ruler.cpp:2782
void SetPlayRegion(double playRegionStart, double playRegionEnd)
Definition: Ruler.cpp:3366
void ClearPlayRegion()
Definition: Ruler.cpp:3381
TrackList * mTracks
Definition: Ruler.h:426
bool mPlayRegionLock
Definition: Ruler.h:442
AudacityProject *const mProject
Definition: Ruler.h:424
double mOldPlayRegionEnd
Definition: Ruler.h:446
double GetSel1() const
Definition: Project.h:205
double mPlayRegionEnd
Definition: Ruler.h:444
void AdornedRulerPanel::HandleSnapping ( )
private

Definition at line 3044 of file Ruler.cpp.

References mIsSnapped, mQuickPlayPos, mSnapManager, mTracks, and mViewInfo.

Referenced by OnMouseEvents().

3045 {
3046  if (!mSnapManager) {
3047  mSnapManager = std::make_unique<SnapManager>(mTracks, mViewInfo);
3048  }
3049 
3050  auto results = mSnapManager->Snap(NULL, mQuickPlayPos, false);
3051  mQuickPlayPos = results.outTime;
3052  mIsSnapped = results.Snapped();
3053 }
bool mIsSnapped
Definition: Ruler.h:440
std::unique_ptr< SnapManager > mSnapManager
Definition: Ruler.h:439
ViewInfo *const mViewInfo
Definition: Ruler.h:425
double mQuickPlayPos
Definition: Ruler.h:437
TrackList * mTracks
Definition: Ruler.h:426
void AdornedRulerPanel::HideQuickPlayIndicator ( bool  repaint_all = false)

Definition at line 3342 of file Ruler.cpp.

References ShowOrHideQuickPlayIndicator().

Referenced by ClearPlayRegion(), HandleQPDrag(), HandleQPRelease(), OnCapture(), OnCaptureLost(), OnMouseEvents(), ControlToolBar::PlayPlayRegion(), ShowContextMenu(), and Scrubber::StopScrubbing().

3343 {
3344  ShowOrHideQuickPlayIndicator(false, repaint_all);
3345 }
void ShowOrHideQuickPlayIndicator(bool show, bool repaint_all=false)
Definition: Ruler.cpp:3348
void AdornedRulerPanel::InvalidateRuler ( )

Definition at line 2158 of file Ruler.cpp.

References Ruler::Invalidate(), and mRuler.

2159 {
2160  mRuler.Invalidate();
2161 }
Ruler mRuler
Definition: Ruler.h:423
void Invalidate()
Definition: Ruler.cpp:371
bool AdornedRulerPanel::IsWithinMarker ( int  mousePosX,
double  markerTime 
)
private

Definition at line 2381 of file Ruler.cpp.

References SELECT_TOLERANCE_PIXEL, and Time2Pos().

Referenced by HandleQPClick(), HandleQPDrag(), and OnMouseEvents().

2382 {
2383  if (markerTime < 0)
2384  return false;
2385 
2386  int pixelPos = Time2Pos(markerTime);
2387  int boundLeft = pixelPos - SELECT_TOLERANCE_PIXEL;
2388  int boundRight = pixelPos + SELECT_TOLERANCE_PIXEL;
2389 
2390  return mousePosX >= boundLeft && mousePosX < boundRight;
2391 }
#define SELECT_TOLERANCE_PIXEL
Definition: Ruler.cpp:107
int Time2Pos(double t, bool ignoreFisheye=false)
Definition: Ruler.cpp:2373
void AdornedRulerPanel::OnAutoScroll ( wxCommandEvent &  evt)
private

Definition at line 3065 of file Ruler.cpp.

References ViewInfo::bUpdateTrackIndicator, gPrefs, mProject, mViewInfo, and AudacityProject::UpdatePrefs().

3066 {
3068  gPrefs->Write(wxT("/GUI/AutoScroll"), false);
3069  else
3070  gPrefs->Write(wxT("/GUI/AutoScroll"), true);
3071  mProject->UpdatePrefs();
3072  gPrefs->Flush();
3073 }
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
bool bUpdateTrackIndicator
Definition: ViewInfo.h:182
ViewInfo *const mViewInfo
Definition: Ruler.h:425
void UpdatePrefs()
Definition: Project.cpp:1344
AudacityProject *const mProject
Definition: Ruler.h:424
void AdornedRulerPanel::OnCapture ( wxCommandEvent &  evt)
private

Definition at line 2250 of file Ruler.cpp.

References HideQuickPlayIndicator(), mCursorDefault, mCursorHand, mIsRecording, mPrevZone, and RegenerateTooltips().

Referenced by EVT_COMMAND().

2251 {
2252  evt.Skip();
2253 
2254  if (evt.GetInt() != 0)
2255  {
2256  // Set cursor immediately because OnMouseEvents is not called
2257  // if recording is initiated by a modal window (Timer Record).
2258  SetCursor(mCursorDefault);
2259  mIsRecording = true;
2260 
2261  // The quick play indicator is useless during recording
2263  }
2264  else {
2265  SetCursor(mCursorHand);
2266  mIsRecording = false;
2267  }
2269 }
void RegenerateTooltips(StatusChoice choice)
Definition: Ruler.cpp:2215
wxCursor mCursorHand
Definition: Ruler.h:419
void HideQuickPlayIndicator(bool repaint_all=false)
Definition: Ruler.cpp:3342
StatusChoice mPrevZone
Definition: Ruler.h:487
bool mIsRecording
Definition: Ruler.h:448
wxCursor mCursorDefault
Definition: Ruler.h:418
void AdornedRulerPanel::OnCaptureLost ( wxMouseCaptureLostEvent &  evt)
private

Definition at line 2944 of file Ruler.cpp.

References HideQuickPlayIndicator(), mLastMouseX, and OnMouseEvents().

2945 {
2947 
2948  wxMouseEvent e(wxEVT_LEFT_UP);
2949  e.m_x = mLastMouseX;
2950  OnMouseEvents(e);
2951 }
void OnMouseEvents(wxMouseEvent &evt)
Definition: Ruler.cpp:2393
void HideQuickPlayIndicator(bool repaint_all=false)
Definition: Ruler.cpp:3342
void AdornedRulerPanel::OnContextMenu ( wxContextMenuEvent &  WXUNUSEDevent)
private

Definition at line 2906 of file Ruler.cpp.

References QuickPlay, and ShowContextMenu().

2907 {
2909 }
void ShowContextMenu(MenuChoice choice, const wxPoint *pPosition)
Definition: Ruler.cpp:3142
void AdornedRulerPanel::OnLockPlayRegion ( wxCommandEvent &  evt)
private

Definition at line 3076 of file Ruler.cpp.

References AudacityProject::IsPlayRegionLocked(), mProject, AudacityProject::OnLockPlayRegion(), and AudacityProject::OnUnlockPlayRegion().

3077 {
3080  else
3082 }
void OnLockPlayRegion(const CommandContext &context)
Definition: Menus.cpp:9110
void OnUnlockPlayRegion(const CommandContext &context)
Definition: Menus.cpp:9124
AudacityProject *const mProject
Definition: Ruler.h:424
bool IsPlayRegionLocked()
Definition: Project.h:213
void AdornedRulerPanel::OnMouseEvents ( wxMouseEvent &  evt)
private

Definition at line 2393 of file Ruler.cpp.

References Scrubber::CanScrub(), EnteringQP, EnteringScrubZone, TrackList::GetEndTime(), TracksPrefs::GetPinnedHeadPreference(), AudacityProject::GetScrubber(), HandleQPClick(), HandleQPDrag(), HandleQPRelease(), HandleSnapping(), Scrubber::HasStartedScrubbing(), HideQuickPlayIndicator(), Scrubber::IsOneShotSeeking(), Scrubber::IsPaused(), AudacityProject::IsPlayRegionLocked(), Scrubber::IsScrubbing(), IsWithinMarker(), Leaving, Scrubber::MarkScrubStart(), mCursorDefault, mCursorHand, mCursorSizeWE, mesNone, min(), mInner, Scrubber::mInOneShotMode, mIsRecording, mIsWE, mMouseEventState, mOldPlayRegionEnd, mOldPlayRegionStart, mPlayRegionEnd, mPlayRegionLock, mPlayRegionStart, mPrevZone, mProject, mQuickPlayEnabled, mQuickPlayPos, mScrubZone, mShowScrubbing, mSnapManager, mTracks, NoChange, AudacityProject::OnPause(), QuickPlay, Scrub, ShowContextMenu(), ShowQuickPlayIndicator(), UpdateQuickPlayPos(), and UpdateStatusBarAndTooltips().

Referenced by OnCaptureLost().

2394 {
2395  // Disable mouse actions on Timeline while recording.
2396  if (mIsRecording) {
2397  if (HasCapture())
2398  ReleaseMouse();
2399  return;
2400  }
2401 
2402  const auto position = evt.GetPosition();
2403 
2404  const bool inScrubZone =
2405  // only if scrubbing is allowed now
2406  mProject->GetScrubber().CanScrub() &&
2407  mShowScrubbing &&
2408  mScrubZone.Contains(position);
2409  const bool inQPZone =
2410  (!inScrubZone) && mInner.Contains(position);
2411 
2412  const StatusChoice zone =
2413  evt.Leaving()
2415  : inScrubZone
2417  : inQPZone
2420  const bool changeInZone = (zone != mPrevZone);
2421  const bool changing = evt.Leaving() || evt.Entering() || changeInZone;
2422 
2423  wxCoord xx = evt.GetX();
2424  wxCoord mousePosX = xx;
2425  UpdateQuickPlayPos(mousePosX);
2426  HandleSnapping();
2427 
2428  // If not looping, restrict selection to end of project
2429  if (zone == StatusChoice::EnteringQP && !evt.ShiftDown()) {
2430  const double t1 = mTracks->GetEndTime();
2432  }
2433 
2434  // Handle status bar messages
2436 
2437  mPrevZone = zone;
2438 
2439  auto &scrubber = mProject->GetScrubber();
2440  if (scrubber.HasStartedScrubbing()) {
2441  if (evt.RightDown() )
2442  // Fall through to context menu handling
2443  ;
2444  else if ( evt.LeftUp() && inScrubZone)
2445  // Fall through to seeking changes to scrubbing
2446  ;
2447 // else if ( evt.LeftDown() && inScrubZone)
2448 // // Fall through to ready to seek
2449 // ;
2450  else {
2451  bool switchToQP = (zone == StatusChoice::EnteringQP && mQuickPlayEnabled);
2452  if (switchToQP && evt.LeftDown()) {
2453  // We can't stop scrubbing yet (see comments in Bug 1391), but we can pause it.
2455  // Don't return, fall through
2456  }
2457  else if (scrubber.IsPaused())
2458  // Just fall through
2459  ;
2460  else {
2461  // If already clicked for scrub, preempt the usual event handling,
2462  // no matter what the y coordinate.
2463 
2464  // Do this hack so scrubber can detect mouse drags anywhere
2465  evt.ResumePropagation(wxEVENT_PROPAGATE_MAX);
2466 
2467  //if (scrubber.IsScrubbing())
2468  evt.Skip();
2469  //else
2470  //evt.Skip();
2471 
2472  // Don't do this, it slows down drag-scrub on Mac.
2473  // Timer updates of display elsewhere make it unnecessary.
2474  // Done here, it's too frequent.
2475  // ShowQuickPlayIndicator();
2476 
2477  return;
2478  }
2479  }
2480  }
2481 
2482  // Store the initial play region state
2483  if(mMouseEventState == mesNone) {
2487  }
2488 
2489  // Handle entering and leaving of the bar, or movement from
2490  // one portion (quick play or scrub) to the other
2491  if (evt.Leaving() || (changeInZone && zone != StatusChoice::EnteringQP)) {
2492  if (evt.Leaving()) {
2493  // Erase the line
2495  }
2496 
2497  SetCursor(mCursorDefault);
2498  mIsWE = false;
2499 
2500  mSnapManager.reset();
2501 
2502  if(evt.Leaving())
2503  return;
2504  // else, may detect a scrub click below
2505  }
2506  else if (evt.Entering() || (changeInZone && zone == StatusChoice::EnteringQP)) {
2507  SetCursor(mCursorHand);
2509  return;
2510  }
2511 
2512  // Handle popup menus
2513  if (!HasCapture() && evt.RightDown() && !(evt.LeftIsDown())) {
2515  (inScrubZone ? MenuChoice::Scrub : MenuChoice::QuickPlay,
2516  &position);
2517  return;
2518  }
2519  else if( !HasCapture() && evt.LeftUp() && inScrubZone ) {
2520  if( scrubber.IsOneShotSeeking() ){
2521  scrubber.mInOneShotMode = false;
2522  return;
2523  }
2524  //wxLogDebug("up");
2525  // mouse going up => we shift to scrubbing.
2526  scrubber.MarkScrubStart(evt.m_x,
2529  // repaint_all so that the indicator changes shape.
2530  bool repaint_all = true;
2531  ShowQuickPlayIndicator(repaint_all);
2532  return;
2533  }
2534  else if ( !HasCapture() && inScrubZone) {
2535  // mouse going down => we are (probably) seeking
2536  bool repaint_all = false;
2537  if (evt.LeftDown()) {
2538  //wxLogDebug("down");
2539  scrubber.mInOneShotMode = !scrubber.IsScrubbing();
2540  scrubber.MarkScrubStart(evt.m_x,
2543  }
2544  else if( changeInZone ) {
2545  repaint_all = true;
2546  }
2547 
2548  ShowQuickPlayIndicator(repaint_all);
2549  return;
2550  }
2551  else if ( mQuickPlayEnabled) {
2552  bool isWithinStart = IsWithinMarker(mousePosX, mOldPlayRegionStart);
2553  bool isWithinEnd = IsWithinMarker(mousePosX, mOldPlayRegionEnd);
2554 
2555  if (isWithinStart || isWithinEnd) {
2556  if (!mIsWE) {
2557  SetCursor(mCursorSizeWE);
2558  mIsWE = true;
2559  }
2560  }
2561  else {
2562  if (mIsWE) {
2563  SetCursor(mCursorHand);
2564  mIsWE = false;
2565  }
2566  }
2567 
2568  if (evt.LeftDown()) {
2569  if( inQPZone ){
2570  HandleQPClick(evt, mousePosX);
2571  HandleQPDrag(evt, mousePosX);
2573  }
2574  }
2575  else if (evt.LeftIsDown() && HasCapture()) {
2576  HandleQPDrag(evt, mousePosX);
2578  }
2579  else if (evt.LeftUp() && HasCapture()) {
2580  HandleQPRelease(evt);
2582  }
2583  else // if (!inScrubZone)
2585  }
2586 }
void ShowContextMenu(MenuChoice choice, const wxPoint *pPosition)
Definition: Ruler.cpp:3142
bool mQuickPlayEnabled
Definition: Ruler.h:469
void HandleQPClick(wxMouseEvent &event, wxCoord mousePosX)
Definition: Ruler.cpp:2588
Scrubber & GetScrubber()
Definition: Project.h:801
wxCursor mCursorHand
Definition: Ruler.h:419
wxRect mInner
Definition: Ruler.h:430
std::unique_ptr< SnapManager > mSnapManager
Definition: Ruler.h:439
double mOldPlayRegionStart
Definition: Ruler.h:445
double GetEndTime() const
Definition: Track.cpp:1418
void HandleSnapping()
Definition: Ruler.cpp:3044
void HandleQPRelease(wxMouseEvent &event)
Definition: Ruler.cpp:2723
MouseEventState mMouseEventState
Definition: Ruler.h:479
void HideQuickPlayIndicator(bool repaint_all=false)
Definition: Ruler.cpp:3342
double mPlayRegionStart
Definition: Ruler.h:443
double mQuickPlayPos
Definition: Ruler.h:437
void HandleQPDrag(wxMouseEvent &event, wxCoord mousePosX)
Definition: Ruler.cpp:2629
bool IsWithinMarker(int mousePosX, double markerTime)
Definition: Ruler.cpp:2381
bool mShowScrubbing
Definition: Ruler.h:489
void ShowQuickPlayIndicator(bool repaint_all=false)
Definition: Ruler.cpp:3337
StatusChoice mPrevZone
Definition: Ruler.h:487
TrackList * mTracks
Definition: Ruler.h:426
int min(int a, int b)
wxRect mScrubZone
Definition: Ruler.h:429
bool CanScrub() const
Definition: Scrubbing.cpp:986
bool mPlayRegionLock
Definition: Ruler.h:442
void UpdateStatusBarAndTooltips(StatusChoice choice)
Definition: Ruler.cpp:2845
AudacityProject *const mProject
Definition: Ruler.h:424
void OnPause(const CommandContext &context)
Definition: Menus.cpp:2864
static bool GetPinnedHeadPreference()
wxCursor mCursorSizeWE
Definition: Ruler.h:420
void UpdateQuickPlayPos(wxCoord &mousPosX)
Definition: Ruler.cpp:2953
bool mIsRecording
Definition: Ruler.h:448
double mOldPlayRegionEnd
Definition: Ruler.h:446
bool IsPlayRegionLocked()
Definition: Project.h:213
double mPlayRegionEnd
Definition: Ruler.h:444
wxCursor mCursorDefault
Definition: Ruler.h:418
void AdornedRulerPanel::OnPaint ( wxPaintEvent &  evt)
private

Definition at line 2271 of file Ruler.cpp.

References BackedPanel::DisplayBitmap(), DoDrawBackground(), DoDrawEdge(), DoDrawMarks(), DoDrawPlayRegion(), DoDrawSelection(), OverlayPanel::DrawOverlays(), BackedPanel::GetBackingDCForRepaint(), SelectedRegion::isPoint(), mNeedButtonUpdate, mViewInfo, ReCreateButtons(), ViewInfo::selectedRegion, and UpdatePrefs().

2272 {
2273  if (mNeedButtonUpdate) {
2274  // Visit this block once only in the lifetime of this panel
2275  mNeedButtonUpdate = false;
2276  // Do this first time setting of button status texts
2277  // when we are sure the CommandManager is initialized.
2278  ReCreateButtons();
2279  // Sends a resize event, which will cause a second paint.
2280  UpdatePrefs();
2281  }
2282 
2283  wxPaintDC dc(this);
2284 
2285  auto &backDC = GetBackingDCForRepaint();
2286 
2287  DoDrawBackground(&backDC);
2288 
2290  {
2291  DoDrawSelection(&backDC);
2292  }
2293 
2294  DoDrawMarks(&backDC, true);
2295 
2296  DoDrawPlayRegion(&backDC);
2297 
2298  DoDrawEdge(&backDC);
2299 
2300  DisplayBitmap(dc);
2301 
2302  // Stroke extras direct to the client area,
2303  // maybe outside of the damaged area
2304  // As with TrackPanel, do not make a NEW wxClientDC or else Mac flashes badly!
2305  dc.DestroyClippingRegion();
2306  DrawOverlays(true, &dc);
2307 }
bool isPoint() const
SelectedRegion selectedRegion
Definition: ViewInfo.h:160
void DoDrawEdge(wxDC *dc)
Definition: Ruler.cpp:3185
void DoDrawMarks(wxDC *dc, bool)
Definition: Ruler.cpp:3200
ViewInfo *const mViewInfo
Definition: Ruler.h:425
void DoDrawBackground(wxDC *dc)
Definition: Ruler.cpp:3169
void DisplayBitmap(wxDC &dc)
Definition: BackedPanel.cpp:65
void DrawOverlays(bool repaint_all, wxDC *pDC=nullptr)
wxDC & GetBackingDCForRepaint()
Definition: BackedPanel.cpp:35
void DoDrawPlayRegion(wxDC *dc)
Definition: Ruler.cpp:3086
void ReCreateButtons()
Definition: Ruler.cpp:2098
bool mNeedButtonUpdate
Definition: Ruler.h:496
void DoDrawSelection(wxDC *dc)
Definition: Ruler.cpp:3217
void UpdatePrefs()
Definition: Ruler.cpp:2074
void AdornedRulerPanel::OnSize ( wxSizeEvent &  evt)
private

Definition at line 2309 of file Ruler.cpp.

References mOuter, BackedPanel::OnSize(), and UpdateRects().

2310 {
2311  mOuter = GetClientRect();
2312  if (mOuter.GetWidth() == 0 || mOuter.GetHeight() == 0)
2313  {
2314  return;
2315  }
2316 
2317  UpdateRects();
2318 
2319  OverlayPanel::OnSize(evt);
2320 }
void OnSize(wxSizeEvent &event)
Definition: BackedPanel.cpp:70
void UpdateRects()
Definition: Ruler.cpp:2322
wxRect mOuter
Definition: Ruler.h:428
void AdornedRulerPanel::OnSyncSelToQuickPlay ( wxCommandEvent &  evt)
private

Definition at line 3031 of file Ruler.cpp.

References gPrefs, and mPlayRegionDragsSelection.

3032 {
3034  gPrefs->Write(wxT("/QuickPlay/DragSelection"), mPlayRegionDragsSelection);
3035  gPrefs->Flush();
3036 }
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
bool mPlayRegionDragsSelection
Definition: Ruler.h:467
void AdornedRulerPanel::OnTimelineToolTips ( wxCommandEvent &  evt)
private

Definition at line 3055 of file Ruler.cpp.

References gPrefs, mPrevZone, mTimelineToolTip, and RegenerateTooltips().

3056 {
3057  mTimelineToolTip = (mTimelineToolTip)? false : true;
3058  gPrefs->Write(wxT("/QuickPlay/ToolTips"), mTimelineToolTip);
3059  gPrefs->Flush();
3060 #if wxUSE_TOOLTIPS
3062 #endif
3063 }
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
void RegenerateTooltips(StatusChoice choice)
Definition: Ruler.cpp:2215
StatusChoice mPrevZone
Definition: Ruler.h:487
bool mTimelineToolTip
Definition: Ruler.h:468
void AdornedRulerPanel::OnTogglePinnedState ( wxCommandEvent &  event)
private

Definition at line 2938 of file Ruler.cpp.

References mProject, AudacityProject::OnTogglePinnedHead(), and UpdateButtonStates().

2939 {
2942 }
void OnTogglePinnedHead(const CommandContext &context)
Definition: Menus.cpp:2973
AudacityProject *const mProject
Definition: Ruler.h:424
void UpdateButtonStates()
Definition: Ruler.cpp:2911
void AdornedRulerPanel::OnToggleQuickPlay ( wxCommandEvent &  evt)
private

Definition at line 3023 of file Ruler.cpp.

References gPrefs, mPrevZone, mQuickPlayEnabled, and RegenerateTooltips().

3024 {
3025  mQuickPlayEnabled = (mQuickPlayEnabled)? false : true;
3026  gPrefs->Write(wxT("/QuickPlay/QuickPlayEnabled"), mQuickPlayEnabled);
3027  gPrefs->Flush();
3029 }
bool mQuickPlayEnabled
Definition: Ruler.h:469
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
void RegenerateTooltips(StatusChoice choice)
Definition: Ruler.cpp:2215
StatusChoice mPrevZone
Definition: Ruler.h:487
void AdornedRulerPanel::OnToggleScrubRuler ( )

Definition at line 2890 of file Ruler.cpp.

References gPrefs, mShowScrubbing, and SetPanelSize().

Referenced by Scrubber::OnToggleScrubRuler().

2891 {
2893  WriteScrubEnabledPref(mShowScrubbing);
2894  gPrefs->Flush();
2895  SetPanelSize();
2896 }
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
bool mShowScrubbing
Definition: Ruler.h:489
void SetPanelSize()
Definition: Ruler.cpp:2898
void AdornedRulerPanel::OnToggleScrubRulerFromMenu ( wxCommandEvent &  )

Definition at line 2884 of file Ruler.cpp.

References AudacityProject::GetScrubber(), mProject, and Scrubber::OnToggleScrubRuler().

2885 {
2886  auto &scrubber = mProject->GetScrubber();
2887  scrubber.OnToggleScrubRuler(*mProject);
2888 }
Scrubber & GetScrubber()
Definition: Project.h:801
void OnToggleScrubRuler(const CommandContext &)
Definition: Scrubbing.cpp:924
AudacityProject *const mProject
Definition: Ruler.h:424
double AdornedRulerPanel::Pos2Time ( int  p,
bool  ignoreFisheye = false 
)
private

Definition at line 2366 of file Ruler.cpp.

References mLeftOffset, mViewInfo, and ZoomInfo::PositionToTime().

Referenced by DoDrawMarks(), and UpdateQuickPlayPos().

2367 {
2369  , ignoreFisheye
2370  );
2371 }
double PositionToTime(wxInt64 position, wxInt64 origin=0, bool ignoreFisheye=false) const
Definition: ViewInfo.cpp:49
ViewInfo *const mViewInfo
Definition: Ruler.h:425
void AdornedRulerPanel::ReCreateButtons ( )

Definition at line 2098 of file Ruler.cpp.

References ThemeBase::Colour(), GetRulerHeight(), ThemeBase::ImageSize(), ToolBar::MakeAlternateImages(), ToolBar::MakeButton(), mButtons, min(), OnTogglePinnedStateID, safenew, Grabber::SetAsSpacer(), theTheme, and UpdateButtonStates().

Referenced by Theme::ApplyUpdatedImages(), and OnPaint().

2099 {
2100  // TODO: Should we do this to destroy the grabber??
2101  // Get rid of any children we may have
2102  // DestroyChildren();
2103 
2104  SetBackgroundColour(theTheme.Colour( clrMedium ));
2105 
2106  for (auto & button : mButtons) {
2107  if (button)
2108  button->Destroy();
2109  button = nullptr;
2110  }
2111 
2112  size_t iButton = 0;
2113  // Make the short row of time ruler pushbottons.
2114  // Don't bother with sizers. Their sizes and positions are fixed.
2115  // Add a grabber converted to a spacer.
2116  // This makes it visually clearer that the button is a button.
2117 
2118  wxPoint position( 1, 0 );
2119 
2120  Grabber * pGrabber = safenew Grabber(this, this->GetId());
2121  pGrabber->SetAsSpacer( true );
2122  //pGrabber->SetSize( 10, 27 ); // default is 10,27
2123  pGrabber->SetPosition( position );
2124 
2125  position.x = 12;
2126 
2127  auto size = theTheme.ImageSize( bmpRecoloredUpSmall );
2128  size.y = std::min(size.y, GetRulerHeight(false));
2129 
2130  auto buttonMaker = [&]
2131  (wxWindowID id, teBmps bitmap, bool toggle)
2132  {
2133  const auto button =
2135  this,
2136  bmpRecoloredUpSmall, bmpRecoloredDownSmall,
2137  bmpRecoloredUpHiliteSmall, bmpRecoloredHiliteSmall,
2138  bitmap, bitmap, bitmap,
2139  id, position, toggle, size
2140  );
2141 
2142  position.x += size.GetWidth();
2143  mButtons[iButton++] = button;
2144  return button;
2145  };
2146  auto button = buttonMaker(OnTogglePinnedStateID, bmpPlayPointerPinned, true);
2148  *button, 1,
2149  bmpRecoloredUpSmall, bmpRecoloredDownSmall,
2150  bmpRecoloredUpHiliteSmall, bmpRecoloredHiliteSmall,
2151  //bmpUnpinnedPlayHead, bmpUnpinnedPlayHead, bmpUnpinnedPlayHead,
2152  bmpPlayPointer, bmpPlayPointer, bmpPlayPointer,
2153  size);
2154 
2156 }
AUDACITY_DLL_API Theme theTheme
Definition: Theme.cpp:209
int GetRulerHeight()
Definition: Ruler.h:333
int teBmps
Definition: Theme.h:28
wxSize ImageSize(int iIndex)
Definition: Theme.cpp:1257
static AButton * MakeButton(wxWindow *parent, teBmps eUp, teBmps eDown, teBmps eHilite, teBmps eDownHi, teBmps eStandardUp, teBmps eStandardDown, teBmps eDisabled, wxWindowID id, wxPoint placement, bool processdownevents, wxSize size)
Definition: ToolBar.cpp:765
#define safenew
Definition: Audacity.h:230
int min(int a, int b)
static void MakeAlternateImages(AButton &button, int idx, teBmps eUp, teBmps eDown, teBmps eHilite, teBmps eDownHi, teBmps eStandardUp, teBmps eStandardDown, teBmps eDisabled, wxSize size)
Definition: ToolBar.cpp:798
void SetAsSpacer(bool bIsSpacer)
Definition: Grabber.cpp:101
The widget to the left of a ToolBar that allows it to be dragged around to NEW positions.
Definition: Grabber.h:98
wxWindow * mButtons[3]
Definition: Ruler.h:495
wxColour & Colour(int iIndex)
Definition: Theme.cpp:1225
void UpdateButtonStates()
Definition: Ruler.cpp:2911
void AdornedRulerPanel::RegenerateTooltips ( StatusChoice  choice)

Definition at line 2215 of file Ruler.cpp.

References _(), EnteringQP, EnteringScrubZone, AudacityProject::GetScrubber(), mIsRecording, mProject, mQuickPlayEnabled, and mTimelineToolTip.

Referenced by OnCapture(), OnTimelineToolTips(), OnToggleQuickPlay(), UpdatePrefs(), and UpdateStatusBarAndTooltips().

2216 {
2217 #if wxUSE_TOOLTIPS
2218  if (mTimelineToolTip) {
2219  if (mIsRecording) {
2220  this->SetToolTip(_("Timeline actions disabled during recording"));
2221  }
2222  else {
2223  switch(choice) {
2225  if (!mQuickPlayEnabled) {
2226  this->SetToolTip(_("Quick-Play disabled"));
2227  }
2228  else {
2229  this->SetToolTip(_("Quick-Play enabled"));
2230  }
2231  break;
2233  {
2234  const auto message = ScrubbingMessage(mProject->GetScrubber());
2235  this->SetToolTip(message);
2236  }
2237  break;
2238  default:
2239  this->SetToolTip(NULL);
2240  break;
2241  }
2242  }
2243  }
2244  else {
2245  this->SetToolTip(NULL);
2246  }
2247 #endif
2248 }
bool mQuickPlayEnabled
Definition: Ruler.h:469
Scrubber & GetScrubber()
Definition: Project.h:801
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
AudacityProject *const mProject
Definition: Ruler.h:424
bool mTimelineToolTip
Definition: Ruler.h:468
bool mIsRecording
Definition: Ruler.h:448
void AdornedRulerPanel::SetFocusFromKbd ( )
override

Definition at line 3422 of file Ruler.cpp.

References TemporarilyAllowFocus().

3423 {
3424  auto temp = TemporarilyAllowFocus();
3425  SetFocus();
3426 }
static TempAllowFocus TemporarilyAllowFocus()
Definition: Ruler.cpp:3417
void AdornedRulerPanel::SetLeftOffset ( int  offset)

Definition at line 3239 of file Ruler.cpp.

References mLeftOffset, mRuler, mViewInfo, and Ruler::SetUseZoomInfo().

Referenced by TrackPanel::UpdateVRulerSize().

3240 {
3241  mLeftOffset = offset;
3242  mRuler.SetUseZoomInfo(offset, mViewInfo);
3243 }
Ruler mRuler
Definition: Ruler.h:423
ViewInfo *const mViewInfo
Definition: Ruler.h:425
void SetUseZoomInfo(int leftOffset, const ZoomInfo *zoomInfo)
Definition: Ruler.cpp:1606
void AdornedRulerPanel::SetPanelSize ( )

Definition at line 2898 of file Ruler.cpp.

References GetRulerHeight(), and mShowScrubbing.

Referenced by OnToggleScrubRuler(), and UpdatePrefs().

2899 {
2900  wxSize size { GetSize().GetWidth(), GetRulerHeight(mShowScrubbing) };
2901  SetSize(size);
2902  SetMinSize(size);
2903  GetParent()->PostSizeEventToParent();
2904 }
int GetRulerHeight()
Definition: Ruler.h:333
bool mShowScrubbing
Definition: Ruler.h:489
void AdornedRulerPanel::SetPlayRegion ( double  playRegionStart,
double  playRegionEnd 
)

Definition at line 3366 of file Ruler.cpp.

References mesNone, mMouseEventState, mPlayRegionEnd, and mPlayRegionStart.

Referenced by HandleQPRelease(), and AudacityProject::TP_DisplaySelection().

3368 {
3369  // This is called by AudacityProject to make the play region follow
3370  // the current selection. But while the user is selecting a play region
3371  // with the mouse directly in the ruler, changes from outside are blocked.
3372  if (mMouseEventState != mesNone)
3373  return;
3374 
3375  mPlayRegionStart = playRegionStart;
3376  mPlayRegionEnd = playRegionEnd;
3377 
3378  Refresh();
3379 }
MouseEventState mMouseEventState
Definition: Ruler.h:479
double mPlayRegionStart
Definition: Ruler.h:443
double mPlayRegionEnd
Definition: Ruler.h:444
void AdornedRulerPanel::ShowContextMenu ( MenuChoice  choice,
const wxPoint *  pPosition 
)
private

Definition at line 3142 of file Ruler.cpp.

References HideQuickPlayIndicator(), QuickPlay, Scrub, ShowMenu(), and ShowScrubMenu().

Referenced by OnContextMenu(), and OnMouseEvents().

3143 {
3144  wxPoint position;
3145  if(pPosition)
3146  position = *pPosition;
3147  else
3148  {
3149  auto rect = GetRect();
3150  position = { rect.GetLeft() + 1, rect.GetBottom() + 1 };
3151  }
3152 
3153  switch (choice) {
3154  case MenuChoice::QuickPlay:
3155  ShowMenu(position); break;
3156  case MenuChoice::Scrub:
3157  ShowScrubMenu(position); break;
3158  default:
3159  return;
3160  }
3161 
3162  // dismiss and clear Quick-Play indicator
3164 
3165  if (HasCapture())
3166  ReleaseMouse();
3167 }
void ShowScrubMenu(const wxPoint &pos)
Definition: Ruler.cpp:3012
void HideQuickPlayIndicator(bool repaint_all=false)
Definition: Ruler.cpp:3342
void ShowMenu(const wxPoint &pos)
Definition: Ruler.cpp:2968
bool AdornedRulerPanel::ShowingScrubRuler ( ) const
inline

Definition at line 365 of file Ruler.h.

Referenced by ScrubbingToolBar::EnableDisableButtons(), and Scrubber::ShowsBar().

365 { return mShowScrubbing; }
bool mShowScrubbing
Definition: Ruler.h:489
void AdornedRulerPanel::ShowMenu ( const wxPoint &  pos)
private

Definition at line 2968 of file Ruler.cpp.

References _(), ViewInfo::bUpdateTrackIndicator, AudacityProject::IsPlayRegionLocked(), mPlayRegionDragsSelection, mPlayRegionEnd, mPlayRegionStart, mProject, mQuickPlayEnabled, mShowScrubbing, mTimelineToolTip, mViewInfo, OnAutoScrollID, OnLockPlayRegionID, OnScrubRulerID, OnSyncQuickPlaySelID, OnTimelineToolTipID, and OnToggleQuickPlayID.

Referenced by ShowContextMenu().

2969 {
2970  wxMenu rulerMenu;
2971 
2972  if (mQuickPlayEnabled)
2973  rulerMenu.Append(OnToggleQuickPlayID, _("Disable Quick-Play"));
2974  else
2975  rulerMenu.Append(OnToggleQuickPlayID, _("Enable Quick-Play"));
2976 
2977  wxMenuItem *dragitem;
2979  dragitem = rulerMenu.Append(OnSyncQuickPlaySelID, _("Disable dragging selection"));
2980  else
2981  dragitem = rulerMenu.Append(OnSyncQuickPlaySelID, _("Enable dragging selection"));
2982  dragitem->Enable(mQuickPlayEnabled && !mProject->IsPlayRegionLocked());
2983 
2984 #if wxUSE_TOOLTIPS
2985  if (mTimelineToolTip)
2986  rulerMenu.Append(OnTimelineToolTipID, _("Disable Timeline Tooltips"));
2987  else
2988  rulerMenu.Append(OnTimelineToolTipID, _("Enable Timeline Tooltips"));
2989 #endif
2990 
2992  rulerMenu.Append(OnAutoScrollID, _("Do not scroll while playing"));
2993  else
2994  rulerMenu.Append(OnAutoScrollID, _("Update display while playing"));
2995 
2996  wxMenuItem *prlitem;
2997  if (!mProject->IsPlayRegionLocked())
2998  prlitem = rulerMenu.Append(OnLockPlayRegionID, _("Lock Play Region"));
2999  else
3000  prlitem = rulerMenu.Append(OnLockPlayRegionID, _("Unlock Play Region"));
3001  prlitem->Enable(mProject->IsPlayRegionLocked() || (mPlayRegionStart != mPlayRegionEnd));
3002 
3003  wxMenuItem *ruleritem;
3004  if (mShowScrubbing)
3005  ruleritem = rulerMenu.Append(OnScrubRulerID, _("Disable Scrub Ruler"));
3006  else
3007  ruleritem = rulerMenu.Append(OnScrubRulerID, _("Enable Scrub Ruler"));
3008 
3009  PopupMenu(&rulerMenu, pos);
3010 }
bool mQuickPlayEnabled
Definition: Ruler.h:469
bool mPlayRegionDragsSelection
Definition: Ruler.h:467
bool bUpdateTrackIndicator
Definition: ViewInfo.h:182
ViewInfo *const mViewInfo
Definition: Ruler.h:425
double mPlayRegionStart
Definition: Ruler.h:443
bool mShowScrubbing
Definition: Ruler.h:489
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
AudacityProject *const mProject
Definition: Ruler.h:424
bool mTimelineToolTip
Definition: Ruler.h:468
bool IsPlayRegionLocked()
Definition: Project.h:213
double mPlayRegionEnd
Definition: Ruler.h:444
void AdornedRulerPanel::ShowOrHideQuickPlayIndicator ( bool  show,
bool  repaint_all = false 
)
private

Definition at line 3348 of file Ruler.cpp.

References OverlayPanel::DrawOverlays(), EnteringScrubZone, TrackList::GetEndTime(), GetOverlay(), AudacityProject::GetScrubber(), AudacityProject::GetSel1(), AudacityProject::GetTrackPanel(), Scrubber::IsScrubbing(), mIsSnapped, mPrevZone, mProject, mQuickPlayPos, mTracks, Time2Pos(), and QuickPlayIndicatorOverlay::Update().

Referenced by HideQuickPlayIndicator(), and ShowQuickPlayIndicator().

3349 {
3350  double latestEnd = std::max(mTracks->GetEndTime(), mProject->GetSel1());
3351  if (!show || (mQuickPlayPos >= latestEnd)) {
3352  GetOverlay()->Update(-1);
3353  }
3354  else {
3355  const int x = Time2Pos(mQuickPlayPos);
3356  bool previewScrub =
3359  GetOverlay()->Update(x, mIsSnapped, previewScrub);
3360  }
3361 
3362  mProject->GetTrackPanel()->DrawOverlays(repaint_all);
3363  DrawOverlays(repaint_all);
3364 }
bool mIsSnapped
Definition: Ruler.h:440
Scrubber & GetScrubber()
Definition: Project.h:801
QuickPlayIndicatorOverlay * GetOverlay()
Definition: Ruler.cpp:3329
double GetEndTime() const
Definition: Track.cpp:1418
double mQuickPlayPos
Definition: Ruler.h:437
bool IsScrubbing() const
Definition: Scrubbing.cpp:575
StatusChoice mPrevZone
Definition: Ruler.h:487
TrackList * mTracks
Definition: Ruler.h:426
void DrawOverlays(bool repaint_all, wxDC *pDC=nullptr)
int Time2Pos(double t, bool ignoreFisheye=false)
Definition: Ruler.cpp:2373
AudacityProject *const mProject
Definition: Ruler.h:424
TrackPanel * GetTrackPanel()
Definition: Project.h:307
double GetSel1() const
Definition: Project.h:205
void Update(int x, bool snapped=false, bool previewScrub=false)
Definition: Ruler.cpp:1889
void AdornedRulerPanel::ShowQuickPlayIndicator ( bool  repaint_all = false)

Definition at line 3337 of file Ruler.cpp.

References ShowOrHideQuickPlayIndicator().

Referenced by OnMouseEvents().

3338 {
3339  ShowOrHideQuickPlayIndicator(true, repaint_all);
3340 }
void ShowOrHideQuickPlayIndicator(bool show, bool repaint_all=false)
Definition: Ruler.cpp:3348
void AdornedRulerPanel::ShowScrubMenu ( const wxPoint &  pos)
private

Definition at line 3012 of file Ruler.cpp.

References AudacityProject::GetScrubber(), mProject, and Scrubber::PopulatePopupMenu().

Referenced by ShowContextMenu().

3013 {
3014  auto &scrubber = mProject->GetScrubber();
3015  PushEventHandler(&scrubber);
3016  auto cleanup = finally([this]{ PopEventHandler(); });
3017 
3018  wxMenu rulerMenu;
3019  mProject->GetScrubber().PopulatePopupMenu(rulerMenu);
3020  PopupMenu(&rulerMenu, pos);
3021 }
Scrubber & GetScrubber()
Definition: Project.h:801
AudacityProject *const mProject
Definition: Ruler.h:424
void PopulatePopupMenu(wxMenu &menu)
Definition: Scrubbing.cpp:1022
void AdornedRulerPanel::StartQPPlay ( bool  looped,
bool  cutPreview 
)
private

Definition at line 2782 of file Ruler.cpp.

References ControlToolBar::CutPreview, AudacityProject::GetControlToolBar(), AudacityProject::GetDefaultPlayOptions(), TrackList::GetEndTime(), AudacityProject::GetSel0(), AudacityProject::GetSel1(), TrackList::GetStartTime(), ControlToolBar::Looped, mPlayRegionEnd, mPlayRegionStart, mProject, mTracks, normalPlay, AudioIOStartStreamOptions::playLooped, ControlToolBar::PlayPlayRegion(), ControlToolBar::StopPlaying(), and ControlToolBar::Straight.

Referenced by HandleQPRelease().

2783 {
2784  const double t0 = mTracks->GetStartTime();
2785  const double t1 = mTracks->GetEndTime();
2786  const double sel0 = mProject->GetSel0();
2787  const double sel1 = mProject->GetSel1();
2788 
2789  // Start / Restart playback on left click.
2790  bool startPlaying = (mPlayRegionStart >= 0);
2791 
2792  if (startPlaying) {
2794  ctb->StopPlaying();
2795 
2796  bool loopEnabled = true;
2797  double start, end;
2798 
2799  if ((mPlayRegionEnd - mPlayRegionStart == 0.0) && looped) {
2800  // Loop play a point will loop either a selection or the project.
2801  if ((mPlayRegionStart > sel0) && (mPlayRegionStart < sel1)) {
2802  // we are in a selection, so use the selection
2803  start = sel0;
2804  end = sel1;
2805  } // not in a selection, so use the project
2806  else {
2807  start = t0;
2808  end = t1;
2809  }
2810  }
2811  else {
2812  start = mPlayRegionStart;
2813  end = mPlayRegionEnd;
2814  }
2815  // Looping a tiny selection may freeze, so just play it once.
2816  loopEnabled = ((end - start) > 0.001)? true : false;
2817 
2819  options.playLooped = (loopEnabled && looped);
2820 
2821  auto oldStart = mPlayRegionStart;
2822  if (!cutPreview)
2823  options.pStartTime = &oldStart;
2824  else
2825  options.timeTrack = NULL;
2826 
2827  ControlToolBar::PlayAppearance appearance =
2829  : options.playLooped ? ControlToolBar::PlayAppearance::Looped
2831 
2832  mPlayRegionStart = start;
2833  mPlayRegionEnd = end;
2834  Refresh();
2835 
2836  ctb->PlayPlayRegion((SelectedRegion(start, end)),
2837  options, PlayMode::normalPlay,
2838  appearance,
2839  false,
2840  true);
2841 
2842  }
2843 }
A ToolBar that has the main Transport buttons.
AudioIOStartStreamOptions GetDefaultPlayOptions()
Definition: Project.cpp:1298
double GetSel0() const
Definition: Project.h:204
double GetStartTime() const
Definition: Track.cpp:1413
double GetEndTime() const
Definition: Track.cpp:1418
void StopPlaying(bool stopStream=true)
double mPlayRegionStart
Definition: Ruler.h:443
Defines a selected portion of a project.
struct holding stream options, including a pointer to the TimeTrack and AudioIOListener and whether t...
Definition: AudioIO.h:123
TrackList * mTracks
Definition: Ruler.h:426
AudacityProject *const mProject
Definition: Ruler.h:424
int PlayPlayRegion(const SelectedRegion &selectedRegion, const AudioIOStartStreamOptions &options, PlayMode playMode, PlayAppearance appearance=PlayAppearance::Straight, bool backwards=false, bool playWhiteSpace=false)
ControlToolBar * GetControlToolBar()
Definition: Project.cpp:5003
double GetSel1() const
Definition: Project.h:205
double mPlayRegionEnd
Definition: Ruler.h:444
auto AdornedRulerPanel::TemporarilyAllowFocus ( )
static

Definition at line 3417 of file Ruler.cpp.

Referenced by SetFocusFromKbd().

3417  {
3418  s_AcceptsFocus = true;
3419  return TempAllowFocus{ &s_AcceptsFocus };
3420 }
static bool s_AcceptsFocus
Definition: Ruler.h:396
std::unique_ptr< bool, Resetter > TempAllowFocus
Definition: Ruler.h:398
int AdornedRulerPanel::Time2Pos ( double  t,
bool  ignoreFisheye = false 
)
private

Definition at line 2373 of file Ruler.cpp.

References mLeftOffset, mViewInfo, and ZoomInfo::TimeToPosition().

Referenced by DoDrawPlayRegion(), DoDrawSelection(), HandleQPClick(), IsWithinMarker(), and ShowOrHideQuickPlayIndicator().

2374 {
2376  , ignoreFisheye
2377  );
2378 }
ViewInfo *const mViewInfo
Definition: Ruler.h:425
wxInt64 TimeToPosition(double time, wxInt64 origin=0, bool ignoreFisheye=false) const
STM: Converts a project time to screen x position.
Definition: ViewInfo.cpp:59
void AdornedRulerPanel::UpdateButtonStates ( )

Definition at line 2911 of file Ruler.cpp.

References _(), TracksPrefs::GetPinnedHeadPreference(), label, OnTogglePinnedStateID, AButton::PopUp(), ToolBar::SetButtonToolTip(), and AButton::UpdateStatus().

Referenced by Scrubber::OnScrubOrSeek(), OnTogglePinnedState(), ReCreateButtons(), and UpdatePrefs().

2912 {
2913  auto common = [this]
2914  (AButton &button, const wxString &commandName, const wxString &label) {
2915  TranslatedInternalString command{ commandName, label };
2916  ToolBar::SetButtonToolTip( button, &command, 1u );
2917  button.SetLabel(button.GetToolTipText());
2918 
2919  button.UpdateStatus();
2920  };
2921 
2922  {
2923  bool state = TracksPrefs::GetPinnedHeadPreference();
2924  auto pinButton = static_cast<AButton*>(FindWindow(OnTogglePinnedStateID));
2925  if( !state )
2926  pinButton->PopUp();
2927  else
2928  pinButton->PushDown();
2929  pinButton->SetAlternateIdx(state ? 0 : 1);
2930  // Bug 1584: Toltip now shows what clicking will do.
2931  const auto label = state
2932  ? _("Click to unpin")
2933  : _("Click to pin");
2934  common(*pinButton, wxT("PinnedHead"), label);
2935  }
2936 }
void PopUp()
Definition: AButton.cpp:525
wxString label
Definition: Tags.cpp:727
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
static bool GetPinnedHeadPreference()
static void SetButtonToolTip(AButton &button, const TranslatedInternalString commands[], size_t nCommands)
Definition: ToolBar.cpp:823
A wxButton with mouse-over behaviour.
Definition: AButton.h:28
void UpdateStatus()
Definition: AButton.cpp:421
void AdornedRulerPanel::UpdatePrefs ( )

Definition at line 2074 of file Ruler.cpp.

References gPrefs, mPrevZone, mRuler, mShowScrubbing, RegenerateTooltips(), TracksBehaviorsPrefs::ScrollingPreferenceDefault(), TracksBehaviorsPrefs::ScrollingPreferenceKey(), SetPanelSize(), Ruler::SetTwoTone(), UpdateButtonStates(), and UpdateRects().

Referenced by OnPaint(), and AudacityProject::UpdatePrefs().

2075 {
2076  // Update button texts for language change
2078 
2079 #ifdef EXPERIMENTAL_SCROLLING_LIMITS
2080 #ifdef EXPERIMENTAL_TWO_TONE_TIME_RULER
2081  {
2082  bool scrollBeyondZero = false;
2083  gPrefs->Read(TracksBehaviorsPrefs::ScrollingPreferenceKey(), &scrollBeyondZero,
2085  mRuler.SetTwoTone(scrollBeyondZero);
2086  }
2087 #endif
2088 #endif
2089 
2090  mShowScrubbing = ReadScrubEnabledPref();
2091  // Affected by the last
2092  UpdateRects();
2093  SetPanelSize();
2094 
2096 }
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
void RegenerateTooltips(StatusChoice choice)
Definition: Ruler.cpp:2215
static const wxChar * ScrollingPreferenceKey()
Ruler mRuler
Definition: Ruler.h:423
void UpdateRects()
Definition: Ruler.cpp:2322
void SetTwoTone(bool twoTone)
Definition: Ruler.cpp:183
bool mShowScrubbing
Definition: Ruler.h:489
StatusChoice mPrevZone
Definition: Ruler.h:487
void SetPanelSize()
Definition: Ruler.cpp:2898
static bool ScrollingPreferenceDefault()
void UpdateButtonStates()
Definition: Ruler.cpp:2911
void AdornedRulerPanel::UpdateQuickPlayPos ( wxCoord &  mousPosX)

Definition at line 2953 of file Ruler.cpp.

References TrackPanel::GetLeftOffset(), AudacityProject::GetTrackPanel(), TrackPanel::GetTracksUsableArea(), min(), mLastMouseX, mProject, mQuickPlayPos, mQuickPlayPosUnsnapped, and Pos2Time().

Referenced by OnMouseEvents().

2954 {
2955  // Keep Quick-Play within usable track area.
2957  int width;
2958  tp->GetTracksUsableArea(&width, NULL);
2959  mousePosX = std::max(mousePosX, tp->GetLeftOffset());
2960  mousePosX = std::min(mousePosX, tp->GetLeftOffset() + width - 1);
2961 
2962  mLastMouseX = mousePosX;
2964 }
void GetTracksUsableArea(int *width, int *height) const
Definition: TrackPanel.cpp:421
double mQuickPlayPos
Definition: Ruler.h:437
The TrackPanel class coordinates updates and operations on the main part of the screen which contains...
Definition: TrackPanel.h:245
int min(int a, int b)
AudacityProject *const mProject
Definition: Ruler.h:424
double mQuickPlayPosUnsnapped
Definition: Ruler.h:436
TrackPanel * GetTrackPanel()
Definition: Project.h:307
int GetLeftOffset() const
Definition: TrackPanel.h:287
double Pos2Time(int p, bool ignoreFisheye=false)
Definition: Ruler.cpp:2366
void AdornedRulerPanel::UpdateRects ( )
private

Definition at line 2322 of file Ruler.cpp.

References BottomMargin, LeftMargin, min(), mInner, mOuter, mRuler, mScrubZone, mShowScrubbing, RightMargin, ScrubHeight, Ruler::SetBounds(), and TopMargin.

Referenced by OnSize(), and UpdatePrefs().

2323 {
2324  mInner = mOuter;
2325  mInner.x += LeftMargin;
2326  mInner.width -= (LeftMargin + RightMargin);
2327 
2328  auto top = &mInner;
2329  auto bottom = &mInner;
2330 
2331  if (mShowScrubbing) {
2332  mScrubZone = mInner;
2333  auto scrubHeight = std::min(mScrubZone.height, (int)(ScrubHeight));
2334 
2335  int topHeight;
2336 #ifdef SCRUB_ABOVE
2337  top = &mScrubZone, topHeight = scrubHeight;
2338 #else
2339  auto qpHeight = mScrubZone.height - scrubHeight;
2340  bottom = &mScrubZone, topHeight = qpHeight;
2341  // Increase scrub zone height so that hit testing finds it and
2342  // not QP region, when on bottom 'edge'.
2343  mScrubZone.height+=BottomMargin;
2344 #endif
2345 
2346  top->height = topHeight;
2347  bottom->height -= topHeight;
2348  bottom->y += topHeight;
2349  }
2350 
2351  top->y += TopMargin;
2352  top->height -= TopMargin;
2353 
2354  bottom->height -= BottomMargin;
2355 
2356  if (!mShowScrubbing)
2357  mScrubZone = mInner;
2358 
2359  mRuler.SetBounds(mInner.GetLeft(),
2360  mInner.GetTop(),
2361  mInner.GetRight(),
2362  mInner.GetBottom());
2363 
2364 }
wxRect mInner
Definition: Ruler.h:430
Ruler mRuler
Definition: Ruler.h:423
void SetBounds(int left, int top, int right, int bottom)
Definition: Ruler.cpp:358
wxRect mOuter
Definition: Ruler.h:428
bool mShowScrubbing
Definition: Ruler.h:489
int min(int a, int b)
wxRect mScrubZone
Definition: Ruler.h:429
void AdornedRulerPanel::UpdateStatusBarAndTooltips ( StatusChoice  choice)
private

Definition at line 2845 of file Ruler.cpp.

References EnteringQP, EnteringScrubZone, AudacityProject::GetScrubber(), Scrubber::HasStartedScrubbing(), Leaving, mProject, NoChange, RegenerateTooltips(), and AudacityProject::TP_DisplayStatusMessage().

Referenced by OnMouseEvents().

2846 {
2847  if (choice == StatusChoice::NoChange)
2848  return;
2849 
2850  wxString message {};
2851 
2852  const auto &scrubber = mProject->GetScrubber();
2853  const bool scrubbing = scrubber.HasStartedScrubbing();
2854  if (scrubbing && choice != StatusChoice::Leaving)
2855  // Don't distinguish zones
2857 
2858  switch (choice) {
2860  {
2861  // message = Insert timeline status bar message here
2862  }
2863  break;
2864 
2866  {
2867  message = ScrubbingMessage(scrubber);
2868  }
2869  break;
2870 
2871  default:
2872  break;
2873  }
2874 
2875  // Display a message, or empty message
2877 
2878  RegenerateTooltips(choice);
2879 }
bool HasStartedScrubbing() const
Definition: Scrubbing.h:95
void RegenerateTooltips(StatusChoice choice)
Definition: Ruler.cpp:2215
Scrubber & GetScrubber()
Definition: Project.h:801
void TP_DisplayStatusMessage(const wxString &msg) override
Definition: Project.cpp:5356
AudacityProject *const mProject
Definition: Ruler.h:424

Member Data Documentation

wxWindow* AdornedRulerPanel::mButtons[3]
private

Definition at line 495 of file Ruler.h.

Referenced by ReCreateButtons().

wxCursor AdornedRulerPanel::mCursorDefault
private

Definition at line 418 of file Ruler.h.

Referenced by OnCapture(), and OnMouseEvents().

wxCursor AdornedRulerPanel::mCursorHand
private

Definition at line 419 of file Ruler.h.

Referenced by OnCapture(), and OnMouseEvents().

wxCursor AdornedRulerPanel::mCursorSizeWE
private

Definition at line 420 of file Ruler.h.

Referenced by HandleQPClick(), and OnMouseEvents().

double AdornedRulerPanel::mIndTime
private

Definition at line 435 of file Ruler.h.

wxRect AdornedRulerPanel::mInner
private
bool AdornedRulerPanel::mIsDragging
private

Definition at line 483 of file Ruler.h.

Referenced by HandleQPDrag(), and HandleQPRelease().

bool AdornedRulerPanel::mIsRecording
private

Definition at line 448 of file Ruler.h.

Referenced by OnCapture(), OnMouseEvents(), and RegenerateTooltips().

bool AdornedRulerPanel::mIsSnapped
private

Definition at line 440 of file Ruler.h.

Referenced by HandleSnapping(), and ShowOrHideQuickPlayIndicator().

bool AdornedRulerPanel::mIsWE
private

Definition at line 421 of file Ruler.h.

Referenced by OnMouseEvents().

int AdornedRulerPanel::mLastMouseX
private

Definition at line 482 of file Ruler.h.

Referenced by OnCaptureLost(), and UpdateQuickPlayPos().

double AdornedRulerPanel::mLeftDownClick
private

Definition at line 481 of file Ruler.h.

Referenced by HandleQPClick(), HandleQPDrag(), and HandleQPRelease().

double AdornedRulerPanel::mLeftDownClickUnsnapped
private

Definition at line 480 of file Ruler.h.

Referenced by HandleQPClick(), and HandleQPDrag().

int AdornedRulerPanel::mLeftOffset
private

Definition at line 432 of file Ruler.h.

Referenced by Pos2Time(), SetLeftOffset(), and Time2Pos().

MouseEventState AdornedRulerPanel::mMouseEventState
private

Definition at line 479 of file Ruler.h.

Referenced by HandleQPClick(), HandleQPDrag(), HandleQPRelease(), OnMouseEvents(), and SetPlayRegion().

bool AdornedRulerPanel::mNeedButtonUpdate { true }
private

Definition at line 496 of file Ruler.h.

Referenced by OnPaint().

double AdornedRulerPanel::mOldPlayRegionEnd
private

Definition at line 446 of file Ruler.h.

Referenced by HandleQPClick(), HandleQPDrag(), HandleQPRelease(), and OnMouseEvents().

double AdornedRulerPanel::mOldPlayRegionStart
private

Definition at line 445 of file Ruler.h.

Referenced by HandleQPClick(), HandleQPDrag(), HandleQPRelease(), and OnMouseEvents().

wxRect AdornedRulerPanel::mOuter
private

Definition at line 428 of file Ruler.h.

Referenced by DoDrawEdge(), OnSize(), and UpdateRects().

std::unique_ptr<QuickPlayIndicatorOverlay> AdornedRulerPanel::mOverlay
private

Definition at line 485 of file Ruler.h.

Referenced by GetOverlay().

bool AdornedRulerPanel::mPlayRegionDragsSelection
private

Definition at line 467 of file Ruler.h.

Referenced by HandleQPDrag(), OnSyncSelToQuickPlay(), and ShowMenu().

double AdornedRulerPanel::mPlayRegionEnd
private
bool AdornedRulerPanel::mPlayRegionLock
private

Definition at line 442 of file Ruler.h.

Referenced by HandleQPClick(), HandleQPDrag(), HandleQPRelease(), and OnMouseEvents().

double AdornedRulerPanel::mPlayRegionStart
private
StatusChoice AdornedRulerPanel::mPrevZone { StatusChoice::NoChange }
private
AudacityProject* const AdornedRulerPanel::mProject
private
bool AdornedRulerPanel::mQuickPlayEnabled
private

Definition at line 469 of file Ruler.h.

Referenced by OnMouseEvents(), OnToggleQuickPlay(), RegenerateTooltips(), and ShowMenu().

double AdornedRulerPanel::mQuickPlayPos
private
double AdornedRulerPanel::mQuickPlayPosUnsnapped
private

Definition at line 436 of file Ruler.h.

Referenced by HandleQPClick(), and UpdateQuickPlayPos().

Ruler AdornedRulerPanel::mRuler
private
wxRect AdornedRulerPanel::mScrubZone
private

Definition at line 429 of file Ruler.h.

Referenced by DoDrawBackground(), OnMouseEvents(), and UpdateRects().

bool AdornedRulerPanel::mShowScrubbing { false }
private
std::unique_ptr<SnapManager> AdornedRulerPanel::mSnapManager
private

Definition at line 439 of file Ruler.h.

Referenced by HandleSnapping(), and OnMouseEvents().

bool AdornedRulerPanel::mTimelineToolTip
private

Definition at line 468 of file Ruler.h.

Referenced by OnTimelineToolTips(), RegenerateTooltips(), and ShowMenu().

TrackList* AdornedRulerPanel::mTracks
private
ViewInfo* const AdornedRulerPanel::mViewInfo
private
friend AdornedRulerPanel::QuickPlayRulerOverlay
private

Definition at line 493 of file Ruler.h.

bool AdornedRulerPanel::s_AcceptsFocus { false }
staticprivate

Definition at line 396 of file Ruler.h.


The documentation for this class was generated from the following files: