feat: waveform view/selection state + band/handle painting

This commit is contained in:
2026-07-02 16:56:36 +02:00
parent ee7de4d83c
commit 7ca894d585
2 changed files with 66 additions and 9 deletions
+16
View File
@@ -398,6 +398,22 @@ def test_waveform_strip_present_and_safe(win):
win._on_wave_refresh()
def test_waveform_view_and_selection(win):
w = win._wave
w.set_view(10.0, 4.0)
w.set_selection(11.0, 12.5)
assert w._view_start == 10.0 and w._view_dur == 4.0
assert w.selection() == (11.0, 12.5)
# selection clamps into the view window and keeps start < end
w.set_selection(9.0, 20.0)
s, e = w.selection()
assert s >= 10.0 and e <= 14.0 and s < e
w.set_peaks([0.1, 0.9, 0.3]) # still paints without crashing
w.set_playhead(11.5)
w.clear() # resets display state
assert w.selection() is None
def test_audition_button_present_and_safe(win):
from PyQt6.QtWidgets import QPushButton
assert isinstance(win._btn_audio_play, QPushButton)