Audacity 3.2.0
|
#include <LabelGlyphHandle.h>
Public Member Functions | |
LabelGlyphHandle (const std::shared_ptr< LabelTrack > &pLT, const wxRect &rect, const std::shared_ptr< LabelTrackHit > &pHit) | |
LabelGlyphHandle & | operator= (const LabelGlyphHandle &)=default |
virtual | ~LabelGlyphHandle () |
std::shared_ptr< const Track > | FindTrack () const override |
void | Enter (bool forward, AudacityProject *) override |
Result | Click (const TrackPanelMouseEvent &event, AudacityProject *pProject) override |
Result | Drag (const TrackPanelMouseEvent &event, AudacityProject *pProject) override |
HitTestPreview | Preview (const TrackPanelMouseState &state, AudacityProject *pProject) override |
Result | Release (const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override |
Result | Cancel (AudacityProject *pProject) override |
bool | StopsOnKeystroke () override |
Public Member Functions inherited from LabelDefaultClickHandle | |
LabelDefaultClickHandle () | |
virtual | ~LabelDefaultClickHandle () |
LabelDefaultClickHandle & | operator= (const LabelDefaultClickHandle &)=default |
Result | Click (const TrackPanelMouseEvent &event, AudacityProject *pProject) override |
Result | Drag (const TrackPanelMouseEvent &event, AudacityProject *pProject) override |
Result | Release (const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override |
Result | Cancel (AudacityProject *pProject) override |
Public Member Functions inherited from UIHandle | |
virtual | ~UIHandle ()=0 |
virtual void | Enter (bool forward, AudacityProject *pProject) |
virtual bool | HasRotation () const |
virtual bool | Rotate (bool forward) |
virtual bool | HasEscape (AudacityProject *pProject) const |
virtual bool | Escape (AudacityProject *pProject) |
virtual bool | HandlesRightClick () |
Whether the handle has any special right-button handling. More... | |
virtual Result | Click (const TrackPanelMouseEvent &event, AudacityProject *pProject)=0 |
virtual Result | Drag (const TrackPanelMouseEvent &event, AudacityProject *pProject)=0 |
virtual HitTestPreview | Preview (const TrackPanelMouseState &state, AudacityProject *pProject)=0 |
virtual Result | Release (const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent)=0 |
virtual Result | Cancel (AudacityProject *pProject)=0 |
virtual bool | StopsOnKeystroke () |
virtual void | OnProjectChange (AudacityProject *pProject) |
virtual std::shared_ptr< const Track > | FindTrack () const =0 |
virtual bool | IsDragging () const |
Result | GetChangeHighlight () const |
void | SetChangeHighlight (Result val) |
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) |
Static Public Member Functions | |
static UIHandlePtr | HitTest (std::weak_ptr< LabelGlyphHandle > &holder, const wxMouseState &state, const std::shared_ptr< LabelTrack > &pLT, const wxRect &rect) |
static UIHandle::Result | NeedChangeHighlight (const LabelGlyphHandle &oldState, const LabelGlyphHandle &newState) |
Static Public Member Functions inherited from UIHandle | |
static UIHandle::Result | NeedChangeHighlight (const UIHandle &, const UIHandle &) |
static std::shared_ptr< const Track > | TrackFromChannel (const std::shared_ptr< const Channel > &pChannel) |
A frequent convenience in the definition of UIHandles. More... | |
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) |
Public Attributes | |
std::shared_ptr< LabelTrackHit > | mpHit {} |
Private Member Functions | |
void | HandleGlyphClick (LabelTrackHit &hit, const wxMouseEvent &evt, const wxRect &r, const ZoomInfo &zoomInfo, NotifyingSelectedRegion &newSel) |
bool | HandleGlyphDragRelease (AudacityProject &project, LabelTrackHit &hit, const wxMouseEvent &evt, wxRect &r, const ZoomInfo &zoomInfo, NotifyingSelectedRegion &newSel) |
void | MayAdjustLabel (LabelTrackHit &hit, int iLabel, int iEdge, bool bAllowSwapping, double fNewTime) |
void | MayMoveLabel (int iLabel, int iEdge, double fNewTime) |
Private Attributes | |
std::shared_ptr< LabelTrack > | mpLT {} |
wxRect | mRect {} |
int | mxMouseDisplacement |
Displacement of mouse cursor from the centre being dragged. More... | |
Additional Inherited Members | |
Public Types inherited from UIHandle | |
using | Result = unsigned |
using | Cell = TrackPanelCell |
Protected Attributes inherited from UIHandle | |
Result | mChangeHighlight { 0 } |
Definition at line 51 of file LabelGlyphHandle.h.
|
explicit |
Definition at line 66 of file LabelGlyphHandle.cpp.
|
virtual |
Definition at line 113 of file LabelGlyphHandle.cpp.
|
overridevirtual |
Reimplemented from LabelDefaultClickHandle.
Definition at line 474 of file LabelGlyphHandle.cpp.
References LabelDefaultClickHandle::Cancel(), ProjectHistory::Get(), RefreshCode::RefreshAll, and ProjectHistory::RollbackState().
|
overridevirtual |
Reimplemented from LabelDefaultClickHandle.
Definition at line 201 of file LabelGlyphHandle.cpp.
References RefreshCode::Cancelled, LabelDefaultClickHandle::Click(), TrackPanelMouseEvent::event, ViewInfo::Get(), SelectionState::Get(), TrackList::Get(), HandleGlyphClick(), mpHit, mRect, RefreshCode::RefreshCell, and tracks.
|
overridevirtual |
Reimplemented from LabelDefaultClickHandle.
Definition at line 419 of file LabelGlyphHandle.cpp.
References LabelDefaultClickHandle::Drag(), RefreshCode::DrawOverlays, TrackPanelMouseEvent::event, ViewInfo::Get(), HandleGlyphDragRelease(), mpHit, mRect, and RefreshCode::RefreshAll.
|
overridevirtual |
Reimplemented from UIHandle.
Definition at line 75 of file LabelGlyphHandle.cpp.
References UIHandle::mChangeHighlight, and RefreshCode::RefreshCell.
|
overridevirtual |
Implements UIHandle.
Definition at line 117 of file LabelGlyphHandle.cpp.
References mpLT.
|
private |
Definition at line 122 of file LabelGlyphHandle.cpp.
References LabelTrackView::Get(), MayAdjustLabel(), LabelTrackHit::mEdge, LabelTrackHit::mIsAdjustingLabel, LabelTrackHit::mMouseOverLabel, LabelTrackHit::mMouseOverLabelLeft, LabelTrackHit::mMouseOverLabelRight, mpLT, mxMouseDisplacement, LabelTrackView::OverGlyph(), and ZoomInfo::TimeToPosition().
Referenced by Click().
|
private |
Definition at line 291 of file LabelGlyphHandle.cpp.
References Constrain(), ProjectAudioIO::Get(), SelectionState::Get(), TrackList::Get(), LabelTrackView::Get(), ProjectAudioIO::IsAudioActive(), MayAdjustLabel(), MayMoveLabel(), LabelTrackHit::mIsAdjustingLabel, LabelTrackHit::mMouseOverLabel, LabelTrackHit::mMouseOverLabelLeft, LabelTrackHit::mMouseOverLabelRight, mpLT, mxMouseDisplacement, ZoomInfo::PositionToTime(), project, and tracks.
Referenced by Drag(), and Release().
|
static |
Definition at line 89 of file LabelGlyphHandle.cpp.
References AssignUIHandlePtr(), and LabelTrackView::OverGlyph().
Referenced by LabelTrackView::DetailedHitTest().
|
private |
If the index is for a real label, adjust its left or right boundary. @iLabel - index of label, -1 for none. @iEdge - which edge is requested to move, -1 for left +1 for right. @bAllowSwapping - if we can switch which edge is being dragged. fNewTime - the NEW time for this edge of the label.
Definition at line 232 of file LabelGlyphHandle.cpp.
References LabelTrackHit::mMouseOverLabelLeft, LabelTrackHit::mMouseOverLabelRight, mpLT, and anonymous_namespace{NoteTrack.cpp}::swap().
Referenced by HandleGlyphClick(), and HandleGlyphDragRelease().
|
private |
Definition at line 266 of file LabelGlyphHandle.cpp.
References mpLT.
Referenced by HandleGlyphDragRelease().
|
static |
Definition at line 80 of file LabelGlyphHandle.cpp.
References mpHit, and RefreshCode::RefreshCell.
|
default |
|
overridevirtual |
Implements UIHandle.
Definition at line 433 of file LabelGlyphHandle.cpp.
References handOpenCursor, MakeCursor(), mpHit, and XO().
|
overridevirtual |
Reimplemented from LabelDefaultClickHandle.
Definition at line 455 of file LabelGlyphHandle.cpp.
References CONSOLIDATE, RefreshCode::DrawOverlays, TrackPanelMouseEvent::event, ProjectHistory::Get(), ViewInfo::Get(), HandleGlyphDragRelease(), mpHit, mRect, ProjectHistory::PushState(), RefreshCode::RefreshAll, LabelDefaultClickHandle::Release(), and XO().
|
inlineoverridevirtual |
std::shared_ptr<LabelTrackHit> LabelGlyphHandle::mpHit {} |
Definition at line 89 of file LabelGlyphHandle.h.
Referenced by Click(), Drag(), anonymous_namespace{LabelTrackView.cpp}::findHit(), NeedChangeHighlight(), Preview(), and Release().
|
private |
Definition at line 110 of file LabelGlyphHandle.h.
Referenced by FindTrack(), HandleGlyphClick(), HandleGlyphDragRelease(), MayAdjustLabel(), and MayMoveLabel().
|
private |
Definition at line 111 of file LabelGlyphHandle.h.
|
private |
Displacement of mouse cursor from the centre being dragged.
Definition at line 114 of file LabelGlyphHandle.h.
Referenced by HandleGlyphClick(), and HandleGlyphDragRelease().