Compare commits
No commits in common. "87d2d7adae683cd762f7bf306fd6144f774928b7" and "f2867deb2fb90603ad17c5829aecb95a7609f6e4" have entirely different histories.
87d2d7adae
...
f2867deb2f
@ -23,9 +23,7 @@ from PyQt6.QtCore import (
|
|||||||
from PyQt6.QtGui import (
|
from PyQt6.QtGui import (
|
||||||
QCloseEvent,
|
QCloseEvent,
|
||||||
QColor,
|
QColor,
|
||||||
QKeySequence,
|
|
||||||
QPalette,
|
QPalette,
|
||||||
QShortcut,
|
|
||||||
)
|
)
|
||||||
from PyQt6.QtWidgets import (
|
from PyQt6.QtWidgets import (
|
||||||
QApplication,
|
QApplication,
|
||||||
@ -249,7 +247,6 @@ class PreviewManager:
|
|||||||
|
|
||||||
def stop(self) -> None:
|
def stop(self) -> None:
|
||||||
mixer.music.stop()
|
mixer.music.stop()
|
||||||
mixer.music.unload()
|
|
||||||
self.path = ""
|
self.path = ""
|
||||||
self.row_number = None
|
self.row_number = None
|
||||||
self.track_id = 0
|
self.track_id = 0
|
||||||
@ -299,10 +296,6 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
self.catch_return_key = False
|
self.catch_return_key = False
|
||||||
self.load_last_playlists()
|
self.load_last_playlists()
|
||||||
|
|
||||||
# Set up shortcut key for instant logging from keyboard
|
|
||||||
self.action_quicklog = QShortcut(QKeySequence("Ctrl+L"), self)
|
|
||||||
self.action_quicklog.activated.connect(self.quicklog)
|
|
||||||
|
|
||||||
def about(self) -> None:
|
def about(self) -> None:
|
||||||
"""Get git tag and database name"""
|
"""Get git tag and database name"""
|
||||||
|
|
||||||
@ -1058,7 +1051,6 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
|
|
||||||
Actions required:
|
Actions required:
|
||||||
- If there is no next track set, return.
|
- If there is no next track set, return.
|
||||||
- Check for inadvertent press of return
|
|
||||||
- If there's currently a track playing, fade it.
|
- If there's currently a track playing, fade it.
|
||||||
- Move next track to current track.
|
- Move next track to current track.
|
||||||
- Clear next track
|
- Clear next track
|
||||||
@ -1071,13 +1063,6 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
- Update headers
|
- Update headers
|
||||||
"""
|
"""
|
||||||
|
|
||||||
log.debug(f"issue223: play_next({position=})")
|
|
||||||
|
|
||||||
# If there is no next track set, return.
|
|
||||||
if track_sequence.next is None:
|
|
||||||
log.error("musicmuster.play_next(): no next track selected")
|
|
||||||
return
|
|
||||||
|
|
||||||
# Check for inadvertent press of 'return'
|
# Check for inadvertent press of 'return'
|
||||||
if track_sequence.current and self.catch_return_key:
|
if track_sequence.current and self.catch_return_key:
|
||||||
# Suppress inadvertent double press
|
# Suppress inadvertent double press
|
||||||
@ -1097,18 +1082,21 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
* 1000
|
* 1000
|
||||||
> Config.PLAY_NEXT_GUARD_MS
|
> Config.PLAY_NEXT_GUARD_MS
|
||||||
)
|
)
|
||||||
if default_yes:
|
|
||||||
msg = "Hit return to play next track now"
|
|
||||||
else:
|
|
||||||
msg = "Press tab to select Yes and hit return to play next track"
|
|
||||||
if not helpers.ask_yes_no(
|
if not helpers.ask_yes_no(
|
||||||
"Play next track",
|
"Track playing",
|
||||||
msg,
|
"Really play next track now?",
|
||||||
default_yes=default_yes,
|
default_yes=default_yes,
|
||||||
parent=self,
|
parent=self,
|
||||||
):
|
):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
log.debug(f"play_next({position=})")
|
||||||
|
|
||||||
|
# If there is no next track set, return.
|
||||||
|
if track_sequence.next is None:
|
||||||
|
log.error("musicmuster.play_next(): no next track selected")
|
||||||
|
return
|
||||||
|
|
||||||
# Issue #223 concerns a very short pause (maybe 0.1s) sometimes
|
# Issue #223 concerns a very short pause (maybe 0.1s) sometimes
|
||||||
# when starting to play at track.
|
# when starting to play at track.
|
||||||
|
|
||||||
@ -1116,7 +1104,7 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
# seconds of playback. Re-enable in update_clocks.
|
# seconds of playback. Re-enable in update_clocks.
|
||||||
|
|
||||||
self.timer10.stop()
|
self.timer10.stop()
|
||||||
log.debug("issue223: play_next: 10ms timer disabled")
|
log.debug("10ms timer disabled")
|
||||||
|
|
||||||
# If there's currently a track playing, fade it.
|
# If there's currently a track playing, fade it.
|
||||||
if track_sequence.current:
|
if track_sequence.current:
|
||||||
@ -1132,35 +1120,32 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
|
|
||||||
# Restore volume if -3dB active
|
# Restore volume if -3dB active
|
||||||
if self.btnDrop3db.isChecked():
|
if self.btnDrop3db.isChecked():
|
||||||
log.debug("issue223: play_next: Reset -3db button")
|
log.debug("Reset -3db button")
|
||||||
self.btnDrop3db.setChecked(False)
|
self.btnDrop3db.setChecked(False)
|
||||||
|
|
||||||
# Play (new) current track
|
# Play (new) current track
|
||||||
track_sequence.current.play(position)
|
track_sequence.current.play(position)
|
||||||
|
|
||||||
# Update clocks now, don't wait for next tick
|
# Update clocks now, don't wait for next tick
|
||||||
log.debug("issue223: play_next: update_clocks()")
|
|
||||||
self.update_clocks()
|
self.update_clocks()
|
||||||
|
|
||||||
# Show closing volume graph
|
# Show closing volume graph
|
||||||
if track_sequence.current.fade_graph:
|
if track_sequence.current.fade_graph:
|
||||||
log.error("issue223: play_next: set up fade_graph")
|
|
||||||
track_sequence.current.fade_graph.GraphWidget = self.widgetFadeVolume
|
track_sequence.current.fade_graph.GraphWidget = self.widgetFadeVolume
|
||||||
track_sequence.current.fade_graph.clear()
|
track_sequence.current.fade_graph.clear()
|
||||||
track_sequence.current.fade_graph.plot()
|
track_sequence.current.fade_graph.plot()
|
||||||
else:
|
else:
|
||||||
log.error("issue223: play_next: No fade_graph")
|
log.error("No fade_graph")
|
||||||
|
|
||||||
# Disable play next controls
|
# Disable play next controls
|
||||||
self.catch_return_key = True
|
self.catch_return_key = True
|
||||||
self.show_status_message("Play controls: Disabled", 0)
|
self.show_status_message("Play controls: Disabled", 0)
|
||||||
|
|
||||||
# Notify model
|
# Notify model
|
||||||
log.debug("issue223: play_next: notify model")
|
|
||||||
self.active_proxy_model().current_track_started()
|
self.active_proxy_model().current_track_started()
|
||||||
|
|
||||||
# Update headers
|
# Update headers
|
||||||
log.debug("issue223: play_next: update headers")
|
log.debug("update headers")
|
||||||
self.update_headers()
|
self.update_headers()
|
||||||
with db.Session() as session:
|
with db.Session() as session:
|
||||||
last_played = Playdates.last_played_tracks(session)
|
last_played = Playdates.last_played_tracks(session)
|
||||||
@ -1241,22 +1226,6 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
|
|
||||||
self.preview_manager.restart()
|
self.preview_manager.restart()
|
||||||
|
|
||||||
def quicklog(self) -> None:
|
|
||||||
"""
|
|
||||||
Create log entry
|
|
||||||
"""
|
|
||||||
|
|
||||||
log.debug("quicklog")
|
|
||||||
|
|
||||||
# Get log text
|
|
||||||
dlg: QInputDialog = QInputDialog(self)
|
|
||||||
dlg.setInputMode(QInputDialog.InputMode.TextInput)
|
|
||||||
dlg.setLabelText("Log text:")
|
|
||||||
dlg.resize(500, 100)
|
|
||||||
ok = dlg.exec()
|
|
||||||
if ok:
|
|
||||||
log.debug("quicklog: " + dlg.textValue())
|
|
||||||
|
|
||||||
def rename_playlist(self) -> None:
|
def rename_playlist(self) -> None:
|
||||||
"""
|
"""
|
||||||
Rename current playlist
|
Rename current playlist
|
||||||
@ -1655,7 +1624,7 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
and not self.timer10.isActive()
|
and not self.timer10.isActive()
|
||||||
):
|
):
|
||||||
self.timer10.start(10)
|
self.timer10.start(10)
|
||||||
log.debug("issue223: update_clocks: 10ms timer enabled")
|
log.debug("10ms timer enabled")
|
||||||
|
|
||||||
# Elapsed time
|
# Elapsed time
|
||||||
self.label_elapsed_timer.setText(
|
self.label_elapsed_timer.setText(
|
||||||
|
|||||||
@ -646,7 +646,7 @@ class PlaylistTab(QTableView):
|
|||||||
|
|
||||||
def get_selected_row_track_info(self) -> Optional[TrackInfo]:
|
def get_selected_row_track_info(self) -> Optional[TrackInfo]:
|
||||||
"""
|
"""
|
||||||
Return the track_id and row number of the selected
|
Return the track_path, track_id and row number of the selected
|
||||||
row. If no row selected or selected row does not have a track,
|
row. If no row selected or selected row does not have a track,
|
||||||
return None.
|
return None.
|
||||||
"""
|
"""
|
||||||
@ -679,6 +679,8 @@ class PlaylistTab(QTableView):
|
|||||||
def get_selected_rows(self) -> List[int]:
|
def get_selected_rows(self) -> List[int]:
|
||||||
"""Return a list of model-selected row numbers sorted by row"""
|
"""Return a list of model-selected row numbers sorted by row"""
|
||||||
|
|
||||||
|
log.debug("get_selected_rows() called")
|
||||||
|
|
||||||
# Use a set to deduplicate result (a selected row will have all
|
# Use a set to deduplicate result (a selected row will have all
|
||||||
# items in that row selected)
|
# items in that row selected)
|
||||||
result = sorted(
|
result = sorted(
|
||||||
|
|||||||
@ -119,12 +119,10 @@ class _FadeCurve:
|
|||||||
|
|
||||||
if self.region is None:
|
if self.region is None:
|
||||||
# Create the region now that we're into fade
|
# Create the region now that we're into fade
|
||||||
log.debug("issue223: _FadeCurve: create region")
|
|
||||||
self.region = pg.LinearRegionItem([0, 0], bounds=[0, len(self.graph_array)])
|
self.region = pg.LinearRegionItem([0, 0], bounds=[0, len(self.graph_array)])
|
||||||
self.GraphWidget.addItem(self.region)
|
self.GraphWidget.addItem(self.region)
|
||||||
|
|
||||||
# Update region position
|
# Update region position
|
||||||
log.debug("issue223: _FadeCurve: update region")
|
|
||||||
self.region.setRegion([0, ms_of_graph * self.ms_to_array_factor])
|
self.region.setRegion([0, ms_of_graph * self.ms_to_array_factor])
|
||||||
|
|
||||||
|
|
||||||
@ -501,7 +499,6 @@ class _TrackManager:
|
|||||||
def play(self, position: Optional[float] = None) -> None:
|
def play(self, position: Optional[float] = None) -> None:
|
||||||
"""Play track"""
|
"""Play track"""
|
||||||
|
|
||||||
log.debug(f"issue223: _TrackManager: play {self.track_id=}")
|
|
||||||
now = dt.datetime.now()
|
now = dt.datetime.now()
|
||||||
self.start_time = now
|
self.start_time = now
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user