Audacity  3.0.3
Public Member Functions | Private Attributes | List of all members
AdornedRulerPanel::ScrubbingCell Class Referencefinal
Inheritance diagram for AdornedRulerPanel::ScrubbingCell:
Collaboration diagram for AdornedRulerPanel::ScrubbingCell:

Public Member Functions

 ScrubbingCell (AdornedRulerPanel *parent)
std::vector< UIHandlePtrHitTest (const TrackPanelMouseState &state, const AudacityProject *pProject) override
std::shared_ptr< TrackPanelCellContextMenuDelegate () override
bool Hit () const
bool Clicked () const
- Public Member Functions inherited from AdornedRulerPanel::CommonCell
 CommonCell (AdornedRulerPanel *parent, MenuChoice menuChoice)
HitTestPreview DefaultPreview (const TrackPanelMouseState &, const AudacityProject *) override
unsigned DoContextMenu (const wxRect &, wxWindow *, const wxPoint *pPosition, AudacityProject *) final
- Public Member Functions inherited from TrackPanelCell
 TrackPanelCell ()=default
 TrackPanelCell (const TrackPanelCell &) PROHIBITED
TrackPanelCelloperator= (const TrackPanelCell &) PROHIBITED
virtual ~TrackPanelCell ()=0
virtual unsigned HandleWheelRotation (const TrackPanelMouseEvent &event, AudacityProject *pProject)
virtual unsigned CaptureKey (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent, AudacityProject *project)
virtual unsigned KeyDown (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent, AudacityProject *project)
virtual unsigned KeyUp (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent, AudacityProject *project)
virtual unsigned Char (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent, AudacityProject *project)
virtual unsigned LoseFocus (AudacityProject *project)
- Public Member Functions inherited from TrackPanelNode
 TrackPanelNode ()
virtual ~TrackPanelNode ()=0
- Public Member Functions inherited from TrackPanelDrawable
virtual ~TrackPanelDrawable ()=0
virtual void Draw (TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass)
virtual wxRect DrawingArea (TrackPanelDrawingContext &context, const wxRect &rect, const wxRect &panelRect, unsigned iPass)

Private Attributes

std::weak_ptr< ScrubbingHandlemHolder

Additional Inherited Members

- Static Public Member Functions inherited from TrackPanelDrawable
static wxRect MaximizeWidth (const wxRect &rect, const wxRect &panelRect)
static wxRect MaximizeHeight (const wxRect &rect, const wxRect &panelRect)
- Protected Attributes inherited from AdornedRulerPanel::CommonCell
const MenuChoice mMenuChoice

Detailed Description

Definition at line 836 of file AdornedRulerPanel.cpp.

Constructor & Destructor Documentation

◆ ScrubbingCell()

AdornedRulerPanel::ScrubbingCell::ScrubbingCell ( AdornedRulerPanel parent)

Definition at line 840 of file AdornedRulerPanel.cpp.

842  {}

References AdornedRulerPanel::Scrub.

Member Function Documentation

◆ Clicked()

bool AdornedRulerPanel::ScrubbingCell::Clicked ( ) const

Definition at line 853 of file AdornedRulerPanel.cpp.

853  {
854  if (auto ptr = mHolder.lock())
855  return ptr->Clicked();
856  return false;
857  }

References mHolder.

◆ ContextMenuDelegate()

std::shared_ptr<TrackPanelCell> AdornedRulerPanel::ScrubbingCell::ContextMenuDelegate ( )

Reimplemented from TrackPanelCell.

Definition at line 849 of file AdornedRulerPanel.cpp.

850  { return mParent->mScrubbingCell; }

References AdornedRulerPanel::CommonCell::mParent, and AdornedRulerPanel::mScrubbingCell.

◆ Hit()

bool AdornedRulerPanel::ScrubbingCell::Hit ( ) const

Definition at line 852 of file AdornedRulerPanel.cpp.

852 { return !mHolder.expired(); }

References mHolder.

◆ HitTest()

std::vector< UIHandlePtr > AdornedRulerPanel::ScrubbingCell::HitTest ( const TrackPanelMouseState state,
const AudacityProject pProject 

Implements TrackPanelCell.

Definition at line 863 of file AdornedRulerPanel.cpp.

865 {
866  // Creation of overlays on demand here -- constructor of AdornedRulerPanel
867  // is too early to do it
870  std::vector<UIHandlePtr> results;
872  // Disable mouse actions on Timeline while recording.
873  if (!mParent->mIsRecording) {
874  auto xx = state.state.m_x;
875  mParent->UpdateQuickPlayPos( xx, state.state.ShiftDown() );
876  auto result = std::make_shared<ScrubbingHandle>( mParent, xx );
877  result = AssignUIHandlePtr( mHolder, result );
878  results.push_back( result );
879  }
881  return results;
882 }

References AssignUIHandlePtr(), and TrackPanelMouseState::state.

Here is the call graph for this function:

Member Data Documentation

◆ mHolder

std::weak_ptr<ScrubbingHandle> AdornedRulerPanel::ScrubbingCell::mHolder

Definition at line 860 of file AdornedRulerPanel.cpp.

Referenced by Clicked(), and Hit().

The documentation for this class was generated from the following file:
bool mIsRecording
Definition: AdornedRulerPanel.h:141
Definition: AdornedRulerPanel.cpp:500
AdornedRulerPanel * mParent
Definition: AdornedRulerPanel.cpp:535
void CreateOverlays()
Definition: AdornedRulerPanel.cpp:2320
std::shared_ptr< ScrubbingCell > mScrubbingCell
Definition: AdornedRulerPanel.h:218
std::weak_ptr< ScrubbingHandle > mHolder
Definition: AdornedRulerPanel.cpp:860
void UpdateQuickPlayPos(wxCoord &mousePosX, bool shiftDown)
Definition: AdornedRulerPanel.cpp:1850
@ Scrub
std::shared_ptr< Subclass > AssignUIHandlePtr(std::weak_ptr< Subclass > &holder, const std::shared_ptr< Subclass > &pNew)
Definition: UIHandle.h:151
wxMouseState & state
Definition: TrackPanelMouseEvent.h:38