Audacity 3.2.0
|
#include <BrushHandle.h>
Classes | |
class | StateSaver |
Public Member Functions | |
BrushHandle (std::shared_ptr< StateSaver > pStateSaver, const std::shared_ptr< ChannelView > &pChannelView, const TrackList &trackList, const TrackPanelMouseState &st, const ViewInfo &viewInfo, const std::shared_ptr< SpectralData > &pSpectralData, const ProjectSettings &pSettings) | |
BrushHandle & | operator= (const BrushHandle &)=default |
virtual | ~BrushHandle () |
std::shared_ptr< const Track > | FindTrack () const override |
bool | IsDragging () const override |
void | Enter (bool forward, AudacityProject *pProject) override |
bool | Escape (AudacityProject *pProject) override |
void | HandleHopBinData (int hopNum, int freqBinNum) |
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 *) 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) |
Private Member Functions | |
BrushHandle (const BrushHandle &) | |
std::shared_ptr< WaveChannel > | FindChannel () |
void | Draw (TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass) override |
Private Attributes | |
std::shared_ptr< StateSaver > | mpStateSaver |
std::shared_ptr< SpectralData > | mpSpectralData |
std::weak_ptr< ChannelView > | mpView |
wxRect | mRect {} |
double | mFreqSnappingRatio { 0.01 } |
double | mOvertonesThreshold { 0.999 } |
bool | mIsSmartSelection |
bool | mIsOvertones |
long long | mSampleCountUpperBound |
long long | mSampleCountLowerBound |
wxInt64 | mFreqUpperBound |
wxInt64 | mFreqLowerBound |
int | mMostRecentX { -1 } |
int | mMostRecentY { -1 } |
int | mBrushRadius |
bool | mbCtrlDown |
std::shared_ptr< SelectionStateChanger > | mSelectionStateChanger |
Additional Inherited Members | |
Public Types inherited from UIHandle | |
using | Result = unsigned |
using | Cell = TrackPanelCell |
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 Attributes inherited from UIHandle | |
Result | mChangeHighlight { 0 } |
Definition at line 30 of file BrushHandle.h.
|
private |
|
explicit |
Definition at line 138 of file BrushHandle.cpp.
References SpectrogramSettings::Get(), ProjectSettings::GetBrushRadius(), ProjectSettings::IsOvertones(), ProjectSettings::IsSmartSelection(), mBrushRadius, mFreqLowerBound, mFreqUpperBound, mIsOvertones, mIsSmartSelection, mpSpectralData, mRect, mSampleCountLowerBound, mSampleCountUpperBound, TrackPanelMouseState::rect, settings(), and TrackPanelMouseState::state.
|
virtual |
Definition at line 165 of file BrushHandle.cpp.
|
overridevirtual |
Implements UIHandle.
Definition at line 395 of file BrushHandle.cpp.
References mpStateSaver, and RefreshCode::RefreshAll.
|
overridevirtual |
Implements UIHandle.
Definition at line 220 of file BrushHandle.cpp.
References Cancelled, TrackPanelMouseEvent::event, ViewInfo::Get(), TrackPanel::Get(), mpStateSaver, mpView, and RefreshCode::RefreshAll.
|
overridevirtual |
Implements UIHandle.
Definition at line 240 of file BrushHandle.cpp.
References sampleCount::as_long_long(), Cancelled, TrackPanelMouseEvent::event, FindChannel(), SpectralDataManager::FindFrequencySnappingBin(), SpectralDataManager::FindHighestFrequencyBins(), ViewInfo::Get(), TrackPanel::Get(), HandleHopBinData(), mbCtrlDown, mBrushRadius, mFreqSnappingRatio, mIsOvertones, mIsSmartSelection, mOvertonesThreshold, mpSpectralData, mpView, mRect, anonymous_namespace{BrushHandle.cpp}::PositionToFrequency(), RefreshCode::RefreshAll, and fast_float::round().
|
overrideprivatevirtual |
Reimplemented from TrackPanelDrawable.
Definition at line 401 of file BrushHandle.cpp.
References TrackPanelDrawingContext::dc, mBrushRadius, mMostRecentX, mMostRecentY, and TrackArtist::PassTracks.
|
overridevirtual |
|
overridevirtual |
Reimplemented from UIHandle.
Definition at line 198 of file BrushHandle.cpp.
|
private |
Definition at line 416 of file BrushHandle.cpp.
References mpView.
Referenced by Drag(), and FindTrack().
|
overridevirtual |
Implements UIHandle.
Definition at line 169 of file BrushHandle.cpp.
References FindChannel(), and UIHandle::TrackFromChannel().
void BrushHandle::HandleHopBinData | ( | int | hopNum, |
int | freqBinNum | ||
) |
Definition at line 204 of file BrushHandle.cpp.
References mbCtrlDown, mFreqUpperBound, mpSpectralData, and mSampleCountUpperBound.
Referenced by Drag().
|
overridevirtual |
Whether the handle is dragging, affecting other panel painting; default returns false
Reimplemented from UIHandle.
Definition at line 57 of file BrushHandle.cpp.
References mSelectionStateChanger.
|
default |
|
overridevirtual |
Implements UIHandle.
Definition at line 361 of file BrushHandle.cpp.
References anonymous_namespace{BrushHandle.cpp}::CrosshairCursor().
|
overridevirtual |
Implements UIHandle.
Definition at line 369 of file BrushHandle.cpp.
References ProjectHistory::Get(), mbCtrlDown, ProjectHistory::ModifyState(), mpSpectralData, mpStateSaver, ProjectHistory::PushState(), RefreshCode::RefreshNone, and XO().
|
private |
Definition at line 115 of file BrushHandle.h.
Referenced by Drag(), HandleHopBinData(), and Release().
|
private |
Definition at line 114 of file BrushHandle.h.
Referenced by BrushHandle(), Drag(), and Draw().
|
private |
Definition at line 112 of file BrushHandle.h.
Referenced by BrushHandle().
|
private |
Definition at line 105 of file BrushHandle.h.
Referenced by Drag().
|
private |
Definition at line 112 of file BrushHandle.h.
Referenced by BrushHandle(), and HandleHopBinData().
|
private |
Definition at line 110 of file BrushHandle.h.
Referenced by BrushHandle(), and Drag().
|
private |
Definition at line 110 of file BrushHandle.h.
Referenced by BrushHandle(), and Drag().
|
private |
Definition at line 113 of file BrushHandle.h.
Referenced by Draw().
|
private |
Definition at line 113 of file BrushHandle.h.
Referenced by Draw().
|
private |
Definition at line 108 of file BrushHandle.h.
Referenced by Drag().
|
private |
Definition at line 91 of file BrushHandle.h.
Referenced by BrushHandle(), Drag(), HandleHopBinData(), and Release().
|
private |
Definition at line 90 of file BrushHandle.h.
|
private |
Definition at line 100 of file BrushHandle.h.
Referenced by Click(), Drag(), and FindChannel().
|
private |
Definition at line 101 of file BrushHandle.h.
Referenced by BrushHandle(), and Drag().
|
private |
Definition at line 111 of file BrushHandle.h.
Referenced by BrushHandle().
|
private |
Definition at line 111 of file BrushHandle.h.
Referenced by BrushHandle(), and HandleHopBinData().
|
private |
Definition at line 117 of file BrushHandle.h.
Referenced by IsDragging().