![]() |
Audacity 3.2.0
|
#include <BrushHandle.h>
Classes | |
class | StateSaver |
Public Member Functions | |
BrushHandle (std::shared_ptr< StateSaver > pStateSaver, const std::shared_ptr< TrackView > &pTrackView, 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 () |
bool | IsClicked () const |
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 |
![]() | |
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) |
Private Member Functions | |
BrushHandle (const BrushHandle &) | |
std::weak_ptr< Track > | FindTrack () |
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< TrackView > | 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 | |
![]() | |
using | Result = unsigned |
using | Cell = TrackPanelCell |
![]() | |
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) |
![]() | |
Result | mChangeHighlight { 0 } |
Definition at line 30 of file BrushHandle.h.
|
private |
|
explicit |
Definition at line 143 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 171 of file BrushHandle.cpp.
|
overridevirtual |
Implements UIHandle.
Definition at line 402 of file BrushHandle.cpp.
References mpStateSaver, and RefreshCode::RefreshAll.
|
overridevirtual |
Implements UIHandle.
Definition at line 221 of file BrushHandle.cpp.
References RefreshCode::Cancelled, TrackPanelMouseEvent::event, FindTrack(), ViewInfo::Get(), TrackList::Get(), TrackPanel::Get(), TrackList::Lock(), mpStateSaver, mpView, and RefreshCode::RefreshAll.
|
overridevirtual |
Implements UIHandle.
Definition at line 245 of file BrushHandle.cpp.
References sampleCount::as_long_long(), RefreshCode::Cancelled, TrackPanelMouseEvent::event, SpectralDataManager::FindFrequencySnappingBin(), SpectralDataManager::FindHighestFrequencyBins(), FindTrack(), ViewInfo::Get(), TrackList::Get(), TrackPanel::Get(), HandleHopBinData(), TrackList::Lock(), mbCtrlDown, mBrushRadius, mFreqSnappingRatio, mIsOvertones, mIsSmartSelection, mOvertonesThreshold, mpSpectralData, mpView, mRect, anonymous_namespace{BrushHandle.cpp}::PositionToFrequency(), RefreshCode::RefreshAll, fast_float::round(), and SampleTrack::TimeToLongSamples().
|
overrideprivatevirtual |
Reimplemented from TrackPanelDrawable.
Definition at line 408 of file BrushHandle.cpp.
References TrackPanelDrawingContext::dc, mBrushRadius, mMostRecentX, mMostRecentY, and TrackArtist::PassTracks.
|
overridevirtual |
|
overridevirtual |
Reimplemented from UIHandle.
Definition at line 199 of file BrushHandle.cpp.
|
private |
void BrushHandle::HandleHopBinData | ( | int | hopNum, |
int | freqBinNum | ||
) |
Definition at line 205 of file BrushHandle.cpp.
References mbCtrlDown, mFreqUpperBound, mpSpectralData, and mSampleCountUpperBound.
Referenced by Drag().
bool BrushHandle::IsClicked | ( | ) | const |
Definition at line 57 of file BrushHandle.cpp.
References mSelectionStateChanger.
|
default |
|
overridevirtual |
Implements UIHandle.
Definition at line 368 of file BrushHandle.cpp.
References anonymous_namespace{BrushHandle.cpp}::CrosshairCursor().
|
overridevirtual |
Implements UIHandle.
Definition at line 376 of file BrushHandle.cpp.
References ProjectHistory::Get(), mbCtrlDown, ProjectHistory::ModifyState(), mpSpectralData, mpStateSaver, ProjectHistory::PushState(), RefreshCode::RefreshNone, and XO().
|
private |
Definition at line 113 of file BrushHandle.h.
Referenced by Drag(), HandleHopBinData(), and Release().
|
private |
Definition at line 112 of file BrushHandle.h.
Referenced by BrushHandle(), Drag(), and Draw().
|
private |
Definition at line 110 of file BrushHandle.h.
Referenced by BrushHandle().
|
private |
Definition at line 103 of file BrushHandle.h.
Referenced by Drag().
|
private |
Definition at line 110 of file BrushHandle.h.
Referenced by BrushHandle(), and HandleHopBinData().
|
private |
Definition at line 108 of file BrushHandle.h.
Referenced by BrushHandle(), and Drag().
|
private |
Definition at line 108 of file BrushHandle.h.
Referenced by BrushHandle(), and Drag().
|
private |
Definition at line 111 of file BrushHandle.h.
Referenced by Draw().
|
private |
Definition at line 111 of file BrushHandle.h.
Referenced by Draw().
|
private |
Definition at line 106 of file BrushHandle.h.
Referenced by Drag().
|
private |
Definition at line 89 of file BrushHandle.h.
Referenced by BrushHandle(), Drag(), HandleHopBinData(), and Release().
|
private |
Definition at line 88 of file BrushHandle.h.
|
private |
Definition at line 98 of file BrushHandle.h.
Referenced by Click(), Drag(), and FindTrack().
|
private |
Definition at line 99 of file BrushHandle.h.
Referenced by BrushHandle(), and Drag().
|
private |
Definition at line 109 of file BrushHandle.h.
Referenced by BrushHandle().
|
private |
Definition at line 109 of file BrushHandle.h.
Referenced by BrushHandle(), and HandleHopBinData().
|
private |
Definition at line 115 of file BrushHandle.h.
Referenced by IsClicked().