aboutsummaryrefslogtreecommitdiffstats
path: root/abcontroller.py
diff options
context:
space:
mode:
Diffstat (limited to 'abcontroller.py')
-rw-r--r--abcontroller.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/abcontroller.py b/abcontroller.py
index e4088b4..3604a85 100644
--- a/abcontroller.py
+++ b/abcontroller.py
@@ -35,11 +35,25 @@ 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
+ def nextStoredAbLimits(self):
+ if self._loadedIndex is None:
+ nextIndex = 0
+ else:
+ nextIndex = self._loadedIndex + 1
+ self.loadLimits(nextIndex)
+
+ def previousStoredAbLimits(self):
+ if self._loadedIndex is None:
+ previousIndex = 0
+ else:
+ previousIndex = self._loadedIndex - 1
+ self.loadLimits(previousIndex)
+
def setLimits(self, aLimit, bLimit):
self._currentLimits = _AB(aLimit, bLimit)
self._loadedIndex = None
@@ -62,3 +76,4 @@ class ABController:
def clear(self):
self.__init__(enabled=self._enabled, callback=self._setPositionCallback)
+