Rescan after Audacity

This commit is contained in:
Keith Edmunds 2023-12-08 20:54:37 +00:00
parent 83a817234d
commit 0082f76b56
2 changed files with 14 additions and 5 deletions

View File

@ -53,8 +53,10 @@ class AudacityManager:
return
sa_response = self._do_command("SelectAll:")
if sa_response == '\nBatchCommand finished: OK\n':
exp_response = self._do_command(f'Export2: Filename="{self.path}" NumChannels=2')
if sa_response == "\nBatchCommand finished: OK\n":
exp_response = self._do_command(
f'Export2: Filename="{self.path}" NumChannels=2'
)
return exp_response
else:
print("SelectAll response: " + sa_response)
@ -88,10 +90,12 @@ class AudacityManager:
return response
def ask_yes_no(title: str, question: str, default_yes: bool = False) -> bool:
def ask_yes_no(
title: str, question: str, default_yes: bool = False, parent: QMainWindow = None
) -> bool:
"""Ask question; return True for yes, False for no"""
dlg = QMessageBox()
dlg = QMessageBox(parent)
dlg.setWindowTitle(title)
dlg.setText(question)
dlg.setStandardButtons(

View File

@ -571,8 +571,13 @@ class PlaylistTab(QTableView):
audacity = AudacityManager()
audacity.open_file(path)
if ask_yes_no("Export file", "Click yes to export file, no to ignore"):
if ask_yes_no(
"Export file",
"Click yes to export file, no to ignore",
parent=self.musicmuster,
):
audacity.export_file()
self._rescan(row_number)
def _rescan(self, row_number: int) -> None:
"""Rescan track"""