Audacity 3.2.0
|
#include <TimeShiftHandle.h>
Public Member Functions | |
TimeShiftHandle (std::shared_ptr< Track > pTrack, bool gripHit) | |
TimeShiftHandle & | operator= (TimeShiftHandle &&)=default |
bool | IsGripHit () const |
virtual | ~TimeShiftHandle () |
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 |
bool | Clicked () const |
std::shared_ptr< Track > | GetTrack () const |
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 | HitAnywhere (std::weak_ptr< TimeShiftHandle > &holder, const std::shared_ptr< Track > &pTrack, bool gripHit) |
static UIHandlePtr | HitTest (std::weak_ptr< TimeShiftHandle > &holder, const wxMouseState &state, const wxRect &rect, const std::shared_ptr< Track > &pTrack) |
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) |
Protected Member Functions | |
bool | WasMoved () const |
Private Member Functions | |
TimeShiftHandle (const TimeShiftHandle &)=delete | |
void | DoSlideVertical (ViewInfo &viewInfo, wxCoord xx, TrackList &trackList, Track *dstTrack, double &desiredSlideAmount) |
void | Draw (TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass) override |
wxRect | DrawingArea (TrackPanelDrawingContext &, const wxRect &rect, const wxRect &panelRect, unsigned iPass) override |
Static Private Member Functions | |
static HitTestPreview | HitPreview (const AudacityProject *pProject, bool unsafe) |
Private Attributes | |
wxRect | mRect {} |
bool | mDidSlideVertically {} |
bool | mSlideUpDownOnly {} |
bool | mSnapPreferRightEdge {} |
std::shared_ptr< SnapManager > | mSnapManager {} |
ClipMoveState | mClipMoveState {} |
bool | mGripHit {} |
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 292 of file TimeShiftHandle.h.
|
privatedelete |
TimeShiftHandle::TimeShiftHandle | ( | std::shared_ptr< Track > | pTrack, |
bool | gripHit | ||
) |
Definition at line 32 of file TimeShiftHandle.cpp.
References ClipMoveState::mCapturedTrack, and mClipMoveState.
|
virtual |
Definition at line 114 of file TimeShiftHandle.cpp.
|
overridevirtual |
Implements UIHandle.
Definition at line 962 of file TimeShiftHandle.cpp.
References ProjectHistory::Get(), ClipMoveState::initialized, mClipMoveState, RefreshCode::RefreshAll, RefreshCode::RefreshNone, and ProjectHistory::RollbackState().
Referenced by Drag(), and Release().
|
overridevirtual |
Implements UIHandle.
Definition at line 457 of file TimeShiftHandle.cpp.
References AttachedVirtualFunction< Tag, Return, This, Arguments >::Call(), Cancelled, RefreshCode::Cancelled, ClipMoveState::CapturedInterval(), ClipMoveState::clear(), TrackPanelMouseEvent::event, anonymous_namespace{TimeShiftHandle.cpp}::FindCandidates(), ProjectAudioIO::Get(), ViewInfo::Get(), SyncLockState::Get(), TrackList::Get(), ProjectSettings::Get(), ProjectSettings::GetTool(), ClipMoveState::Init(), ProjectAudioIO::IsAudioActive(), SyncLockState::IsSyncLocked(), mClipMoveState, mDidSlideVertically, TrackShifter::Miss, ClipMoveState::mMouseClickX, mRect, mSlideUpDownOnly, mSnapManager, mSnapPreferRightEdge, ToolCodes::multiTool, params, TrackPanelMouseEvent::pCell, TrackPanelMouseEvent::rect, RefreshCode::RefreshNone, ClipMoveState::shifters, ClipMoveState::snapLeft, ClipMoveState::snapRight, and TrackShifter::Track.
Referenced by AffordanceHandle::Click().
bool TimeShiftHandle::Clicked | ( | ) | const |
Definition at line 48 of file TimeShiftHandle.cpp.
References ClipMoveState::initialized, and mClipMoveState.
Referenced by AffordanceHandle::Preview().
|
private |
Definition at line 725 of file TimeShiftHandle.cpp.
References TrackList::Any(), details::begin(), anonymous_namespace{TimeShiftHandle.cpp}::CheckFit(), details::end(), TrackList::Find(), anonymous_namespace{TimeShiftHandle.cpp}::FindCorrespondence(), forward, ClipMoveState::mCapturedTrack, mClipMoveState, mDidSlideVertically, ClipMoveState::mMouseClickX, NotifyingSelectedRegion::move(), ClipMoveState::movingSelection, ZoomInfo::PositionToTime(), ViewInfo::selectedRegion, Track::SharedPointer(), and ClipMoveState::shifters.
Referenced by Drag().
|
overridevirtual |
Implements UIHandle.
Definition at line 809 of file TimeShiftHandle.cpp.
References anonymous_namespace{TimeShiftHandle.cpp}::AdjustToSnap(), Cancel(), Cancelled, ClipMoveState::DoHorizontalOffset(), ClipMoveState::DoSlideHorizontal(), DoSlideVertical(), TrackPanelMouseEvent::event, CommonChannelCell::FindChannel(), ProjectAudioIO::Get(), ViewInfo::Get(), TrackList::Get(), ClipMoveState::hSlideAmount, ProjectAudioIO::IsAudioActive(), ClipMoveState::mCapturedTrack, mClipMoveState, ClipMoveState::mMouseClickX, ClipMoveState::movingSelection, mRect, mSlideUpDownOnly, mSnapManager, mSnapPreferRightEdge, TrackPanelMouseEvent::pCell, RefreshCode::RefreshAll, RefreshCode::RefreshNone, Track::SharedPointer(), and ClipMoveState::shifters.
Referenced by AffordanceHandle::Drag().
|
overrideprivatevirtual |
Reimplemented from TrackPanelDrawable.
Definition at line 972 of file TimeShiftHandle.cpp.
References TrackPanelDrawingContext::dc, TrackArt::DrawSnapLines(), mClipMoveState, mSnapManager, TrackArtist::PassSnapping, ClipMoveState::snapLeft, and ClipMoveState::snapRight.
|
overrideprivatevirtual |
Reimplemented from TrackPanelDrawable.
Definition at line 986 of file TimeShiftHandle.cpp.
References TrackPanelDrawable::MaximizeHeight(), and TrackArtist::PassSnapping.
|
overridevirtual |
Reimplemented from UIHandle.
Definition at line 53 of file TimeShiftHandle.cpp.
References UIHandle::mChangeHighlight, and RefreshCode::RefreshCell.
Referenced by AffordanceHandle::Enter().
|
overridevirtual |
Implements UIHandle.
Definition at line 118 of file TimeShiftHandle.cpp.
References GetTrack().
std::shared_ptr< Track > TimeShiftHandle::GetTrack | ( | ) | const |
Definition at line 38 of file TimeShiftHandle.cpp.
References ClipMoveState::mCapturedTrack, and mClipMoveState.
Referenced by FindTrack(), NoteTrackAffordanceHandle::SelectAt(), and AffordanceHandle::UpdateTrackSelection().
|
static |
Definition at line 80 of file TimeShiftHandle.cpp.
References AssignUIHandlePtr().
Referenced by WaveChannelView::DoDetailedHitTest(), CommonChannelView::HitTest(), and HitTest().
|
staticprivate |
Definition at line 60 of file TimeShiftHandle.cpp.
References MakeCursor(), and XO().
Referenced by Preview().
|
static |
method that tells us if the mouse event landed on a time-slider that allows us to time shift the sequence. (Those are the two "grips" drawn at left and right edges for multi tool mode.)
Definition at line 89 of file TimeShiftHandle.cpp.
References HitAnywhere().
Referenced by WaveformView::DetailedHitTest().
|
inline |
Definition at line 303 of file TimeShiftHandle.h.
Referenced by WaveformView::DoDraw().
|
default |
|
overridevirtual |
Implements UIHandle.
Definition at line 909 of file TimeShiftHandle.cpp.
References ProjectAudioIO::Get(), HitPreview(), and ProjectAudioIO::IsAudioActive().
|
overridevirtual |
Implements UIHandle.
Definition at line 918 of file TimeShiftHandle.cpp.
References Cancel(), CONSOLIDATE, RefreshCode::FixScrollbars, ProjectAudioIO::Get(), ProjectHistory::Get(), ClipMoveState::hSlideAmount, ProjectAudioIO::IsAudioActive(), mClipMoveState, mDidSlideVertically, anonymous_namespace{TimeShiftHandle.cpp}::MigrationFailure(), NONE, ProjectHistory::PushState(), RefreshCode::RefreshAll, RefreshCode::RefreshNone, ClipMoveState::shifters, ClipMoveState::snapLeft, ClipMoveState::snapRight, and XO().
Referenced by AffordanceHandle::Release().
|
inlineoverridevirtual |
|
protected |
Definition at line 43 of file TimeShiftHandle.cpp.
References ClipMoveState::initialized, mClipMoveState, mDidSlideVertically, and ClipMoveState::wasMoved.
Referenced by AffordanceHandle::Release().
|
private |
Definition at line 375 of file TimeShiftHandle.h.
Referenced by Cancel(), Click(), Clicked(), DoSlideVertical(), Drag(), Draw(), GetTrack(), Release(), TimeShiftHandle(), and WasMoved().
|
private |
Definition at line 364 of file TimeShiftHandle.h.
Referenced by Click(), DoSlideVertical(), Release(), and WasMoved().
|
private |
Definition at line 376 of file TimeShiftHandle.h.
|
private |
Definition at line 362 of file TimeShiftHandle.h.
|
private |
Definition at line 365 of file TimeShiftHandle.h.
|
private |
Definition at line 373 of file TimeShiftHandle.h.
|
private |
Definition at line 367 of file TimeShiftHandle.h.