Audacity 3.2.0
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 &)=delete
 
TrackPanelCelloperator= (const TrackPanelCell &)=delete
 
virtual ~TrackPanelCell ()=0
 
virtual HitTestPreview DefaultPreview (const TrackPanelMouseState &state, const AudacityProject *pProject)
 
virtual std::vector< UIHandlePtrHitTest (const TrackPanelMouseState &state, const AudacityProject *pProject)=0
 
virtual unsigned HandleWheelRotation (const TrackPanelMouseEvent &event, AudacityProject *pProject)
 
virtual std::shared_ptr< TrackPanelCellContextMenuDelegate ()
 
virtual unsigned DoContextMenu (const wxRect &rect, wxWindow *pParent, const wxPoint *pPosition, 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< ResizePlayRegionHandlemResizePlayRegionHolder
 
std::weak_ptr< MovePlayRegionHandlemMovePlayRegionHolder
 
std::weak_ptr< NewPlayRegionHandlemNewPlayRegionHolder
 
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 1023 of file AdornedRulerPanel.cpp.

Constructor & Destructor Documentation

◆ QPCell()

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

Member Function Documentation

◆ Clicked()

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

Definition at line 1039 of file AdornedRulerPanel.cpp.

1039 {
1040#ifdef QUICK_PLAY_HANDLE
1041 if (auto ptr = mHolder.lock())
1042 return ptr->Clicked();
1043#endif
1044 return false;
1045 }

◆ ContextMenuDelegate()

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

Reimplemented from TrackPanelCell.

Definition at line 1036 of file AdornedRulerPanel.cpp.

1037 { return mParent->mQPCell; }
std::shared_ptr< QPCell > 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 1057 of file AdornedRulerPanel.cpp.

1060{
1061 // Creation of overlays on demand here -- constructor of AdornedRulerPanel
1062 // is too early to do it
1064
1065 std::vector<UIHandlePtr> results;
1066 auto xx = state.state.m_x;
1067
1068#ifdef EXPERIMENTAL_DRAGGABLE_PLAY_HEAD
1069 {
1070 // Allow click and drag on the play head even while recording
1071 // Make this handle more prominent then the quick play handle
1072 auto result = PlayheadHandle::HitTest( pProject, *mParent, xx );
1073 if (result) {
1074 result = AssignUIHandlePtr( mPlayheadHolder, result );
1075 results.push_back( result );
1076 }
1077 }
1078#endif
1079
1080 // Disable mouse actions on Timeline while recording.
1081 if (!mParent->mIsRecording) {
1083
1084 #if 0
1085 auto result = std::make_shared<QPHandle>( mParent, xx );
1086 result = AssignUIHandlePtr( mHolder, result );
1087 results.push_back( result );
1088 #endif
1089 }
1090
1091 // High priority hit is a handle to change the existing play region
1092 bool hitLeft = false;
1093 const auto &playRegion = ViewInfo::Get(*pProject).playRegion;
1094 if ((hitLeft =
1095 mParent->IsWithinMarker(xx, playRegion.GetLastActiveStart())) ||
1096 mParent->IsWithinMarker(xx, playRegion.GetLastActiveEnd()))
1097 {
1098 auto result =
1099 std::make_shared<ResizePlayRegionHandle>( mParent, xx, hitLeft );
1100 result = AssignUIHandlePtr( mResizePlayRegionHolder, result );
1101 results.push_back(result);
1102 }
1103
1104 // Middle priority hit is a handle to change the existing play region at
1105 // both ends, but only when the play region is active
1106 if (auto time = mParent->Pos2Time(xx);
1107 playRegion.Active() &&
1108 time >= playRegion.GetStart() &&
1109 time <= playRegion.GetEnd())
1110 {
1111 auto result =
1112 std::make_shared<MovePlayRegionHandle>( mParent, xx );
1113 result = AssignUIHandlePtr( mMovePlayRegionHolder, result );
1114 results.push_back(result);
1115 }
1116
1117 // Lowest priority hit is a handle to drag a completely new play region
1118 {
1119 auto result = std::make_shared<NewPlayRegionHandle>( mParent, xx );
1120 result = AssignUIHandlePtr( mNewPlayRegionHolder, result );
1121 results.push_back(result);
1122 }
1123
1124 return results;
1125}
std::shared_ptr< Subclass > AssignUIHandlePtr(std::weak_ptr< Subclass > &holder, const std::shared_ptr< Subclass > &pNew)
Definition: UIHandle.h:159
std::weak_ptr< NewPlayRegionHandle > mNewPlayRegionHolder
std::weak_ptr< PlayheadHandle > mPlayheadHolder
std::weak_ptr< ResizePlayRegionHandle > mResizePlayRegionHolder
std::weak_ptr< MovePlayRegionHandle > mMovePlayRegionHolder
bool IsWithinMarker(int mousePosX, double markerTime)
void UpdateQuickPlayPos(wxCoord &mousePosX)
double Pos2Time(int p, bool ignoreFisheye=false) const
PlayRegion playRegion
Definition: ViewInfo.h:216
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:235
bool HitTest(const RectangleArgs &args, const wxPoint &mousePos)

References AssignUIHandlePtr(), ViewInfo::Get(), LowlitClipButton::HitTest(), ViewInfo::playRegion, and TrackPanelMouseState::state.

Here is the call graph for this function:

Member Data Documentation

◆ mMovePlayRegionHolder

std::weak_ptr<MovePlayRegionHandle> AdornedRulerPanel::QPCell::mMovePlayRegionHolder

Definition at line 1052 of file AdornedRulerPanel.cpp.

◆ mNewPlayRegionHolder

std::weak_ptr<NewPlayRegionHandle> AdornedRulerPanel::QPCell::mNewPlayRegionHolder

Definition at line 1053 of file AdornedRulerPanel.cpp.

◆ mPlayheadHolder

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

Definition at line 1054 of file AdornedRulerPanel.cpp.

◆ mResizePlayRegionHolder

std::weak_ptr<ResizePlayRegionHandle> AdornedRulerPanel::QPCell::mResizePlayRegionHolder

Definition at line 1051 of file AdornedRulerPanel.cpp.


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