Audacity 3.2.0
|
#include <Snap.h>
Public Member Functions | |
SnapManager (const AudacityProject &project, SnapPointArray candidates, const ZoomInfo &zoomInfo, bool noTimeSnap=false, int pixelTolerance=kPixelTolerance) | |
Construct only for specified candidate points. More... | |
SnapManager (const AudacityProject &project, const TrackList &tracks, const ZoomInfo &zoomInfo, SnapPointArray candidates={}, bool noTimeSnap=false, int pixelTolerance=kPixelTolerance) | |
~SnapManager () | |
SnapResults | Snap (Track *currentTrack, double t, bool rightEdge) |
Private Member Functions | |
void | Reinit () |
void | CondListAdd (double t, const Track *track) |
double | Get (size_t index) |
wxInt64 | PixelDiff (double t, size_t index) |
size_t | Find (double t, size_t i0, size_t i1) |
size_t | Find (double t) |
bool | SnapToPoints (Track *currentTrack, double t, bool rightEdge, double *outT) |
Private Attributes | |
const AudacityProject * | mProject |
const ZoomInfo * | mZoomInfo |
int | mPixelTolerance |
bool | mNoTimeSnap |
double | mEpsilon { 1 / 44100.0 } |
Two time points closer than this are considered the same. More... | |
SnapPointArray | mCandidates |
SnapPointArray | mSnapPoints |
bool | mSnapToTime { false } |
Identifier | mSnapTo {} |
double | mRate { 0.0 } |
NumericFormatID | mFormat {} |
SnapManager::SnapManager | ( | const AudacityProject & | project, |
SnapPointArray | candidates, | ||
const ZoomInfo & | zoomInfo, | ||
bool | noTimeSnap = false , |
||
int | pixelTolerance = kPixelTolerance |
||
) |
Construct only for specified candidate points.
Definition at line 29 of file Snap.cpp.
References Reinit().
SnapManager::SnapManager | ( | const AudacityProject & | project, |
const TrackList & | tracks, | ||
const ZoomInfo & | zoomInfo, | ||
SnapPointArray | candidates = {} , |
||
bool | noTimeSnap = false , |
||
int | pixelTolerance = kPixelTolerance |
||
) |
Construct for (optionally) specified points, plus significant points on the tracks in the given list
Definition at line 58 of file Snap.cpp.
|
private |
Definition at line 115 of file Snap.cpp.
References ProjectSnap::Get(), mSnapPoints, mSnapToTime, ProjectSnap::SnapTime(), and SnapResult::time.
Referenced by Reinit().
|
private |
Definition at line 156 of file Snap.cpp.
References Find(), Get(), mSnapPoints, and PixelDiff().
|
private |
Definition at line 138 of file Snap.cpp.
Referenced by Find(), and SnapToPoints().
|
private |
Definition at line 124 of file Snap.cpp.
References mSnapPoints.
Referenced by Find(), PixelDiff(), and SnapToPoints().
|
private |
Definition at line 130 of file Snap.cpp.
References Get(), mZoomInfo, and ZoomInfo::TimeToPosition().
Referenced by Find(), and SnapToPoints().
|
private |
Definition at line 76 of file Snap.cpp.
References CondListAdd(), anonymous_namespace{ExportPCM.cpp}::format, ProjectNumericFormats::Get(), ProjectRate::Get(), ProjectSnap::Get(), ProjectRate::GetRate(), mCandidates, mFormat, mNoTimeSnap, mProject, mRate, mSnapPoints, mSnapTo, mSnapToTime, settings(), and SNAP_OFF.
Referenced by Snap(), and SnapManager().
SnapResults SnapManager::Snap | ( | Track * | currentTrack, |
double | t, | ||
bool | rightEdge | ||
) |
Definition at line 261 of file Snap.cpp.
References ProjectSnap::Get(), mSnapToTime, mZoomInfo, SnapResults::outCoord, SnapResults::outTime, Reinit(), SnapResults::Snapped(), SnapResults::snappedPoint, SnapResults::snappedTime, ProjectSnap::SnapTime(), SnapToPoints(), SnapResult::time, SnapResults::timeSnappedTime, and ZoomInfo::TimeToPosition().
Referenced by anonymous_namespace{TimeShiftHandle.cpp}::AdjustToSnap().
|
private |
Definition at line 180 of file Snap.cpp.
References Find(), Get(), mEpsilon, mPixelTolerance, mSnapPoints, and PixelDiff().
Referenced by Snap().
|
private |
|
private |
Two time points closer than this are considered the same.
Definition at line 102 of file Snap.h.
Referenced by SnapToPoints().
|
private |
|
private |
Definition at line 98 of file Snap.h.
Referenced by SnapToPoints().
|
private |
|
private |
|
private |
Definition at line 104 of file Snap.h.
Referenced by CondListAdd(), Find(), Get(), Reinit(), and SnapToPoints().
|
private |
|
private |
Definition at line 107 of file Snap.h.
Referenced by CondListAdd(), Reinit(), and Snap().
|
private |
Definition at line 97 of file Snap.h.
Referenced by PixelDiff(), and Snap().