Audacity 3.2.0
|
#include <SampleHandle.h>
Public Member Functions | |
SampleHandle (const std::shared_ptr< WaveChannel > &pTrack) | |
SampleHandle & | operator= (const SampleHandle &)=default |
virtual | ~SampleHandle () |
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 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< SampleHandle > &holder, const wxMouseState &state, const std::shared_ptr< WaveChannel > &pChannel) |
static UIHandlePtr | HitTest (std::weak_ptr< SampleHandle > &holder, const wxMouseState &state, const wxRect &rect, const AudacityProject *pProject, const std::shared_ptr< WaveChannel > &pChannel) |
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 | |
SampleHandle (const SampleHandle &)=delete | |
float | FindSampleEditingLevel (const wxMouseEvent &event, const ViewInfo &viewInfo, double t0) |
Static Private Member Functions | |
static HitTestPreview | HitPreview (const wxMouseState &state, const AudacityProject *pProject, bool unsafe) |
Private Attributes | |
std::shared_ptr< WaveChannel > | mClickedTrack |
std::shared_ptr< WaveClipChannel > | mClickedClip {} |
wxRect | mRect {} |
int | mClickedStartPixel {} |
int | mLastDragPixel {} |
float | mLastDragSampleValue {} |
bool | mAltKey {} |
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 25 of file SampleHandle.h.
|
privatedelete |
|
explicit |
Definition at line 41 of file SampleHandle.cpp.
|
virtual |
Definition at line 177 of file SampleHandle.cpp.
|
overridevirtual |
Implements UIHandle.
Definition at line 460 of file SampleHandle.cpp.
References ProjectHistory::Get(), mClickedTrack, RefreshCode::RefreshCell, and ProjectHistory::RollbackState().
Referenced by Drag(), and Release().
|
overridevirtual |
Someone has just clicked the mouse. What do we do?
We're in a track view and zoomed enough to see the samples.
Implements UIHandle.
Definition at line 186 of file SampleHandle.cpp.
References AudacityMessageBox(), Cancelled, TrackPanelMouseEvent::event, FindSampleEditingLevel(), ProjectAudioIO::Get(), ViewInfo::Get(), WaveChannelUtilities::GetClipAtTime(), WaveChannelUtilities::GetFloatsCenteredAroundTime(), ProjectAudioIO::IsAudioActive(), mAltKey, mClickedClip, mClickedStartPixel, mClickedTrack, mLastDragPixel, mLastDragSampleValue, mRect, narrowestSampleFormat, TrackPanelMouseEvent::rect, RefreshCode::RefreshCell, anonymous_namespace{SampleHandle.cpp}::SampleResolutionTest(), WaveChannelUtilities::SetFloatAtTime(), WaveChannelUtilities::SetFloatsCenteredAroundTime(), SMOOTHING_BRUSH_RADIUS, SMOOTHING_KERNEL_RADIUS, SMOOTHING_PROPORTION_MAX, SMOOTHING_PROPORTION_MIN, and XO().
|
overridevirtual |
Implements UIHandle.
Definition at line 351 of file SampleHandle.cpp.
References Cancel(), Cancelled, details::end(), TrackPanelMouseEvent::event, FindSampleEditingLevel(), forward, ProjectAudioIO::Get(), ViewInfo::Get(), anonymous_namespace{SampleHandle.cpp}::GetLastEditableClipStartingFromNthClip(), ProjectAudioIO::IsAudioActive(), mAltKey, mClickedClip, mClickedStartPixel, mClickedTrack, min(), mLastDragPixel, mLastDragSampleValue, mRect, narrowestSampleFormat, RefreshCode::RefreshCell, RefreshCode::RefreshNone, WaveChannelUtilities::SetFloatsWithinTimeRange(), and WaveChannelUtilities::SortedClipArray().
|
overridevirtual |
Reimplemented from UIHandle.
Definition at line 46 of file SampleHandle.cpp.
References UIHandle::mChangeHighlight, and RefreshCode::RefreshCell.
|
private |
Definition at line 467 of file SampleHandle.cpp.
References WaveformSettings::Get(), WaveformScale::Get(), WaveChannelUtilities::GetEnvelopeAtTime(), mClickedTrack, min(), mRect, ZoomInfo::PositionToTime(), settings(), and ValueOfPixel().
Referenced by Click(), and Drag().
|
overridevirtual |
Implements UIHandle.
Definition at line 181 of file SampleHandle.cpp.
References mClickedTrack, and UIHandle::TrackFromChannel().
|
static |
Definition at line 76 of file SampleHandle.cpp.
References AssignUIHandlePtr().
Referenced by WaveformView::DetailedHitTest(), and HitTest().
|
staticprivate |
Definition at line 53 of file SampleHandle.cpp.
References MakeCursor(), and XO().
Referenced by Preview().
|
static |
method that tells us if the mouse event landed on an editable sample
Definition at line 118 of file SampleHandle.cpp.
References anonymous_namespace{SampleHandle.cpp}::adjustTime(), ViewInfo::Get(), WaveformSettings::Get(), WaveformScale::Get(), WaveChannelUtilities::GetClipAtTime(), WaveChannelUtilities::GetEnvelopeAtTime(), WaveChannelUtilities::GetFloatAtTime(), GetWaveYPos(), HitAnywhere(), anonymous_namespace{SampleHandle.cpp}::SampleResolutionTest(), and settings().
Referenced by WaveformView::DetailedHitTest().
|
default |
|
overridevirtual |
Implements UIHandle.
Definition at line 431 of file SampleHandle.cpp.
References ProjectAudioIO::Get(), HitPreview(), ProjectAudioIO::IsAudioActive(), and TrackPanelMouseState::state.
|
overridevirtual |
Implements UIHandle.
Definition at line 438 of file SampleHandle.cpp.
References Cancel(), CONSOLIDATE, ProjectAudioIO::Get(), ProjectHistory::Get(), ProjectAudioIO::IsAudioActive(), mClickedClip, mClickedTrack, ProjectHistory::PushState(), RefreshCode::RefreshNone, and XO().
|
inlineoverridevirtual |
|
private |
Definition at line 80 of file SampleHandle.h.
|
private |
Definition at line 74 of file SampleHandle.h.
|
private |
Definition at line 77 of file SampleHandle.h.
|
private |
Definition at line 73 of file SampleHandle.h.
Referenced by Cancel(), Click(), Drag(), FindSampleEditingLevel(), FindTrack(), and Release().
|
private |
Definition at line 78 of file SampleHandle.h.
|
private |
Definition at line 79 of file SampleHandle.h.
|
private |
Definition at line 75 of file SampleHandle.h.
Referenced by Click(), Drag(), and FindSampleEditingLevel().