aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2006-02-28 01:44:30 +0000
committerFelix Domke <tmbinc@elitedvb.net>2006-02-28 01:44:30 +0000
commit152165863017eb70db9d824db5a087527824a721 (patch)
treeb91125c65e4eadb21f0dc317ad6ae6d70fabde09 /lib/python
parent2c0fdda82ac02f8436816236b4649819274d1c95 (diff)
downloadenigma2-152165863017eb70db9d824db5a087527824a721.tar.gz
enigma2-152165863017eb70db9d824db5a087527824a721.zip
removing marks from cut editor is now possible. minor hack to seek back one GOP
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Plugins/Extensions/CutListEditor/plugin.py31
-rw-r--r--lib/python/Screens/InfoBarGenerics.py14
2 files changed, 37 insertions, 8 deletions
diff --git a/lib/python/Plugins/Extensions/CutListEditor/plugin.py b/lib/python/Plugins/Extensions/CutListEditor/plugin.py
index 9c016c43..25a5e742 100644
--- a/lib/python/Plugins/Extensions/CutListEditor/plugin.py
+++ b/lib/python/Plugins/Extensions/CutListEditor/plugin.py
@@ -36,19 +36,20 @@ class CutListContextMenu(FixedMenu):
RET_ENDCUT = 1
RET_DELETECUT = 2
RET_MARK = 3
+ RET_DELETEMARK = 4
SHOW_STARTCUT = 0
SHOW_ENDCUT = 1
SHOW_DELETECUT = 2
- def __init__(self, session, state):
+ def __init__(self, session, state, nearmark):
menu = [(_("back"), self.close), (None, )]
if state == self.SHOW_STARTCUT:
menu.append((_("start cut here"), self.startCut))
else:
menu.append((_("start cut here"), ))
-
+
if state == self.SHOW_ENDCUT:
menu.append((_("end cut here"), self.endCut))
else:
@@ -58,12 +59,17 @@ class CutListContextMenu(FixedMenu):
menu.append((_("delete cut"), self.deleteCut))
else:
menu.append((_("delete cut"), ))
-
+
menu.append((None, ))
- menu.append((_("insert mark here"), self.insertMark))
+
+ if not nearmark:
+ menu.append((_("insert mark here"), self.insertMark))
+ else:
+ menu.append((_("remove this mark"), self.removeMark))
+
FixedMenu.__init__(self, session, _("Cut"), menu)
self.skinName = "Menu"
-
+
def startCut(self):
self.close(self.RET_STARTCUT)
@@ -76,6 +82,9 @@ class CutListContextMenu(FixedMenu):
def insertMark(self):
self.close(self.RET_MARK)
+ def removeMark(self):
+ self.close(self.RET_DELETEMARK)
+
class CutList(GUIComponent):
def __init__(self, list):
GUIComponent.__init__(self)
@@ -267,6 +276,8 @@ Then seek to the end, press OK, select 'end cut'. That's it.
self.context_position = curpos
+ self.context_nearest_mark = self.toggleMark(onlyreturn=True)
+
cur_state = self.getStateForPosition(curpos)
if cur_state == 0:
print "currently in 'IN'"
@@ -278,7 +289,12 @@ Then seek to the end, press OK, select 'end cut'. That's it.
print "currently in 'OUT'"
state = CutListContextMenu.SHOW_DELETECUT
- self.session.openWithCallback(self.menuCallback, CutListContextMenu, state)
+ if self.context_nearest_mark is None:
+ nearmark = False
+ else:
+ nearmark = True
+
+ self.session.openWithCallback(self.menuCallback, CutListContextMenu, state, nearmark)
def menuCallback(self, *result):
self.setSeekState(self.SEEK_STATE_PLAY)
@@ -318,6 +334,9 @@ Then seek to the end, press OK, select 'end cut'. That's it.
self.uploadCuesheet()
elif result == CutListContextMenu.RET_MARK:
self.__addMark()
+ elif result == CutListContextMenu.RET_DELETEMARK:
+ self.cut_list.remove(self.context_nearest_mark)
+ self.uploadCuesheet()
def main(session, service):
session.open(CutListEditor, service)
diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py
index 84d04f92..e37730f3 100644
--- a/lib/python/Screens/InfoBarGenerics.py
+++ b/lib/python/Screens/InfoBarGenerics.py
@@ -743,6 +743,11 @@ class InfoBarSeek:
self.SEEK_STATE_SM_EIGHTH: self.SEEK_STATE_PAUSE
}
self.setSeekState(lookup[self.seekstate])
+
+ if self.seekstate == self.SEEK_STATE_PAUSE:
+ seekable = self.getSeek()
+ if seekable is not None:
+ seekable.seekRelative(-1, 2)
def fwdTimerFire(self):
print "Display seek fwd"
@@ -1287,7 +1292,7 @@ class InfoBarCueSheetSupport:
nearest = cp
return nearest
- def toggleMark(self, onlyremove=False, onlyadd=False, tolerance=5*90000):
+ def toggleMark(self, onlyremove=False, onlyadd=False, tolerance=5*90000, onlyreturn=False):
current_pos = self.cueGetCurrentPosition()
if current_pos is None:
print "not seekable"
@@ -1296,10 +1301,15 @@ class InfoBarCueSheetSupport:
nearest_cutpoint = self.getNearestCutPoint(current_pos)
if nearest_cutpoint is not None and abs(nearest_cutpoint[0] - current_pos) < tolerance:
+ if onlyreturn:
+ return nearest_cutpoint
if not onlyadd:
self.removeMark(nearest_cutpoint)
- elif not onlyremove:
+ elif not onlyremove and not onlyreturn:
self.addMark((current_pos, self.CUT_TYPE_MARK))
+
+ if onlyreturn:
+ return None
def addMark(self, point):
bisect.insort(self.cut_list, point)