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 (
|
||||
QCloseEvent,
|
||||
QColor,
|
||||
QKeySequence,
|
||||
QPalette,
|
||||
QShortcut,
|
||||
)
|
||||
from PyQt6.QtWidgets import (
|
||||
QApplication,
|
||||
@ -249,7 +247,6 @@ class PreviewManager:
|
||||
|
||||
def stop(self) -> None:
|
||||
mixer.music.stop()
|
||||
mixer.music.unload()
|
||||
self.path = ""
|
||||
self.row_number = None
|
||||
self.track_id = 0
|
||||
@ -299,10 +296,6 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
self.catch_return_key = False
|
||||
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:
|
||||
"""Get git tag and database name"""
|
||||
|
||||
@ -1058,7 +1051,6 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
|
||||
Actions required:
|
||||
- If there is no next track set, return.
|
||||
- Check for inadvertent press of return
|
||||
- If there's currently a track playing, fade it.
|
||||
- Move next track to current track.
|
||||
- Clear next track
|
||||
@ -1071,13 +1063,6 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
- 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'
|
||||
if track_sequence.current and self.catch_return_key:
|
||||
# Suppress inadvertent double press
|
||||
@ -1097,18 +1082,21 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
* 1000
|
||||
> 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(
|
||||
"Play next track",
|
||||
msg,
|
||||
"Track playing",
|
||||
"Really play next track now?",
|
||||
default_yes=default_yes,
|
||||
parent=self,
|
||||
):
|
||||
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
|
||||
# when starting to play at track.
|
||||
|
||||
@ -1116,7 +1104,7 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
# seconds of playback. Re-enable in update_clocks.
|
||||
|
||||
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 track_sequence.current:
|
||||
@ -1132,35 +1120,32 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
|
||||
# Restore volume if -3dB active
|
||||
if self.btnDrop3db.isChecked():
|
||||
log.debug("issue223: play_next: Reset -3db button")
|
||||
log.debug("Reset -3db button")
|
||||
self.btnDrop3db.setChecked(False)
|
||||
|
||||
# Play (new) current track
|
||||
track_sequence.current.play(position)
|
||||
|
||||
# Update clocks now, don't wait for next tick
|
||||
log.debug("issue223: play_next: update_clocks()")
|
||||
self.update_clocks()
|
||||
|
||||
# Show closing volume 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.clear()
|
||||
track_sequence.current.fade_graph.plot()
|
||||
else:
|
||||
log.error("issue223: play_next: No fade_graph")
|
||||
log.error("No fade_graph")
|
||||
|
||||
# Disable play next controls
|
||||
self.catch_return_key = True
|
||||
self.show_status_message("Play controls: Disabled", 0)
|
||||
|
||||
# Notify model
|
||||
log.debug("issue223: play_next: notify model")
|
||||
self.active_proxy_model().current_track_started()
|
||||
|
||||
# Update headers
|
||||
log.debug("issue223: play_next: update headers")
|
||||
log.debug("update headers")
|
||||
self.update_headers()
|
||||
with db.Session() as session:
|
||||
last_played = Playdates.last_played_tracks(session)
|
||||
@ -1241,22 +1226,6 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
|
||||
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:
|
||||
"""
|
||||
Rename current playlist
|
||||
@ -1655,7 +1624,7 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
and not self.timer10.isActive()
|
||||
):
|
||||
self.timer10.start(10)
|
||||
log.debug("issue223: update_clocks: 10ms timer enabled")
|
||||
log.debug("10ms timer enabled")
|
||||
|
||||
# Elapsed time
|
||||
self.label_elapsed_timer.setText(
|
||||
|
||||
@ -646,7 +646,7 @@ class PlaylistTab(QTableView):
|
||||
|
||||
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,
|
||||
return None.
|
||||
"""
|
||||
@ -679,6 +679,8 @@ class PlaylistTab(QTableView):
|
||||
def get_selected_rows(self) -> List[int]:
|
||||
"""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
|
||||
# items in that row selected)
|
||||
result = sorted(
|
||||
|
||||
@ -119,12 +119,10 @@ class _FadeCurve:
|
||||
|
||||
if self.region is None:
|
||||
# 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.GraphWidget.addItem(self.region)
|
||||
|
||||
# Update region position
|
||||
log.debug("issue223: _FadeCurve: update region")
|
||||
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:
|
||||
"""Play track"""
|
||||
|
||||
log.debug(f"issue223: _TrackManager: play {self.track_id=}")
|
||||
now = dt.datetime.now()
|
||||
self.start_time = now
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user