v0.103.1: holding the vocals slider's mic or note changes only the deck's whole-song waveform at the bottom, not the zoomed one in the middle

This commit is contained in:
2026-11-27 10:38:31 -08:00
parent fa6f99d639
commit d1799afa79
4 changed files with 22 additions and 5 deletions
+2 -1
View File
@@ -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 (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 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 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 (`DeckView.preview` → `shown_peaks`, from `stem_peaks`, worked out when
the stems decode); the slider doesn't move and the sound never changes. the stems decode); the slider doesn't move and the sound never changes.
Sync is **sticky**: a synced deck Sync is **sticky**: a synced deck
+1 -1
View File
@@ -1,3 +1,3 @@
"""LinTunes — iTunes-style music library manager and player for Linux.""" """LinTunes — iTunes-style music library manager and player for Linux."""
__version__ = "0.103.0" __version__ = "0.103.1"
+3 -3
View File
@@ -88,7 +88,8 @@ class DeckView:
def shown_peaks(self) -> np.ndarray | None: def shown_peaks(self) -> np.ndarray | None:
"""The peaks the waveforms draw: the whole song's, or one stem's """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 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: if self.preview and self.stem_peaks:
return self.stem_peaks.get(self.preview, self.peaks) return self.stem_peaks.get(self.preview, self.peaks)
return self.peaks return self.peaks
@@ -499,7 +500,7 @@ class WaveLanes(QWidget):
p.drawLine(QPointF(w / 2, 0), QPointF(w / 2, h)) p.drawLine(QPointF(w / 2, 0), QPointF(w / 2, h))
def _lane(self, p, view, lane: QRectF, ticks_on_top: bool): def _lane(self, p, view, lane: QRectF, ticks_on_top: bool):
peaks = view.shown_peaks peaks = view.peaks
deck = view.deck deck = view.deck
if peaks is None or deck.source is None: if peaks is None or deck.source is None:
p.setPen(QColor("#5a5a5a")) p.setPen(QColor("#5a5a5a"))
@@ -1946,7 +1947,6 @@ class DjShelf(QWidget):
"""Show one stem's waveform for this deck (``None``: the whole """Show one stem's waveform for this deck (``None``: the whole
song's again). Only the drawing changes, never the sound.""" song's again). Only the drawing changes, never the sound."""
view.preview = kind view.preview = kind
self.lanes.update()
self.overviews[view.name].update() self.overviews[view.name].update()
def _on_stem_failed(self, path: str, why: str, engine: str = stems.HQ): def _on_stem_failed(self, path: str, why: str, engine: str = stems.HQ):
+16
View File
@@ -63,7 +63,23 @@ def test_the_waveforms_show_the_held_stem(shelf):
assert a.shown_peaks is full assert a.shown_peaks is full
assert a.deck.vocal_mix == 0 # what plays is untouched assert a.deck.vocal_mix == 0 # what plays is untouched
shelf.overviews["A"].grab() # paints with the stem's peaks 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() 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): def test_no_split_yet_shows_the_whole_song(shelf):