diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2008-10-03 11:41:25 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2008-10-03 11:41:25 +0000 |
| commit | 6696994da0d59a3b483eda65d1dc8b1a9df67cc0 (patch) | |
| tree | 7b246636bd292b1b0234dd11d74c658aacf65e88 /timer.py | |
| parent | bfb6b4765a85a65047655ad4282756ca31229c3e (diff) | |
| download | enigma2-6696994da0d59a3b483eda65d1dc8b1a9df67cc0.tar.gz enigma2-6696994da0d59a3b483eda65d1dc8b1a9df67cc0.zip | |
add code to simulate recordings (with faked frontends)
now its more easy to build a timer overlap detection or similar
Diffstat (limited to 'timer.py')
| -rw-r--r-- | timer.py | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -3,6 +3,8 @@ from time import strftime, time, localtime, mktime from enigma import eTimer import datetime +import NavigationInstance + class TimerEntry: StateWaiting = 0 StatePrepared = 1 @@ -175,6 +177,27 @@ class Timer: insort(self.timer_list, entry) if not noRecalc: self.calcNextActivation() + +# small piece of example code to understand how to use record simulation +# if NavigationInstance.instance: +# lst = [ ] +# cnt = 0 +# for timer in self.timer_list: +# print "timer", cnt +# cnt += 1 +# if timer.state == 0: #waiting +# lst.append(NavigationInstance.instance.recordService(timer.service_ref)) +# else: +# print "STATE: ", timer.state +# +# for rec in lst: +# if rec.start(True): #simulate +# print "FAILED!!!!!!!!!!!!" +# else: +# print "OK!!!!!!!!!!!!!!" +# NavigationInstance.instance.stopRecordService(rec) +# else: +# print "no NAV" def setNextActivation(self, when): delay = int((when - time()) * 1000) |
