Audacity  2.2.0
AdornedRulerPanel Class Referencefinal

#include <Ruler.h>

Inheritance diagram for AdornedRulerPanel:
OverlayPanel BackedPanel wxTabTraversalWrapper< Base >

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 wxTabTraversalWrapper< Base >
template<typename... Args>
 wxTabTraversalWrapper (Args &&...args)
 
 ~wxTabTraversalWrapper ()
 

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 }
 

Member Typedef Documentation

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

Member Enumeration Documentation

enum AdornedRulerPanel::MenuChoice
strongprivate
Enumerator
QuickPlay 
Scrub 
Enumerator
mesNone 
mesDraggingPlayRegionStart 
mesDraggingPlayRegionEnd 
mesSelectingPlayRegionClick 
mesSelectingPlayRegionRange 
Enumerator
EnteringQP 
EnteringScrubZone 
Leaving 
NoChange 

Constructor & Destructor Documentation

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

References OnCapture().

Member Function Documentation

bool AdornedRulerPanel::AcceptsFocus ( ) const
inlineoverride
bool AdornedRulerPanel::AcceptsFocusFromKeyboard ( ) const
inlineoverride
void AdornedRulerPanel::DoDrawBackground ( wxDC *  dc)
private
void AdornedRulerPanel::DoDrawEdge ( wxDC *  dc)
private
void AdornedRulerPanel::DoDrawIndicator ( wxDC *  dc,
wxCoord  xx,
bool  playing,
int  width,
bool  scrub,
bool  seek 
)
void AdornedRulerPanel::DoDrawMarks ( wxDC *  dc,
bool   
)
private
void AdornedRulerPanel::DoDrawSelection ( wxDC *  dc)
private
void AdornedRulerPanel::DragSelection ( )
private
void AdornedRulerPanel::DrawSelection ( )
wxRect AdornedRulerPanel::GetInnerRect ( ) const
inline
void AdornedRulerPanel::GetMaxSize ( wxCoord *  width,
wxCoord *  height 
)

References Ruler::GetMaxSize(), and mRuler.

QuickPlayIndicatorOverlay * AdornedRulerPanel::GetOverlay ( )
private

References mOverlay, and mProject.

Referenced by ShowOrHideQuickPlayIndicator().

void AdornedRulerPanel::GetPlayRegion ( double *  playRegionStart,
double *  playRegionEnd 
)
int AdornedRulerPanel::GetRulerHeight ( )
inline
int AdornedRulerPanel::GetRulerHeight ( bool  showScrubBar)
static

References ProperRulerHeight, and ScrubHeight.

void AdornedRulerPanel::HandleSnapping ( )
private
void AdornedRulerPanel::InvalidateRuler ( )

References Ruler::Invalidate(), and mRuler.

bool AdornedRulerPanel::IsWithinMarker ( int  mousePosX,
double  markerTime 
)
private
void AdornedRulerPanel::OnAutoScroll ( wxCommandEvent &  evt)
private
void AdornedRulerPanel::OnCapture ( wxCommandEvent &  evt)
private
void AdornedRulerPanel::OnCaptureLost ( wxMouseCaptureLostEvent &  evt)
private
void AdornedRulerPanel::OnContextMenu ( wxContextMenuEvent &  WXUNUSEDevent)
private

References QuickPlay, and ShowContextMenu().

void AdornedRulerPanel::OnLockPlayRegion ( wxCommandEvent &  evt)
private
void AdornedRulerPanel::OnSize ( wxSizeEvent &  evt)
private
void AdornedRulerPanel::OnSyncSelToQuickPlay ( wxCommandEvent &  evt)
private
void AdornedRulerPanel::OnTimelineToolTips ( wxCommandEvent &  evt)
private
void AdornedRulerPanel::OnTogglePinnedState ( wxCommandEvent &  event)
private
void AdornedRulerPanel::OnToggleQuickPlay ( wxCommandEvent &  evt)
private
void AdornedRulerPanel::OnToggleScrubRuler ( )
void AdornedRulerPanel::OnToggleScrubRulerFromMenu ( wxCommandEvent &  Evt)
double AdornedRulerPanel::Pos2Time ( int  p,
bool  ignoreFisheye = false 
)
private
void AdornedRulerPanel::SetFocusFromKbd ( )
override
void AdornedRulerPanel::SetLeftOffset ( int  offset)
void AdornedRulerPanel::SetPanelSize ( )

