feat: Audio tab drives timeline audio-mode; drag the band to set the extract region
This commit is contained in:
@@ -4533,6 +4533,7 @@ class MainWindow(QMainWindow):
|
||||
self._timeline.scan_region_resized.connect(self._on_scan_region_resized)
|
||||
self._timeline.clip_count_delta.connect(self._change_clip_count)
|
||||
self._timeline.autoclip_requested.connect(self._autoclip)
|
||||
self._timeline.audio_region_changed.connect(self._on_wave_selection_changed)
|
||||
|
||||
self._lbl_file = QLabel("← Drop files onto the queue")
|
||||
self._lbl_file.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||
@@ -5231,6 +5232,9 @@ class MainWindow(QMainWindow):
|
||||
panel._pinned = panel._deck_key in _deck_pinned
|
||||
self._refresh_deck_layout()
|
||||
|
||||
# Sync timeline audio-mode to the current deck tab (Export default → off).
|
||||
self._on_deck_tab_changed(self._control_deck.currentIndex())
|
||||
|
||||
# Defer the changelog modal so the window paints/interacts first.
|
||||
QTimer.singleShot(120, self._show_changelog)
|
||||
|
||||
@@ -5269,6 +5273,7 @@ class MainWindow(QMainWindow):
|
||||
deck.addTab(self._tab_audio, self._tab_audio._label)
|
||||
self._control_deck = deck
|
||||
deck.tabBar().pin_toggle_requested.connect(self._on_deck_pin_toggle)
|
||||
deck.currentChanged.connect(self._on_deck_tab_changed)
|
||||
|
||||
# Side-by-side container (shown when 2+ panels are pinned), wrapped in a
|
||||
# stack so the deck can swap between tabbed and split views.
|
||||
@@ -7363,6 +7368,14 @@ class MainWindow(QMainWindow):
|
||||
self._wave.set_peaks(peaks(samples))
|
||||
return samples.size > 0
|
||||
|
||||
def _on_deck_tab_changed(self, _idx: int) -> None:
|
||||
if self._deck_loading:
|
||||
return
|
||||
is_audio = self._control_deck.currentWidget() is self._tab_audio
|
||||
self._timeline.set_audio_mode(is_audio)
|
||||
if is_audio and self._file_path:
|
||||
self._update_audio_region() # ensure the band reflects cursor + length
|
||||
|
||||
def _on_wave_selection_changed(self, s: float, e: float) -> None:
|
||||
if self._wave_syncing:
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user