# TODO: remove pNavgation, eNavigation and rewrite this stuff in python.
class Navigation:
- def __init__(self):
+ def __init__(self, nextRecordTimerAfterEventActionAuto=False):
if NavigationInstance.instance is not None:
raise NavigationInstance.instance
clearFPWasTimerWakeup()
if getFPWasTimerWakeup(): # sanity check to detect if the FP driver is working correct!
print "buggy fp driver detected!!! please update drivers.... ignore timer wakeup!"
- elif len(self.getRecordings()) or abs(self.RecordTimer.getNextRecordingTime() - time()) <= 360:
+ elif nextRecordTimerAfterEventActionAuto and (len(self.getRecordings()) or abs(self.RecordTimer.getNextRecordingTime() - time()) <= 360):
if not Screens.Standby.inTryQuitMainloop: # not a shutdown messagebox is open
RecordTimer.RecordTimerEntry.TryQuitMainloop(False) # start shutdown handling
self.SleepTimer = SleepTimer.SleepTimer()
NONE = 0
STANDBY = 1
DEEPSTANDBY = 2
+ AUTO = 3
# please do not translate log messages
class RecordTimerEntry(timer.TimerEntry, object):
Notifications.AddNotification(Screens.Standby.TryQuitMainloop, 1, onSessionOpenCallback=RecordTimerEntry.stopTryQuitMainloop, default_yes = default_yes)
#################################################################
- def __init__(self, serviceref, begin, end, name, description, eit, disabled = False, justplay = False, afterEvent = AFTEREVENT.NONE, checkOldTimers = False, dirname = None, tags = None):
+ def __init__(self, serviceref, begin, end, name, description, eit, disabled = False, justplay = False, afterEvent = AFTEREVENT.AUTO, checkOldTimers = False, dirname = None, tags = None):
timer.TimerEntry.__init__(self, int(begin), int(end))
if checkOldTimers == True:
disabled = long(xml.getAttribute("disabled") or "0")
justplay = long(xml.getAttribute("justplay") or "0")
afterevent = str(xml.getAttribute("afterevent") or "nothing")
- afterevent = { "nothing": AFTEREVENT.NONE, "standby": AFTEREVENT.STANDBY, "deepstandby": AFTEREVENT.DEEPSTANDBY }[afterevent]
+ afterevent = {
+ "nothing": AFTEREVENT.NONE,
+ "standby": AFTEREVENT.STANDBY,
+ "deepstandby": AFTEREVENT.DEEPSTANDBY,
+ "auto": AFTEREVENT.AUTO
+ }[afterevent]
if xml.hasAttribute("eit") and xml.getAttribute("eit") != "None":
eit = long(xml.getAttribute("eit"))
else:
list.append(' repeated="' + str(int(timer.repeated)) + '"')
list.append(' name="' + str(stringToXML(timer.name)) + '"')
list.append(' description="' + str(stringToXML(timer.description)) + '"')
- list.append(' afterevent="' + str(stringToXML({ AFTEREVENT.NONE: "nothing", AFTEREVENT.STANDBY: "standby", AFTEREVENT.DEEPSTANDBY: "deepstandby" }[timer.afterEvent])) + '"')
+ list.append(' afterevent="' + str(stringToXML({
+ AFTEREVENT.NONE: "nothing",
+ AFTEREVENT.STANDBY: "standby",
+ AFTEREVENT.DEEPSTANDBY: "deepstandby",
+ AFTEREVENT.AUTO: "auto"
+ }[timer.afterEvent])) + '"')
if timer.eit is not None:
list.append(' eit="' + str(timer.eit) + '"')
if timer.dirname is not None:
return timer.begin
return -1
+ def isNextRecordAfterEventActionAuto(self):
+ now = time.time()
+ t = None
+ for timer in self.timer_list:
+ if timer.justplay or timer.begin < now:
+ continue
+ if t is None or t.begin == timer.begin:
+ t = timer
+ if t.afterEvent == AFTEREVENT.AUTO:
+ return True
+ return False
+
def record(self, entry, ignoreTSC=False, dosave=True): #wird von loadTimer mit dosave=False aufgerufen
timersanitycheck = TimerSanityCheck(self.timer_list,entry)
if not timersanitycheck.check():
"bmp": "picture",
"ts": "movie",
"avi": "movie",
+ "divx": "movie",
"mpg": "movie",
"mpeg": "movie",
"mkv": "movie",
s_minor = int(tmp[1])
for disc in listdir("/dev/discs"):
path = readlink('/dev/discs/'+disc)
- devidex = '/dev'+path[2:]+'/'
- disc = devidex+'disc'
+ devidex = '/dev/discs/'+disc+'/'
+ devidex2 = '/dev'+path[2:]+'/'
+ disc = devidex2+'disc'
ret = stat(disc).st_rdev
if s_major == major(ret) and s_minor == minor(ret):
self.devidex = devidex
- print "new Harddisk", device, self.devidex
+ self.devidex2 = devidex2
+ print "new Harddisk", device, '->', self.devidex, '->', self.devidex2
break
def __lt__(self, ob):
return self.device < ob.device
def bus(self):
- ide_cf = self.device.find("hd") == 0 and self.devidex.find("host0") == -1 # 7025 specific
- internal = self.device.find("hd") == 0 and self.devidex
+ ide_cf = self.device.find("hd") == 0 and self.devidex2.find("host0") == -1 # 7025 specific
+ internal = self.device.find("hd") == 0
if ide_cf:
ret = "External (CF)"
elif internal:
if self.zapFunc and self["key_red"].getText() == "Zap":
self.closeRecursive = True
ref = self["list"].getCurrent()[1]
- self.zapFunc(ref.ref)
+ if ref:
+ self.zapFunc(ref.ref)
def eventSelected(self):
self.infoKeyPressed()
def Plugins(**kwargs):
name = _("Graphical Multi EPG")
descr = _("A graphical EPG for all services of an specific bouquet")
- return [ PluginDescriptor(name=name, description=descr, where = PluginDescriptor.WHERE_EVENTINFO, fnc=main) ]
+ return [ PluginDescriptor(name=name, description=descr, where = PluginDescriptor.WHERE_EVENTINFO, fnc=main),
+ PluginDescriptor(name=name, description=descr, where = PluginDescriptor.WHERE_EXTENSIONSMENU, fnc=main) ]
# 'None' is magic to start at the list of mountpoints
defaultDir = config.mediaplayer.defaultDir.getValue()
- self.filelist = FileList(defaultDir, matchingPattern = "(?i)^.*\.(mp2|mp3|ogg|ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|mkv|mp4|dat|flac)", useServiceRef = True, additionalExtensions = "4098:m3u 4098:e2pls 4098:pls")
+ self.filelist = FileList(defaultDir, matchingPattern = "(?i)^.*\.(mp2|mp3|ogg|ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|mkv|mp4|dat|flac|divx)", useServiceRef = True, additionalExtensions = "4098:m3u 4098:e2pls 4098:pls")
self["filelist"] = self.filelist
self.playlist = MyPlayList()
def createConfig(self):
justplay = self.timer.justplay
- afterevent = { AFTEREVENT.NONE: "nothing", AFTEREVENT.DEEPSTANDBY: "deepstandby", AFTEREVENT.STANDBY: "standby"}[self.timer.afterEvent]
+ afterevent = {
+ AFTEREVENT.NONE: "nothing",
+ AFTEREVENT.DEEPSTANDBY: "deepstandby",
+ AFTEREVENT.STANDBY: "standby",
+ AFTEREVENT.AUTO: "auto"
+ }[self.timer.afterEvent]
weekday_table = ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]
day[weekday] = 1
self.timerentry_justplay = ConfigSelection(choices = [("zap", _("zap")), ("record", _("record"))], default = {0: "record", 1: "zap"}[justplay])
- self.timerentry_afterevent = ConfigSelection(choices = [("nothing", _("do nothing")), ("standby", _("go to standby")), ("deepstandby", _("go to deep standby"))], default = afterevent)
+ self.timerentry_afterevent = ConfigSelection(choices = [("nothing", _("do nothing")), ("standby", _("go to standby")), ("deepstandby", _("go to deep standby")), ("auto", _("auto"))], default = afterevent)
self.timerentry_type = ConfigSelection(choices = [("once",_("once")), ("repeated", _("repeated"))], default = type)
self.timerentry_name = ConfigText(default = self.timer.name, visible_width = 50, fixed_size = False)
self.timerentry_description = ConfigText(default = self.timer.description, visible_width = 50, fixed_size = False)
self.timer.description = self.timerentry_description.value
self.timer.justplay = self.timerentry_justplay.value == "zap"
self.timer.resetRepeated()
- self.timer.afterEvent = {"nothing": AFTEREVENT.NONE, "deepstandby": AFTEREVENT.DEEPSTANDBY, "standby": AFTEREVENT.STANDBY}[self.timerentry_afterevent.value]
+ self.timer.afterEvent = {
+ "nothing": AFTEREVENT.NONE,
+ "deepstandby": AFTEREVENT.DEEPSTANDBY,
+ "standby": AFTEREVENT.STANDBY,
+ "auto": AFTEREVENT.AUTO
+ }[self.timerentry_afterevent.value]
self.timer.service_ref = self.timerentry_service_ref
self.timer.tags = self.timerentry_tags
extensions.push_back("wave");
extensions.push_back("mkv");
extensions.push_back("avi");
+ extensions.push_back("divx");
extensions.push_back("dat");
extensions.push_back("flac");
extensions.push_back("mp4");
sourceinfo.containertype = ctMPEGTS;
else if ( strcasecmp(ext, ".mkv") == 0 )
sourceinfo.containertype = ctMKV;
- else if ( strcasecmp(ext, ".avi") == 0 )
+ else if ( strcasecmp(ext, ".avi") == 0 || strcasecmp(ext, ".divx") == 0)
sourceinfo.containertype = ctAVI;
else if ( strcasecmp(ext, ".mp4") == 0 )
sourceinfo.containertype = ctMP4;
profile("LOAD:Tools")
from Tools.Directories import InitFallbackFiles, resolveFilename, SCOPE_PLUGINS, SCOPE_SKIN_IMAGE
-from Components.config import config, configfile, ConfigText
+from Components.config import config, configfile, ConfigText, ConfigYesNo
InitFallbackFiles()
profile("ReloadProfiles")
eDVBDB.getInstance().reloadBouquets()
config.misc.radiopic = ConfigText(default = resolveFilename(SCOPE_SKIN_IMAGE)+"radio.mvi")
+config.misc.isNextRecordTimerAfterEventActionAuto = ConfigYesNo(default=False)
profile("Twisted")
try:
plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
profile("Init:Session")
- session = Session(desktop = getDesktop(0), summary_desktop = getDesktop(1), navigation = Navigation())
+ nav = Navigation(config.misc.isNextRecordTimerAfterEventActionAuto.value)
+ session = Session(desktop = getDesktop(0), summary_desktop = getDesktop(1), navigation = nav)
CiHandler.setSession(session)
profile("RunReactor")
profile_final()
runReactor()
- profile("configfile.save")
- configfile.save()
profile("wakeup")
from time import time
#get currentTime
nowTime = time()
wakeupList = [
- x for x in
- [session.nav.RecordTimer.getNextRecordingTime(),
- session.nav.RecordTimer.getNextZapTime(),
- plugins.getNextWakeupTime()]
- if x != -1
+ x for x in ((session.nav.RecordTimer.getNextRecordingTime(), 0, session.nav.RecordTimer.isNextRecordAfterEventActionAuto()),
+ (session.nav.RecordTimer.getNextZapTime(), 1),
+ (plugins.getNextWakeupTime(), 2))
+ if x[0] != -1
]
wakeupList.sort()
+ recordTimerWakeupAuto = False
if len(wakeupList):
startTime = wakeupList.pop(0)
- if (startTime - nowTime) < 330: # no time to switch box back on
+ if (startTime[0] - nowTime) < 330: # no time to switch box back on
wptime = nowTime + 30 # so switch back on in 30 seconds
else:
- wptime = startTime - 300
+ wptime = startTime[0] - 300
setFPWakeuptime(wptime)
+ recordTimerWakeupAuto = startTime[1] == 0 and startTime[2]
+ config.misc.isNextRecordTimerAfterEventActionAuto.value = recordTimerWakeupAuto
+ config.misc.isNextRecordTimerAfterEventActionAuto.save()
+
profile("stopService")
session.nav.stopService()
profile("nav shutdown")
session.nav.shutdown()
+ profile("configfile.save")
+ configfile.save()
+
return 0
profile("Init:skin")