Skip to content

CMRT 30: Library table CMRT track name column - #41

Open
Swarnadip-Kar wants to merge 10 commits into
gsoc-cmrt-phase1.5from
cmrt-library-table-column
Open

CMRT 30: Library table CMRT track name column#41
Swarnadip-Kar wants to merge 10 commits into
gsoc-cmrt-phase1.5from
cmrt-library-table-column

Conversation

@Swarnadip-Kar

Copy link
Copy Markdown
Owner

Introduces a CMRT track name column to the main library table,
showing the canonical track’s “Artist – Title” for any track in a
multi-member CMRT group, along with a color swatch and tooltip.
cmrt_groups/cmrt_members already exist from Phase 1 and are
populated by the grouping pipeline (CMRT 24‑28).

Changes

trackschema.h

  • Add three virtual column name constants (cmrt_track_name,
    cmrt_is_canonical, cmrt_offset) produced by the library_view
    self‑join, following the pattern of LIBRARYTABLE_COVERART.

columncache.h / columncache.cpp

  • Add one visible ColumnCache entry (COLUMN_LIBRARYTABLE_CMRT) and
    two internal‑only entries (CANONICAL, OFFSET) with no display
    name and width 0. The visible column uses kDefaultColumnWidth*3
    to accommodate the “Artist – Title” text alongside the swatch.

librarytablemodel.cpp

  • Extend library_view with LEFT JOINs on cmrt_members, cmrt_groups,
    and a self‑join on library AS cmrt_canonical.
  • Emit cmrt_track_name (canonical track’s “Artist – Title”),
    cmrt_is_canonical (cg.canonical_track_id = library.id), and a
    gated cmrt_offset (NULL unless group_id is present).
  • Qualify the formerly bare mixxx_deleted reference as
    library.mixxx_deleted to avoid ambiguity with the self‑join.
  • Qualify coverart_digest as library.coverart_digest for the
    same reason.
  • Mark cmrt_is_canonical and cmrt_offset as internal columns
    (isColumnInternal).
  • Hide the CMRT column by default (isColumnHiddenByDefault) since
    most libraries have few multi‑member CMRT groups.

basetracktablemodel.h

  • Document the three new virtual columns in the rawValue() comment
    (same style as the existing COVERART entry).

basetracktablemodel.cpp

  • Wire Qt::DecorationRole (QVariantMap with isCanonical flag) and
    Qt::ToolTipRole (canonical status or offset text) for the CMRT
    column, reading sibling values via rawSiblingValue().
  • Return the plain “Artist – Title” text for kDataExportRole.
  • Register CmrtDelegate in delegateForColumn().
  • Hide the column by default in isColumnHiddenByDefault().

trackmodel.h / basesqltablemodel.cpp

  • Add SortColumnId::CmrtGroup (appended before IdMax, respecting
    the append‑only contract for controller‑script compat).
  • Map it to COLUMN_LIBRARYTABLE_CMRT in initSortColumnMapping().

cmrtdelegate.h / cmrtdelegate.cpp (new)

  • CmrtDelegate draws a 4px swatch (green = canonical, orange =
    member) followed by elided canonical‑track text.
  • Falls back to “--” when library_view returns NULL (no group or
    lone‑member group).
  • Reuses the hotcue “Green” (0x32BE44) for consistency; member
    color is a distinct orange, not an error red.

CMakeLists.txt

  • Register cmrtdelegate.cpp alongside keydelegate.cpp.

Notes for reviewers

  • Swatch colours deliberately reuse the existing hotcue “Green”
    (0x32BE44) rather than introducing a new green, for visual
    consistency with cue colours elsewhere in Mixxx.
  • Beat‑grid/cue transfer between CMRT members (the “Use CMRT grid &
    cues for CMRT members” preference) is explicitly out of scope
    here—it requires its own design pass.

Depends on: cmrt-fixup-threshold-reanalyze-timestamp (#39)

@coveralls

coveralls commented Jul 2, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 28698862293

Coverage decreased (-0.04%) to 30.251%

Details

  • Coverage decreased (-0.04%) from the base build.
  • Patch coverage: 220 uncovered changes across 5 files (21 of 241 lines covered, 8.71%).
  • 3 coverage regressions across 2 files.

Uncovered Changes

File Changed Covered %
src/library/basetracktablemodel.cpp 100 0 0.0%
src/preferences/dialog/dlgpreffingerprint.cpp 77 0 0.0%
src/library/tabledelegates/cmrtdelegate.cpp 28 0 0.0%
src/library/librarytablemodel.cpp 30 18 60.0%
src/library/tabledelegates/cmrtdelegate.h 3 0 0.0%
Total (7 files) 241 21 8.71%

Coverage Regressions

3 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
src/preferences/dialog/dlgpreffingerprint.cpp 2 0.0%
src/library/basetracktablemodel.cpp 1 9.0%

Coverage Stats

Coverage Status
Relevant Lines: 117029
Covered Lines: 35402
Line Coverage: 30.25%
Coverage Strength: 117724.01 hits per line

💛 - Coveralls

@Swarnadip-Kar
Swarnadip-Kar force-pushed the cmrt-library-table-column branch 3 times, most recently from c99edeb to 4b7b756 Compare July 3, 2026 08:46
@Swarnadip-Kar
Swarnadip-Kar force-pushed the cmrt-library-table-column branch from 4b7b756 to 4d2b15e Compare July 3, 2026 21:17
@Swarnadip-Kar
Swarnadip-Kar changed the base branch from cmrt-fixup-threshold-reanalyze-timestamp to gsoc-cmrt-phase1.5 July 3, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants