Add sync preview, restore Detect All Claps button, reorder markers panel

- Preview Sync button builds a short (8s) lossless clip around the
  marked events with the current offset applied, and plays it in a
  small popup PreviewDialog (its own independent PlayerWidget/mpv
  instance) -- lets you check the fix sounds/looks right before
  committing to a full export. ExportWorker gained optional
  clip_start/clip_duration so both the real export and this preview
  share the same underlying export_synced() call.
- Detect All Claps is back as a button in the Sync markers panel
  (alongside Mark Audio/Video Event), in addition to staying in the
  Tools menu -- both widgets' enabled state are kept in sync.
- Sync markers panel now shows Mark Audio Event before Mark Video
  Event.

The clip-mode branch of ffmpeg_export.py (the -ss/-t-on-both-inputs
path ffdelay's own notes flag as easy to get subtly wrong) hadn't been
covered by the existing roundtrip test, which only exercised full-file
export -- added a clip-mode case there, independently verified via the
same scene-change/silence-detection technique as the other cases:
29.4ms drift after the fix, well under one frame.

All of this was built and verified entirely on a virtual Xvfb display
(DISPLAY=:99) per the user's request to stop interrupting their real
desktop -- real mouse clicks and a real (non-monkeypatched) preview
dialog were exercised there, screenshotted, and confirmed correct,
without ever touching the real screen.
This commit is contained in:
ThePendulum
2026-07-26 03:01:06 +02:00
parent 6f76b3f15a
commit eb7c1aa500
4 changed files with 277 additions and 18 deletions
+7 -3
View File
@@ -30,13 +30,17 @@ def main():
win.show()
qapp.processEvents()
# -- Tools menu has the clap detection actions, no buttons in the layout
# -- Tools menu has the clap detection actions, AND Detect All Claps is
# also back as a button in the Sync markers panel (both should reflect
# the same enabled state, kept in sync explicitly since they're two
# separate widgets).
menu_titles = [a.text() for a in win.menuBar().actions()]
assert "&Tools" in menu_titles, f"expected a Tools menu, got {menu_titles}"
assert not hasattr(win, "detect_all_button"), "old button attribute should be gone"
assert win.detect_all_action.text() == "Detect All Claps"
assert win.detect_next_action.text() == "Detect Next Clap"
print("PASS: Tools menu has plain-labeled clap detection actions")
assert win.detect_all_button.text() == "Detect All Claps"
assert win.detect_all_action.isEnabled() == win.detect_all_button.isEnabled()
print("PASS: Tools menu has plain-labeled clap detection actions, button back in sync markers panel")
# -- Load via drag-and-drop simulation on the player widget
mime = QMimeData()