diff --git a/CLAUDE.md b/CLAUDE.md index 65c9687..629d9b2 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -586,7 +586,8 @@ persistence) → GUI (Qt widgets that read the manager and connect to its signal (tempo, vocals — `VocalSlider`, a mic and a note over its ends, a small line over the middle — crossfader): a centre line and a snap. Holding the vocals slider's mic or note (Round 135) lights it green and shows - only that stem's waveform in both of the deck's waveforms + only that stem's waveform in the deck's whole-song overview (not the + zoomed lanes) (`DeckView.preview` → `shown_peaks`, from `stem_peaks`, worked out when the stems decode); the slider doesn't move and the sound never changes. Sync is **sticky**: a synced deck diff --git a/lintunes/__init__.py b/lintunes/__init__.py index a890aef..38ec9a8 100644 --- a/lintunes/__init__.py +++ b/lintunes/__init__.py @@ -1,3 +1,3 @@ """LinTunes — iTunes-style music library manager and player for Linux.""" -__version__ = "0.103.0" +__version__ = "0.103.1" diff --git a/lintunes/gui/dj_shelf.py b/lintunes/gui/dj_shelf.py index d120d2d..477a8f7 100644 --- a/lintunes/gui/dj_shelf.py +++ b/lintunes/gui/dj_shelf.py @@ -88,7 +88,8 @@ class DeckView: def shown_peaks(self) -> np.ndarray | None: """The peaks the waveforms draw: the whole song's, or one stem's while its icon on the vocals slider is held (a look only — what - plays doesn't change).""" + plays doesn't change). Only the whole-song overview draws these; + the zoomed lanes always show the whole song.""" if self.preview and self.stem_peaks: return self.stem_peaks.get(self.preview, self.peaks) return self.peaks @@ -499,7 +500,7 @@ class WaveLanes(QWidget): p.drawLine(QPointF(w / 2, 0), QPointF(w / 2, h)) def _lane(self, p, view, lane: QRectF, ticks_on_top: bool): - peaks = view.shown_peaks + peaks = view.peaks deck = view.deck if peaks is None or deck.source is None: p.setPen(QColor("#5a5a5a")) @@ -1946,7 +1947,6 @@ class DjShelf(QWidget): """Show one stem's waveform for this deck (``None``: the whole song's again). Only the drawing changes, never the sound.""" view.preview = kind - self.lanes.update() self.overviews[view.name].update() def _on_stem_failed(self, path: str, why: str, engine: str = stems.HQ): diff --git a/tests/test_round135.py b/tests/test_round135.py index 2694947..5b4cc61 100644 --- a/tests/test_round135.py +++ b/tests/test_round135.py @@ -63,7 +63,23 @@ def test_the_waveforms_show_the_held_stem(shelf): assert a.shown_peaks is full assert a.deck.vocal_mix == 0 # what plays is untouched shelf.overviews["A"].grab() # paints with the stem's peaks + + +def test_the_zoomed_lanes_never_preview(shelf, monkeypatch): + from lintunes.gui import dj_shelf + a, _ = shelf.views + _loaded(shelf, a, shelf.tracks[0], _clicks(124, 0.1, 5), 124.0, 0.1) + n = a.deck.source.frames + shelf._apply_stems("/x.mp3", (np.zeros((n, 2), np.int16), + np.zeros((n, 2), np.int16), "htdemucs")) + shelf.set_preview(a, "vocals") + drawn = [] + real = dj_shelf._pixel_max + monkeypatch.setattr(dj_shelf, "_pixel_max", + lambda peaks, *rest, **k: drawn.append(peaks) or real(peaks, *rest, **k)) shelf.lanes.grab() + assert any(d is a.peaks for d in drawn) + assert not any(d is a.stem_peaks["vocals"] for d in drawn) def test_no_split_yet_shows_the_whole_song(shelf):