Audacity 3.2.0
|
#include <SliderHandle.h>
Public Types | |
using | SliderFn = LWSlider *(*)(AudacityProject *, const wxRect &, Track *) |
Public Types inherited from UIHandle | |
using | Result = unsigned |
using | Cell = TrackPanelCell |
Public Member Functions | |
SliderHandle (SliderFn sliderFn, const wxRect &rect, const std::shared_ptr< Track > &pTrack) | |
SliderHandle & | operator= (const SliderHandle &)=default |
std::shared_ptr< const Track > | FindTrack () const override |
std::shared_ptr< Track > | GetTrack () const |
bool | IsDragging () const 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) |
Protected Member Functions | |
virtual | ~SliderHandle () |
virtual float | GetValue ()=0 |
virtual Result | SetValue (AudacityProject *pProject, float newValue)=0 |
virtual Result | CommitChanges (const wxMouseEvent &event, AudacityProject *pProject)=0 |
virtual TranslatableString | Tip (const wxMouseState &state, AudacityProject &project) const =0 |
void | Enter (bool forward, AudacityProject *) override |
Result | Click (const TrackPanelMouseEvent &event, AudacityProject *pProject) final override |
Result | Drag (const TrackPanelMouseEvent &event, AudacityProject *pProject) final override |
HitTestPreview | Preview (const TrackPanelMouseState &state, AudacityProject *pProject) final override |
Result | Release (const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) final override |
Result | Cancel (AudacityProject *pProject) final override |
LWSlider * | GetSlider (AudacityProject *pProject) |
Protected Attributes | |
std::weak_ptr< Track > | mpTrack |
wxRect | mRect {} |
SliderFn | mSliderFn |
float | mStartingValue {} |
bool | mIsDragging {} |
Protected Attributes inherited from UIHandle | |
Result | mChangeHighlight { 0 } |
Private Member Functions | |
SliderHandle (const SliderHandle &)=delete | |
Additional Inherited Members | |
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) |
Definition at line 22 of file SliderHandle.h.
using SliderHandle::SliderFn = LWSlider *(*)( AudacityProject*, const wxRect&, Track* ) |
Definition at line 27 of file SliderHandle.h.
|
privatedelete |
|
explicit |
Definition at line 20 of file SliderHandle.cpp.
|
protectedvirtual |
Definition at line 33 of file SliderHandle.cpp.
|
finaloverrideprotectedvirtual |
Implements UIHandle.
Definition at line 115 of file SliderHandle.cpp.
References GetSlider(), mpTrack, mStartingValue, LWSlider::OnMouseEvent(), RefreshCode::RefreshCell, and SetValue().
|
finaloverrideprotectedvirtual |
Implements UIHandle.
Definition at line 47 of file SliderHandle.cpp.
References Cancelled, TrackPanelMouseEvent::event, GetSlider(), GetValue(), mIsDragging, mStartingValue, RefreshCode::RefreshCell, and SetValue().
|
protectedpure virtual |
Implemented in VelocitySliderHandle, VolumeSliderHandle, and PanSliderHandle.
Referenced by Release().
|
finaloverrideprotectedvirtual |
Implements UIHandle.
Definition at line 74 of file SliderHandle.cpp.
References TrackPanelMouseEvent::event, LWSlider::Get(), GetSlider(), LWSlider::OnMouseEvent(), RefreshCode::RefreshCell, and SetValue().
|
overrideprotectedvirtual |
Reimplemented from UIHandle.
Definition at line 28 of file SliderHandle.cpp.
References UIHandle::mChangeHighlight, and RefreshCode::RefreshCell.
|
overridevirtual |
Implements UIHandle.
Definition at line 37 of file SliderHandle.cpp.
References mpTrack.
|
protected |
Definition at line 126 of file SliderHandle.cpp.
References TrackList::Get(), TrackList::Lock(), mpTrack, mRect, and mSliderFn.
Referenced by Cancel(), Click(), Drag(), and Release().
|
inline |
Definition at line 36 of file SliderHandle.h.
Referenced by anonymous_namespace{NoteTrackControls.cpp}::VelocitySliderDrawFunction().
|
protectedpure virtual |
Implemented in VelocitySliderHandle, VolumeSliderHandle, and PanSliderHandle.
Referenced by Click().
|
overridevirtual |
Whether the handle is dragging, affecting other panel painting; default returns false
Reimplemented from UIHandle.
Definition at line 42 of file SliderHandle.cpp.
References mIsDragging.
|
default |
|
finaloverrideprotectedvirtual |
Implements UIHandle.
Definition at line 86 of file SliderHandle.cpp.
References project, TrackPanelMouseState::state, and Tip().
|
finaloverrideprotectedvirtual |
Implements UIHandle.
Definition at line 96 of file SliderHandle.cpp.
References CommitChanges(), TrackPanelMouseEvent::event, LWSlider::Get(), GetSlider(), mpTrack, LWSlider::OnMouseEvent(), RefreshCode::RefreshCell, and SetValue().
|
protectedpure virtual |
Implemented in VelocitySliderHandle, VolumeSliderHandle, and PanSliderHandle.
Referenced by Cancel(), Click(), Drag(), and Release().
|
protectedpure virtual |
Implemented in VelocitySliderHandle, VolumeSliderHandle, and PanSliderHandle.
Referenced by Preview().
|
protected |
Definition at line 83 of file SliderHandle.h.
Referenced by Click(), and IsDragging().
|
protected |
Definition at line 76 of file SliderHandle.h.
Referenced by Cancel(), FindTrack(), VelocitySliderHandle::GetNoteTrack(), GetSlider(), VolumeSliderHandle::GetWaveTrack(), PanSliderHandle::GetWaveTrack(), and Release().
|
protected |
Definition at line 77 of file SliderHandle.h.
Referenced by GetSlider().
|
protected |
Definition at line 78 of file SliderHandle.h.
Referenced by GetSlider().
|
protected |
Definition at line 81 of file SliderHandle.h.