aboutsummaryrefslogtreecommitdiffstats
path: root/solo-tool-project/src/solo_tool/solo_tool.py
diff options
context:
space:
mode:
Diffstat (limited to 'solo-tool-project/src/solo_tool/solo_tool.py')
-rw-r--r--solo-tool-project/src/solo_tool/solo_tool.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/solo-tool-project/src/solo_tool/solo_tool.py b/solo-tool-project/src/solo_tool/solo_tool.py
index 38e3d11..47e31ca 100644
--- a/solo-tool-project/src/solo_tool/solo_tool.py
+++ b/solo-tool-project/src/solo_tool/solo_tool.py
@@ -25,23 +25,26 @@ class SoloTool:
position = self._player.getPlaybackPosition()
self._abController.positionChanged(position)
- def addSong(self, path):
+ @property
+ def songList(self) -> list[str]:
+ return self._playlist.getSongs()
+
+ def addSong(self, path: str) -> None:
if os.path.isfile(path):
self._sessionManager.addSong(path)
- def setSong(self, index):
+ @property
+ def song(self) -> int:
+ return self._playlist.getCurrentSongIndex()
+
+ @song.setter
+ def song(self, index: int) -> None:
previous = self._playlist.getCurrentSongIndex()
self._playlist.setCurrentSong(index)
new = self._playlist.getCurrentSongIndex()
if previous != new:
self._notifier.notify(Notifier.CURRENT_SONG_EVENT, new)
- def getCurrentSong(self):
- return self._playlist.getCurrentSongIndex()
-
- def getSongs(self):
- return self._playlist.getSongs()
-
def storeAbLimits(self, aLimit, bLimit):
self._abController.storeLimits(aLimit, bLimit)