Compare commits
No commits in common. "5d95748640c5189715f36cdc435bbe4b87524cef" and "468ecda4507b7ea4cac3e077e8aaa5324a972ba6" have entirely different histories.
5d95748640
...
468ecda450
@ -226,8 +226,12 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
self.move_source_rows: Optional[List[int]] = None
|
||||
self.move_source_model: Optional[PlaylistProxyModel] = None
|
||||
self.audacity_file_path: Optional[str] = None
|
||||
self.audacity_client: Optional[pipeclient.PipeClient] = None
|
||||
self.initialise_audacity()
|
||||
# Initialise Audacity access
|
||||
try:
|
||||
self.audacity_client = pipeclient.PipeClient()
|
||||
log.info(f"{hex(id(self.audacity_client))=}")
|
||||
except RuntimeError as e:
|
||||
log.error(f"Unable to initialise Audacity: {str(e)}")
|
||||
|
||||
if Config.CARTS_HIDE:
|
||||
self.cartsWidget.hide()
|
||||
@ -861,17 +865,6 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
self.import_thread.finished.connect(self.import_thread.deleteLater)
|
||||
self.import_thread.start()
|
||||
|
||||
def initialise_audacity(self) -> None:
|
||||
"""
|
||||
Initialise access to audacity
|
||||
"""
|
||||
|
||||
try:
|
||||
self.audacity_client = pipeclient.PipeClient()
|
||||
log.info(f"{hex(id(self.audacity_client))=}")
|
||||
except RuntimeError as e:
|
||||
log.error(f"Unable to initialise Audacity: {str(e)}")
|
||||
|
||||
def insert_header(self) -> None:
|
||||
"""Show dialog box to enter header text and add to playlist"""
|
||||
|
||||
|
||||
@ -370,15 +370,11 @@ class PlaylistModel(QAbstractTableModel):
|
||||
with Session() as session:
|
||||
for row_number in row_numbers:
|
||||
super().beginRemoveRows(QModelIndex(), row_number, row_number)
|
||||
# We need to remove data from the underlying data store,
|
||||
# which is the database, but we cache in
|
||||
# self.playlist_rows, which is what calls to data()
|
||||
# reads, so fixup that too.
|
||||
PlaylistRows.delete_row(session, self.playlist_id, row_number)
|
||||
PlaylistRows.fixup_rownumbers(session, self.playlist_id)
|
||||
self.refresh_data(session)
|
||||
super().endRemoveRows()
|
||||
|
||||
PlaylistRows.fixup_rownumbers(session, self.playlist_id)
|
||||
self.refresh_data(session)
|
||||
self.reset_track_sequence_row_numbers()
|
||||
|
||||
def display_role(self, row: int, column: int, prd: PlaylistRowData) -> QVariant:
|
||||
@ -1426,7 +1422,7 @@ class PlaylistProxyModel(QSortFilterProxyModel):
|
||||
self.setFilterKeyColumn(-1)
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f"<PlaylistProxyModel: source_model={self.source_model}>"
|
||||
return (f"<PlaylistProxyModel: source_model={self.source_model}>")
|
||||
|
||||
def filterAcceptsRow(self, source_row: int, source_parent: QModelIndex) -> bool:
|
||||
"""
|
||||
|
||||
@ -358,12 +358,6 @@ class PlaylistTab(QTableView):
|
||||
show_warning(self.musicmuster, "Audacity", "Audacity is not running")
|
||||
return False
|
||||
|
||||
if not self.musicmuster.audacity_client:
|
||||
self.musicmuster.initialise_audacity()
|
||||
if not self.musicmuster.audacity_client:
|
||||
log.error("Unable to access Audacity client")
|
||||
return False
|
||||
|
||||
self.musicmuster.audacity_client.write(cmd, timer=True)
|
||||
|
||||
reply = ""
|
||||
@ -677,19 +671,15 @@ class PlaylistTab(QTableView):
|
||||
Open track in passed row in Audacity
|
||||
"""
|
||||
|
||||
if not self.musicmuster.audacity_client:
|
||||
self.musicmuster.initialise_audacity()
|
||||
|
||||
path = self.source_model.get_row_track_path(row_number)
|
||||
if not path:
|
||||
log.error(f"_open_in_audacity: can't get path for {row_number=}")
|
||||
return
|
||||
|
||||
self.musicmuster.audacity_file_path = path
|
||||
escaped_path = path.replace('"', '\\"')
|
||||
cmd = f'Import2: Filename="{escaped_path}"'
|
||||
status = self._audactity_command(cmd)
|
||||
if status:
|
||||
self.musicmuster.audacity_file_path = path
|
||||
|
||||
log.info(f"_open_in_audacity {path=}, {status=}")
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user