feat: Audio tab QToolBox — Extract & Edit + Scan/Classify panes
This commit is contained in:
@@ -4777,19 +4777,48 @@ class MainWindow(QMainWindow):
|
||||
g.setRowStretch(4, 1); g.setColumnStretch(2, 1)
|
||||
|
||||
def _build_audio_tab(self) -> None:
|
||||
g = QGridLayout(self._tab_audio)
|
||||
outer = QVBoxLayout(self._tab_audio)
|
||||
outer.setContentsMargins(0, 0, 0, 0)
|
||||
tb = QToolBox()
|
||||
|
||||
# ── Page 1: Extract & Edit ───────────────────────────────
|
||||
extract_page = QWidget()
|
||||
g = QGridLayout(extract_page)
|
||||
g.setContentsMargins(8, 6, 8, 6); g.setHorizontalSpacing(8); g.setVerticalSpacing(6)
|
||||
g.addWidget(QLabel("Length:"), 0, 0)
|
||||
g.addWidget(self._spn_audio_len, 0, 1)
|
||||
g.addWidget(QLabel("Format:"), 0, 2)
|
||||
g.addWidget(self._cmb_audio_fmt, 0, 3)
|
||||
g.addWidget(self._group_sep(), 1, 0, 1, 4)
|
||||
g.addWidget(QLabel("Fade in:"), 2, 0)
|
||||
g.addWidget(self._spn_fade_in, 2, 1)
|
||||
g.addWidget(QLabel("Fade out:"), 2, 2)
|
||||
g.addWidget(self._spn_fade_out, 2, 3)
|
||||
g.addWidget(self._chk_normalize, 3, 0, 1, 2)
|
||||
g.addWidget(QLabel("Gain:"), 3, 2)
|
||||
g.addWidget(self._spn_gain, 3, 3)
|
||||
# Row 4 reserved for the waveform strip (added in a later task).
|
||||
g.addWidget(self._btn_extract_audio, 5, 0, 1, 4)
|
||||
g.setColumnStretch(4, 1) # spare gutter column clusters label/field pairs to the left
|
||||
g.setRowStretch(6, 1) # anchor content to the top (row 4 stays reserved for the waveform)
|
||||
tb.addItem(extract_page, "Extract & Edit")
|
||||
|
||||
# ── Page 2: Scan / Classify (moved verbatim) ─────────────
|
||||
scan_page = QWidget()
|
||||
sg = QGridLayout(scan_page)
|
||||
sg.setContentsMargins(8, 6, 8, 6); sg.setHorizontalSpacing(8); sg.setVerticalSpacing(6)
|
||||
model_row = QHBoxLayout()
|
||||
model_row.addWidget(self._cmb_scan_model, 1); model_row.addWidget(self._btn_model_history)
|
||||
g.addWidget(QLabel("Model:"), 0, 0); g.addLayout(model_row, 0, 1, 1, 3)
|
||||
# Row 1: separator — model │ actions
|
||||
g.addWidget(self._group_sep(), 1, 0, 1, 4)
|
||||
g.addWidget(self._btn_scan, 2, 0); g.addWidget(self._btn_auto_export, 2, 1)
|
||||
g.addWidget(self._btn_speech, 2, 2); g.addWidget(self._btn_scan_mode, 2, 3)
|
||||
# Row 3: separator — actions │ fuse/threshold
|
||||
g.addWidget(self._group_sep(), 3, 0, 1, 4)
|
||||
g.addWidget(self._spn_auto_fuse, 4, 0); g.addWidget(self._sld_threshold, 4, 1)
|
||||
g.setColumnStretch(3, 1)
|
||||
sg.addWidget(QLabel("Model:"), 0, 0); sg.addLayout(model_row, 0, 1, 1, 3)
|
||||
sg.addWidget(self._group_sep(), 1, 0, 1, 4)
|
||||
sg.addWidget(self._btn_scan, 2, 0); sg.addWidget(self._btn_auto_export, 2, 1)
|
||||
sg.addWidget(self._btn_speech, 2, 2); sg.addWidget(self._btn_scan_mode, 2, 3)
|
||||
sg.addWidget(self._group_sep(), 3, 0, 1, 4)
|
||||
sg.addWidget(self._spn_auto_fuse, 4, 0); sg.addWidget(self._sld_threshold, 4, 1)
|
||||
sg.setColumnStretch(3, 1)
|
||||
tb.addItem(scan_page, "Scan / Classify")
|
||||
|
||||
outer.addWidget(tb)
|
||||
|
||||
# ── Menu bar ─────────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user