aboutsummaryrefslogtreecommitdiffstats
path: root/abcontroller.py
diff options
context:
space:
mode:
authorEddy Pedroni <eddy@0xf7.com>2021-12-21 22:56:14 +0100
committerEddy Pedroni <eddy@0xf7.com>2021-12-21 22:56:14 +0100
commit6bdde28f33b3e27349731291ee94c043ec238e4d (patch)
tree1f165897eba916bf9293f2ecf23ec1767ffadb5c /abcontroller.py
parent663970d0165e226147d95fb92c617714dfbd7553 (diff)
AB controller integration test added
Diffstat (limited to 'abcontroller.py')
-rw-r--r--abcontroller.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/abcontroller.py b/abcontroller.py
index 9d232c1..e9eace4 100644
--- a/abcontroller.py
+++ b/abcontroller.py
@@ -3,8 +3,8 @@ from collections import namedtuple
_AB = namedtuple("_AB", ["a", "b"])
class ABController:
- def __init__(self, enabled=True):
- self.setPositionCallback = None
+ def __init__(self, enabled=True, callback=None):
+ self.setPositionCallback = callback
self._limits = dict() # dictionary of all songs
self._songLimits = None # list of limits for selected song
self._currentLimits = None # a/b positions of selected limit
@@ -42,7 +42,6 @@ class ABController:
def positionChanged(self, position):
if not self._currentLimits:
return
-
if position > self._currentLimits.b and self.setPositionCallback and self._enabled:
self.setPositionCallback(self._currentLimits.a)