MCPcopy Create free account
hub / github.com/audacity/audacity / HandleSnapping

Method HandleSnapping

src/AdornedRulerPanel.cpp:2294–2308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2292}
2293
2294void AdornedRulerPanel::HandleSnapping(size_t index)
2295{
2296 // Play region dragging can snap to selection boundaries
2297 const auto &selectedRegion = ViewInfo::Get(*GetProject()).selectedRegion;
2298 SnapPointArray candidates;
2299 if (!mPlayRegionDragsSelection)
2300 candidates = {
2301 SnapPoint{ selectedRegion.t0() },
2302 SnapPoint{ selectedRegion.t1() },
2303 };
2304 SnapManager snapManager{ *mProject, *mTracks, *mViewInfo, move(candidates) };
2305 auto results = snapManager.Snap(nullptr, mQuickPlayPos[index], false);
2306 mQuickPlayPos[index] = results.outTime;
2307 mIsSnapped[index] = results.Snapped();
2308}
2309
2310void AdornedRulerPanel::OnTimelineFormatChange(wxCommandEvent& event)
2311{

Callers

nothing calls this directly

Calls 4

GetFunction · 0.85
moveFunction · 0.85
SnappedMethod · 0.80
SnapMethod · 0.45

Tested by

no test coverage detected