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

Method Update

src/AdornedRulerPanel.cpp:504–545  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

502}
503
504void AdornedRulerPanel::ScrubbingRulerOverlay::Update()
505{
506 const auto project = mPartner.mProject;
507 auto &scrubber = Scrubber::Get( *project );
508 auto ruler = GetRuler();
509
510 bool scrubbing = (scrubber.IsScrubbing()
511 && !scrubber.IsSpeedPlaying()
512 && !scrubber.IsKeyboardScrubbing());
513
514 // Hide during transport, or if mouse is not in the ruler, unless scrubbing
515 if ((!ruler->LastCell() || ProjectAudioIO::Get( *project ).IsAudioActive())
516 && !scrubbing)
517 mNewQPIndicatorPos = -1;
518 else {
519 const auto &selectedRegion = ViewInfo::Get( *project ).selectedRegion;
520 double latestEnd =
521 std::max(ruler->mTracks->GetEndTime(), selectedRegion.t1());
522 // This will determine the x coordinate of the line and of the
523 // ruler indicator
524
525 // Test all snap points
526 mNewIndicatorSnapped = -1;
527 for (size_t ii = 0;
528 mNewIndicatorSnapped == -1 && ii < ruler->mNumGuides; ++ii) {
529 if (ruler->mIsSnapped[ii]) {
530 mNewIndicatorSnapped = ii;
531 }
532 }
533 mNewQPIndicatorPos = ruler->Time2Pos(
534 ruler->mQuickPlayPos[std::max(0, mNewIndicatorSnapped)]);
535
536 // These determine which shape is drawn on the ruler, and whether
537 // in the scrub or the qp zone
538 mNewScrub =
539 !ruler->IsMouseCaptured() && // not doing some other drag in the ruler
540 (ruler->LastCell() == ruler->mScrubbingCell ||
541 (scrubber.HasMark()));
542 mNewSeek = mNewScrub &&
543 (scrubber.Seeks() || scrubber.TemporarilySeeks());
544 }
545}
546
547unsigned
548AdornedRulerPanel::ScrubbingRulerOverlay::SequenceNumber() const

Callers 8

ProcessMethod · 0.45
SetTimeLabelFunction · 0.45
RemoveDependenciesFunction · 0.45
PlayPlayRegionAndWaitMethod · 0.45
RecordAndWaitMethod · 0.45
OnOKMethod · 0.45
OpenProjectFileMethod · 0.45

Calls 11

GetFunction · 0.85
GetRulerFunction · 0.85
maxFunction · 0.85
LastCellMethod · 0.80
Time2PosMethod · 0.80
IsMouseCapturedMethod · 0.80
SeeksMethod · 0.80
TemporarilySeeksMethod · 0.80
IsScrubbingMethod · 0.45
IsAudioActiveMethod · 0.45
GetEndTimeMethod · 0.45

Tested by

no test coverage detected