Compare commits
No commits in common. "4fd9a0381fb391142b24c4206f28171cbf998119" and "9720c11ecc518baea5f3937a6d6bb2f194af7e28" have entirely different histories.
4fd9a0381f
...
9720c11ecc
@ -140,6 +140,6 @@ class Config(object):
|
|||||||
WIKIPEDIA_ON_NEXT = False
|
WIKIPEDIA_ON_NEXT = False
|
||||||
|
|
||||||
# These rely on earlier definitions
|
# These rely on earlier definitions
|
||||||
HIDE_PLAYED_MODE = HIDE_PLAYED_MODE_TRACKS
|
HIDE_PLAYED_MODE = HIDE_PLAYED_MODE_SECTIONS
|
||||||
IMPORT_DESTINATION = os.path.join(ROOT, "Singles")
|
IMPORT_DESTINATION = os.path.join(ROOT, "Singles")
|
||||||
REPLACE_FILES_DEFAULT_DESTINATION = os.path.dirname(REPLACE_FILES_DEFAULT_SOURCE)
|
REPLACE_FILES_DEFAULT_DESTINATION = os.path.dirname(REPLACE_FILES_DEFAULT_SOURCE)
|
||||||
|
|||||||
@ -63,7 +63,6 @@ from sqlalchemy.orm.session import Session
|
|||||||
import stackprinter # type: ignore
|
import stackprinter # type: ignore
|
||||||
|
|
||||||
# App imports
|
# App imports
|
||||||
from audacity_controller import AudacityController
|
|
||||||
from classes import (
|
from classes import (
|
||||||
ApplicationError,
|
ApplicationError,
|
||||||
Filter,
|
Filter,
|
||||||
@ -73,8 +72,8 @@ from classes import (
|
|||||||
from config import Config
|
from config import Config
|
||||||
from dialogs import TrackSelectDialog
|
from dialogs import TrackSelectDialog
|
||||||
from file_importer import FileImporter
|
from file_importer import FileImporter
|
||||||
|
from helpers import ask_yes_no, file_is_unreadable, get_name
|
||||||
from log import log, log_call
|
from log import log, log_call
|
||||||
from helpers import ask_yes_no, file_is_unreadable, get_name, show_warning
|
|
||||||
from models import db, Playdates, PlaylistRows, Playlists, Queries, Settings, Tracks
|
from models import db, Playdates, PlaylistRows, Playlists, Queries, Settings, Tracks
|
||||||
from music_manager import RowAndTrack, track_sequence
|
from music_manager import RowAndTrack, track_sequence
|
||||||
from playlistmodel import PlaylistModel, PlaylistProxyModel
|
from playlistmodel import PlaylistModel, PlaylistProxyModel
|
||||||
@ -1209,13 +1208,6 @@ class Window(QMainWindow):
|
|||||||
self.load_last_playlists()
|
self.load_last_playlists()
|
||||||
self.stop_autoplay = False
|
self.stop_autoplay = False
|
||||||
|
|
||||||
# Set up for Audacity
|
|
||||||
try:
|
|
||||||
self.ac: Optional[AudacityController] = AudacityController()
|
|
||||||
except ApplicationError as e:
|
|
||||||
self.ac = None
|
|
||||||
show_warning(self, "Audacity error", str(e))
|
|
||||||
|
|
||||||
# # # # # # # # # # Overrides # # # # # # # # # #
|
# # # # # # # # # # Overrides # # # # # # # # # #
|
||||||
|
|
||||||
def closeEvent(self, event: Optional[QCloseEvent]) -> None:
|
def closeEvent(self, event: Optional[QCloseEvent]) -> None:
|
||||||
|
|||||||
@ -34,6 +34,7 @@ from PyQt6.QtWidgets import (
|
|||||||
# import line_profiler
|
# import line_profiler
|
||||||
|
|
||||||
# App imports
|
# App imports
|
||||||
|
from audacity_controller import AudacityController
|
||||||
from classes import ApplicationError, Col, MusicMusterSignals, PlaylistStyle, TrackInfo
|
from classes import ApplicationError, Col, MusicMusterSignals, PlaylistStyle, TrackInfo
|
||||||
from config import Config
|
from config import Config
|
||||||
from dialogs import TrackSelectDialog
|
from dialogs import TrackSelectDialog
|
||||||
@ -307,6 +308,13 @@ class PlaylistTab(QTableView):
|
|||||||
self.setSelectionMode(QAbstractItemView.SelectionMode.ExtendedSelection)
|
self.setSelectionMode(QAbstractItemView.SelectionMode.ExtendedSelection)
|
||||||
self.setSelectionBehavior(QAbstractItemView.SelectionBehavior.SelectRows)
|
self.setSelectionBehavior(QAbstractItemView.SelectionBehavior.SelectRows)
|
||||||
|
|
||||||
|
# Set up for Audacity
|
||||||
|
try:
|
||||||
|
self.ac: Optional[AudacityController] = AudacityController()
|
||||||
|
except ApplicationError as e:
|
||||||
|
self.ac = None
|
||||||
|
show_warning(self.musicmuster, "Audacity error", str(e))
|
||||||
|
|
||||||
# Load model, set column widths
|
# Load model, set column widths
|
||||||
self.setModel(model)
|
self.setModel(model)
|
||||||
self._set_column_widths()
|
self._set_column_widths()
|
||||||
@ -538,8 +546,8 @@ class PlaylistTab(QTableView):
|
|||||||
track_path = base_model.get_row_info(model_row_number).path
|
track_path = base_model.get_row_info(model_row_number).path
|
||||||
|
|
||||||
# Open/import in/from Audacity
|
# Open/import in/from Audacity
|
||||||
if track_row and not this_is_current_row and self.musicmuster.ac:
|
if track_row and not this_is_current_row:
|
||||||
if track_path == self.musicmuster.ac.path:
|
if self.ac and track_path == self.ac.path:
|
||||||
# This track was opened in Audacity
|
# This track was opened in Audacity
|
||||||
self._add_context_menu(
|
self._add_context_menu(
|
||||||
"Update from Audacity",
|
"Update from Audacity",
|
||||||
@ -649,8 +657,8 @@ class PlaylistTab(QTableView):
|
|||||||
that we have an edit open.
|
that we have an edit open.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if self.musicmuster.ac:
|
if self.ac:
|
||||||
self.musicmuster.ac.path = None
|
self.ac.path = None
|
||||||
|
|
||||||
def clear_selection(self) -> None:
|
def clear_selection(self) -> None:
|
||||||
"""Unselect all tracks and reset drag mode"""
|
"""Unselect all tracks and reset drag mode"""
|
||||||
@ -852,10 +860,10 @@ class PlaylistTab(QTableView):
|
|||||||
Import current Audacity track to passed row
|
Import current Audacity track to passed row
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if not self.musicmuster.ac:
|
if not self.ac:
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
self.ac.musicmuster.export()
|
self.ac.export()
|
||||||
self._rescan(row_number)
|
self._rescan(row_number)
|
||||||
except ApplicationError as e:
|
except ApplicationError as e:
|
||||||
show_warning(self.musicmuster, "Audacity error", str(e))
|
show_warning(self.musicmuster, "Audacity error", str(e))
|
||||||
@ -912,16 +920,15 @@ class PlaylistTab(QTableView):
|
|||||||
Open track in passed row in Audacity
|
Open track in passed row in Audacity
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if not self.musicmuster.ac:
|
|
||||||
return
|
|
||||||
|
|
||||||
path = self.get_base_model().get_row_track_path(row_number)
|
path = self.get_base_model().get_row_track_path(row_number)
|
||||||
if not path:
|
if not path:
|
||||||
log.error(f"_open_in_audacity: can't get path for {row_number=}")
|
log.error(f"_open_in_audacity: can't get path for {row_number=}")
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.musicmuster.ac.open(path)
|
if not self.ac:
|
||||||
|
self.ac = AudacityController()
|
||||||
|
self.ac.open(path)
|
||||||
except ApplicationError as e:
|
except ApplicationError as e:
|
||||||
show_warning(self.musicmuster, "Audacity error", str(e))
|
show_warning(self.musicmuster, "Audacity error", str(e))
|
||||||
|
|
||||||
|
|||||||
@ -33,7 +33,6 @@ dependencies = [
|
|||||||
"types-pyyaml>=6.0.12.20241230",
|
"types-pyyaml>=6.0.12.20241230",
|
||||||
"dogpile-cache>=1.3.4",
|
"dogpile-cache>=1.3.4",
|
||||||
"pdbpp>=0.10.3",
|
"pdbpp>=0.10.3",
|
||||||
"filetype>=1.2.0",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[dependency-groups]
|
[dependency-groups]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user