aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>2006-04-02 22:13:38 +0000
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>2006-04-02 22:13:38 +0000
commitd8733ed57694bbb5309afc396cabe2bfc6f35c16 (patch)
tree68ee8fdc52a52da1db37179e9f2f2834c7806d2a
parentecf05a2de9a95814a3efdc3dafa0a10ad343f82a (diff)
downloadenigma2-d8733ed57694bbb5309afc396cabe2bfc6f35c16.tar.gz
enigma2-d8733ed57694bbb5309afc396cabe2bfc6f35c16.zip
add support for multiple instant recordings
-rw-r--r--data/skin_default.xml3
-rw-r--r--lib/python/Screens/InfoBarGenerics.py63
-rw-r--r--lib/python/Screens/Makefile.am2
-rw-r--r--lib/python/Screens/TimerSelection.py25
-rw-r--r--lib/python/Screens/__init__.py3
5 files changed, 71 insertions, 25 deletions
diff --git a/data/skin_default.xml b/data/skin_default.xml
index 087239a2..d9ec7e7b 100644
--- a/data/skin_default.xml
+++ b/data/skin_default.xml
@@ -128,6 +128,9 @@
<widget name="key_yellow" position="280,0" size="140,40" backgroundColor="yellow" font="Regular;21" />
<widget name="key_blue" position="420,0" size="140,40" backgroundColor="blue" font="Regular;21" />
</screen>
+ <screen name="TimerSelection" position="70,100" size="560,400" title="Timer selection">
+ <widget name="timerlist" position="0,45" size="560,350" scrollbarMode="showOnDemand" />
+ </screen>
<screen name="TimerSanityConflict" position="70,100" size="600,400" title="Timer sanity error">
<widget name="timer1" position="0,45" size="290,80" scrollbarMode="showOnDemand" />
<widget name="timer2" position="310,45" size="280,80" scrollbarMode="showOnDemand" />
diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py
index e96a034d..f8b185f0 100644
--- a/lib/python/Screens/InfoBarGenerics.py
+++ b/lib/python/Screens/InfoBarGenerics.py
@@ -15,6 +15,7 @@ from Components.ServiceEventTracker import ServiceEventTracker
from Components.ServiceName import ServiceName
from Components.config import config, configElement, ConfigSubsection, configSequence, configElementBoolean
from Components.config import configfile, configsequencearg
+from Components.TimerList import TimerEntryComponent
from EpgSelection import EPGSelection
from Plugins.Plugin import PluginDescriptor
@@ -26,6 +27,7 @@ from Screens.EventView import EventViewEPGSelect, EventViewSimple
from Screens.InputBox import InputBox
from Screens.MessageBox import MessageBox
from Screens.MinuteInput import MinuteInput
+from Screens.TimerSelection import TimerSelection
from ServiceReference import ServiceReference
from Tools import Notifications
@@ -983,15 +985,16 @@ class InfoBarInstantRecord:
{
"instantRecord": (self.instantRecord, "Instant Record..."),
})
- self.recording = None
+ self.recording = []
self["BlinkingPoint"] = BlinkingPixmapConditional()
self["BlinkingPoint"].hide()
self["BlinkingPoint"].setConnect(self.session.nav.RecordTimer.isRecording)
- def stopCurrentRecording(self):
- self.session.nav.RecordTimer.removeEntry(self.recording)
- self.recording = None
-
+ def stopCurrentRecording(self, entry = -1):
+ if entry is not None and entry != -1:
+ self.session.nav.RecordTimer.removeEntry(self.recording[entry])
+ self.recording.remove(self.recording[entry])
+
def startInstantRecording(self, limitEvent = False):
serviceref = self.session.nav.getCurrentlyPlayingServiceReference()
@@ -1027,27 +1030,39 @@ class InfoBarInstantRecord:
data = (begin, end, name, description, eventid)
- self.recording = self.session.nav.recordWithTimer(serviceref, *data)
- self.recording.dontSave = True
+ recording = self.session.nav.recordWithTimer(serviceref, *data)
+ recording.dontSave = True
+ self.recording.append(recording)
#self["BlinkingPoint"].setConnect(lambda: self.recording.isRunning())
def isInstantRecordRunning(self):
- if self.recording != None:
- if self.recording.isRunning():
- return True
+ print "self.recording:", self.recording
+ if len(self.recording) > 0:
+ for x in self.recording:
+ if x.isRunning():
+ return True
return False
def recordQuestionCallback(self, answer):
if answer is None or answer[1] == "no":
return
-
- if self.isInstantRecordRunning():
- if answer[1] == "manualduration":
- self.session.openWithCallback(self.inputCallback, InputBox, title=_("How many minutes do you want to record?"), text="5", maxSize=False, type=Input.NUMBER)
+ list = []
+ for x in self.recording:
+ if x.dontSave:
+ list.append(TimerEntryComponent(x, False))
+
+ if answer[1] == "changeduration":
+ if len(self.recording) == 1:
+ self.changeDuration(0)
else:
- self.stopCurrentRecording()
- else:
+ self.session.openWithCallback(self.changeDuration, TimerSelection, list)
+ elif answer[1] == "stop":
+ if len(self.recording) == 1:
+ self.stopCurrentRecording(0)
+ else:
+ self.session.openWithCallback(self.stopCurrentRecording, TimerSelection, list)
+ if answer[1] == "indefinitely" or answer[1] == "manualduration" or answer[1] == "event":
limitEvent = False
if answer[1] == "event":
limitEvent = True
@@ -1055,12 +1070,16 @@ class InfoBarInstantRecord:
self.session.openWithCallback(self.inputCallback, InputBox, title=_("How many minutes do you want to record?"), text="5", maxSize=False, type=Input.NUMBER)
self.startInstantRecording(limitEvent = limitEvent)
+ def changeDuration(self, entry):
+ if entry is not None:
+ self.selectedEntry = entry
+ self.session.openWithCallback(self.inputCallback, InputBox, title=_("How many minutes do you want to record?"), text="5", maxSize=False, type=Input.NUMBER)
+
def inputCallback(self, value):
if value is not None:
print "stopping recording after", int(value), "minutes."
- if self.recording is not None:
- self.recording.end = time.time() + 60 * int(value)
- self.session.nav.RecordTimer.timeChanged(self.recording)
+ self.recording[self.selectedEntry].end = time.time() + 60 * int(value)
+ self.session.nav.RecordTimer.timeChanged(self.recording[self.selectedEntry])
def instantRecord(self):
try:
@@ -1070,11 +1089,9 @@ class InfoBarInstantRecord:
return
if self.isInstantRecordRunning():
- self.session.openWithCallback(self.recordQuestionCallback, ChoiceBox, title=_("A recording is currently running.\nWhat do you want to do?"), list=[(_("stop recording"), "yes"), (_("enter recording duration"), "manualduration"), (_("do nothing"), "no")])
-# self.session.openWithCallback(self.recordQuestionCallback, MessageBox, _("Do you want to stop the current\n(instant) recording?"))
+ self.session.openWithCallback(self.recordQuestionCallback, ChoiceBox, title=_("A recording is currently running.\nWhat do you want to do?"), list=[(_("stop recording"), "stop"), (_("change recording (duration)"), "changeduration"), (_("add recording (indefinitely)"), "indefinitely"), (_("add recording (stop after current event)"), "event"), (_("add recording (enter recording duration)"), "manualduration"), (_("do nothing"), "no")])
else:
- self.session.openWithCallback(self.recordQuestionCallback, ChoiceBox, title=_("Start recording?"), list=[(_("record indefinitely"), "indefinitely"), (_("stop after current event"), "event"), (_("enter recording duration"), "manualduration"),(_("don't record"), "no")])
- #self.session.openWithCallback(self.recordQuestionCallback, MessageBox, _("Start recording?"))
+ self.session.openWithCallback(self.recordQuestionCallback, ChoiceBox, title=_("Start recording?"), list=[(_("add recording (indefinitely)"), "indefinitely"), (_("add recording (stop after current event)"), "event"), (_("add recording (enter recording duration)"), "manualduration"),(_("don't record"), "no")])
from Screens.AudioSelection import AudioSelection
diff --git a/lib/python/Screens/Makefile.am b/lib/python/Screens/Makefile.am
index ea314e24..031e6088 100644
--- a/lib/python/Screens/Makefile.am
+++ b/lib/python/Screens/Makefile.am
@@ -10,4 +10,4 @@ install_PYTHON = \
Dish.py SubserviceSelection.py LanguageSelection.py StartWizard.py \
TutorialWizard.py PluginBrowser.py MinuteInput.py Scart.py PVRState.py \
Console.py InputBox.py ChoiceBox.py SimpleSummary.py ImageWizard.py \
- MediaPlayer.py
+ MediaPlayer.py TimerSelection.py
diff --git a/lib/python/Screens/TimerSelection.py b/lib/python/Screens/TimerSelection.py
new file mode 100644
index 00000000..7a1d9ecd
--- /dev/null
+++ b/lib/python/Screens/TimerSelection.py
@@ -0,0 +1,25 @@
+from Screen import Screen
+from Components.TimerList import TimerList
+from Components.ActionMap import ActionMap
+
+class TimerSelection(Screen):
+ def __init__(self, session, list):
+ Screen.__init__(self, session)
+
+ self.list = list
+
+ self["timerlist"] = TimerList(self.list)
+
+ self["actions"] = ActionMap(["OkCancelActions"],
+ {
+ "ok": self.selected,
+ "cancel": self.leave,
+ }, -1)
+
+
+ def leave(self):
+ self.close(None)
+
+ def selected(self):
+ self.close(self["timerlist"].getCurrentIndex())
+ \ No newline at end of file
diff --git a/lib/python/Screens/__init__.py b/lib/python/Screens/__init__.py
index c25426f4..60bb48d9 100644
--- a/lib/python/Screens/__init__.py
+++ b/lib/python/Screens/__init__.py
@@ -5,4 +5,5 @@ __all__ = ["ChannelSelection", "ClockDisplay", "ConfigMenu",
"Satconfig", "Scanconfig", "Ci.py", "Volume.py", "Mute.py",
"EpgSelection", "EventView", "Standby", "ServiceInfo",
"AudioSelection", "SubserviceSelection", "InfoBarGenerics", "HelpMenu", "Wizard",
- "PVRState", "Console", "InputBox", "ChoiceBox", "SimpleSummary" ]
+ "PVRState", "Console", "InputBox", "ChoiceBox", "SimpleSummary",
+ "TimerSelection" ]