Audacity 3.2.0
|
#include <StretchHandle.h>
Classes | |
struct | StretchState |
Public Types | |
enum | StretchEnum { stretchNone = 0 , stretchLeft , stretchCenter , stretchRight } |
Public Types inherited from UIHandle | |
using | Result = unsigned |
using | Cell = TrackPanelCell |
Public Member Functions | |
StretchHandle (const std::shared_ptr< NoteTrack > &pTrack, const StretchState &stretchState) | |
StretchHandle & | operator= (const StretchHandle &)=default |
virtual | ~StretchHandle () |
std::shared_ptr< const Track > | FindTrack () const 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 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< StretchHandle > &holder, const TrackPanelMouseState &state, const AudacityProject *pProject, const std::shared_ptr< NoteTrack > &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) |
Private Member Functions | |
StretchHandle (const StretchHandle &) | |
void | Stretch (AudacityProject *pProject, int mouseXCoordinate, int trackLeftEdge, Channel *pChannel) |
Static Private Member Functions | |
static HitTestPreview | HitPreview (StretchEnum stretchMode, bool unsafe) |
static double | GetT0 (const Track &track, const ViewInfo &viewInfo) |
static double | GetT1 (const Track &track, const ViewInfo &viewInfo) |
Private Attributes | |
std::shared_ptr< NoteTrack > | mpTrack {} |
int | mLeftEdge { -1 } |
StretchState | mStretchState {} |
Additional Inherited Members | |
Protected Attributes inherited from UIHandle | |
Result | mChangeHighlight { 0 } |
Definition at line 22 of file StretchHandle.h.
Enumerator | |
---|---|
stretchNone | |
stretchLeft | |
stretchCenter | |
stretchRight |
Definition at line 25 of file StretchHandle.h.
|
private |
|
explicit |
Definition at line 33 of file StretchHandle.cpp.
|
virtual |
Definition at line 155 of file StretchHandle.cpp.
|
overridevirtual |
Implements UIHandle.
Definition at line 274 of file StretchHandle.cpp.
References ProjectHistory::Get(), RefreshCode::RefreshNone, and ProjectHistory::RollbackState().
Referenced by Drag(), and Release().
|
overridevirtual |
Implements UIHandle.
Definition at line 164 of file StretchHandle.cpp.
References Cancelled, TrackPanelMouseEvent::event, ProjectAudioIO::Get(), ViewInfo::Get(), ProjectAudioIO::IsAudioActive(), StretchHandle::StretchState::mBeat0, StretchHandle::StretchState::mBeat1, mLeftEdge, mStretchState, TrackPanelMouseEvent::pCell, TrackPanelMouseEvent::rect, and RefreshCode::RefreshAll.
|
overridevirtual |
Implements UIHandle.
Definition at line 193 of file StretchHandle.cpp.
References Cancel(), Cancelled, TrackPanelMouseEvent::event, ProjectAudioIO::Get(), ProjectAudioIO::IsAudioActive(), mLeftEdge, mpTrack, TrackPanelMouseEvent::pCell, RefreshCode::RefreshAll, and Stretch().
|
overridevirtual |
Implements UIHandle.
Definition at line 159 of file StretchHandle.cpp.
References mpTrack.
Definition at line 280 of file StretchHandle.cpp.
References ChannelGroup::GetStartTime(), ViewInfo::selectedRegion, and NotifyingSelectedRegion::t0().
Referenced by HitTest().
Definition at line 285 of file StretchHandle.cpp.
References ChannelGroup::GetEndTime(), min(), ViewInfo::selectedRegion, and NotifyingSelectedRegion::t1().
Referenced by HitTest().
|
staticprivate |
Definition at line 39 of file StretchHandle.cpp.
References MakeCursor(), stretchCenter, stretchLeft, stretchRight, and XO().
Referenced by Preview().
|
static |
Definition at line 72 of file StretchHandle.cpp.
References AssignUIHandlePtr(), ViewInfo::Get(), GetT0(), GetT1(), StretchHandle::StretchState::mBeat0, StretchHandle::StretchState::mBeat1, StretchHandle::StretchState::mBeatCenter, min(), StretchHandle::StretchState::mLeftBeats, StretchHandle::StretchState::mMode, StretchHandle::StretchState::mOrigSel0Quantized, StretchHandle::StretchState::mOrigSel1Quantized, StretchHandle::StretchState::mRightBeats, TrackPanelMouseState::rect, TrackPanelMouseState::state, stretchCenter, stretchLeft, stretchRight, and within().
Referenced by NoteTrackView::DetailedHitTest().
|
default |
|
overridevirtual |
Implements UIHandle.
Definition at line 217 of file StretchHandle.cpp.
References ProjectAudioIO::Get(), HitPreview(), ProjectAudioIO::IsAudioActive(), StretchHandle::StretchState::mMode, and mStretchState.
|
overridevirtual |
Implements UIHandle.
Definition at line 224 of file StretchHandle.cpp.
References Cancel(), Cancelled, CONSOLIDATE, ProjectAudioIO::Get(), ProjectHistory::Get(), ViewInfo::Get(), SyncLockState::Get(), SyncLock::Group(), ProjectAudioIO::IsAudioActive(), SyncLockState::IsSyncLocked(), StretchHandle::StretchState::mMode, StretchHandle::StretchState::mOrigSel0Quantized, StretchHandle::StretchState::mOrigSel1Quantized, mpTrack, mStretchState, ProjectHistory::PushState(), RefreshCode::RefreshAll, RefreshCode::RefreshNone, stretchLeft, stretchRight, and XO().
|
inlineoverridevirtual |
|
private |
Definition at line 290 of file StretchHandle.cpp.
References ViewInfo::Get(), StretchHandle::StretchState::mBeat0, StretchHandle::StretchState::mBeat1, StretchHandle::StretchState::mBeatCenter, min(), StretchHandle::StretchState::mLeftBeats, StretchHandle::StretchState::mMode, mpTrack, StretchHandle::StretchState::mRightBeats, mStretchState, stretchCenter, stretchLeft, and stretchRight.
Referenced by Drag().
|
private |
Definition at line 100 of file StretchHandle.h.
|
private |
Definition at line 99 of file StretchHandle.h.
Referenced by Drag(), FindTrack(), Release(), and Stretch().
|
private |