diff options
author | Eddy Pedroni <eddy@0xf7.com> | 2022-01-04 13:49:38 +0100 |
---|---|---|
committer | Eddy Pedroni <eddy@0xf7.com> | 2022-01-04 13:49:38 +0100 |
commit | edb2ffc66231702c931429ab44ad5009abb8c128 (patch) | |
tree | 6b1ad17f45aaf35a8cf0f3cedf03ac71c6611d6c /abcontroller.py | |
parent | 67f07cf01155b98321f590e3c18e378018c0a624 (diff) |
Added proper volume and playback rate feedback, changed volume steps in MIDI interface
Diffstat (limited to 'abcontroller.py')
-rw-r--r-- | abcontroller.py | 7 |
1 files changed, 3 insertions, 4 deletions
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) - |