Skip to content

CMRT 32: Add beatgrid/cue overlay for CMRT members ("Use CMRT Data" checkbox) - #47

Open
Swarnadip-Kar wants to merge 9 commits into
cmrt-fixups-stem-mbclear-refreshfrom
cmrt-use-cmrt-beatgrid
Open

CMRT 32: Add beatgrid/cue overlay for CMRT members ("Use CMRT Data" checkbox)#47
Swarnadip-Kar wants to merge 9 commits into
cmrt-fixups-stem-mbclear-refreshfrom
cmrt-use-cmrt-beatgrid

Conversation

@Swarnadip-Kar

Copy link
Copy Markdown
Owner

Lets a CMRT member track load its canonical track's beatgrid and cues in
place of its own -- without touching its own stored data, so unchecking
the box restores exactly what was there before, and without touching the
audio file at all (Engine keeps reading the member's own file).
Toggled per-track via a library checkbox column.

This version puts the redirect inside
Track's own mutators, so every existing caller (CueControl
included) is redirected transparently with zero changes to any of them.

Changes

  • New cmrt_members.use_cmrt_data column + DAO read/write methods.
  • "Use CMRT Data" library checkbox column (CheckboxDelegate, same
    CASE-gated-virtual-column pattern the other CMRT columns already use).
  • Track::applyCmrtOverlay()/clearCmrtOverlay(): swaps a track's own
    cues/beats for a shifted, resampled view of its canonical track's data.
    Handles cross-sample-rate transfers correctly by reprojecting every
    beat marker and cue position through seconds (the one sample-rate-
    independent common unit) rather than a raw frame-offset add.
  • Write-through in createAndAddCue()/removeCue()/trySetBeats()/the
    per-Cue updated() handler, so edits made while the overlay is active
    land on the canonical track, not the local stashed copy.
  • TrackDAO applies the overlay at load time (getTrackById()) and exposes
    apply/restore entry points for the checkbox's live-toggle case.
  • CmrtGroupingService purges overlaying members' cached Track objects on
    canonical re-election, so a stale TrackPointer doesn't linger.

Depends on: cmrt-fixups-stem-mbclear-refresh (#46)

@Swarnadip-Kar
Swarnadip-Kar force-pushed the cmrt-fixups-stem-mbclear-refresh branch from 73d396c to 9b719c8 Compare July 9, 2026 17:42
@Swarnadip-Kar
Swarnadip-Kar force-pushed the cmrt-use-cmrt-beatgrid branch 2 times, most recently from 05344ef to 3f1bb8e Compare July 9, 2026 18:05
@coveralls

coveralls commented Jul 9, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 29039378495

Coverage decreased (-0.07%) to 30.159%

Details

  • Coverage decreased (-0.07%) from the base build.
  • Patch coverage: 343 uncovered changes across 9 files (34 of 377 lines covered, 9.02%).
  • 7 coverage regressions across 4 files.

Uncovered Changes

File Changed Covered %
src/track/track.cpp 177 6 3.39%
src/library/basetracktablemodel.cpp 57 0 0.0%
src/library/dao/trackfingerprintdao.cpp 72 15 20.83%
src/library/dao/trackdao.cpp 37 8 21.62%
src/library/tabledelegates/checkboxdelegate.cpp 15 0 0.0%
src/musicbrainz/cmrtgroupingservice.cpp 6 0 0.0%
src/library/basesqltablemodel.h 5 0 0.0%
src/library/basetracktablemodel.h 2 0 0.0%
src/library/librarytablemodel.cpp 6 5 83.33%

Coverage Regressions

7 previously-covered lines in 4 files lost coverage.

File Lines Losing Coverage Coverage
src/library/basetracktablemodel.cpp 3 8.36%
src/library/dao/trackfingerprintdao.cpp 2 2.03%
src/musicbrainz/cmrtgroupingservice.cpp 1 0.0%
src/track/track.cpp 1 54.36%

Coverage Stats

Coverage Status
Relevant Lines: 117478
Covered Lines: 35430
Line Coverage: 30.16%
Coverage Strength: 58612.69 hits per line

💛 - Coveralls

@Swarnadip-Kar
Swarnadip-Kar force-pushed the cmrt-use-cmrt-beatgrid branch from 3f1bb8e to 90db7c8 Compare July 10, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants