add support for turning rotor without power measurement
[enigma2.git] / lib / python / Screens / InfoBarGenerics.py
index 195f6d0afda2d68f49c8258eb2548cb77ec93e4a..d6a10012332311e7a39fd00906958038674a51d3 100644 (file)
@@ -769,7 +769,7 @@ class InfoBarSeek:
                if self.seekstate != self.SEEK_STATE_PLAY:
                        self.setSeekState(self.SEEK_STATE_PAUSE)
                        # HACK
-                       self.getSeek().seekRelative(1, -90000)
+                       #self.getSeek().seekRelative(1, -90000)
                        self.setSeekState(self.SEEK_STATE_PLAY)
                else:
                        self.setSeekState(self.SEEK_STATE_PAUSE)
@@ -1232,7 +1232,7 @@ class InfoBarCueSheetSupport:
                        return None
                return service.seek()
 
-       def __getCurrentPosition(self):
+       def cueGetCurrentPosition(self):
                seek = self.__getSeekable()
                if seek is None:
                        return None
@@ -1242,7 +1242,7 @@ class InfoBarCueSheetSupport:
                return long(r[1])
 
        def jumpPreviousNextMark(self, cmp, alternative=None):
-               current_pos = self.__getCurrentPosition()
+               current_pos = self.cueGetCurrentPosition()
                if current_pos is None:
                        return
                mark = self.getNearestCutPoint(current_pos, cmp=cmp)
@@ -1274,17 +1274,18 @@ class InfoBarCueSheetSupport:
                                nearest = cp
                return nearest
 
-       def toggleMark(self):
-               current_pos = self.__getCurrentPosition()
+       def toggleMark(self, onlyremove=False, onlyadd=False, tolerance=5*90000):
+               current_pos = self.cueGetCurrentPosition()
                if current_pos is None:
                        print "not seekable"
                        return
                
                nearest_cutpoint = self.getNearestCutPoint(current_pos)
                
-               if nearest_cutpoint is not None and abs(nearest_cutpoint[0] - current_pos) < 5*90000:
-                       self.removeMark(nearest_cutpoint)
-               else:
+               if nearest_cutpoint is not None and abs(nearest_cutpoint[0] - current_pos) < tolerance:
+                       if not onlyadd:
+                               self.removeMark(nearest_cutpoint)
+               elif not onlyremove:
                        self.addMark((current_pos, self.CUT_TYPE_MARK))
 
        def addMark(self, point):