aboutsummaryrefslogtreecommitdiffstats
path: root/abcontroller.py
diff options
context:
space:
mode:
authorEddy Pedroni <eddy@0xf7.com>2022-01-04 13:49:38 +0100
committerEddy Pedroni <eddy@0xf7.com>2022-01-04 13:49:38 +0100
commitedb2ffc66231702c931429ab44ad5009abb8c128 (patch)
tree6b1ad17f45aaf35a8cf0f3cedf03ac71c6611d6c /abcontroller.py
parent67f07cf01155b98321f590e3c18e378018c0a624 (diff)
Added proper volume and playback rate feedback, changed volume steps in MIDI interface
Diffstat (limited to 'abcontroller.py')
-rw-r--r--abcontroller.py7
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)
-