![]() |
Audacity 3.2.0
|
#include <SampleHandle.h>
Public Member Functions | |
SampleHandle (const std::shared_ptr< WaveTrack > &pTrack) | |
SampleHandle & | operator= (const SampleHandle &)=default |
virtual | ~SampleHandle () |
std::shared_ptr< WaveTrack > | GetTrack () const |
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 |
![]() | |
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) |
Result | GetChangeHighlight () const |
void | SetChangeHighlight (Result val) |
![]() | |
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< WaveTrack > &pTrack) |
static UIHandlePtr | HitTest (std::weak_ptr< SampleHandle > &holder, const wxMouseState &state, const wxRect &rect, const AudacityProject *pProject, const std::shared_ptr< WaveTrack > &pTrack) |
![]() | |
static UIHandle::Result | NeedChangeHighlight (const UIHandle &, const UIHandle &) |
![]() | |
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< WaveTrack > | mClickedTrack |
wxRect | mRect {} |
sampleCount | mClickedStartSample {} |
sampleCount | mLastDragSample {} |
float | mLastDragSampleValue {} |
bool | mAltKey {} |
Additional Inherited Members | |
![]() | |
using | Result = unsigned |
using | Cell = TrackPanelCell |
![]() | |
Result | mChangeHighlight { 0 } |
Definition at line 24 of file SampleHandle.h.
|
privatedelete |
|
explicit |
Definition at line 38 of file SampleHandle.cpp.
|
virtual |
Definition at line 165 of file SampleHandle.cpp.
|
overridevirtual |
Implements UIHandle.
Definition at line 441 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 191 of file SampleHandle.cpp.
References anonymous_namespace{SampleHandle.cpp}::adjustTime(), RefreshCode::Cancelled, TrackPanelMouseEvent::event, FindSampleEditingLevel(), floatSample, ProjectAudioIO::Get(), ViewInfo::Get(), ProjectAudioIO::IsAudioActive(), anonymous_namespace{SampleHandle.cpp}::IsSampleEditingPossible(), mAltKey, mClickedStartSample, mClickedTrack, mLastDragSample, mLastDragSampleValue, mRect, narrowestSampleFormat, TrackPanelMouseEvent::rect, RefreshCode::RefreshCell, SMOOTHING_BRUSH_RADIUS, SMOOTHING_KERNEL_RADIUS, SMOOTHING_PROPORTION_MAX, and SMOOTHING_PROPORTION_MIN.
|
overridevirtual |
Implements UIHandle.
Definition at line 326 of file SampleHandle.cpp.
References Cancel(), RefreshCode::Cancelled, PackedArray::end(), TrackPanelMouseEvent::event, FindSampleEditingLevel(), floatSample, ProjectAudioIO::Get(), ViewInfo::Get(), ProjectAudioIO::IsAudioActive(), mAltKey, mClickedStartSample, mClickedTrack, min(), mLastDragSample, mLastDragSampleValue, mRect, narrowestSampleFormat, RefreshCode::RefreshCell, RefreshCode::RefreshNone, size, and values.
|
overridevirtual |
Reimplemented from UIHandle.
Definition at line 43 of file SampleHandle.cpp.
References UIHandle::mChangeHighlight, and RefreshCode::RefreshCell.
|
private |
Definition at line 448 of file SampleHandle.cpp.
References WaveformSettings::Get(), WaveformScale::Get(), Envelope::GetValue(), mClickedTrack, min(), mRect, ZoomInfo::PositionToTime(), settings(), and ValueOfPixel().
Referenced by Click(), and Drag().
|
inline |
Definition at line 45 of file SampleHandle.h.
References mClickedTrack.
Referenced by anonymous_namespace{WaveformView.cpp}::DrawClipWaveform().
|
static |
Definition at line 73 of file SampleHandle.cpp.
References AssignUIHandlePtr().
Referenced by WaveformView::DetailedHitTest(), and HitTest().
|
staticprivate |
Definition at line 50 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 111 of file SampleHandle.cpp.
References anonymous_namespace{SampleHandle.cpp}::adjustTime(), fillZero, ViewInfo::Get(), WaveformSettings::Get(), WaveformScale::Get(), Envelope::GetValue(), GetWaveYPos(), HitAnywhere(), anonymous_namespace{SampleHandle.cpp}::SampleResolutionTest(), and settings().
Referenced by WaveformView::DetailedHitTest().
|
default |
|
overridevirtual |
Implements UIHandle.
Definition at line 413 of file SampleHandle.cpp.
References ProjectAudioIO::Get(), HitPreview(), ProjectAudioIO::IsAudioActive(), and TrackPanelMouseState::state.
|
overridevirtual |
Implements UIHandle.
Definition at line 420 of file SampleHandle.cpp.
References Cancel(), CONSOLIDATE, ProjectAudioIO::Get(), ProjectHistory::Get(), ProjectAudioIO::IsAudioActive(), mClickedTrack, ProjectHistory::PushState(), RefreshCode::RefreshNone, and XO().
|
inlineoverridevirtual |
|
private |
Definition at line 77 of file SampleHandle.h.
|
private |
Definition at line 74 of file SampleHandle.h.
|
private |
Definition at line 71 of file SampleHandle.h.
Referenced by Cancel(), Click(), Drag(), FindSampleEditingLevel(), GetTrack(), and Release().
|
private |
Definition at line 75 of file SampleHandle.h.
|
private |
Definition at line 76 of file SampleHandle.h.
|
private |
Definition at line 72 of file SampleHandle.h.
Referenced by Click(), Drag(), and FindSampleEditingLevel().