From edb2ffc66231702c931429ab44ad5009abb8c128 Mon Sep 17 00:00:00 2001 From: Eddy Pedroni Date: Tue, 4 Jan 2022 13:49:38 +0100 Subject: Added proper volume and playback rate feedback, changed volume steps in MIDI interface --- abcontroller.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'abcontroller.py') diff --git a/abcontroller.py b/abcontroller.py index 3604a85..5c9bda7 100644 --- a/abcontroller.py +++ b/abcontroller.py @@ -5,7 +5,7 @@ _AB = namedtuple("_AB", ["a", "b"]) class ABController: def __init__(self, enabled=True, callback=None): self._setPositionCallback = callback - self._limits = dict() # dictionary of all songs + self._limits = {} # dictionary of all songs self._songLimits = None # list of limits for selected song self._currentLimits = _AB(0.0, 0.0) # a/b positions of active limit self._loadedIndex = None @@ -13,7 +13,7 @@ class ABController: def _ensureSongExists(self, path): if path not in self._limits: - self._limits[path] = list() + self._limits[path] = [] def setCurrentSong(self, path): self._ensureSongExists(path) @@ -35,7 +35,7 @@ class ABController: def loadLimits(self, index): if not self._songLimits: return - + if index >= 0 and index < len(self._songLimits): self._currentLimits = self._songLimits[index] self._loadedIndex = index @@ -76,4 +76,3 @@ class ABController: def clear(self): self.__init__(enabled=self._enabled, callback=self._setPositionCallback) - -- cgit v1.2.3