References GetRulerHeight(), and mShowScrubbing.

Referenced by OnToggleScrubRuler(), and UpdatePrefs().

void AdornedRulerPanel::SetPlayRegion ( double  playRegionStart,
double  playRegionEnd 
)
void AdornedRulerPanel::ShowContextMenu ( MenuChoice  choice,
const wxPoint *  pPosition 
)
private
bool AdornedRulerPanel::ShowingScrubRuler ( ) const
inline
void AdornedRulerPanel::ShowQuickPlayIndicator ( bool  repaint_all = false)

References ShowOrHideQuickPlayIndicator().

Referenced by OnMouseEvents().

void AdornedRulerPanel::ShowScrubMenu ( const wxPoint &  pos)
private
auto AdornedRulerPanel::TemporarilyAllowFocus ( )
static

Referenced by SetFocusFromKbd().

int AdornedRulerPanel::Time2Pos ( double  t,
bool  ignoreFisheye = false 
)
private
void AdornedRulerPanel::UpdateRects ( )
private

Member Data Documentation

wxWindow* AdornedRulerPanel::mButtons[3]
private

Referenced by ReCreateButtons().

wxCursor AdornedRulerPanel::mCursorDefault
private

Referenced by OnCapture(), and OnMouseEvents().

wxCursor AdornedRulerPanel::mCursorHand
private

Referenced by OnCapture(), and OnMouseEvents().

wxCursor AdornedRulerPanel::mCursorSizeWE
private

Referenced by HandleQPClick(), and OnMouseEvents().

double AdornedRulerPanel::mIndTime
private
wxRect AdornedRulerPanel::mInner
private
bool AdornedRulerPanel::mIsDragging
private

Referenced by HandleQPDrag(), and HandleQPRelease().

bool AdornedRulerPanel::mIsRecording
private
bool AdornedRulerPanel::mIsSnapped
private
bool AdornedRulerPanel::mIsWE
private

Referenced by OnMouseEvents().

int AdornedRulerPanel::mLastMouseX
private
double AdornedRulerPanel::mLeftDownClick
private
double AdornedRulerPanel::mLeftDownClickUnsnapped
private

Referenced by HandleQPClick(), and HandleQPDrag().

int AdornedRulerPanel::mLeftOffset
private

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

MouseEventState AdornedRulerPanel::mMouseEventState
private
bool AdornedRulerPanel::mNeedButtonUpdate { true }
private

Referenced by OnPaint().

double AdornedRulerPanel::mOldPlayRegionEnd
private
double AdornedRulerPanel::mOldPlayRegionStart
private
wxRect AdornedRulerPanel::mOuter
private

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

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

Referenced by GetOverlay().

bool AdornedRulerPanel::mPlayRegionDragsSelection
private
bool AdornedRulerPanel::mPlayRegionLock
private
bool AdornedRulerPanel::mQuickPlayEnabled
private
double AdornedRulerPanel::mQuickPlayPos
private
double AdornedRulerPanel::mQuickPlayPosUnsnapped
private
Ruler AdornedRulerPanel::mRuler
private
wxRect AdornedRulerPanel::mScrubZone
private
bool AdornedRulerPanel::mShowScrubbing { false }
private
std::unique_ptr<SnapManager> AdornedRulerPanel::mSnapManager
private

Referenced by HandleSnapping(), and OnMouseEvents().

bool AdornedRulerPanel::mTimelineToolTip
private
friend AdornedRulerPanel::QuickPlayRulerOverlay
private
bool AdornedRulerPanel::s_AcceptsFocus { false }
staticprivate

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