feat: play/stop audition of the current audio region

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-02 15:13:06 +02:00
co-authored by Claude Opus 4.8
parent 7501c4729b
commit c57c078100
2 changed files with 102 additions and 6 deletions
+16
View File
@@ -386,3 +386,19 @@ def test_waveform_strip_present_and_safe(win):
# refresh with no file loaded is a safe no-op
win._file_path = ""
win._on_wave_refresh()
def test_audition_button_present_and_safe(win):
from PyQt6.QtWidgets import QPushButton
assert isinstance(win._btn_audio_play, QPushButton)
assert win._btn_audio_play.isCheckable()
assert win._btn_audio_play.text() == "▶ Play"
# No file loaded -> toggling on must be a safe no-op that snaps back to unchecked.
win._file_path = ""
win._btn_audio_play.setChecked(True) # fires _on_audio_audition(True)
assert win._btn_audio_play.isChecked() is False
# Stopping when nothing is playing must be safe.
win._stop_audition()
assert win._btn_audio_play.isChecked() is False
assert win._btn_audio_play.text() == "▶ Play"
assert win._audition_proc is None