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

Method UpdateQuickPlayPos

src/AdornedRulerPanel.cpp:2194–2212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2192}
2193
2194void AdornedRulerPanel::UpdateQuickPlayPos(wxCoord &mousePosX)
2195{
2196 // Invoked for mouse-over preview events, or dragging, or scrub position
2197 // polling updates. Remember x coordinates, converted to times, for
2198 // drawing of guides.
2199
2200 // Keep Quick-Play within usable track area. (Dependent on zoom)
2201 const auto &viewInfo = ViewInfo::Get( *mProject );
2202 auto width = viewInfo.GetTracksUsableWidth();
2203 mousePosX = std::max(mousePosX, viewInfo.GetLeftOffset());
2204 mousePosX = std::min(mousePosX, viewInfo.GetLeftOffset() + width - 1);
2205 const auto time = Pos2Time(mousePosX);
2206
2207 for (size_t ii = 0; ii < mNumGuides; ++ii) {
2208 mQuickPlayPosUnsnapped[ii] = mQuickPlayPos[ii] =
2209 time + mQuickPlayOffset[ii];
2210 HandleSnapping(ii);
2211 }
2212}
2213
2214// Pop-up menus
2215

Callers 4

DragMethod · 0.80
HitTestMethod · 0.80
DragMethod · 0.80
OnTimerMethod · 0.80

Calls 4

GetFunction · 0.85
maxFunction · 0.85
GetLeftOffsetMethod · 0.80
minFunction · 0.50

Tested by

no test coverage detected