Repository navigation
DIVIDE_BY_ZERO & timecode out-of-sync fix - #11937
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: CHILL Plan: Team Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between e49114a23ab5c539b29eae4f377dc66434c81528 and ce637c354b65311f544dea496e065c20f3355cb9. 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change synchronizes toolbar and selection-model time signature notifications with project updates. Numeric timing components now use valid defaults and tolerate zero or negative values during beat formatting. Regression tests cover zero and negative time signatures. Playhead dragging and release now clamp positions to the timeline start. Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant TrackeditProject
participant PlaybackToolBarTimeItem
participant SelectionStatusModel
PlaybackToolBarTimeItem->>TrackeditProject: Subscribe to timeSignatureChanged()
SelectionStatusModel->>TrackeditProject: Subscribe to timeSignatureChanged()
TrackeditProject->>PlaybackToolBarTimeItem: Emit timeSignatureChanged()
PlaybackToolBarTimeItem-->>PlaybackToolBarTimeItem: Re-emit timeSignatureChanged()
TrackeditProject->>SelectionStatusModel: Emit timeSignatureChanged()
SelectionStatusModel-->>SelectionStatusModel: Re-emit timeSignatureChanged()
Merge Risk: ⚪ Minimal · up to This change hardens bar-beat formatting and keeps the playhead from seeking before the timeline start. The supplied evidence indicates the intended safeguards and regression coverage are present, with no concrete unresolved current-head risk. 🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
Warning Linked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were analyzed; skipped Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: CHILL
Plan: Team
Run ID: 013eea8c-bfc0-4661-bbda-0a153025e1dc
📥 Commits
Reviewing files that changed from the base of the PR and between ed63687 and 88355847f67b3100b7fee488461b525fd5399285.
📒 Files selected for processing (9)
src/playback/view/toolbars/playbacktoolbartimeitem.cppsrc/playback/view/toolbars/playbacktoolbartimeitem.hsrc/projectscene/qml/Audacity/ProjectScene/tracksitemsview/TracksItemsView.qmlsrc/projectscene/view/statusbar/selectionstatusmodel.cppsrc/projectscene/view/statusbar/selectionstatusmodel.hsrc/uicomponents/components/internal/numeric/beatsformatter.cppsrc/uicomponents/components/internal/numeric/numericviewmodel.hsrc/uicomponents/components/internal/numeric/timecodeformatter.hsrc/uicomponents/tests/timecodemodel_tests.cpp
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| configuration()->playbackTimeItemFormatChanged().onNotify(this, [this](){ | ||
| emit currentFormatChanged(); | ||
| }); | ||
| } | ||
|
|
||
| void PlaybackToolBarTimeItem::listenTimeSignatureChanges() |
There was a problem hiding this comment.
is this listen something standard?
is it to translate something like "detecting" "reacting" to a change?
what about timeSignatureChangesCallback maybe better in singular timeSignatureChangeCallback
btw shouldn't we use a lambda for that?
There was a problem hiding this comment.
yep, we already have such listeners across the codebase so I'd like it as is
| void SelectionStatusModel::listenTimeSignatureChanges() | ||
| { | ||
| emit timeSignatureChanged(); | ||
|
|
||
| auto project = globalContext()->currentTrackeditProject(); | ||
| if (!project) { | ||
| return; | ||
| } | ||
|
|
||
| project->timeSignatureChanged().onReceive(this, [this](const trackedit::TimeSignature&) { | ||
| emit timeSignatureChanged(); | ||
| }); | ||
| } | ||
|
|
There was a problem hiding this comment.
we relay the change ?
shouldn't we review who's interested in the change callback in first place?
There was a problem hiding this comment.
yes, timeSignatureChanged is literally the NOTIFY signal of the tempo/upperTimeSignature/lowerTimeSignature Q_PROPERTYs
| { | ||
| if (m_tempo <= 0 || m_upperTimeSignature <= 0 || m_lowerTimeSignature <= 0) { | ||
| updateFields(MIN_DIGITS[0]); | ||
| return; | ||
| } | ||
|
|
There was a problem hiding this comment.
shouldn't we expect at least 1 or more ?
should we also do the top cap ?
There was a problem hiding this comment.
previously variables were initialized to 0 and as sentry report shows there's a case when we access those before those variables are filled with proper values (happens only on Windows x86)
There was a problem hiding this comment.
about the top cap: TimeSignature popup clamps upper to 1-128 and lower to {2,4,8,16,32,64} so I think top cap is not needed, we're checking only the validity there
There was a problem hiding this comment.
from what I see those were init at -1 hence that fix is valid but at the same time now we init with more "normal" values 120 bpm 4/4 so isthis check really still relevant?
e49114a to
ce637c3
Compare
ce637c3 to
e5ef53a
Compare
DIVIDE_BY_ZERO & timecode out-of-sync fix (#11937)
Resolves: #11925
Resolves: #11397
Resolves: EXCEPTION_INT_DIVIDE_BY_ZERO mentioned on Sentry
Recommended:
QA: