From cda8197669409689be291660f93cb288ab2d31b3 Mon Sep 17 00:00:00 2001 From: Eddy Pedroni Date: Sat, 9 Nov 2024 20:35:56 +0100 Subject: Migrate to project-based structure --- playlist.py | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 playlist.py (limited to 'playlist.py') diff --git a/playlist.py b/playlist.py deleted file mode 100644 index 5dad711..0000000 --- a/playlist.py +++ /dev/null @@ -1,41 +0,0 @@ - -class Playlist: - def __init__(self, callback): - self._songList = list() - self._currentSong = None - self._setSongCallback = callback - - def addSong(self, path): - self._songList.append(path) - - def setCurrentSong(self, index): - if index >= 0 and index < len(self._songList): - self._currentSong = index - self._setSongCallback(self._songList[index]) - - def getCurrentSong(self): - index = self._currentSong - return self._songList[index] if index is not None else None - - def getCurrentSongIndex(self): - return self._currentSong - - def getSongs(self): - return self._songList - - def clear(self): - self.__init__(self._setSongCallback) - - def nextSong(self): - if self._currentSong is None: - nextSong = 0 - else: - nextSong = self._currentSong + 1 - self.setCurrentSong(nextSong) - - def previousSong(self): - if self._currentSong is None: - prevSong = 0 - else: - prevSong = self._currentSong - 1 - self.setCurrentSong(prevSong) -- cgit v1.2.3