From eab5c690c7a6766c74437c8d79324e652d5c889a Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Thu, 2 Jul 2026 01:11:57 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20audio=20area=20length=20=E2=80=94=20rem?= =?UTF-8?q?ove=20the=20upper=20cap=20+=20step=20by=201s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The audio extract length is meant for visualizing/grabbing sequences that can run minutes long, but the control capped it and stepped in fiddly 0.10s increments. Raise the range to effectively unlimited (24h; ffmpeg stops cleanly at end-of-file if the source is shorter) and make the arrows step 1s — typing still allows sub-second precision. Widen the field for the larger values. Co-Authored-By: Claude Opus 4.8 --- main.py | 13 +++++++++---- tests/test_ui_structure.py | 3 +++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 9d4e3df..301097b 100755 --- a/main.py +++ b/main.py @@ -4439,12 +4439,17 @@ class MainWindow(QMainWindow): # saved via a Save As dialog (format follows the chosen extension). transport_row.addSpacing(12) self._spn_audio_len = QDoubleSpinBox() - self._spn_audio_len.setRange(0.10, 120.0) + # No practical upper cap — audio areas can be minutes long; ffmpeg stops + # cleanly at end-of-file if the source is shorter. Arrows step by 1s; + # type for sub-second precision. + self._spn_audio_len.setRange(0.10, 86400.0) self._spn_audio_len.setDecimals(2) - self._spn_audio_len.setSingleStep(0.10) + self._spn_audio_len.setSingleStep(1.0) self._spn_audio_len.setSuffix(" s") - self._spn_audio_len.setFixedWidth(78) - self._spn_audio_len.setToolTip("Audio area length, measured from the playhead") + self._spn_audio_len.setFixedWidth(92) + self._spn_audio_len.setToolTip( + "Audio area length, measured from the playhead " + "(arrows step 1s; type for finer)") self._spn_audio_len.setValue( float(self._settings.value("audio_extract_len", 3.0))) self._spn_audio_len.valueChanged.connect(self._on_audio_len_changed) diff --git a/tests/test_ui_structure.py b/tests/test_ui_structure.py index 8431856..f3c1721 100644 --- a/tests/test_ui_structure.py +++ b/tests/test_ui_structure.py @@ -251,6 +251,9 @@ def test_extract_audio_controls_exist(win): assert isinstance(win._spn_audio_len, QDoubleSpinBox) # Disabled until a file is loaded. assert not win._btn_extract_audio.isEnabled() + # Arrows step by 1s and there's no practical upper cap (long audio areas). + assert win._spn_audio_len.singleStep() == 1.0 + assert win._spn_audio_len.maximum() >= 3600.0 def test_audio_region_tracks_cursor_and_length(win):