Audacity  3.0.3
Public Member Functions | Public Attributes | List of all members
AdornedRulerPanel::QPCell Class Referencefinal
Inheritance diagram for AdornedRulerPanel::QPCell:
[legend]
Collaboration diagram for AdornedRulerPanel::QPCell:
[legend]

Public Member Functions

 QPCell (AdornedRulerPanel *parent)
 
std::vector< UIHandlePtrHitTest (const TrackPanelMouseState &state, const AudacityProject *pProject) override
 
std::shared_ptr< TrackPanelCellContextMenuDelegate () override
 
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)
 

Public Attributes

std::weak_ptr< PlayheadHandle > mPlayheadHolder
 

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
AdornedRulerPanelmParent
 
const MenuChoice mMenuChoice
 

Detailed Description

Definition at line 691 of file AdornedRulerPanel.cpp.

Constructor & Destructor Documentation

◆ QPCell()

AdornedRulerPanel::QPCell::QPCell ( AdornedRulerPanel parent)
inlineexplicit

Definition at line 695 of file AdornedRulerPanel.cpp.

References AdornedRulerPanel::QuickPlay.

Member Function Documentation

◆ Clicked()

bool AdornedRulerPanel::QPCell::Clicked ( ) const
inline

Definition at line 707 of file AdornedRulerPanel.cpp.

707  {
708 #ifdef QUICK_PLAY_HANDLE
709  if (auto ptr = mHolder.lock())
710  return ptr->Clicked();
711 #endif
712  return false;
713  }

◆ ContextMenuDelegate()

std::shared_ptr<TrackPanelCell> AdornedRulerPanel::QPCell::ContextMenuDelegate ( )
inlineoverridevirtual

Reimplemented from TrackPanelCell.

Definition at line 704 of file AdornedRulerPanel.cpp.

705  { return mParent->mQPCell; }

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

◆ HitTest()

std::vector< UIHandlePtr > AdornedRulerPanel::QPCell::HitTest ( const TrackPanelMouseState state,
const AudacityProject pProject 
)
overridevirtual

Implements TrackPanelCell.

Definition at line 722 of file AdornedRulerPanel.cpp.

725 {
726  // Creation of overlays on demand here -- constructor of AdornedRulerPanel
727  // is too early to do it
729 
730  std::vector<UIHandlePtr> results;
731  auto xx = state.state.m_x;
732 
733 #ifdef EXPERIMENTAL_DRAGGABLE_PLAY_HEAD
734  {
735  // Allow click and drag on the play head even while recording
736  // Make this handle more prominent then the quick play handle
737  auto result = PlayheadHandle::HitTest( pProject, xx );
738  if (result) {
739  result = AssignUIHandlePtr( mPlayheadHolder, result );
740  results.push_back( result );
741  }
742  }
743 #endif
744 
745  // Disable mouse actions on Timeline while recording.
746  if (!mParent->mIsRecording) {
747  mParent->UpdateQuickPlayPos( xx, state.state.ShiftDown() );
748 
749  #if 0
750  auto result = std::make_shared<QPHandle>( mParent, xx );
751  result = AssignUIHandlePtr( mHolder, result );
752  results.push_back( result );
753  #endif
754  }
755 
756  return results;
757 }

References AssignUIHandlePtr(), and TrackPanelMouseState::state.

Here is the call graph for this function:

Member Data Documentation

◆ mPlayheadHolder

std::weak_ptr<PlayheadHandle> AdornedRulerPanel::QPCell::mPlayheadHolder

Definition at line 719 of file AdornedRulerPanel.cpp.


The documentation for this class was generated from the following file:
AdornedRulerPanel::mIsRecording
bool mIsRecording
Definition: AdornedRulerPanel.h:141
AdornedRulerPanel::CommonCell
Definition: AdornedRulerPanel.cpp:500
AdornedRulerPanel::CommonCell::mParent
AdornedRulerPanel * mParent
Definition: AdornedRulerPanel.cpp:535
AdornedRulerPanel::CreateOverlays
void CreateOverlays()
Definition: AdornedRulerPanel.cpp:2320
AdornedRulerPanel::MenuChoice::QuickPlay
@ QuickPlay
AdornedRulerPanel::mQPCell
std::shared_ptr< QPCell > mQPCell
Definition: AdornedRulerPanel.h:215
AdornedRulerPanel::QPCell::mPlayheadHolder
std::weak_ptr< PlayheadHandle > mPlayheadHolder
Definition: AdornedRulerPanel.cpp:719
AdornedRulerPanel::UpdateQuickPlayPos
void UpdateQuickPlayPos(wxCoord &mousePosX, bool shiftDown)
Definition: AdornedRulerPanel.cpp:1850
AssignUIHandlePtr
std::shared_ptr< Subclass > AssignUIHandlePtr(std::weak_ptr< Subclass > &holder, const std::shared_ptr< Subclass > &pNew)
Definition: UIHandle.h:151
TrackPanelMouseState::state
wxMouseState & state
Definition: TrackPanelMouseEvent.h:38