Compare commits
No commits in common. "5d3d373abc68cba3999926f169355d43879346da" and "1da0668807808055282f75d9604c6f5a1d0c9d63" have entirely different histories.
5d3d373abc
...
1da0668807
@ -215,8 +215,10 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
self.btnFade.clicked.connect(self.fade)
|
||||
self.btnHidePlayed.clicked.connect(self.hide_played)
|
||||
self.btnStop.clicked.connect(self.stop)
|
||||
self.hdrCurrentTrack.clicked.connect(self.show_current)
|
||||
self.hdrNextTrack.clicked.connect(self.show_next)
|
||||
self.hdrCurrentTrack.clicked.connect(
|
||||
lambda: self.tabPlaylist.currentWidget().scroll_current_to_top())
|
||||
self.hdrNextTrack.clicked.connect(
|
||||
lambda: self.tabPlaylist.currentWidget().scroll_next_to_top())
|
||||
self.tabPlaylist.currentChanged.connect(
|
||||
lambda: self.tabPlaylist.currentWidget().tab_visible())
|
||||
self.tabPlaylist.tabCloseRequested.connect(self.close_tab)
|
||||
@ -770,20 +772,6 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
idx = self.tabPlaylist.indexOf(widget)
|
||||
self.tabPlaylist.tabBar().setTabTextColor(idx, colour)
|
||||
|
||||
def show_current(self) -> None:
|
||||
"""Scroll to show current track"""
|
||||
|
||||
if self.current_track_playlist_tab != self.visible_playlist_tab:
|
||||
self.tabPlaylist.setCurrentWidget(self.current_track_playlist_tab)
|
||||
self.tabPlaylist.currentWidget().scroll_current_to_top()
|
||||
|
||||
def show_next(self) -> None:
|
||||
"""Scroll to show next track"""
|
||||
|
||||
if self.next_track_playlist_tab != self.visible_playlist_tab:
|
||||
self.tabPlaylist.setCurrentWidget(self.next_track_playlist_tab)
|
||||
self.tabPlaylist.currentWidget().scroll_next_to_top()
|
||||
|
||||
def stop(self) -> None:
|
||||
"""Stop playing immediately"""
|
||||
|
||||
@ -949,18 +937,6 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
if self.playing:
|
||||
self.stop_playing()
|
||||
|
||||
def update_current_track(self, track):
|
||||
"""Update current track with passed details"""
|
||||
|
||||
self.current_track = TrackData(track)
|
||||
self.update_headers()
|
||||
|
||||
def update_next_track(self, track):
|
||||
"""Update next track with passed details"""
|
||||
|
||||
self.next_track = TrackData(track)
|
||||
self.update_headers()
|
||||
|
||||
def update_headers(self) -> None:
|
||||
"""
|
||||
Update last / current / next track headers
|
||||
|
||||
@ -432,17 +432,10 @@ class PlaylistTab(QTableWidget):
|
||||
if track_id:
|
||||
track = session.get(Tracks, track_id)
|
||||
if track:
|
||||
update_current = row == self._get_current_track_row()
|
||||
update_next = row == self._get_next_track_row()
|
||||
if self.edit_cell_type == "title":
|
||||
track.title = new_text
|
||||
elif self.edit_cell_type == "artist":
|
||||
track.artist = new_text
|
||||
if update_current:
|
||||
self.musicmuster.update_current_track(track)
|
||||
elif update_next:
|
||||
self.musicmuster.update_next_track(track)
|
||||
|
||||
# Headers will be incorrect if the edited track is
|
||||
# previous / current / next TODO: this will require
|
||||
# the stored data in musicmuster to be updated,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user