from enigma import eListboxPythonMultiContent, eListbox, gFont, iPlayableService, RT_HALIGN_RIGHT
from Screens.FixedMenu import FixedMenu
from Screens.HelpMenu import HelpableScreen
+from ServiceReference import ServiceReference
import bisect
def CutListEntry(where, what):
RET_DELETEMARK = 4
RET_REMOVEBEFORE = 5
RET_REMOVEAFTER = 6
+ RET_GRABFRAME = 7
SHOW_STARTCUT = 0
SHOW_ENDCUT = 1
else:
menu.append((_("remove this mark"), self.removeMark))
+ menu.append((("grab this frame as bitmap"), self.grabFrame))
FixedMenu.__init__(self, session, _("Cut"), menu)
self.skinName = "Menu"
def removeAfter(self):
self.close(self.RET_REMOVEAFTER)
+ def grabFrame(self):
+ self.close(self.RET_GRABFRAME)
class CutList(GUIComponent):
def __init__(self, list):
def showTutorial(self):
if not self.tutorial_seen:
self.tutorial_seen = True
- self.session.open(MessageBox,
- """Welcome to the Cutlist editor.
-
-Seek to the start of the stuff you want to cut away. Press OK, select 'start cut'.
-
-Then seek to the end, press OK, select 'end cut'. That's it.
- """, MessageBox.TYPE_INFO)
+ self.session.open(MessageBox,_("Welcome to the Cutlist editor.\n\nSeek to the start of the stuff you want to cut away. Press OK, select 'start cut'.\n\nThen seek to the end, press OK, select 'end cut'. That's it."), MessageBox.TYPE_INFO)
def checkSkipShowHideLock(self):
pass
# add 'out' point
bisect.insort(self.cut_list, (self.context_position, 1))
self.uploadCuesheet()
+ elif result == CutListContextMenu.RET_GRABFRAME:
+ self.grabFrame()
# we modify the "play" behavior a bit:
# if we press pause while being in slowmotion, we will pause (and not play)
else:
self.pauseService()
+ def grabFrame(self):
+ path = self.session.nav.getCurrentlyPlayingServiceReference().getPath()
+ from Components.Console import Console
+ grabConsole = Console()
+ cmd = 'grab -vblpr%d "%s"' % (180, path.rsplit('.',1)[0] + ".png")
+ grabConsole.ePopen(cmd)
+ self.playpauseService()
+
def main(session, service, **kwargs):
session.open(CutListEditor, service)