Implemented displaying of tracks in a QTreeWidget.

This commit is contained in:
The Wobbler 2024-12-28 20:41:18 +01:00
parent 10c36b37a1
commit af2b7b6c8d
11 changed files with 90 additions and 19 deletions

View file

@ -5,8 +5,9 @@ from .track import Track
class Playlist:
def __init__(self, app):
def __init__(self, app, title: str):
self.app = app
self.title = title # playlist title
self.tracks: list[Track] = []
self.current_track_index = 0
self.current_track: Track | None = None
@ -22,7 +23,8 @@ class Playlist:
i += 1
self.current_track = self.tracks[0] # current track is the first track in the playlist
if self.current_track is None: # set current track to the first track if there is no currently playing track
self.current_track = self.tracks[0]
def load_from_m3u(self, path):
file = open(path, "r")
@ -43,7 +45,8 @@ class Playlist:
i += 1
self.current_track = self.tracks[0]
if self.current_track is None: # set current track to the first track if there is no currently playing track
self.current_track = self.tracks[0]
def load_from_wbz(self, path):
pass