| 502 | } |
| 503 | |
| 504 | void 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 | |
| 547 | unsigned |
| 548 | AdornedRulerPanel::ScrubbingRulerOverlay::SequenceNumber() const |
no test coverage detected