Merge branch 'experimental' into vuplus_sum_exper
authorikseong <ikseong@vuplus>
Tue, 29 Jun 2010 10:06:17 +0000 (19:06 +0900)
committerikseong <ikseong@vuplus>
Tue, 29 Jun 2010 10:06:17 +0000 (19:06 +0900)
Conflicts:

lib/dvb/epgcache.cpp
lib/dvb/frontend.cpp
lib/dvb/idvb.h
lib/gdi/lcd.cpp
lib/python/Components/Converter/TemplatedMultiContent.py
lib/python/Components/NimManager.py
lib/python/Components/Renderer/Listbox.py
lib/python/Screens/Satconfig.py
lib/python/Screens/ServiceScan.py
lib/python/Screens/Subtitles.py
po/nl.po

88 files changed:
RecordTimer.py
configure.ac
data/Makefile.am
data/defaults/Dream/Makefile.am
data/defaults/Dream/dm800se.info [new file with mode: 0644]
data/defaults/Dream/settings.800se [new file with mode: 0644]
data/menu.xml
data/setup.xml [changed mode: 0644->0755]
data/skin.xml
data/skin_default.xml
data/skin_default/Makefile.am
data/skin_default/celserviceeventprogressbar.png [new file with mode: 0644]
data/skin_default/icons/Makefile.am [changed mode: 0644->0755]
data/skin_default/icons/lock.png
data/skin_default/icons/lockBouquet.png [new file with mode: 0644]
data/skin_default/icons/network_wired-active.png [new file with mode: 0755]
data/skin_default/icons/network_wired-inactive.png [new file with mode: 0755]
data/skin_default/icons/network_wired.png [new file with mode: 0755]
data/skin_default/icons/network_wireless-active.png [new file with mode: 0755]
data/skin_default/icons/network_wireless-inactive.png [new file with mode: 0755]
data/skin_default/icons/network_wireless.png [new file with mode: 0755]
data/skin_default/icons/unlock.png [new file with mode: 0644]
data/skin_default/icons/unlockBouquet.png [new file with mode: 0644]
data/skin_default/lock.png [deleted file]
data/skin_default/lockBouquet.png [deleted file]
data/skin_default/unlock.png [deleted file]
data/skin_default/unlockBouquet.png [deleted file]
data/unicable.xml [new file with mode: 0644]
doc/TPM [new file with mode: 0644]
lib/base/Makefile.am
lib/base/etpm.cpp [new file with mode: 0644]
lib/base/etpm.h [new file with mode: 0644]
lib/dvb/dvb.cpp
lib/dvb/dvb.h
lib/dvb/epgcache.cpp
lib/dvb/frontend.cpp
lib/dvb/frontend.h
lib/dvb/idvb.h
lib/dvb/sec.cpp
lib/dvb/sec.h
lib/gdi/font.cpp
lib/gdi/font.h
lib/gdi/glcddc.cpp
lib/gdi/gpixmap.cpp
lib/gdi/lcd.cpp
lib/gdi/lcd.h
lib/gui/elistboxcontent.cpp
lib/gui/elistboxcontent.h
lib/python/Components/ConfigList.py
lib/python/Components/Converter/TemplatedMultiContent.py [changed mode: 0644->0755]
lib/python/Components/Ipkg.py
lib/python/Components/Network.py
lib/python/Components/NimManager.py
lib/python/Components/ParentalControl.py
lib/python/Components/RecordingConfig.py [changed mode: 0644->0755]
lib/python/Components/Renderer/Listbox.py [changed mode: 0644->0755]
lib/python/Components/ServiceList.py [changed mode: 0755->0644]
lib/python/Components/UsageConfig.py
lib/python/Components/config.py
lib/python/Plugins/DemoPlugins/Makefile.am
lib/python/Plugins/DemoPlugins/TPMDemo/Makefile.am [new file with mode: 0644]
lib/python/Plugins/DemoPlugins/TPMDemo/README [new file with mode: 0644]
lib/python/Plugins/DemoPlugins/TPMDemo/__init__.py [new file with mode: 0644]
lib/python/Plugins/DemoPlugins/TPMDemo/plugin.py [new file with mode: 0644]
lib/python/Plugins/Extensions/DVDPlayer/plugin.py
lib/python/Plugins/Extensions/MediaPlayer/plugin.py
lib/python/Plugins/Makefile.am
lib/python/Plugins/SystemPlugins/NFIFlash/flasher.py [changed mode: 0644->0755]
lib/python/Plugins/SystemPlugins/NetworkWizard/NetworkWizard.py
lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py
lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py [changed mode: 0644->0755]
lib/python/Plugins/SystemPlugins/WirelessLan/plugin.py
lib/python/Screens/AudioSelection.py [new file with mode: 0644]
lib/python/Screens/InfoBarGenerics.py
lib/python/Screens/Makefile.am
lib/python/Screens/NetworkSetup.py
lib/python/Screens/Satconfig.py
lib/python/Screens/ScanSetup.py
lib/python/Screens/ServiceScan.py
lib/python/Screens/Standby.py
lib/python/enigma_python.i
lib/service/listboxservice.cpp
lib/service/listboxservice.h
lib/service/servicemp3.cpp
main/enigma.cpp
mytest.py
po/nl.po
skin.py

index dc2f6b2..f259e95 100755 (executable)
@@ -129,6 +129,7 @@ class RecordTimerEntry(timer.TimerEntry, object):
        def calculateFilename(self):
                service_name = self.service_ref.getServiceName()
                begin_date = strftime("%Y%m%d %H%M", localtime(self.begin))
+               begin_shortdate = strftime("%Y%m%d", localtime(self.begin))
                
                print "begin_date: ", begin_date
                print "service_name: ", service_name
@@ -137,7 +138,15 @@ class RecordTimerEntry(timer.TimerEntry, object):
                
                filename = begin_date + " - " + service_name
                if self.name:
-                       filename += " - " + self.name
+                       if config.usage.setup_level.index >= 2: # expert+
+                               if config.recording.filename_composition.value == "short":
+                                       filename = begin_shortdate + " - " + self.name
+                               elif config.recording.filename_composition.value == "long":
+                                       filename += " - " + self.name + " - " + self.description
+                               else:
+                                       filename += " - " + self.name # standard
+                       else:
+                               filename += " - " + self.name
 
                if config.recording.ascii_filenames.value:
                        filename = ASCIItranslit.legacyEncode(filename)
index b0d706c..0953e4c 100755 (executable)
@@ -118,6 +118,7 @@ lib/python/Components/Sources/Makefile
 lib/python/Screens/Makefile
 lib/python/Plugins/Makefile
 lib/python/Plugins/DemoPlugins/Makefile
+lib/python/Plugins/DemoPlugins/TPMDemo/Makefile
 lib/python/Plugins/DemoPlugins/TestPlugin/Makefile
 lib/python/Plugins/Extensions/CutListEditor/Makefile
 lib/python/Plugins/Extensions/CutListEditor/meta/Makefile
index 84a5989..1ed9444 100644 (file)
@@ -14,4 +14,5 @@ dist_pkgdata_DATA = \
        skin_default.xml \
        skin.xml \
        startwizard.xml \
-       tutorialwizard.xml
+       tutorialwizard.xml \
+       unicable.xml
index 31ba1c6..cda5583 100644 (file)
@@ -4,10 +4,12 @@ installdir = $(pkgdatadir)/defaults/Dream
 
 dist_install_DATA = \
        bouquets.tv \
+       dm800se.info \
        dm500hd.info \
        dm7025.info \
        dm8000.info \
        dm800.info \
+       settings.800se \
        settings.500hd \
        settings.7025 \
        settings.800 \
diff --git a/data/defaults/Dream/dm800se.info b/data/defaults/Dream/dm800se.info
new file mode 100644 (file)
index 0000000..6974b12
--- /dev/null
@@ -0,0 +1,26 @@
+<default>
+       <prerequisites>
+               <!-- hardware can occur more than once -->
+               <hardware type="dm800se" />
+       </prerequisites>
+       
+       <info>
+               <author>Dream Multimedia GmbH</author>
+               <name>Dream Multimedia Default</name>
+       </info>
+
+               <!-- available types: "directories" -->
+       <files type="directories">
+               <!--file type="skin" directory="test_skin/" flag="default" name="Default Skin" /-->
+               <file type="config" name="settings.800se" />
+               <!--file type="services" name="lamedb.192">
+                       <prerequisites>
+                               <bcastsystem type="DVB-S" />
+                               <satellite type="192" />
+                       </prerequisites>
+               </file-->
+               <file type="favourites" directory="" name="bouquets.tv" />              
+               <file type="favourites" directory="hdbouquets/" name="userbouquet.favourites.tv" />
+               <!--file type="package" directory="packages/" name="small-test_1.0_mipsel.ipk" /-->
+       </files>
+</default>
diff --git a/data/defaults/Dream/settings.800se b/data/defaults/Dream/settings.800se
new file mode 100644 (file)
index 0000000..ae2963b
--- /dev/null
@@ -0,0 +1 @@
+config.misc.rcused=1
\ No newline at end of file
index 9706e20..57b8826 100755 (executable)
@@ -17,7 +17,6 @@
                <item text="Network setup" entryID="network_setup">self.openSetup("network")</item>-->
                <!--<item text="CI"><screen module="Ci" screen="CiSelection" /></item>-->
                <!--<item text="Radio"><code>print "radio mode"</code></item>-->
-               <item level="0" text="Subtitles" entryID="subtitle_selection" weight="40"><screen module="Subtitles" screen="Subtitles" /></item>
                <item level="0" text="Timer" entryID="timer_edit"><screen module="TimerEdit" screen="TimerEditList" /></item>
                <item level="1" text="VCR scart" entryID="scart_switch" requires="ScartSwitch"><code>self.session.scart.VCRSbChanged(3)</code></item>
 
old mode 100644 (file)
new mode 100755 (executable)
index 9425afd..f5dea73
                        <item level="1" text="Change bouquets in quickzap">config.usage.quickzap_bouquet_change</item>
                        <item level="1" text="Alternative radio mode">config.usage.e1like_radio_mode</item>
                        <item level="1" text="Action on long powerbutton press">config.usage.on_long_powerpress</item>
+                       <item level="1" text="Action on short powerbutton press">config.usage.on_short_powerpress</item>
                        <item level="0" text="Infobar timeout">config.usage.infobar_timeout</item>
                        <item level="1" text="12V output" requires="12V_Output">config.usage.output_12V</item>
+                       <item level="0" text="Show event-progress in channel selection">config.usage.show_event_progress_in_servicelist</item>
                        <item level="2" text="Show infobar on channel change">config.usage.show_infobar_on_zap</item>
                        <item level="2" text="Show infobar on skip forward/backward">config.usage.show_infobar_on_skip</item>
                        <item level="2" text="Show infobar on event change">config.usage.show_infobar_on_event_change</item>
@@ -70,6 +72,7 @@
                        <item level="2" text="Behavior of 0 key in PiP-mode">config.usage.pip_zero_button</item>
                        <item level="2" text="Alternative services tuner priority">config.usage.alternatives_priority</item>
                        <item level="2" text="Limited character set for recording filenames">config.recording.ascii_filenames</item>
+                       <item level="2" text="Composition of the recording filenames">config.recording.filename_composition</item>
                </setup>
                <setup key="harddisk" title="Harddisk setup" >
                        <item level="0" text="Harddisk standby after">config.usage.hdd_standby</item>
index 78bd73d..cde03f4 100755 (executable)
                <color name="WindowTitleForeground" color="#ffffff" />
                <color name="WindowTitleBackground" color="#000000" />
        </windowstyle>
+       <windowstyle type="skinned" id="2">
+               <color name="Background" color="#000000" />
+               <color name="LabelForeground" color="#ffffff" />
+               <color name="ListboxBackground" color="#000000" />
+               <color name="ListboxForeground" color="#ffffff" />
+               <color name="ListboxSelectedBackground" color="#000000" />
+               <color name="ListboxSelectedForeground" color="#ffffff" />
+               <color name="ListboxMarkedBackground" color="#000000" />
+               <color name="ListboxMarkedForeground" color="#ffffff" />
+               <color name="ListboxMarkedAndSelectedBackground" color="#000000" />
+               <color name="ListboxMarkedAndSelectedForeground" color="#ffffff" />
+               <color name="WindowTitleForeground" color="#ffffff" />
+               <color name="WindowTitleBackground" color="#000000" />
+       </windowstyle>
        <!-- Fonts -->
        <fonts>
                <!-- <font filename="md_khmurabi_10.ttf" name="Regular" scale="90" /> -->
index 0114349..a2bcc6f 100755 (executable)
                <widget name="statuspic" pixmaps="skin_default/buttons/button_green.png,skin_default/buttons/button_green_off.png" position="130,380" zPosition="10" size="15,16" transparent="1" alphatest="on"/>
        </screen>
        <!-- Audio selection -->
-       <screen name="AudioSelection" position="center,center" size="300,170" title="Audio">
-               <widget name="tracks" position="20,10" size="260,150" scrollbarMode="showOnDemand" />
+       <screen name="AudioSelection" position="center,center" size="560,330" title="Audio">
+               <widget name="config" position="50,10" size="500,110" scrollbarMode="showOnDemand" />
+               
+               <widget source="key_red" render="Pixmap" pixmap="skin_default/buttons/key_red.png" position="10,10" size="35,25" alphatest="on">
+                       <convert type="ConditionalShowHide" />
+               </widget>
+               <widget source="key_green" render="Pixmap" pixmap="skin_default/buttons/key_green.png" position="10,35" size="35,25" alphatest="on">
+                       <convert type="ConditionalShowHide" />
+               </widget>
+               <widget source="key_yellow" render="Pixmap" pixmap="skin_default/buttons/key_yellow.png" position="10,60" size="35,25" alphatest="on">
+                       <convert type="ConditionalShowHide" />
+               </widget>
+               <widget source="key_blue" render="Pixmap" pixmap="skin_default/buttons/key_blue.png" position="10,85" size="35,25" alphatest="on">
+                       <convert type="ConditionalShowHide" />
+               </widget>
+               
+               <ePixmap pixmap="skin_default/div-h.png" position="10,112" zPosition="10" size="540,2" />
+
+               <widget source="streams" render="Listbox" scrollbarMode="showOnDemand" position="10,120" size="540,200" zPosition="3" transparent="1" >
+                       <convert type="TemplatedMultiContent">
+                               {"templates":
+                                       {"default": (25, [ 
+                                               MultiContentEntryText(pos = (0, 0),   size = (35, 25),  font = 0, flags = RT_HALIGN_LEFT,  text = 1), # key,
+                                               MultiContentEntryText(pos = (40, 0),  size = (60, 25),  font = 0, flags = RT_HALIGN_LEFT,  text = 2), # number,
+                                               MultiContentEntryText(pos = (110, 0), size = (120, 25), font = 0, flags = RT_HALIGN_LEFT,  text = 3), # description,
+                                               MultiContentEntryText(pos = (240, 0), size = (200, 25), font = 0, flags = RT_HALIGN_LEFT,  text = 4), # language,
+                                               MultiContentEntryText(pos = (450, 4), size = (90, 25),  font = 1, flags = RT_HALIGN_RIGHT, text = 5), # selection,
+                                       ], True, "showNever"),
+                                       "notselected": (25, [ 
+                                               MultiContentEntryText(pos = (0, 0),   size = (35, 25),  font = 0, flags = RT_HALIGN_LEFT,  text = 1), # key,
+                                               MultiContentEntryText(pos = (40, 0),  size = (60, 25),  font = 0, flags = RT_HALIGN_LEFT,  text = 2), # number,
+                                               MultiContentEntryText(pos = (110, 0), size = (120, 25), font = 0, flags = RT_HALIGN_LEFT,  text = 3), # description,
+                                               MultiContentEntryText(pos = (240, 0), size = (200, 25), font = 0, flags = RT_HALIGN_LEFT,  text = 4), # language,
+                                               MultiContentEntryText(pos = (450, 4), size = (90, 25),  font = 1, flags = RT_HALIGN_RIGHT, text = 5), # selection,
+                                       ], False, "showNever")
+                                       },
+                               "fonts": [gFont("Regular", 20), gFont("Regular", 16)],
+                               "itemHeight": 25
+                               }
+                       </convert>
+               </widget>
        </screen>
        <!-- Bouquet selector -->
        <screen name="BouquetSelector" position="center,center" size="300,240" title="Choose bouquet">
@@ -164,9 +203,7 @@ self.instance.move(ePoint((720-wsizex)/2, (576-wsizey)/(count &gt; 7 and 2 or 3)
 
                </applet>
        </screen>
-       <screen name="ChoiceBox_summary" position="0,0" size="132,64">
-               <widget source="parent.summary_list" render="Label" position="6,0" size="126,64" font="Regular;11" />
-       </screen>       
+
        <!-- Common interface -->
        <screen name="MMIDialog" position="center,center" size="450,270">
                <widget name="title" position="10,10" size="430,25" font="Regular;23" />
@@ -511,10 +548,6 @@ newwidth = wsize[0]
 self.instance.move(ePoint(orgpos.x() + (orgwidth - newwidth)/2, orgpos.y()))
                </applet>
        </screen>
-       <screen name="MessageBox_summary" position="0,0" size="132,64">
-               <widget source="parent.Text" render="Label" position="0,0" size="132,52" font="Regular;11" halign="center" valign="center" />
-               <widget source="parent.selectedChoice" render="Label" position="6,50" size="120,14" font="Regular;14" halign="center" valign="center" />
-       </screen>
        <!-- Minute input -->
        <screen name="MinuteInput" position="center,center" size="280,60" title="Seek">
                <widget name="minutes" position="80,15" size="160,25" halign="right" font="Regular;23" />
@@ -577,7 +610,19 @@ self.instance.move(ePoint(orgpos.x() + (orgwidth - newwidth)/2, orgpos.y()))
                <widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
                <widget source="key_yellow" render="Label" position="280,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#a08500" transparent="1" />
                <widget source="key_blue" render="Label" position="420,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#18188b" transparent="1" />
-               <widget name="list" position="5,50" size="550,280" scrollbarMode="showOnDemand" zPosition="10"/>
+               <widget source="list" render="Listbox" position="5,50" size="550,280" zPosition="10" scrollbarMode="showOnDemand">
+                       <convert type="TemplatedMultiContent"> <!--  iface, name, description, interfacepng, defaultpng, activepng, divpng  -->
+                               {"template": [
+                                               MultiContentEntryText(pos = (85, 6), size = (440, 28), font=0, flags = RT_HALIGN_LEFT|RT_VALIGN_TOP, text = 1), # index 1 is the interfacename
+                                               MultiContentEntryText(pos = (85, 43), size = (440, 20), font=1, flags = RT_HALIGN_LEFT|RT_VALIGN_BOTTOM, text = 2), # index 2 is the description
+                                               MultiContentEntryPixmapAlphaTest(pos = (2, 8), size = (54, 54), png = 3), # index 3 is the interface pixmap
+                                               MultiContentEntryPixmapAlphaTest(pos = (63, 46), size = (15, 16), png = 4), # index 4 is the default pixmap
+                                       ],
+                               "fonts": [gFont("Regular", 28),gFont("Regular", 20)],
+                               "itemHeight": 70
+                               }
+                       </convert>
+               </widget>
                <ePixmap pixmap="skin_default/div-h.png" position="0,340" zPosition="1" size="560,2" />
                <widget source="introduction" render="Label" position="0,350" size="560,50" zPosition="10" font="Regular;21" halign="center" valign="center" backgroundColor="#25062748" transparent="1" />
        </screen>
@@ -935,9 +980,9 @@ self.instance.move(ePoint(orgpos.x() + (orgwidth - newwidth)/2, orgpos.y()))
                </widget>
        </screen>
        <!-- Subtitle selection -->
-       <screen name="Subtitles" position="center,center" size="380,285" title="Subtitle selection">
+<!--   <screen name="Subtitles" position="center,center" size="380,285" title="Subtitle selection">
                <widget name="config" position="10,10" zPosition="1" size="360,275" scrollbarMode="showOnDemand" />
-       </screen>
+       </screen>-->
        <!-- Subtitle area -->
        <screen name="SubtitleDisplay" position="0,0" size="720,576" zPosition="-1" flags="wfNoBorder" backgroundColor="transparent" />
        <!-- TextBox -->
@@ -1042,11 +1087,55 @@ self.instance.move(ePoint(orgpos.x() + (orgwidth - newwidth)/2, orgpos.y()))
                <ePixmap pixmap="skin_default/volume.png" position="0,0" size="214,21" />
                <widget name="Volume" pixmap="skin_default/progress_small.png" position="31,7" zPosition="1" size="168,7" transparent="1" />
        </screen>
+       <!-- JobView -->
+       <screen name="JobView" position="center,center" size="520,350" title="Job View">
+               <widget source="job_name" render="Label" position="20,12" size="480,60" font="Regular;28" />
+               <widget source="job_task" render="Label" position="20,90" size="480,50" font="Regular;23" />
+               <widget source="job_progress" render="Progress" position="20,162" size="480,36" borderWidth="2" backgroundColor="#254f7497" />
+               <widget source="job_progress" render="Label" position="120,166" size="280,32" font="Regular;28" foregroundColor="#000000" zPosition="2" halign="center" transparent="1"  >
+                       <convert type="ProgressToText" />
+               </widget>
+               <widget source="job_status" render="Label" position="20,212" size="480,26" font="Regular;23" />
+               <widget name="config" position="20,254" size="480,20" />
+               <widget source="cancelable" render="Pixmap" pixmap="skin_default/buttons/red.png" position="20,300" size="140,40" alphatest="on" >
+                       <convert type="ConditionalShowHide" />
+               </widget>
+               <widget source="cancelable" render="FixedLabel" text="Cancel" position="20,300" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" >
+                       <convert type="ConditionalShowHide" />
+               </widget>
+               <widget source="finished" render="Pixmap" pixmap="skin_default/buttons/green.png" position="190,300" size="140,40" alphatest="on" >
+                       <convert type="ConditionalShowHide" />
+               </widget>
+               <widget source="finished" render="FixedLabel" text="OK" font="Regular;20" halign="center" valign="center" position="190,300" size="140,40" transparent="1" backgroundColor="#1f771f" >
+                       <convert type="ConditionalShowHide" />
+               </widget>
+               <widget source="backgroundable" render="Pixmap" pixmap="skin_default/buttons/blue.png" position="360,300" size="140,40" alphatest="on" >
+                       <convert type="ConditionalShowHide" />
+               </widget>
+               <widget source="backgroundable" render="FixedLabel" text="Continue in background" font="Regular;20" halign="center" valign="center" position="360,300" size="140,40" transparent="1" backgroundColor="#18188b" >
+                       <convert type="ConditionalShowHide" />
+               </widget>
+       </screen>
+       <!-- VirtualKeyBoard -->
+       <screen name="VirtualKeyBoard" position="center,center" size="560,350" zPosition="99" title="Virtual KeyBoard">
+               <ePixmap pixmap="skin_default/vkey_text.png" position="9,35" zPosition="-4" size="542,52" alphatest="on" />
+               <widget name="header" position="10,10" size="500,20" font="Regular;20" transparent="1" noWrap="1" />
+               <widget name="text" position="12,35" size="536,46" font="Regular;46" transparent="1" noWrap="1" halign="right" />
+               <widget name="list" position="10,100" size="540,225" selectionDisabled="1" transparent="1" />
+       </screen>
+       <!-- FileBrowser -->
+       <screen name="FileBrowser" position="center,center" size="520,430" title="DVD File Browser" >
+               <ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" />
+               <ePixmap pixmap="skin_default/buttons/green.png" position="140,0" size="140,40" alphatest="on" />
+               <widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
+               <widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
+               <widget name="filelist" position="5,50" size="510,370" scrollbarMode="showOnDemand" />
+       </screen>
 
        <!-- LCD/OLED Screens -->
 
        <!-- LCD screen (channelselection) -->
-       <screen name="ChannelSelection_summary" position="0,0" size="132,64">
+       <screen name="ChannelSelection_summary" position="0,0" size="132,64" id="1">
                <widget source="parent.ServiceEvent" render="Label" position="6,0" size="120,25" font="Regular;14" halign="center" valign="center" >
                        <convert type="ServiceName">Name</convert>
                </widget>
@@ -1059,9 +1148,21 @@ self.instance.move(ePoint(orgpos.x() + (orgwidth - newwidth)/2, orgpos.y()))
                <widget source="global.CurrentTime" render="Label" position="100,34" zPosition="1" size="26,30" font="Regular;16" valign="top">
                        <convert type="ClockToText">Format:%S</convert>
                </widget>
+       </screen> 
+       <!-- Color OLED screen (ChannelSelection) -->
+       <screen name="ChannelSelection_summary" position="0,0" size="96,64" id="2">
+               <widget source="parent.ServiceEvent" render="Label" position="0,0" size="96,25" font="Regular;14" halign="center" valign="center" >
+                       <convert type="ServiceName">Name</convert>
+               </widget>
+               <widget source="parent.ServiceEvent" render="Progress" position="0,27" size="96,5" borderWidth="1" >
+                       <convert type="EventTime">Progress</convert>
+               </widget>
+               <widget source="global.CurrentTime" render="Label" position="0,32" size="96,32" font="Regular;32" halign="center" valign="center" foregroundColor="#FFFFFF" backgroundColor="#000000" >
+                       <convert type="ClockToText">Format:%H:%M</convert>
+               </widget>
        </screen>
        <!-- LCD screen (main) -->
-       <screen name="InfoBarSummary" position="0,0" size="132,64">
+       <screen name="InfoBarSummary" position="0,0" size="132,64" id="1">
                <widget source="session.CurrentService" render="Label" position="6,0" size="120,25" font="Regular;14" halign="center" valign="center" >
                        <convert type="ServiceName">Name</convert>
                </widget>
@@ -1079,15 +1180,24 @@ self.instance.move(ePoint(orgpos.x() + (orgwidth - newwidth)/2, orgpos.y()))
                        <convert type="ConditionalShowHide">Blink</convert>
                </widget>
        </screen>
-       <!-- LCD screen (menus) -->
-       <screen name="MenuSummary" position="0,0" size="132,64">
-               <widget source="parent.title" render="Label" position="6,0" size="120,32" font="Regular;14" halign="center" valign="center"/>
-               <widget source="parent.menu" render="Label" position="6,32" size="120,32" font="Regular;16" halign="center" valign="center">
-                       <convert type="StringListSelection" />
+       <!-- Color OLED screen (main) -->
+       <screen name="InfoBarSummary" position="0,0" size="96,64" id="2">
+               <widget source="session.CurrentService" render="Label" position="0,0" size="96,25" font="Regular;14" halign="center" valign="center" >
+                       <convert type="ServiceName">Name</convert>
+               </widget>
+               <widget source="session.Event_Now" render="Progress" position="0,27" size="96,5" borderWidth="1" >
+                       <convert type="EventTime">Progress</convert>
+               </widget>
+               <widget source="global.CurrentTime" render="Label" position="0,32" size="96,32" font="Regular;32" halign="center" valign="center" foregroundColor="#FFFFFF" backgroundColor="#000000" >
+                       <convert type="ClockToText">Format:%H:%M</convert>
+               </widget>
+               <widget source="session.RecordState" render="FixedLabel" text=" " position="0,32" zPosition="1" size="96,32">
+                       <convert type="ConfigEntryTest">config.usage.blinking_display_clock_during_recording,True,CheckSourceBoolean</convert>
+                       <convert type="ConditionalShowHide">Blink</convert>
                </widget>
        </screen>
        <!-- LCD screen (movieplayer) -->
-       <screen name="InfoBarMoviePlayerSummary" position="0,0" size="132,64">
+       <screen name="InfoBarMoviePlayerSummary" position="0,0" size="132,64" id="1">
                <widget source="session.CurrentService" render="Label" position="6,0" size="120,25" font="Regular;14" halign="center" valign="center" >
                        <convert type="ServiceName">Name</convert>
                </widget>
@@ -1102,18 +1212,89 @@ self.instance.move(ePoint(orgpos.x() + (orgwidth - newwidth)/2, orgpos.y()))
                        <convert type="ConditionalShowHide">Blink</convert>
                </widget>
        </screen>
+       <!-- Color OLED screen (movieplayer) -->
+       <screen name="InfoBarMoviePlayerSummary" position="0,0" size="96,64" id="2">
+               <widget source="session.CurrentService" render="Label" position="0,0" size="96,25" font="Regular;14" halign="center" valign="center" >
+                       <convert type="ServiceName">Name</convert>
+               </widget>
+               <widget source="session.CurrentService" render="Progress" position="0,27" size="96,5" borderWidth="1" >
+                       <convert type="ServicePosition">Position</convert>
+               </widget>
+               <widget source="global.CurrentTime" render="Label" position="0,32" size="96,32" font="Regular;32" halign="center" valign="center" foregroundColor="#FFFFFF" backgroundColor="#000000" >
+                       <convert type="ClockToText">Format:%H:%M</convert>
+               </widget>
+               <widget source="session.RecordState" render="FixedLabel" text=" " position="0,32" zPosition="1" size="96,32">
+                       <convert type="ConfigEntryTest">config.usage.blinking_display_clock_during_recording,True,CheckSourceBoolean</convert>
+                       <convert type="ConditionalShowHide">Blink</convert>
+               </widget>
+       </screen>
+       <!-- LCD screen (ChoiceBox) -->
+       <screen name="ChoiceBox_summary" position="0,0" size="132,64" id="1">
+               <widget source="parent.summary_list" render="Label" position="6,0" size="126,64" font="Regular;11" />
+       </screen>
+       <!-- Color OLED screen (ChoiceBox) -->
+       <screen name="ChoiceBox_summary" position="0,0" size="96,64" id="2">
+               <widget source="parent.summary_list" render="Label" position="0,0" size="96,64" font="Regular;10" />
+       </screen>       
+       <!-- LCD screen (MessageBox) -->
+       <screen name="MessageBox_summary" position="0,0" size="132,64" id="1">
+               <widget source="parent.Text" render="Label" position="0,0" size="132,52" font="Regular;11" halign="center" valign="center" />
+               <widget source="parent.selectedChoice" render="Label" position="6,50" size="120,14" font="Regular;14" halign="center" valign="center" />
+       </screen>
+       <!-- Color OLED screen (MessageBox) -->
+       <screen name="MessageBox_summary" position="0,0" size="96,64" id="2">
+               <widget source="parent.Text" render="Label" position="0,0" size="96,52" font="Regular;10" halign="center" valign="center" />
+               <widget source="parent.selectedChoice" render="Label" position="0,50" size="96,14" font="Regular;12" halign="center" valign="center" />
+       </screen>
+
+       <!-- LCD screen (menus) -->
+       <screen name="MenuSummary" position="0,0" size="132,64" id="1">
+               <widget source="parent.title" render="Label" position="6,0" size="120,32" font="Regular;14" halign="center" valign="center"/>
+               <widget source="parent.menu" render="Label" position="6,32" size="120,32" font="Regular;16" halign="center" valign="center">
+                       <convert type="StringListSelection" />
+               </widget>
+       </screen> 
+       <!-- Color OLED screen (menus) -->
+       <screen name="MenuSummary" position="0,0" size="96,64" id="2">
+               <widget source="parent.title" render="Label" position="0,0" size="96,32" font="Regular;14" halign="center" valign="center"/>
+               <widget source="parent.menu" render="Label" position="0,32" size="96,32" font="Regular;14" halign="center" valign="center">
+                       <convert type="StringListSelection" />
+               </widget>
+       </screen>       
+       <!-- LCD screen (ServiceScan) -->
+       <screen name="ServiceScanSummary" position="0,0" size="132,64" id="1">
+               <widget name="Title" position="6,4" size="120,42" font="Regular;16" transparent="1" />
+               <widget name="Service" position="6,22" size="120,26" font="Regular;12" transparent="1" />
+               <widget name="scan_progress" position="6,50" zPosition="1" borderWidth="1" size="56,12" backgroundColor="dark" />
+       </screen>
+       <!-- Color OLED screen (ServiceScan) -->
+       <screen name="ServiceScanSummary" position="0,0" size="96,64" id="2">
+               <widget name="Title" position="0,0" size="96,30" font="Regular;14" transparent="1" />
+               <widget name="Service" position="0,30" size="96,20" font="Regular;10" transparent="1" />
+               <widget name="scan_progress" position="0,50" zPosition="1" borderWidth="1" size="96,12" backgroundColor="dark" />
+       </screen>
        <!-- LCD screen (setup) -->
-       <screen name="SetupSummary" position="0,0" size="132,64">
+       <screen name="SetupSummary" position="0,0" size="132,64" id="1">
                <widget source="SetupTitle" render="Label" position="6,0" size="120,16" font="Regular;12" />
                <widget source="SetupEntry" render="Label" position="6,16" size="120,32" font="Regular;12" />
                <widget source="SetupValue" render="Label" position="6,48" size="120,16" font="Regular;12" />
        </screen>
+       <!-- Color OLED screen (setup) -->
+       <screen name="SetupSummary" position="0,0" size="96,64" id="2">
+               <widget source="SetupTitle" render="Label" position="0,0" size="96,16" font="Regular;10" />
+               <widget source="SetupEntry" render="Label" position="0,16" size="96,32" font="Regular;10" />
+               <widget source="SetupValue" render="Label" position="0,48" size="96,16" font="Regular;10" />
+       </screen>
        <!-- LCD screen (misc) -->
-       <screen name="SimpleSummary" position="0,0" size="132,64">
+       <screen name="SimpleSummary" position="0,0" size="132,64" id="1">
                <widget source="parent.Title" render="Label" position="6,0" size="120,64" font="Regular;16" halign="center" valign="center" />
        </screen>
+       <!-- Color OLED screen (misc) -->
+       <screen name="SimpleSummary" position="0,0" size="96,64" id="2">
+               <widget source="parent.Title" render="Label" position="0,0" size="96,64" font="Regular;14" halign="center" valign="center" />
+       </screen>
        <!-- LCD screen (standby) -->
-       <screen name="StandbySummary" position="0,0" size="132,64">
+       <screen name="StandbySummary" position="0,0" size="132,64" id="1">
                <widget source="global.CurrentTime" render="Label" position="6,0" size="120,64" font="Regular;40" halign="center" valign="center">
                        <convert type="ClockToText">Format:%H:%M</convert>
                </widget>
@@ -1122,37 +1303,18 @@ self.instance.move(ePoint(orgpos.x() + (orgwidth - newwidth)/2, orgpos.y()))
                        <convert type="ConditionalShowHide">Blink</convert>
                </widget>
        </screen>
-       <!-- JobView -->
-       <screen name="JobView" position="center,center" size="520,350" title="Job View">
-               <widget source="job_name" render="Label" position="20,12" size="480,60" font="Regular;28" />
-               <widget source="job_task" render="Label" position="20,90" size="480,50" font="Regular;23" />
-               <widget source="job_progress" render="Progress" position="20,162" size="480,36" borderWidth="2" backgroundColor="#254f7497" />
-               <widget source="job_progress" render="Label" position="120,166" size="280,32" font="Regular;28" foregroundColor="#000000" zPosition="2" halign="center" transparent="1"  >
-                       <convert type="ProgressToText" />
-               </widget>
-               <widget source="job_status" render="Label" position="20,212" size="480,26" font="Regular;23" />
-               <widget name="config" position="20,254" size="480,20" />
-               <widget source="cancelable" render="Pixmap" pixmap="skin_default/buttons/red.png" position="20,300" size="140,40" alphatest="on" >
-                       <convert type="ConditionalShowHide" />
-               </widget>
-               <widget source="cancelable" render="FixedLabel" text="Cancel" position="20,300" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" >
-                       <convert type="ConditionalShowHide" />
-               </widget>
-               <widget source="finished" render="Pixmap" pixmap="skin_default/buttons/green.png" position="190,300" size="140,40" alphatest="on" >
-                       <convert type="ConditionalShowHide" />
-               </widget>
-               <widget source="finished" render="FixedLabel" text="OK" font="Regular;20" halign="center" valign="center" position="190,300" size="140,40" transparent="1" backgroundColor="#1f771f" >
-                       <convert type="ConditionalShowHide" />
-               </widget>
-               <widget source="backgroundable" render="Pixmap" pixmap="skin_default/buttons/blue.png" position="360,300" size="140,40" alphatest="on" >
-                       <convert type="ConditionalShowHide" />
+       <!-- Color OLED screen (standby) -->
+       <screen name="StandbySummary" position="0,0" size="96,64" id="2">
+               <widget source="global.CurrentTime" render="Label" position="0,0" size="96,64" font="Regular;40" halign="center" valign="center">
+                       <convert type="ClockToText">Format:%H:%M</convert>
                </widget>
-               <widget source="backgroundable" render="FixedLabel" text="Continue in background" font="Regular;20" halign="center" valign="center" position="360,300" size="140,40" transparent="1" backgroundColor="#18188b" >
-                       <convert type="ConditionalShowHide" />
+               <widget source="session.RecordState" render="FixedLabel" position="0,0" zPosition="1" size="96,64" text=" ">
+                       <convert type="ConfigEntryTest">config.usage.blinking_display_clock_during_recording,True,CheckSourceBoolean</convert>
+                       <convert type="ConditionalShowHide">Blink</convert>
                </widget>
        </screen>
-       <!-- JobView Summary -->
-       <screen name="JobView_summary" position="0,0" size="132,64">
+       <!-- LCD screen (JobView) -->
+       <screen name="JobView_summary" position="0,0" size="132,64" id="1">
                <widget source="parent.summary_job_name" render="Label" position="6,4" size="120,42" font="Regular;16" />
                <widget source="parent.summary_job_task" render="Label" position="6,22" size="120,26" font="Regular;12" />
                <widget source="parent.summary_job_progress" render="Progress" position="6,50" size="60,12" borderWidth="1" zPosition="1" />
@@ -1160,19 +1322,29 @@ self.instance.move(ePoint(orgpos.x() + (orgwidth - newwidth)/2, orgpos.y()))
                        <convert type="ProgressToText" />
                </widget>
        </screen>
-       <!-- VirtualKeyBoard -->
-       <screen name="VirtualKeyBoard" position="center,center" size="560,350" zPosition="99" title="Virtual KeyBoard">
-               <ePixmap pixmap="skin_default/vkey_text.png" position="9,35" zPosition="-4" size="542,52" alphatest="on" />
-               <widget name="header" position="10,10" size="500,20" font="Regular;20" transparent="1" noWrap="1" />
-               <widget name="text" position="12,35" size="536,46" font="Regular;46" transparent="1" noWrap="1" halign="right" />
-               <widget name="list" position="10,100" size="540,225" selectionDisabled="1" transparent="1" />
+       <!-- Color OLED screen (JobView) -->
+       <screen name="JobView_summary" position="0,0" size="96,64" id="2">
+               <widget source="parent.summary_job_name" render="Label" position="0,4" size="96,42" font="Regular;14" />
+               <widget source="parent.summary_job_task" render="Label" position="0,22" size="96,26" font="Regular;10" />
+               <widget source="parent.summary_job_progress" render="Progress" position="0,50" size="60,12" borderWidth="1" zPosition="1" />
+               <widget source="parent.summary_job_progress" render="Label" position="60,50" size="36,12" font="Regular;10" zPosition="2" halign="center" transparent="1"  >
+                       <convert type="ProgressToText" />
+               </widget>
        </screen>
-       <!-- FileBrowser -->
-       <screen name="FileBrowser" position="center,center" size="520,430" title="DVD File Browser" >
-               <ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" />
-               <ePixmap pixmap="skin_default/buttons/green.png" position="140,0" size="140,40" alphatest="on" />
-               <widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
-               <widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
-               <widget name="filelist" position="5,50" size="510,370" scrollbarMode="showOnDemand" />
+       <!-- LCD screen (Wizard) -->
+       <screen name="WizardSummary" position="0,0" size="132,64" id="1">
+               <widget source="text" render="Label" position="6,0" size="120,16" font="Regular;16" transparent="1" />
+               <widget source="parent.list" render="Label" position="6,18" size="120,46" font="Regular;12">
+                       <convert type="StringListSelection" />
+               </widget>
        </screen>
+       <!-- Color OLED screen (Wizard) -->
+       <screen name="WizardSummary" position="0,0" size="96,64" id="2">
+               <widget source="text" render="Label" position="0,0" size="96,16" font="Regular;14" transparent="1" />
+               <widget source="parent.list" render="Label" position="0,18" size="96,46" font="Regular;12">
+                       <convert type="StringListSelection" />
+               </widget>
+       </screen>
+
+
 </skin>
index 85bb800..30b04f9 100755 (executable)
@@ -23,6 +23,7 @@ dist_install_DATA = \
        b_tl.png \
        b_t.png \
        b_tr.png \
+       celserviceeventprogressbar.png \
        div-h.png \
        div-v.png \
        epg_more.png \
@@ -32,8 +33,6 @@ dist_install_DATA = \
        expanded-plugins.png \
        info-bg_mp.png \
        info-bg.png \
-       lock.png \
-       lockBouquet.png \
        mediaplayer_bg.png \
        mute.png \
        nim_active.png \
@@ -54,8 +53,6 @@ dist_install_DATA = \
        timeline-now.png \
        timeline.png \
        unhandled-key.png \
-       unlock.png \
-       unlockBouquet.png \
        verticalline-plugins.png \
        vkey_backspace.png \
        vkey_bg.png \
diff --git a/data/skin_default/celserviceeventprogressbar.png b/data/skin_default/celserviceeventprogressbar.png
new file mode 100644 (file)
index 0000000..7bf5c65
Binary files /dev/null and b/data/skin_default/celserviceeventprogressbar.png differ
old mode 100644 (file)
new mode 100755 (executable)
index 8e2052b..61c0059
@@ -32,8 +32,15 @@ dist_install_DATA = \
        lock_off.png \
        lock_on.png \
        lock.png \
+       lockBouquet.png \
        marker.png \
        mp_buttons.png \
+       network_wired.png \
+       network_wired-active.png \
+       network_wired-inactive.png \    
+       network_wireless.png \
+       network_wireless-active.png \
+       network_wireless-inactive.png \ 
        plugin.png \
        rass_logo.png \
        rass_page1.png \
@@ -47,4 +54,6 @@ dist_install_DATA = \
        scan-c.png \
        scan-s.png \
        scan-t.png \
-       selectioncross.png
+       selectioncross.png \
+       unlock.png \
+       unlockBouquet.png
index cfee1ba..d0ae7f6 100644 (file)
Binary files a/data/skin_default/icons/lock.png and b/data/skin_default/icons/lock.png differ
diff --git a/data/skin_default/icons/lockBouquet.png b/data/skin_default/icons/lockBouquet.png
new file mode 100644 (file)
index 0000000..d503dd2
Binary files /dev/null and b/data/skin_default/icons/lockBouquet.png differ
diff --git a/data/skin_default/icons/network_wired-active.png b/data/skin_default/icons/network_wired-active.png
new file mode 100755 (executable)
index 0000000..d8efc9c
Binary files /dev/null and b/data/skin_default/icons/network_wired-active.png differ
diff --git a/data/skin_default/icons/network_wired-inactive.png b/data/skin_default/icons/network_wired-inactive.png
new file mode 100755 (executable)
index 0000000..18f2c70
Binary files /dev/null and b/data/skin_default/icons/network_wired-inactive.png differ
diff --git a/data/skin_default/icons/network_wired.png b/data/skin_default/icons/network_wired.png
new file mode 100755 (executable)
index 0000000..db695ad
Binary files /dev/null and b/data/skin_default/icons/network_wired.png differ
diff --git a/data/skin_default/icons/network_wireless-active.png b/data/skin_default/icons/network_wireless-active.png
new file mode 100755 (executable)
index 0000000..07a2187
Binary files /dev/null and b/data/skin_default/icons/network_wireless-active.png differ
diff --git a/data/skin_default/icons/network_wireless-inactive.png b/data/skin_default/icons/network_wireless-inactive.png
new file mode 100755 (executable)
index 0000000..5bd69f9
Binary files /dev/null and b/data/skin_default/icons/network_wireless-inactive.png differ
diff --git a/data/skin_default/icons/network_wireless.png b/data/skin_default/icons/network_wireless.png
new file mode 100755 (executable)
index 0000000..629a05a
Binary files /dev/null and b/data/skin_default/icons/network_wireless.png differ
diff --git a/data/skin_default/icons/unlock.png b/data/skin_default/icons/unlock.png
new file mode 100644 (file)
index 0000000..bd4486e
Binary files /dev/null and b/data/skin_default/icons/unlock.png differ
diff --git a/data/skin_default/icons/unlockBouquet.png b/data/skin_default/icons/unlockBouquet.png
new file mode 100644 (file)
index 0000000..c5d146d
Binary files /dev/null and b/data/skin_default/icons/unlockBouquet.png differ
diff --git a/data/skin_default/lock.png b/data/skin_default/lock.png
deleted file mode 100644 (file)
index d0ae7f6..0000000
Binary files a/data/skin_default/lock.png and /dev/null differ
diff --git a/data/skin_default/lockBouquet.png b/data/skin_default/lockBouquet.png
deleted file mode 100644 (file)
index d503dd2..0000000
Binary files a/data/skin_default/lockBouquet.png and /dev/null differ
diff --git a/data/skin_default/unlock.png b/data/skin_default/unlock.png
deleted file mode 100644 (file)
index bd4486e..0000000
Binary files a/data/skin_default/unlock.png and /dev/null differ
diff --git a/data/skin_default/unlockBouquet.png b/data/skin_default/unlockBouquet.png
deleted file mode 100644 (file)
index c5d146d..0000000
Binary files a/data/skin_default/unlockBouquet.png and /dev/null differ
diff --git a/data/unicable.xml b/data/unicable.xml
new file mode 100644 (file)
index 0000000..33951d7
--- /dev/null
@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<unicable version="20100522">
+<!--
+structur of tree
+unicable (version)
+  |
+  |\
+  | \
+  | lnb
+  |  |
+  |  |\
+  |  | \
+  |  | manufacturer (name)
+  |  |  |\
+  |  |  | \
+  |  |  | product (name, position, sc11-scr8. lofl, lofh, loft)
+  |  |  |
+  |  |  |\
+  |  |  | \
+  |  |  | product
+  |  |  
+  |  |\
+  |  | \
+  |  | manufacturer
+  |  |  |\
+  |  |  | \
+  |  |  | product
+  |  |  |
+  |  |  |\
+  |  |  | \
+  |  |  | product
+  |
+   \
+    \
+    matrix
+     |
+     |\
+     | \
+     | manufacturer
+     |  |\
+     |  | \
+     |  | product
+     |  |
+     |  |\
+     |  | \
+     |  | product
+     |  
+     |\
+     | \
+     | manufacturer
+     |  |\
+     |  | \
+     |  | product
+     |  |
+     |  |\
+     |  | \
+     |  | product
+
+-->
+
+       <lnb>
+               <manufacturer name="DUR-line">
+                       <product name="Unicable LNB" scr1="1210" scr2="1420" scr3="1680" scr4="2040"/>
+               </manufacturer>
+               <manufacturer name="G-STAR">
+                       <product name="GS-404-L1" scr1="1280" scr2="1382" scr3="1484"/>
+                       <product name="GS-406-L1" scr1="1280" scr2="1382" scr3="1484" scr4="1586" scr5="1688" scr6="1790"/>
+               </manufacturer>
+               <manufacturer name="Humax">
+                       <product name="150 SCR" scr1="1210" scr2="1420" scr3="1680" scr4="2040"/>
+               </manufacturer>
+               <manufacturer name="Inverto">
+                       <product name="IDLP-40UNIQD+S" scr1="1680" scr2="1420" scr3="2040" scr4="1210"/>
+                       <product name="IDLB-QUDL-UNI2L-OPP" scr1="1210" scr2="1420" scr3="1680" scr4="2040"/>
+               </manufacturer>
+               <manufacturer name="Kathrein">
+                       <product name="UAS481"  lofl="10200" lofh="10200" scr1="1400" scr2="1516" scr3="1632" scr4="1748"/>
+               </manufacturer>
+               <manufacturer name="Kreiling">
+                       <product name="KR1440" scr1="1680" scr2="1420" scr3="2040" scr4="1210"/>
+               </manufacturer>
+               <manufacturer name="Radix">
+                       <product name="Unicable LNB" scr1="1680" scr2="1420" scr3="2040" scr4="1210"/>
+               </manufacturer>
+               <manufacturer name="Wisi">
+                       <product name="OC 05" scr1="1210" scr2="1420" scr3="1680" scr4="2040"/>
+               </manufacturer>
+       </lnb>
+       <matrix>
+               <manufacturer name="Ankaro">
+                       <product name="UCS 51440" scr1="1400" scr2="1632" scr3="1284" scr4="1516"/>
+                       <product name="UCS 51820" scr1="1400" scr2="1632" scr3="1284" scr4="1516" scr5="1864" scr6="2096" scr7="1748" scr8="1980"/>
+                       <product name="UCS 51840" scr1="1400" scr2="1632" scr3="1284" scr4="1516" scr5="1864" scr6="2096" scr7="1748" scr8="1980"/>
+                       <product name="UCS 52240" scr1="1400" scr2="1632"/>
+                       <product name="UCS 52420" scr1="1400" scr2="1632" scr3="1284" scr4="1516"/>
+                       <product name="UCS 52440" scr1="1400" scr2="1632" scr3="1284" scr4="1516"/>
+                       <product name="UCS 91440" positions="2" scr1="1400" scr2="1632" scr3="1284" scr4="1516"/>
+                       <product name="UCS 91820" positions="2" scr1="1400" scr2="1632" scr3="1284" scr4="1516" scr5="1864" scr6="2096" scr7="1748" scr8="1980"/>
+                       <product name="UCS 91840" positions="2" scr1="1400" scr2="1632" scr3="1284" scr4="1516" scr5="1864" scr6="2096" scr7="1748" scr8="1980"/>
+                       <product name="UCS 92240" positions="2" scr1="1400" scr2="1632"/>
+                       <product name="UCS 92420" positions="2" scr1="1400" scr2="1632" scr3="1284" scr4="1516"/>
+                       <product name="UCS 92440" positions="2" scr1="1400" scr2="1632" scr3="1284" scr4="1516"/>
+               </manufacturer>
+               <manufacturer name="DCT Delta">
+                       <product name="SUM518" scr1="1284" scr2="1400" scr3="1516" scr4="1632" scr5="1748" scr6="1864" scr7="1980" scr8="2096"/>
+                       <product name="SUM918" positions="2" scr1="1284" scr2="1400" scr3="1516" scr4="1632" scr5="1748" scr6="1864" scr7="1980" scr8="2096"/>
+                       <product name="SUM928" positions="2" scr1="1284" scr2="1400" scr3="1516" scr4="1632" scr5="1748" scr6="1864" scr7="1980" scr8="2096"/>
+               </manufacturer>
+               <manufacturer name="Dura-Sat">
+                       <product name="UCP18" scr1="1284" scr2="1400" scr3="1516" scr4="1632" scr5="1748" scr6="1864" scr7="1980" scr8="2096"/>
+                       <product name="VDU543NT" scr1="1280" scr2="1382" scr3="1484"/>
+                       <product name="VDU563NT" scr1="1280" scr2="1382" scr3="1484"/>
+                       <product name="VDU583NT" scr1="1280" scr2="1382" scr3="1484"/>
+                       <product name="VDU586NT" scr1="1280" scr2="1382" scr3="1484" scr4="1586" scr5="1688" scr6="1790"/>
+                       <product name="VDU983NT" positions="2" scr1="1280" scr2="1382" scr3="1484"/>
+               </manufacturer>
+               <manufacturer name="G-STAR">
+                       <product name="GS-506-S1" scr1="1280" scr2="1382" scr3="1484"/>
+                       <product name="GS-516-S1" scr1="1280" scr2="1382" scr3="1484" scr4="1586" scr5="1688" scr6="1790"/>
+               </manufacturer>
+               <manufacturer name="Inverto">
+                       <product name="IDLP-UST11O-CUO1O-8PP" scr1="1076" scr2="1178" scr3="1280" scr4="1382" scr5="1484" scr6="1586" scr7="1688" scr8="1790"/>
+               </manufacturer>
+               <manufacturer name="JULTEC">
+                       <product name="JPS0501-6" scr1="1280" scr2="1382" scr3="1484" scr4="1586" scr5="1688" scr6="1790"/>
+                       <product name="JPS0502-3" scr1="1280" scr2="1382" scr3="1484"/>
+                       <product name="JPS0502-6" scr1="1280" scr2="1382" scr3="1484" scr4="1586" scr5="1688" scr6="1790"/>
+                       <product name="JPS0504-3" scr1="1280" scr2="1382" scr3="1484"/>
+               </manufacturer>
+               <manufacturer name="Kathrein">
+                       <product name="EXR501" scr1="1400" scr2="1516" scr3="1632" scr4="1748"/>
+                       <product name="EXR551" scr1="1400" scr2="1516" scr3="1632" scr4="1748"/>
+                       <product name="EXR552" scr1="1400" scr2="1516"/>
+                       <product name="EXR1541" scr1="1284" scr2="1400" scr3="1516" scr4="1632"/>
+                       <product name="EXR1542" scr1="1284" scr2="1400" scr3="1516" scr4="1632"/>
+                       <product name="EXR1581" scr1="1284" scr2="1400" scr3="1516" scr4="1632" scr5="1748" scr6="1864" scr7="1980" scr8="2096"/>
+                       <product name="EXR1942" positions="2" scr1="1284" scr2="1400" scr3="1516" scr4="1632"/>
+                       <product name="EXR1981" positions="2" scr1="1284" scr2="1400" scr3="1516" scr4="1632" scr5="1748" scr6="1864" scr7="1980" scr8="2096"/>
+                       <product name="EXR2541" scr1="1284" scr2="1400" scr3="1516" scr4="1632"/>
+                       <product name="EXR2542" scr1="1284" scr2="1400" scr3="1516" scr4="1632"/>
+                       <product name="EXR2581" scr1="1284" scr2="1400" scr3="1516" scr4="1632" scr5="1748" scr6="1864" scr7="1980" scr8="2096"/>
+                       <product name="EXR2942" positions="2" scr1="1284" scr2="1400" scr3="1516" scr4="1632"/>
+                       <product name="EXR2981" positions="2" scr1="1284" scr2="1400" scr3="1516" scr4="1632" scr5="1748" scr6="1864" scr7="1980" scr8="2096"/>
+                       <product name="EXU908" positions="2" scr1="1284" scr2="1400" scr3="1516" scr4="1632"/>
+               </manufacturer>
+               <manufacturer name="ROTEK">
+                       <product name="EKL2/1" scr1="1400" scr2="1516"/>
+                       <product name="EKL2/1E" scr3="1632" scr4="1748"/>
+               </manufacturer>
+               <manufacturer name="Smart">
+                       <product name="DPA 51" scr1="1284" scr2="1400" scr3="1516" scr4="1632" scr5="1748" scr6="1864" scr7="1980" scr8="2096"/>
+               </manufacturer>
+               <manufacturer name="Technisat">
+                       <product name="TechniRouter 5/1x8" scr1="1284" scr2="1400" scr3="1516" scr4="1632" scr5="1748" scr6="1864" scr7="1980" scr8="2096"/>
+                       <product name="TechniRouter 9/1x8" positions="2" scr1="1284" scr2="1400" scr3="1516" scr4="1632" scr5="1748" scr6="1864" scr7="1980" scr8="2096"/>
+                       <product name="TechniRouter 5/2x4" scr1="1284" scr2="1400" scr3="1516" scr4="1632"/>
+                       <product name="TechniRouter 9/2x4" positions="2" scr1="1284" scr2="1400" scr3="1516" scr4="1632"/>
+               </manufacturer>
+               <manufacturer name="Telstar">
+                       <product name="SCR 5/1x8" scr1="1284" scr2="1400" scr3="1516" scr4="1632" scr5="1748" scr6="1864" scr7="1980" scr8="2096"/>
+                       <product name="SCR 9/1x8" positions="2" scr1="1284" scr2="1400" scr3="1516" scr4="1632" scr5="1748" scr6="1864" scr7="1980" scr8="2096"/>
+                       <product name="SCR 5/2x4" scr1="1284" scr2="1400" scr3="1516" scr4="1632"/>
+                       <product name="SCR 9/2x4" positions="2" scr1="1284" scr2="1400" scr3="1516" scr4="1632"/>
+               </manufacturer>
+               <manufacturer name="Wisi">
+                       <product name="DY 64 1810" scr1="1178" scr2="1280" scr3="1382" scr4="1484" scr5="1586" scr6="1688" scr7="1790" scr8="1892"/>
+                       <product name="DY 64 2410" scr1="1178" scr2="1280" scr3="1382" scr4="1484"/>
+                       <product name="DY 68 1810" positions="2" scr1="1178" scr2="1280" scr3="1382" scr4="1484" scr5="1586" scr6="1688" scr7="1790" scr8="1892"/>
+                       <product name="DY 68 2410" positions="2" scr1="1178" scr2="1280" scr3="1382" scr4="1484"/>
+               </manufacturer>
+       </matrix>
+</unicable>
diff --git a/doc/TPM b/doc/TPM
new file mode 100644 (file)
index 0000000..20c0230
--- /dev/null
+++ b/doc/TPM
@@ -0,0 +1,27 @@
+The TPM check is currently to be considered a beta version. So please expect
+code changes in the future.
+
+If you'd like to write your own plugins and honor the efforts, Dream Multimedia
+puts into developing Enigma 2, you can protect your plugin against execution
+on Non-Dream Multimedia Hardware by implementing a TPM (Trusted Platform Module)
+check into your plugin.
+For ease of use we provide a demo plugin in lib/python/Plugins/DemoPlugins/TPMDemo.
+
+The main TPM check is implemented into the "main" function. You need to provide
+this code yourself in your plugin. So copy&paste the code into your own as well
+as the needed functions
+- bin2long
+- long2bin
+- rsa_pub1024
+- decrypt_block
+- validate_cert
+- read_random
+Importing the functions from somewhere else would spoil the security model. So
+you need to provide the code with your plugin.
+You can either use the given method using the main function (which will run the
+TPM check each time the plugin is called) or directly use it in the
+Plugins(**kwargs) function and not return the Plugins-list if the TPM check failes
+(which will prevent the plugin from showing up at all). You can also implement
+a warning message for all possible TPM failure scenarios.
+  
index 6ea9d03..0508563 100644 (file)
@@ -8,5 +8,5 @@ libenigma_base_a_SOURCES = \
        init.cpp message.cpp thread.cpp \
        smartptr.cpp estring.cpp connection.cpp \
        filepush.cpp encoding.cpp console.cpp rawfile.cpp \
-       nconfig.cpp ioprio.cpp
+       nconfig.cpp ioprio.cpp etpm.cpp
 
diff --git a/lib/base/etpm.cpp b/lib/base/etpm.cpp
new file mode 100644 (file)
index 0000000..9a443e0
--- /dev/null
@@ -0,0 +1,172 @@
+#include <sys/socket.h>
+#include <fcntl.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/un.h>
+#include <unistd.h>
+#include <openssl/bn.h>
+#include <openssl/sha.h>
+#include <lib/base/eerror.h>
+
+#include "etpm.h"
+
+eTPM::eTPM()
+{
+       struct sockaddr_un addr;
+       unsigned char buf[8];
+       unsigned int tag;
+       size_t len;
+       unsigned char *val;
+
+       level2_cert_read = level3_cert_read = false;
+
+       addr.sun_family = AF_UNIX;
+       strcpy(addr.sun_path, TPMD_SOCKET);
+
+       fd = socket(PF_UNIX, SOCK_STREAM, 0);
+       if (fd < 0)
+       {
+               eDebug("[eTPM] socket error");
+               return;
+       }
+
+       if (connect(fd, (const struct sockaddr *)&addr, SUN_LEN(&addr)) < 0)
+       {
+               eDebug("[eTPM] connect error");
+               return;
+       }
+
+       buf[0] = TPMD_DT_LEVEL2_CERT;
+       buf[1] = TPMD_DT_LEVEL3_CERT;
+       if (!send_cmd(TPMD_CMD_GET_DATA, buf, 2))
+       {
+               return;
+       }
+
+       val = (unsigned char*)recv_cmd(&tag, &len);
+       if (val == NULL)
+       {
+               return;
+       }
+
+       parse_data(val, len);
+       free(val);
+}
+
+eTPM::~eTPM()
+{
+
+}
+
+bool eTPM::send_cmd(enum tpmd_cmd cmd, const void *data, size_t len)
+{
+       unsigned char buf[len + 4];
+
+       buf[0] = (cmd >> 8) & 0xff;
+       buf[1] = (cmd >> 0) & 0xff;
+       buf[2] = (len >> 8) & 0xff;
+       buf[3] = (len >> 0) & 0xff;
+       memcpy(&buf[4], data, len);
+
+       if (write(fd, buf, sizeof(buf)) != (ssize_t)sizeof(buf))
+       {
+               fprintf(stderr, "%s: incomplete write\n", __func__);
+               return false;
+       }
+
+       return true;
+}
+
+void* eTPM::recv_cmd(unsigned int *tag, size_t *len)
+{
+       unsigned char buf[4];
+       void *val;
+
+       if (read(fd, buf, 4) != 4)
+       {
+               fprintf(stderr, "%s: incomplete read\n", __func__);
+               return NULL;
+       }
+
+       *tag = (buf[0] << 8) | buf[1];
+       *len = (buf[2] << 8) | buf[3];
+
+       val = malloc(*len);
+       if (val == NULL)
+               return NULL;
+
+       ssize_t rd = read(fd, val, *len);
+       if (rd < 0)
+       {
+               perror("eTPM::recv_cmd read");
+               free(val);
+       }
+        else if ((size_t)rd != *len) {
+               fprintf(stderr, "%s: incomplete read\n", __func__);
+               free(val);
+               return NULL;
+       }
+
+       return val;
+}
+
+void eTPM::parse_data(const unsigned char *data, size_t datalen)
+{
+       unsigned int i;
+       unsigned int tag;
+       unsigned int len;
+       const unsigned char *val;
+
+       for (i = 0; i < datalen; i += len) {
+               tag = data[i++];
+               len = data[i++];
+               val = &data[i];
+
+               switch (tag) {
+               case TPMD_DT_LEVEL2_CERT:
+                       if (len != 210)
+                               break;
+                       memcpy(level2_cert, val, 210);
+                       level2_cert_read = true;
+                       break;
+               case TPMD_DT_LEVEL3_CERT:
+                       if (len != 210)
+                               break;
+                       memcpy(level3_cert, val, 210);
+                       level3_cert_read = true;
+                       break;
+               }
+       }
+}
+
+std::string eTPM::getCert(cert_type type)
+{
+       if (type == TPMD_DT_LEVEL2_CERT && level2_cert_read)
+               return std::string((char*)level2_cert, 210);
+       else if (type == TPMD_DT_LEVEL3_CERT && level3_cert_read)
+               return std::string((char*)level3_cert, 210);
+       return "";
+}
+
+std::string eTPM::challenge(std::string rnd)
+{
+       if (rnd.length() == 8)
+       {
+               if (!send_cmd(TPMD_CMD_COMPUTE_SIGNATURE, rnd.c_str(), 8))
+                       return "";
+
+               unsigned int tag;
+               size_t len;
+               unsigned char *val = (unsigned char*)recv_cmd(&tag, &len);
+
+               if (tag != TPMD_CMD_COMPUTE_SIGNATURE)
+                       return "";
+
+               std::string ret((char*)val, len);
+               free(val);
+               return ret;
+       }
+       return "";
+}
diff --git a/lib/base/etpm.h b/lib/base/etpm.h
new file mode 100644 (file)
index 0000000..c9e5214
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef __lib_base_etpm_h
+#define __lib_base_etpm_h
+
+#ifndef SWIG
+#define TPMD_SOCKET "/var/run/tpmd_socket"
+#endif
+
+#include <string>
+
+class eTPM
+{
+#ifndef SWIG
+       int fd;
+       unsigned char level2_cert[210];
+       unsigned char level3_cert[210];
+       bool level2_cert_read;
+       bool level3_cert_read;
+
+       enum tpmd_cmd {
+               TPMD_CMD_RESERVED               = 0x0000,
+               TPMD_CMD_GET_DATA               = 0x0001,
+               TPMD_CMD_APDU                   = 0x0002,
+               TPMD_CMD_COMPUTE_SIGNATURE      = 0x0003,
+               TPMD_CMD_APP_CERT               = 0x0004,
+       };
+
+       bool send_cmd(enum tpmd_cmd cmd, const void *data, size_t len);
+       void *recv_cmd(unsigned int *tag, size_t *len);
+       void parse_data(const unsigned char *data, size_t datalen);
+
+#endif
+public:
+       eTPM();
+       ~eTPM();
+
+       enum cert_type {
+               TPMD_DT_LEVEL2_CERT = 0x04,
+               TPMD_DT_LEVEL3_CERT = 0x05
+       };
+       std::string getCert(cert_type type);
+       std::string challenge(std::string rnd);
+};
+
+#endif // __lib_base_etpm_h
index 4acd385..059d417 100755 (executable)
@@ -96,6 +96,8 @@ eDVBResourceManager::eDVBResourceManager()
                m_boxtype = DM800;
        else if (!strncmp(tmp, "dm500hd\n", rd))
                m_boxtype = DM500HD;
+       else if (!strncmp(tmp, "dm800se\n", rd))
+               m_boxtype = DM800SE;
        else {
                eDebug("boxtype detection via /proc/stb/info not possible... use fallback via demux count!\n");
                if (m_demux.size() == 3)
@@ -455,7 +457,7 @@ RESULT eDVBResourceManager::allocateDemux(eDVBRegisteredFrontend *fe, ePtr<eDVBA
 
        ePtr<eDVBRegisteredDemux> unused;
 
-       if (m_boxtype == DM800 || m_boxtype == DM500HD) // dm800 / 500hd
+       if (m_boxtype == DM800 || m_boxtype == DM500HD || m_boxtype == DM800SE) // dm800 / 500hd
        {
                cap |= capHoldDecodeReference; // this is checked in eDVBChannel::getDemux
                for (; i != m_demux.end(); ++i, ++n)
@@ -1671,6 +1673,18 @@ void eDVBChannel::SDTready(int result)
        m_SDT = 0;
 }
 
+int eDVBChannel::reserveDemux()
+{
+       ePtr<iDVBDemux> dmx;
+       if (!getDemux(dmx, 0))
+       {
+               uint8_t id;
+               if (!dmx->getCADemuxID(id))
+                       return id;
+       }
+       return -1;
+}
+
 RESULT eDVBChannel::requestTsidOnid(ePyObject callback)
 {
        if (PyCallable_Check(callback))
index 7b32000..fb92580 100644 (file)
@@ -135,7 +135,7 @@ class eDVBResourceManager: public iObject, public Object
        DECLARE_REF(eDVBResourceManager);
        int avail, busy;
 
-       enum { DM7025, DM800, DM500HD, DM8000 };
+       enum { DM7025, DM800, DM500HD, DM800SE, DM8000 };
 
        int m_boxtype;
 
@@ -268,6 +268,7 @@ public:
        int getUseCount() { return m_use_count; }
 
        RESULT requestTsidOnid(ePyObject callback);
+       int reserveDemux();
 private:
        ePtr<eDVBAllocatedFrontend> m_frontend;
        ePtr<eDVBAllocatedDemux> m_demux, m_decoder_demux;
index 119223a..1e8414c 100644 (file)
@@ -2562,7 +2562,7 @@ void eEPGCache::PMTready(eDVBServicePMTHandler *pmthandler)
                                                                {
                                                                        __u8 buffer[10];
                                                                        (*desc)->writeToBuffer(buffer);
-                                                                       if (!strncmp((const char *)buffer+2, "EPGDATA", 7))
+                                                                       if (!strncmp((char*)buffer+2, "EPGDATA", 7))
                                                                        {
                                                                                eServiceReferenceDVB ref;
                                                                                if (!pmthandler->getServiceReference(ref))
@@ -2571,7 +2571,7 @@ void eEPGCache::PMTready(eDVBServicePMTHandler *pmthandler)
                                                                                        messages.send(Message(Message::got_mhw2_channel_pid, ref, pid));
                                                                                }
                                                                        }
-                                                                       else if(!strncmp((const char *)buffer+2, "FICHAS", 6))
+                                                                       else if(!strncmp((char*)buffer+2, "FICHAS", 6))
                                                                        {
                                                                                eServiceReferenceDVB ref;
                                                                                if (!pmthandler->getServiceReference(ref))
@@ -2580,7 +2580,7 @@ void eEPGCache::PMTready(eDVBServicePMTHandler *pmthandler)
                                                                                        messages.send(Message(Message::got_mhw2_summary_pid, ref, pid));
                                                                                }
                                                                        }
-                                                                       else if(!strncmp((const char *)buffer+2, "GENEROS", 7))
+                                                                       else if(!strncmp((char*)buffer+2, "GENEROS", 7))
                                                                        {
                                                                                eServiceReferenceDVB ref;
                                                                                if (!pmthandler->getServiceReference(ref))
index db58a6f..6b09d3d 100755 (executable)
@@ -596,7 +596,7 @@ int eDVBFrontend::openFrontend()
        return 0;
 }
 
-int eDVBFrontend::closeFrontend(bool force)
+int eDVBFrontend::closeFrontend(bool force, bool no_delayed)
 {
        if (!force && m_data[CUR_VOLTAGE] != -1 && m_data[CUR_VOLTAGE] != iDVBFrontend::voltageOff)
        {
@@ -619,11 +619,34 @@ int eDVBFrontend::closeFrontend(bool force)
                eDebugNoSimulate("close frontend %d", m_dvbid);
                if (m_data[SATCR] != -1)
                {
-                       turnOffSatCR(m_data[SATCR]);
+                       if (!no_delayed)
+                       {
+                               m_sec->prepareTurnOffSatCR(*this, m_data[SATCR]);
+                               m_tuneTimer->start(0, true);
+                               if(!m_tuneTimer->isActive())
+                               {
+                                       int timeout=0;
+                                       eDebug("[turnOffSatCR] no mainloop");
+                                       while(true)
+                                       {
+                                               timeout = tuneLoopInt();
+                                               if (timeout == -1)
+                                                       break;
+                                               usleep(timeout*1000); // blockierendes wait.. eTimer gibts ja nicht mehr
+                                       }
+                               }
+                               else
+                                       eDebug("[turnOffSatCR] running mainloop");
+                               return 0;
+                       }
+                       else
+                               m_data[ROTOR_CMD] = -1;
                }
+
                setTone(iDVBFrontend::toneOff);
                setVoltage(iDVBFrontend::voltageOff);
                m_tuneTimer->stop();
+
                if (m_sec && !m_simulate)
                        m_sec->setRotorMoving(m_slotid, false);
                if (!::close(m_fd))
@@ -1453,9 +1476,11 @@ int eDVBFrontend::readInputpower()
                return 0;
        int power=m_slotid;  // this is needed for read inputpower from the correct tuner !
        char proc_name[64];
-       sprintf(proc_name, "/proc/stb/fp/lnb_sense%d", m_slotid);
-       FILE *f=fopen(proc_name, "r");
-       if (f)
+       char proc_name2[64];
+       sprintf(proc_name, "/proc/stb/frontend/%d/lnb_sense", m_slotid);
+       sprintf(proc_name2, "/proc/stb/fp/lnb_sense%d", m_slotid);
+       FILE *f;
+       if ((f=fopen(proc_name, "r")) || (f=fopen(proc_name2, "r")))
        {
                if (fscanf(f, "%d", &power) != 1)
                        eDebug("read %s failed!! (%m)", proc_name);
@@ -1504,9 +1529,14 @@ bool eDVBFrontend::setSecSequencePos(int steps)
        return true;
 }
 
-void eDVBFrontend::tuneLoop()  // called by m_tuneTimer
+void eDVBFrontend::tuneLoop()
+{
+       tuneLoopInt();
+}
+
+int eDVBFrontend::tuneLoopInt()  // called by m_tuneTimer
 {
-       int delay=0;
+       int delay=-1;
        eDVBFrontend *sec_fe = this;
        eDVBRegisteredFrontend *regFE = 0;
        long tmp = m_data[LINKED_PREV_PTR];
@@ -1536,6 +1566,7 @@ void eDVBFrontend::tuneLoop()  // called by m_tuneTimer
        {
                long *sec_fe_data = sec_fe->m_data;
 //             eDebugNoSimulate("tuneLoop %d\n", m_sec_sequence.current()->cmd);
+               delay = 0;
                switch (m_sec_sequence.current()->cmd)
                {
                        case eSecCommand::SLEEP:
@@ -1862,6 +1893,13 @@ void eDVBFrontend::tuneLoop()  // called by m_tuneTimer
                                ++m_sec_sequence.current();
                                break;
                        }
+                       case eSecCommand::DELAYED_CLOSE_FRONTEND:
+                       {
+                               eDebugNoSimulate("[SEC] delayed close frontend");
+                               closeFrontend(false, true);
+                               ++m_sec_sequence.current();
+                               break;
+                       }
                        default:
                                eDebugNoSimulate("[SEC] unhandled sec command %d",
                                        ++m_sec_sequence.current()->cmd);
@@ -1874,6 +1912,7 @@ void eDVBFrontend::tuneLoop()  // called by m_tuneTimer
                regFE->dec_use();
        if (m_simulate && m_sec_sequence.current() != m_sec_sequence.end())
                tuneLoop();
+       return delay;
 }
 
 void eDVBFrontend::setFrontend(bool recvEvents)
@@ -2609,9 +2648,12 @@ RESULT eDVBFrontend::setSEC(iDVBSatelliteEquipmentControl *sec)
        return 0;
 }
 
-RESULT eDVBFrontend::setSecSequence(const eSecCommandList &list)
+RESULT eDVBFrontend::setSecSequence(eSecCommandList &list)
 {
-       m_sec_sequence = list;
+       if (m_data[SATCR] != -1 && m_sec_sequence.current() != m_sec_sequence.end())
+               m_sec_sequence.push_back(list);
+       else
+               m_sec_sequence = list;
        return 0;
 }
 
@@ -2688,42 +2730,3 @@ arg_error:
                "eDVBFrontend::setSlotInfo must get a tuple with first param slotid, second param slot description and third param enabled boolean");
        return false;
 }
-
-RESULT eDVBFrontend::turnOffSatCR(int satcr)
-{
-       eSecCommandList sec_sequence;
-       // check if voltage is disabled
-       eSecCommand::pair compare;
-       compare.steps = +9;     //nothing to do
-       compare.voltage = iDVBFrontend::voltageOff;
-       sec_sequence.push_back( eSecCommand(eSecCommand::IF_NOT_VOLTAGE_GOTO, compare) );
-       sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltage13) );
-       sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 50 ) );
-
-       sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltage18_5) );
-       sec_sequence.push_back( eSecCommand(eSecCommand::SET_TONE, iDVBFrontend::toneOff) );
-       sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 250) );
-
-       eDVBDiseqcCommand diseqc;
-       memset(diseqc.data, 0, MAX_DISEQC_LENGTH);
-       diseqc.len = 5;
-       diseqc.data[0] = 0xE0;
-       diseqc.data[1] = 0x10;
-       diseqc.data[2] = 0x5A;
-       diseqc.data[3] = satcr << 5;
-       diseqc.data[4] = 0x00;
-
-       sec_sequence.push_back( eSecCommand(eSecCommand::SEND_DISEQC, diseqc) );
-       sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 50+20+14*diseqc.len) );
-       sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltage13) );
-       setSecSequence(sec_sequence);
-       return 0;
-}
-
-RESULT eDVBFrontend::ScanSatCR()
-{
-       setFrontend();
-       usleep(20000);
-       setTone(iDVBFrontend::toneOff);
-       return 0;
-}
index bc31755..bef4a18 100644 (file)
@@ -110,6 +110,7 @@ private:
        void feEvent(int);
        void timeout();
        void tuneLoop();  // called by m_tuneTimer
+       int tuneLoopInt();
        void setFrontend(bool recvEvents=true);
        bool setSecSequencePos(int steps);
        static int PriorityOrder;
@@ -130,7 +131,7 @@ public:
        RESULT sendDiseqc(const eDVBDiseqcCommand &diseqc);
        RESULT sendToneburst(int burst);
        RESULT setSEC(iDVBSatelliteEquipmentControl *sec);
-       RESULT setSecSequence(const eSecCommandList &list);
+       RESULT setSecSequence(eSecCommandList &list);
        RESULT getData(int num, long &data);
        RESULT setData(int num, long val);
 
@@ -148,12 +149,9 @@ public:
 
        void reopenFrontend();
        int openFrontend();
-       int closeFrontend(bool force=false);
+       int closeFrontend(bool force=false, bool no_delayed=false);
        const char *getDescription() const { return m_description; }
        bool is_simulate() const { return m_simulate; }
-
-       RESULT turnOffSatCR(int satcr);
-       RESULT ScanSatCR();
 };
 
 #endif // SWIG
index d20829b..f1217a6 100644 (file)
@@ -459,7 +459,7 @@ class iDVBFrontend: public iDVBFrontend_ENUMS, public iObject
 public:
        virtual RESULT getFrontendType(int &SWIG_OUTPUT)=0;
        virtual RESULT tune(const iDVBFrontendParameters &where)=0;
-       virtual int closeFrontend(bool force = false)=0;
+       virtual int closeFrontend(bool force = false, bool no_delayed = false)=0;
        virtual void reopenFrontend()=0;
 #ifndef SWIG
        virtual RESULT connectStateChange(const Slot1<void,iDVBFrontend*> &stateChange, ePtr<eConnection> &connection)=0;
@@ -471,7 +471,7 @@ public:
        virtual RESULT sendToneburst(int burst)=0;
 #ifndef SWIG
        virtual RESULT setSEC(iDVBSatelliteEquipmentControl *sec)=0;
-       virtual RESULT setSecSequence(const eSecCommandList &list)=0;
+       virtual RESULT setSecSequence(eSecCommandList &list)=0;
 #endif
        virtual int readFrontendData(int type)=0;
        virtual void getFrontendStatus(SWIG_PYOBJECT(ePyObject) dest)=0;
@@ -491,6 +491,7 @@ class iDVBSatelliteEquipmentControl: public iObject
 {
 public:
        virtual RESULT prepare(iDVBFrontend &frontend, FRONTENDPARAMETERS &parm, const eDVBFrontendParametersSatellite &sat, int frontend_id, unsigned int timeout)=0;
+       virtual void prepareTurnOffSatCR(iDVBFrontend &frontend, int satcr)=0;
        virtual int canTune(const eDVBFrontendParametersSatellite &feparm, iDVBFrontend *fe, int frontend_id, int *highest_score_lnb=0)=0;
        virtual void setRotorMoving(int slotid, bool)=0;
 };
@@ -508,6 +509,7 @@ public:
                /* direct frontend access for raw channels and/or status inquiries. */
        virtual SWIG_VOID(RESULT) getFrontend(ePtr<iDVBFrontend> &SWIG_OUTPUT)=0;
        virtual RESULT requestTsidOnid(SWIG_PYOBJECT(ePyObject) callback) { return -1; }
+       virtual int reserveDemux() { return -1; }
 #ifndef SWIG
        enum
        {
index 0e3e7e0..58fc5e3 100644 (file)
@@ -108,6 +108,9 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite
        {
                bool rotor=false;
                eDVBSatelliteLNBParameters &lnb_param = m_lnbs[idx];
+               bool is_unicable = lnb_param.SatCR_idx != -1;
+               bool is_unicable_position_switch = lnb_param.SatCR_positions > 1;
+
                if ( lnb_param.m_slot_mask & slot_id ) // lnb for correct tuner?
                {
                        int ret = 0;
@@ -163,7 +166,7 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite
 
                                eSecDebugNoSimulate("ret1 %d", ret);
 
-                               if (linked_in_use)
+                               if (linked_in_use && !is_unicable)
                                {
                                        // compare tuner data
                                        if ( (csw != linked_csw) ||
@@ -176,7 +179,7 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite
                                                ret += 15;
                                        eSecDebugNoSimulate("ret2 %d", ret);
                                }
-                               else if (satpos_depends_ptr != -1)
+                               else if ((satpos_depends_ptr != -1) && !(is_unicable && is_unicable_position_switch))
                                {
                                        eSecDebugNoSimulate("satpos depends");
                                        eDVBRegisteredFrontend *satpos_depends_to_fe = (eDVBRegisteredFrontend*) satpos_depends_ptr;
@@ -209,7 +212,7 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite
 
                                eSecDebugNoSimulate("ret5 %d", ret);
 
-                               if (ret)
+                               if (ret && lnb_param.SatCR_idx != -1)
                                {
                                        int lof = sat.frequency > lnb_param.m_lof_threshold ?
                                                lnb_param.m_lof_hi : lnb_param.m_lof_lo;
@@ -375,8 +378,8 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
                        {
                        // calc Frequency
                                local = abs(sat.frequency 
-                                       - ((lof - (lof % 1000)) + ((lof % 1000)>500 ? 1000 : 0)) ); //TODO für den Mist mal ein Macro schreiben
-                               parm.FREQUENCY = (local - (local % 125)) + ((local % 125)>62 ? 125 : 0);
+                                       - lof);
+                               parm.FREQUENCY = ((((local * 2) / 125) + 1) / 2) * 125;
                                frontend.setData(eDVBFrontend::FREQ_OFFSET, sat.frequency - parm.FREQUENCY);
 
                                if ( voltage_mode == eDVBSatelliteSwitchParameters::_14V
@@ -396,20 +399,21 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
                        }
                        else
                        {
-                               unsigned int tmp = abs(sat.frequency 
-                                               - ((lof - (lof % 1000)) + ((lof % 1000)>500 ? 1000 : 0)) )
+                               int tmp1 = abs(sat.frequency 
+                                               -lof)
                                                + lnb_param.SatCRvco
                                                - 1400000
                                                + lnb_param.guard_offset;
-                               parm.FREQUENCY = (lnb_param.SatCRvco - (tmp % 4000))+((tmp%4000)>2000?4000:0)+lnb_param.guard_offset;
-                               lnb_param.UnicableTuningWord = (((tmp / 4000)+((tmp%4000)>2000?1:0)) 
+                               int tmp2 = ((((tmp1 * 2) / 4000) + 1) / 2) * 4000;
+                               parm.FREQUENCY = lnb_param.SatCRvco - (tmp1-tmp2) + lnb_param.guard_offset;
+                               lnb_param.UnicableTuningWord = ((tmp2 / 4000) 
                                                | ((band & 1) ? 0x400 : 0)                      //HighLow
                                                | ((band & 2) ? 0x800 : 0)                      //VertHor
                                                | ((lnb_param.LNBNum & 1) ? 0 : 0x1000)                 //Umschaltung LNB1 LNB2
                                                | (lnb_param.SatCR_idx << 13));         //Adresse des SatCR
                                                eDebug("[prepare] UnicableTuningWord %#04x",lnb_param.UnicableTuningWord);
                                                eDebug("[prepare] guard_offset %d",lnb_param.guard_offset);
-                               frontend.setData(eDVBFrontend::FREQ_OFFSET, sat.frequency - ((lnb_param.UnicableTuningWord & 0x3FF) *4000 + 1400000 - lnb_param.SatCRvco + lof));
+                               frontend.setData(eDVBFrontend::FREQ_OFFSET, (lnb_param.UnicableTuningWord & 0x3FF) *4000 + 1400000 + lof - (2 * (lnb_param.SatCRvco - (tmp1-tmp2))) );
                        }
 
                        if (diseqc_mode >= eDVBSatelliteDiseqcParameters::V1_0)
@@ -743,10 +747,10 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
                                                        diseqc.data[3] = RotorCmd;
                                                        diseqc.data[4] = 0x00;
                                                }
-                                               if(lnb_param.SatCR_idx == -1)
+//                                             if(lnb_param.SatCR_idx == -1)
                                                {
                                                        int mrt = m_params[MOTOR_RUNNING_TIMEOUT]; // in seconds!
-                                                       if ( rotor_param.m_inputpower_parameters.m_use )
+                                                       if ( rotor_param.m_inputpower_parameters.m_use || lnb_param.SatCR_idx == -1)
                                                        { // use measure rotor input power to detect rotor state
                                                                bool turn_fast = need_turn_fast(rotor_param.m_inputpower_parameters.m_turning_speed);
                                                                eSecCommand::rotor cmd;
@@ -950,6 +954,40 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
        return -1;
 }
 
+void eDVBSatelliteEquipmentControl::prepareTurnOffSatCR(iDVBFrontend &frontend, int satcr)
+{
+       eSecCommandList sec_sequence;
+
+       // check if voltage is disabled
+       eSecCommand::pair compare;
+       compare.steps = +9;     //only close frontend
+       compare.voltage = iDVBFrontend::voltageOff;
+
+       sec_sequence.push_back( eSecCommand(eSecCommand::IF_VOLTAGE_GOTO, compare) );
+       sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltage13) );
+       sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_ENABLE_VOLTAGE_BEFORE_SWITCH_CMDS]) );
+
+       sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltage18_5) );
+       sec_sequence.push_back( eSecCommand(eSecCommand::SET_TONE, iDVBFrontend::toneOff) );
+       sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_VOLTAGE_CHANGE_BEFORE_SWITCH_CMDS]) );
+
+       eDVBDiseqcCommand diseqc;
+       memset(diseqc.data, 0, MAX_DISEQC_LENGTH);
+       diseqc.len = 5;
+       diseqc.data[0] = 0xE0;
+       diseqc.data[1] = 0x10;
+       diseqc.data[2] = 0x5A;
+       diseqc.data[3] = satcr << 5;
+       diseqc.data[4] = 0x00;
+
+       sec_sequence.push_back( eSecCommand(eSecCommand::SEND_DISEQC, diseqc) );
+       sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_LAST_DISEQC_CMD]) );
+       sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltage13) );
+       sec_sequence.push_back( eSecCommand(eSecCommand::DELAYED_CLOSE_FRONTEND) );
+
+       frontend.setSecSequence(sec_sequence);
+}
+
 RESULT eDVBSatelliteEquipmentControl::clear()
 {
        eSecDebug("eDVBSatelliteEquipmentControl::clear()");
@@ -1254,6 +1292,26 @@ RESULT eDVBSatelliteEquipmentControl::setLNBSatCRvco(int SatCRvco)
                return -ENOENT;
        return 0;
 }
+
+RESULT eDVBSatelliteEquipmentControl::setLNBSatCRpositions(int SatCR_positions)
+{
+       eSecDebug("eDVBSatelliteEquipmentControl::setLNBSatCRpositions(%d)", SatCR_positions);
+       if(SatCR_positions < 1 || SatCR_positions > 2)
+               return -EPERM;
+       if ( currentLNBValid() )
+               m_lnbs[m_lnbidx].SatCR_positions = SatCR_positions;
+       else
+               return -ENOENT;
+       return 0;
+}
+
+RESULT eDVBSatelliteEquipmentControl::getLNBSatCRpositions()
+{
+       if ( currentLNBValid() )
+               return m_lnbs[m_lnbidx].SatCR_positions;
+       return -ENOENT;
+}
+
 RESULT eDVBSatelliteEquipmentControl::getLNBSatCR()
 {
        if ( currentLNBValid() )
index c50aee4..ef8b1e0 100644 (file)
@@ -25,7 +25,8 @@ public:
                IF_TONE_GOTO, IF_NOT_TONE_GOTO,
                START_TUNE_TIMEOUT,
                SET_ROTOR_MOVING,
-               SET_ROTOR_STOPPED
+               SET_ROTOR_STOPPED,
+               DELAYED_CLOSE_FRONTEND
        };
        int cmd;
        struct rotor
@@ -103,6 +104,10 @@ public:
        {
                secSequence.push_back(cmd);
        }
+       void push_back(eSecCommandList &list)
+       {
+               secSequence.insert(end(), list.begin(), list.end());
+       }
        void clear()
        {
                secSequence.clear();
@@ -128,6 +133,12 @@ public:
        {
                return secSequence.size();
        }
+       eSecCommandList &operator=(const eSecCommandList &lst)
+       {
+               secSequence = lst.secSequence;
+               cur = begin();
+               return *this;
+       }
 };
 #endif
 
@@ -252,6 +263,7 @@ public:
 #define MAX_SATCR 8
 #define MAX_LNBNUM 32
 
+       int SatCR_positions;
        int SatCR_idx;
        unsigned int SatCRvco;
        unsigned int UnicableTuningWord;
@@ -311,6 +323,7 @@ public:
 #ifndef SWIG
        eDVBSatelliteEquipmentControl(eSmartPtrList<eDVBRegisteredFrontend> &avail_frontends, eSmartPtrList<eDVBRegisteredFrontend> &avail_simulate_frontends);
        RESULT prepare(iDVBFrontend &frontend, FRONTENDPARAMETERS &parm, const eDVBFrontendParametersSatellite &sat, int frontend_id, unsigned int tunetimeout);
+       void prepareTurnOffSatCR(iDVBFrontend &frontend, int satcr); // used for unicable
        int canTune(const eDVBFrontendParametersSatellite &feparm, iDVBFrontend *, int frontend_id, int *highest_score_lnb=0);
        bool currentLNBValid() { return m_lnbidx > -1 && m_lnbidx < (int)(sizeof(m_lnbs) / sizeof(eDVBSatelliteLNBParameters)); }
 #endif
@@ -346,9 +359,10 @@ public:
 /* Unicable Specific Parameters */
        RESULT setLNBSatCR(int SatCR_idx);
        RESULT setLNBSatCRvco(int SatCRvco);
-//     RESULT checkGuardOffset(const eDVBFrontendParametersSatellite &sat);
+       RESULT setLNBSatCRpositions(int SatCR_positions);
        RESULT getLNBSatCR();
        RESULT getLNBSatCRvco();
+       RESULT getLNBSatCRpositions();
 /* Satellite Specific Parameters */
        RESULT addSatellite(int orbital_position);
        RESULT setVoltageMode(int mode);
index b7d3c1d..a5db43a 100644 (file)
@@ -6,6 +6,11 @@
 #include <pthread.h>
 #include <sys/types.h>
 #include <unistd.h>
+#include <byteswap.h>
+
+#ifndef BYTE_ORDER
+#error "no BYTE_ORDER defined!"
+#endif
 
 // use this for init Freetype...
 #include <ft2build.h>
@@ -341,6 +346,8 @@ int eTextPara::appendGlyph(Font *current_font, FT_Face current_face, FT_UInt gly
                                i->x-=offset.x();
                                i->y-=offset.y();
                                i->bbox.moveBy(-offset.x(), -offset.y());
+                               --lineChars.back();
+                               ++charCount;
                        } while (i-- != glyphs.rbegin()); // rearrange them into the next line
                        cursor+=ePoint(linelength, 0);  // put the cursor after that line
                } else
@@ -378,6 +385,7 @@ int eTextPara::appendGlyph(Font *current_font, FT_Face current_face, FT_UInt gly
        ng.glyph_index = glyphIndex;
        ng.flags = flags;
        glyphs.push_back(ng);
+       ++charCount;
 
                /* when we have a SHY, don't xadvance. It will either be the last in the line (when used for breaking), or not displayed. */
        if (!(flags & GS_SOFTHYPHEN))
@@ -425,7 +433,13 @@ void eTextPara::newLine(int flags)
        cursor.setX(left);
        previous=0;
        int linegap=current_face->size->metrics.height-(current_face->size->metrics.ascender+current_face->size->metrics.descender);
+
+       lineOffsets.push_back(cursor.y());
+       lineChars.push_back(charCount);
+       charCount=0;
+
        cursor+=ePoint(0, (current_face->size->metrics.ascender+current_face->size->metrics.descender+linegap)>>6);
+
        if (maximum.height()<cursor.y())
                maximum.setHeight(cursor.y());
        previous=0;
@@ -595,22 +609,20 @@ int eTextPara::renderString(const char *string, int rflags)
        shape(uc_shape, uc_string);
        
                // now do the usual logical->visual reordering
-#ifdef HAVE_FRIBIDI    
+       int size=uc_shape.size();
+#ifdef HAVE_FRIBIDI
        FriBidiCharType dir=FRIBIDI_TYPE_ON;
-       {
-               int size=uc_shape.size();
-               uc_visual.resize(size);
-               // gaaanz lahm, aber anders geht das leider nicht, sorry.
-               FriBidiChar array[size], target[size];
-               std::copy(uc_shape.begin(), uc_shape.end(), array);
-               fribidi_log2vis(array, size, &dir, target, 0, 0, 0);
-               uc_visual.assign(target, target+size);
-       }
+       uc_visual.resize(size);
+       // gaaanz lahm, aber anders geht das leider nicht, sorry.
+       FriBidiChar array[size], target[size];
+       std::copy(uc_shape.begin(), uc_shape.end(), array);
+       fribidi_log2vis(array, size, &dir, target, 0, 0, 0);
+       uc_visual.assign(target, target+size);
 #else
        uc_visual=uc_shape;
 #endif
 
-       glyphs.reserve(uc_visual.size());
+       glyphs.reserve(size);
        
        int nextflags = 0;
        
@@ -704,8 +716,19 @@ nprint:    isprintable=0;
        calc_bbox();
 #ifdef HAVE_FRIBIDI
        if (dir & FRIBIDI_MASK_RTL)
+       {
                realign(dirRight);
+               doTopBottomReordering=true;
+       }
 #endif
+
+       if (charCount)
+       {
+               lineOffsets.push_back(cursor.y());
+               lineChars.push_back(charCount);
+               charCount=0;
+       }
+
        return 0;
 }
 
@@ -748,8 +771,9 @@ void eTextPara::blit(gDC &dc, const ePoint &offset, const gRGB &background, cons
        gColor *lookup8, lookup8_invert[16];
        gColor *lookup8_normal=0;
 
+       __u16 lookup16_normal[16], lookup16_invert[16], *lookup16;
        __u32 lookup32_normal[16], lookup32_invert[16], *lookup32;
-       
+
        if (surface->bpp == 8)
        {
                if (surface->clut.data)
@@ -763,10 +787,33 @@ void eTextPara::blit(gDC &dc, const ePoint &offset, const gRGB &background, cons
                        opcode=0;
                } else
                        opcode=1;
+       } else if (surface->bpp == 16)
+       {
+               opcode=2;
+               for (int i=0; i<16; ++i)
+               {
+#define BLEND(y, x, a) (y + (((x-y) * a)>>8))
+                       unsigned char da = background.a, dr = background.r, dg = background.g, db = background.b;
+                       int sa = i * 16;
+                       if (sa < 256)
+                       {
+                               dr = BLEND(background.r, foreground.r, sa) & 0xFF;
+                               dg = BLEND(background.g, foreground.g, sa) & 0xFF;
+                               db = BLEND(background.b, foreground.b, sa) & 0xFF;
+                       }
+#undef BLEND
+#if BYTE_ORDER == LITTLE_ENDIAN
+                       lookup16_normal[i] = bswap_16(((db >> 3) << 11) | ((dg >> 2) << 5) | (dr >> 3));
+#else
+                       lookup16_normal[i] = ((db >> 3) << 11) | ((dg >> 2) << 5) | (dr >> 3);
+#endif
+                       da ^= 0xFF;
+               }
+               for (int i=0; i<16; ++i)
+                       lookup16_invert[i]=lookup16_normal[i^0xF];
        } else if (surface->bpp == 32)
        {
                opcode=3;
-
                for (int i=0; i<16; ++i)
                {
 #define BLEND(y, x, a) (y + (((x-y) * a)>>8))
@@ -791,35 +838,47 @@ void eTextPara::blit(gDC &dc, const ePoint &offset, const gRGB &background, cons
                eWarning("can't render to %dbpp", surface->bpp);
                return;
        }
-       
+
        gRegion area(eRect(0, 0, surface->x, surface->y));
        gRegion clip = dc.getClip() & area;
 
        int buffer_stride=surface->stride;
-       
+
        for (unsigned int c = 0; c < clip.rects.size(); ++c)
        {
-               for (glyphString::iterator i(glyphs.begin()); i != glyphs.end(); ++i)
+               std::list<int>::reverse_iterator line_offs_it(lineOffsets.rbegin());
+               std::list<int>::iterator line_chars_it(lineChars.begin());
+               int line_offs=0;
+               int line_chars=0;
+               for (glyphString::iterator i(glyphs.begin()); i != glyphs.end(); ++i, --line_chars)
                {
+                       while(!line_chars)
+                       {
+                               line_offs = *(line_offs_it++);
+                               line_chars = *(line_chars_it++);
+                       }
+
                        if (i->flags & GS_SOFTHYPHEN)
                                continue;
 
                        if (!(i->flags & GS_INVERT))
                        {
                                lookup8 = lookup8_normal;
+                               lookup16 = lookup16_normal;
                                lookup32 = lookup32_normal;
                        } else
                        {
                                lookup8 = lookup8_invert;
+                               lookup16 = lookup16_invert;
                                lookup32 = lookup32_invert;
                        }
-               
+
                        static FTC_SBit glyph_bitmap;
                        if (fontRenderClass::instance->getGlyphBitmap(&i->font->font, i->glyph_index, &glyph_bitmap))
                                continue;
                        int rx=i->x+glyph_bitmap->left + offset.x();
-                       int ry=i->y-glyph_bitmap->top  + offset.y();
-               
+                       int ry=(doTopBottomReordering ? line_offs : i->y) - glyph_bitmap->top + offset.y();
+
                        __u8 *d=(__u8*)(surface->data)+buffer_stride*ry+rx*surface->bypp;
                        __u8 *s=glyph_bitmap->buffer;
                        register int sx=glyph_bitmap->width;
@@ -845,46 +904,76 @@ void eTextPara::blit(gDC &dc, const ePoint &offset, const gRGB &background, cons
                                d+=diff*buffer_stride;
                        }
                        if (sx>0)
-                               for (int ay=0; ay<sy; ay++)
-                               {
-                                       if (!opcode)            // 4bit lookup to 8bit
+                       {
+                               switch(opcode) {
+                               case 0: // 4bit lookup to 8bit
+                                       for (int ay=0; ay<sy; ay++)
                                        {
                                                register __u8 *td=d;
                                                register int ax;
-                                               
                                                for (ax=0; ax<sx; ax++)
-                                               {       
+                                               {
                                                        register int b=(*s++)>>4;
                                                        if(b)
                                                                *td++=lookup8[b];
                                                        else
                                                                td++;
                                                }
-                                       } else if (opcode == 1) // 8bit direct
+                                               s+=glyph_bitmap->pitch-sx;
+                                               d+=buffer_stride;
+                                       }
+                                       break;
+                               case 1: // 8bit direct
+                                       for (int ay=0; ay<sy; ay++)
                                        {
                                                register __u8 *td=d;
                                                register int ax;
                                                for (ax=0; ax<sx; ax++)
-                                               {       
+                                               {
                                                        register int b=*s++;
                                                        *td++^=b;
                                                }
-                                       } else
+                                               s+=glyph_bitmap->pitch-sx;
+                                               d+=buffer_stride;
+                                       }
+                                       break;
+                               case 2: // 16bit
+                                       for (int ay=0; ay<sy; ay++)
+                                       {
+                                               register __u16 *td=(__u16*)d;
+                                               register int ax;
+                                               for (ax=0; ax<sx; ax++)
+                                               {
+                                                       register int b=(*s++)>>4;
+                                                       if(b)
+                                                               *td++=lookup16[b];
+                                                       else
+                                                               td++;
+                                               }
+                                               s+=glyph_bitmap->pitch-sx;
+                                               d+=buffer_stride;
+                                       }
+                                       break;
+                               case 3: // 32bit
+                                       for (int ay=0; ay<sy; ay++)
                                        {
                                                register __u32 *td=(__u32*)d;
                                                register int ax;
                                                for (ax=0; ax<sx; ax++)
-                                               {       
+                                               {
                                                        register int b=(*s++)>>4;
                                                        if(b)
                                                                *td++=lookup32[b];
                                                        else
                                                                td++;
                                                }
+                                               s+=glyph_bitmap->pitch-sx;
+                                               d+=buffer_stride;
                                        }
-                                       s+=glyph_bitmap->pitch-sx;
-                                       d+=buffer_stride;
+                               default:
+                                       break;
                                }
+                       }
                }
        }
 }
index 2643fda..7dd9f89 100644 (file)
@@ -14,6 +14,7 @@ typedef FTC_ImageTypeRec FTC_Image_Desc;
 typedef FTC_SBitCache FTC_SBit_Cache;
 #endif
 #include <vector>
+#include <list>
 
 #include <lib/gdi/fb.h>
 #include <lib/gdi/esize.h>
@@ -113,6 +114,10 @@ class eTextPara: public iObject
        eSize maximum;
        int left;
        glyphString glyphs;
+       std::list<int> lineOffsets;
+       std::list<int> lineChars;
+       int charCount;
+       bool doTopBottomReordering;
 
        int appendGlyph(Font *current_font, FT_Face current_face, FT_UInt glyphIndex, int flags, int rflags);
        void newLine(int flags);
@@ -120,10 +125,12 @@ class eTextPara: public iObject
        eRect boundBox;
        void calc_bbox();
        int bboxValid;
+       void clear();
 public:
        eTextPara(eRect area, ePoint start=ePoint(-1, -1))
-               : current_font(0), replacement_font(0), current_face(0), replacement_face(0),
-                       area(area), cursor(start), maximum(0, 0), left(start.x()), bboxValid(0)
+               :current_font(0), replacement_font(0), current_face(0), replacement_face(0)
+               ,area(area), cursor(start), maximum(0, 0), left(start.x()), charCount(0)
+               ,doTopBottomReordering(false), bboxValid(0)
        {
        }
        virtual ~eTextPara();
@@ -134,7 +141,7 @@ public:
        void setFont(const gFont *font);
        int renderString(const char *string, int flags=0);
 
-       void clear();
+
 
        void blit(gDC &dc, const ePoint &offset, const gRGB &background, const gRGB &foreground);
 
index 2a2973a..096705e 100755 (executable)
@@ -14,13 +14,13 @@ gLCDDC::gLCDDC()
 
        surface.x=lcd->size().width();
        surface.y=lcd->size().height();
-       surface.bpp=8;
-       surface.bypp=1;
        surface.stride=lcd->stride();
+       surface.bypp=surface.stride / surface.x;
+       surface.bpp=surface.bypp*8;
        surface.data=lcd->buffer();
-
-       surface.clut.colors=256;
+       surface.clut.colors=0;
        surface.clut.data=0;
+
        m_pixmap = new gPixmap(&surface);
 }
 
index 3e64310..0e8d39e 100644 (file)
@@ -3,6 +3,11 @@
 #include <lib/gdi/gpixmap.h>
 #include <lib/gdi/region.h>
 #include <lib/gdi/accel.h>
+#include <byteswap.h>
+
+#ifndef BYTE_ORDER
+#error "no BYTE_ORDER defined!"
+#endif
 
 gLookup::gLookup()
        :size(0), lookup(0)
@@ -154,6 +159,26 @@ void gPixmap::fill(const gRegion &region, const gColor &color)
                {
                        for (int y=area.top(); y<area.bottom(); y++)
                                memset(((__u8*)surface->data)+y*surface->stride+area.left(), color.color, area.width());
+               } else if (surface->bpp == 16)
+               {
+                       __u32 icol;
+
+                       if (surface->clut.data && color < surface->clut.colors)
+                               icol=(surface->clut.data[color].a<<24)|(surface->clut.data[color].r<<16)|(surface->clut.data[color].g<<8)|(surface->clut.data[color].b);
+                       else
+                               icol=0x10101*color;
+#if BYTE_ORDER == LITTLE_ENDIAN
+                       __u16 col = bswap_16(((icol & 0xFF) >> 3) << 11 | ((icol & 0xFF00) >> 10) << 5 | (icol & 0xFF0000) >> 19);
+#else
+                       __u16 col = ((icol & 0xFF) >> 3) << 11 | ((icol & 0xFF00) >> 10) << 5 | (icol & 0xFF0000) >> 19;
+#endif
+                       for (int y=area.top(); y<area.bottom(); y++)
+                       {
+                               __u16 *dst=(__u16*)(((__u8*)surface->data)+y*surface->stride+area.left()*surface->bypp);
+                               int x=area.width();
+                               while (x--)
+                                       *dst++=col;
+                       }
                } else if (surface->bpp == 32)
                {
                        __u32 col;
@@ -208,18 +233,33 @@ void gPixmap::fill(const gRegion &region, const gRGB &color)
                                while (x--)
                                        *dst++=col;
                        }
+               } else if (surface->bpp == 16)
+               {
+                       __u32 icol = color.argb();
+#if BYTE_ORDER == LITTLE_ENDIAN
+                       __u16 col = bswap_16(((icol & 0xFF) >> 3) << 11 | ((icol & 0xFF00) >> 10) << 5 | (icol & 0xFF0000) >> 19);
+#else
+                       __u16 col = ((icol & 0xFF) >> 3) << 11 | ((icol & 0xFF00) >> 10) << 5 | (icol & 0xFF0000) >> 19;
+#endif
+                       for (int y=area.top(); y<area.bottom(); y++)
+                       {
+                               __u16 *dst=(__u16*)(((__u8*)surface->data)+y*surface->stride+area.left()*surface->bypp);
+                               int x=area.width();
+                               while (x--)
+                                       *dst++=col;
+                       }
                }       else
                        eWarning("couldn't rgbfill %d bpp", surface->bpp);
        }
 }
 
-static void blit_8i_to_32(__u32 *dst, __u8 *src, __u32 *pal, int width)
+static inline void blit_8i_to_32(__u32 *dst, __u8 *src, __u32 *pal, int width)
 {
        while (width--)
                *dst++=pal[*src++];
 }
 
-static void blit_8i_to_32_at(__u32 *dst, __u8 *src, __u32 *pal, int width)
+static inline void blit_8i_to_32_at(__u32 *dst, __u8 *src, __u32 *pal, int width)
 {
        while (width--)
        {
@@ -232,6 +272,25 @@ static void blit_8i_to_32_at(__u32 *dst, __u8 *src, __u32 *pal, int width)
        }
 }
 
+static inline void blit_8i_to_16(__u16 *dst, __u8 *src, __u32 *pal, int width)
+{
+       while (width--)
+               *dst++=pal[*src++] & 0xFFFF;
+}
+
+static inline void blit_8i_to_16_at(__u16 *dst, __u8 *src, __u32 *pal, int width)
+{
+       while (width--)
+       {
+               if (!(pal[*src]&0x80000000))
+               {
+                       src++;
+                       dst++;
+               } else
+                       *dst++=pal[*src++] & 0xFFFF;
+       }
+}
+
                /* WARNING, this function is not endian safe! */
 static void blit_8i_to_32_ab(__u32 *dst, __u8 *src, __u32 *pal, int width)
 {
@@ -441,6 +500,95 @@ void gPixmap::blit(const gPixmap &src, const eRect &_pos, const gRegion &clip, i
                                srcptr+=src.surface->stride;
                                dstptr+=surface->stride;
                        }
+               } else if ((surface->bpp == 16) && (src.surface->bpp==8))
+               {
+                       __u8 *srcptr=(__u8*)src.surface->data;
+                       __u8 *dstptr=(__u8*)surface->data; // !!
+                       __u32 pal[256];
+
+                       for (int i=0; i<256; ++i)
+                       {
+                               __u32 icol;
+                               if (src.surface->clut.data && (i<src.surface->clut.colors))
+                                       icol=(src.surface->clut.data[i].a<<24)|(src.surface->clut.data[i].r<<16)|(src.surface->clut.data[i].g<<8)|(src.surface->clut.data[i].b);
+                               else
+                                       icol=0x010101*i;
+#if BYTE_ORDER == LITTLE_ENDIAN
+                               pal[i] = bswap_16(((icol & 0xFF) >> 3) << 11 | ((icol & 0xFF00) >> 10) << 5 | (icol & 0xFF0000) >> 19);
+#else
+                               pal[i] = ((icol & 0xFF) >> 3) << 11 | ((icol & 0xFF00) >> 10) << 5 | (icol & 0xFF0000) >> 19;
+#endif
+                               pal[i]^=0xFF000000;
+                       }
+
+                       srcptr+=srcarea.left()*src.surface->bypp+srcarea.top()*src.surface->stride;
+                       dstptr+=area.left()*surface->bypp+area.top()*surface->stride;
+
+                       if (flag & blitAlphaBlend)
+                               eWarning("ignore unsupported 8bpp -> 16bpp alphablend!");
+
+                       for (int y=0; y<area.height(); y++)
+                       {
+                               int width=area.width();
+                               unsigned char *psrc=(unsigned char*)srcptr;
+                               __u16 *dst=(__u16*)dstptr;
+                               if (flag & blitAlphaTest)
+                                       blit_8i_to_16_at(dst, psrc, pal, width);
+                               else
+                                       blit_8i_to_16(dst, psrc, pal, width);
+                               srcptr+=src.surface->stride;
+                               dstptr+=surface->stride;
+                       }
+               } else if ((surface->bpp == 16) && (src.surface->bpp==32))
+               {
+                       __u8 *srcptr=(__u8*)src.surface->data;
+                       __u8 *dstptr=(__u8*)surface->data;
+
+                       srcptr+=srcarea.left()+srcarea.top()*src.surface->stride;
+                       dstptr+=area.left()+area.top()*surface->stride;
+
+                       if (flag & blitAlphaBlend)
+                               eWarning("ignore unsupported 32bpp -> 16bpp alphablend!");
+
+                       for (int y=0; y<area.height(); y++)
+                       {
+                               int width=area.width();
+                               __u32 *srcp=(__u32*)srcptr;
+                               __u16 *dstp=(__u16*)dstptr;
+
+                               if (flag & blitAlphaTest)
+                               {
+                                       while (width--)
+                                       {
+                                               if (!((*srcp)&0xFF000000))
+                                               {
+                                                       srcp++;
+                                                       dstp++;
+                                               } else
+                                               {
+                                                       __u32 icol = *srcp++;
+#if BYTE_ORDER == LITTLE_ENDIAN
+                                                       *dstp++ = bswap_16(((icol & 0xFF) >> 3) << 11 | ((icol & 0xFF00) >> 10) << 5 | (icol & 0xFF0000) >> 19);
+#else
+                                                       *dstp++ = ((icol & 0xFF) >> 3) << 11 | ((icol & 0xFF00) >> 10) << 5 | (icol & 0xFF0000) >> 19;
+#endif
+                                               }
+                                       }
+                               } else
+                               {
+                                       while (width--)
+                                       {
+                                               __u32 icol = *srcp++;
+#if BYTE_ORDER == LITTLE_ENDIAN
+                                               *dstp++ = bswap_16(((icol & 0xFF) >> 3) << 11 | ((icol & 0xFF00) >> 10) << 5 | (icol & 0xFF0000) >> 19);
+#else
+                                               *dstp++ = ((icol & 0xFF) >> 3) << 11 | ((icol & 0xFF00) >> 10) << 5 | (icol & 0xFF0000) >> 19;
+#endif
+                                       }
+                               }
+                               srcptr+=src.surface->stride;
+                               dstptr+=surface->stride;
+                       }
                } else
                        eWarning("cannot blit %dbpp from %dbpp", surface->bpp, src.surface->bpp);
        }
@@ -488,27 +636,34 @@ static inline int sgn(int a)
 void gPixmap::line(const gRegion &clip, ePoint start, ePoint dst, gColor color)
 {
        __u8 *srf8 = 0;
-       __u32 *srf32 = 0; 
+       __u16 *srf16 = 0;
+       __u32 *srf32 = 0;
        int stride = surface->stride;
-       
+
        if (clip.rects.empty())
                return;
-               
+
+       __u16 col16;
        __u32 col = 0;
        if (surface->bpp == 8)
-       {
                srf8 = (__u8*)surface->data;
-       } else if (surface->bpp == 32)
+       else
        {
                srf32 = (__u32*)surface->data;
-               
                if (surface->clut.data && color < surface->clut.colors)
                        col=(surface->clut.data[color].a<<24)|(surface->clut.data[color].r<<16)|(surface->clut.data[color].g<<8)|(surface->clut.data[color].b);
                else
                        col=0x10101*color;
-               col^=0xFF000000;                        
+               col^=0xFF000000;
        }
-       
+
+       if (surface->bpp == 16)
+#if BYTE_ORDER == LITTLE_ENDIAN
+               col16=bswap_16(((col & 0xFF) >> 3) << 11 | ((col & 0xFF00) >> 10) << 5 | (col & 0xFF0000) >> 19);
+#else
+               col16=((col & 0xFF) >> 3) << 11 | ((col & 0xFF00) >> 10) << 5 | (col & 0xFF0000) >> 19;
+#endif
+
        int xa = start.x(), ya = start.y(), xb = dst.x(), yb = dst.y();
        int dx, dy, x, y, s1, s2, e, temp, swap, i;
        dy=abs(yb-ya);
@@ -526,7 +681,7 @@ void gPixmap::line(const gRegion &clip, ePoint start, ePoint dst, gColor color)
        } else
                swap=0;
        e = 2*dy-dx;
-       
+
        int lasthit = 0;
        for(i=1; i<=dx; i++)
        {
@@ -563,20 +718,25 @@ void gPixmap::line(const gRegion &clip, ePoint start, ePoint dst, gColor color)
                        } while (!clip.rects[a].contains(x, y));
                        lasthit = a;
                }
-               
+
                if (srf8)
                        srf8[y * stride + x] = color;
-               if (srf32)
+               else if (srf16)
+                       srf16[y * stride/2 + x] = col16;
+               else
                        srf32[y * stride/4 + x] = col;
 fail:
                while (e>=0)
                {
-                       if (swap==1) x+=s1;
-                       else y+=s2;
+                       if (swap==1)
+                               x+=s1;
+                       else
+                               y+=s2;
                        e-=2*dx;
                }
-    if (swap==1)
-       y+=s2;
+
+               if (swap==1)
+                       y+=s2;
                else
                        x+=s1;
                e+=2*dy;
index c8560ac..9cb657c 100755 (executable)
 
 eDBoxLCD *eDBoxLCD::instance;
 
-eLCD::eLCD(eSize size): res(size)
+eLCD::eLCD()
 {
        lcdfd = -1;
        locked=0;
-       _buffer=new unsigned char[res.height()*res.width()];
-       memset(_buffer, 0, res.height()*res.width());
-       _stride=res.width();
+}
+
+void eLCD::setSize(int xres, int yres, int bpp)
+{
+       res = eSize(xres, yres);
+       _buffer=new unsigned char[xres * yres * bpp/8];
+       memset(_buffer, 0, res.height()*res.width()*bpp/8);
+       _stride=res.width()*bpp/8;
+       eDebug("lcd buffer %p %d bytes, stride %d", _buffer, xres*yres*bpp/8, _stride);
 }
 
 eLCD::~eLCD()
@@ -42,14 +48,17 @@ void eLCD::unlock()
        locked=0;
 }
 
-eDBoxLCD::eDBoxLCD(): eLCD(eSize(132, 64))
+eDBoxLCD::eDBoxLCD()
 {
+       int xres=132, yres=64, bpp=8;
        is_oled = 0;
 #ifndef NO_LCD
        lcdfd = open("/dev/dbox/oled0", O_RDWR);
        if (lcdfd < 0)
        {
-               FILE *f=fopen("/proc/stb/fp/oled_brightness", "w");
+               FILE *f=fopen("/proc/stb/lcd/oled_brightness", "w");
+               if (!f)
+                       f = fopen("/proc/stb/fp/oled_brightness", "w");
                if (f)
                {
                        is_oled = 2;
@@ -73,13 +82,37 @@ eDBoxLCD::eDBoxLCD(): eLCD(eSize(132, 64))
                int i=LCD_MODE_BIN;
                ioctl(lcdfd, LCD_IOCTL_ASC_MODE, &i);
                inverted=0;
+               FILE *f = fopen("/proc/stb/lcd/xres", "r");
+               if (f)
+               {
+                       int tmp;
+                       if (fscanf(f, "%x", &tmp) == 1)
+                               xres = tmp;
+                       fclose(f);
+                       f = fopen("/proc/stb/lcd/yres", "r");
+                       if (f)
+                       {
+                               if (fscanf(f, "%x", &tmp) == 1)
+                                       yres = tmp;
+                               fclose(f);
+                               f = fopen("/proc/stb/lcd/bpp", "r");
+                               if (f)
+                               {
+                                       if (fscanf(f, "%x", &tmp) == 1)
+                                               bpp = tmp;
+                                       fclose(f);
+                               }
+                       }
+                       is_oled = 3;
+               }
        }
+       setSize(xres, yres, bpp);
 }
 
 void eDBoxLCD::setInverted(unsigned char inv)
 {
        inverted=inv;
-       update();       
+       update();
 }
 
 int eDBoxLCD::setLCDContrast(int contrast)
@@ -102,11 +135,13 @@ int eDBoxLCD::setLCDContrast(int contrast)
 int eDBoxLCD::setLCDBrightness(int brightness)
 {
        eDebug("setLCDBrightness %d", brightness);
-       FILE *f=fopen("/proc/stb/fp/oled_brightness", "w");
+       FILE *f=fopen("/proc/stb/lcd/oled_brightness", "w");
+       if (!f)
+               f = fopen("/proc/stb/fp/oled_brightness", "w");
        if (f)
        {
                if (fprintf(f, "%d", brightness) == 0)
-                       eDebug("write /proc/stb/fp/oled_brightness failed!! (%m)");
+                       eDebug("write /proc/stb/lcd/oled_brightness failed!! (%m)");
                fclose(f);
        }
        else
@@ -144,42 +179,52 @@ void eDBoxLCD::update()
 #ifdef BUILD_VUPLUS /* ikseong  */
        return ;
 #endif
-       if (!is_oled || is_oled == 2)
+       if (lcdfd >= 0)
        {
-               unsigned char raw[132*8];
-               int x, y, yy;
-               for (y=0; y<8; y++)
+               if (!is_oled || is_oled == 2)
                {
-                       for (x=0; x<132; x++)
+                       unsigned char raw[132*8];
+                       int x, y, yy;
+                       for (y=0; y<8; y++)
                        {
-                               int pix=0;
-                               for (yy=0; yy<8; yy++)
+                               for (x=0; x<132; x++)
                                {
-                                       pix|=(_buffer[(y*8+yy)*132+x]>=108)<<yy;
+                                       int pix=0;
+                                       for (yy=0; yy<8; yy++)
+                                       {
+                                               pix|=(_buffer[(y*8+yy)*132+x]>=108)<<yy;
+                                       }
+                                       raw[y*132+x]=(pix^inverted);
                                }
-                               raw[y*132+x]=(pix^inverted);
                        }
-               }
-               if (lcdfd >= 0)
                        write(lcdfd, raw, 132*8);
-       } else
-       {
-               unsigned char raw[64*64];
-               int x, y;
-               memset(raw, 0, 64*64);
-               for (y=0; y<64; y++)
+               }
+               else if (is_oled == 3) {
+                       FILE *f = fopen("/tmp/bla", "w+");
+                       if (f) {
+                               fwrite(_buffer, _stride * res.height(), 1, f);
+                               fclose(f);
+                       }
+                       write(lcdfd, _buffer, _stride * res.height());
+               }
+               else
                {
-                       int pix=0;
-                       for (x=0; x<128 / 2; x++)
+                       unsigned char raw[64*64];
+                       int x, y;
+                       memset(raw, 0, 64*64);
+                       for (y=0; y<64; y++)
                        {
-                               pix = (_buffer[y*132 + x * 2 + 2] & 0xF0) |(_buffer[y*132 + x * 2 + 1 + 2] >> 4);
-                               if (inverted)
-                                       pix = 0xFF - pix;
-                               raw[y*64+x] = pix;
+                               int pix=0;
+                               for (x=0; x<128 / 2; x++)
+                               {
+                                       pix = (_buffer[y*132 + x * 2 + 2] & 0xF0) |(_buffer[y*132 + x * 2 + 1 + 2] >> 4);
+                                       if (inverted)
+                                               pix = 0xFF - pix;
+                                       raw[y*64+x] = pix;
+                               }
                        }
-               }
-               if (lcdfd >= 0)
                        write(lcdfd, raw, 64*64);
+               }
        }
 }
 
index 99f921b..e7b4c2c 100644 (file)
 class eLCD
 {
 #ifdef SWIG
-       eLCD(eSize size);
+       eLCD();
        ~eLCD();
 #else
 protected:
+       void setSize(int xres, int yres, int bpp);
        eSize res;
        unsigned char *_buffer;
        int lcdfd;
@@ -29,12 +30,11 @@ public:
        int islocked() { return locked; }
        bool detected() { return lcdfd >= 0; }
 #ifndef SWIG
-       eLCD(eSize size);
+       eLCD();
        virtual ~eLCD();
        __u8 *buffer() { return (__u8*)_buffer; }
        int stride() { return _stride; }
        eSize size() { return res; }
-       
        virtual void update()=0;
 #endif
 };
index 1d0323c..43fbc59 100644 (file)
@@ -516,7 +516,7 @@ void eListboxPythonMultiContent::setSelectionClip(eRect &rect, bool update)
                m_listbox->entryChanged(m_cursor);
 }
 
-static void clearRegionHelper(gPainter &painter, eListboxStyle *local_style, const ePoint &offset, ePyObject &pbackColor, bool cursorValid)
+static void clearRegionHelper(gPainter &painter, eListboxStyle *local_style, const ePoint &offset, ePyObject &pbackColor, bool cursorValid, bool clear=true)
 {
        if (pbackColor)
        {
@@ -538,10 +538,11 @@ static void clearRegionHelper(gPainter &painter, eListboxStyle *local_style, con
                else if (local_style->m_transparent_background)
                        return;
        }
-       painter.clear();
+       if (clear)
+               painter.clear();
 }
 
-static void clearRegionSelectedHelper(gPainter &painter, eListboxStyle *local_style, const ePoint &offset, ePyObject &pbackColorSelected, bool cursorValid)
+static void clearRegionSelectedHelper(gPainter &painter, eListboxStyle *local_style, const ePoint &offset, ePyObject &pbackColorSelected, bool cursorValid, bool clear=true)
 {
        if (pbackColorSelected)
        {
@@ -561,10 +562,11 @@ static void clearRegionSelectedHelper(gPainter &painter, eListboxStyle *local_st
                        return;
                }
        }
-       painter.clear();
+       if (clear)
+               painter.clear();
 }
 
-static void clearRegion(gPainter &painter, eWindowStyle &style, eListboxStyle *local_style, ePyObject pforeColor, ePyObject pforeColorSelected, ePyObject pbackColor, ePyObject pbackColorSelected, int selected, gRegion &rc, eRect &sel_clip, const ePoint &offset, bool cursorValid)
+static void clearRegion(gPainter &painter, eWindowStyle &style, eListboxStyle *local_style, ePyObject pforeColor, ePyObject pforeColorSelected, ePyObject pbackColor, ePyObject pbackColorSelected, int selected, gRegion &rc, eRect &sel_clip, const ePoint &offset, bool cursorValid, bool clear=true)
 {
        if (selected && sel_clip.valid())
        {
@@ -573,7 +575,7 @@ static void clearRegion(gPainter &painter, eWindowStyle &style, eListboxStyle *l
                {
                        painter.clip(part);
                        style.setStyle(painter, eWindowStyle::styleListboxNormal);
-                       clearRegionHelper(painter, local_style, offset, pbackColor, cursorValid);
+                       clearRegionHelper(painter, local_style, offset, pbackColor, cursorValid, clear);
                        painter.clippop();
                        selected = 0;
                }
@@ -582,7 +584,7 @@ static void clearRegion(gPainter &painter, eWindowStyle &style, eListboxStyle *l
                {
                        painter.clip(part);
                        style.setStyle(painter, eWindowStyle::styleListboxSelected);
-                       clearRegionSelectedHelper(painter, local_style, offset, pbackColorSelected, cursorValid);
+                       clearRegionSelectedHelper(painter, local_style, offset, pbackColorSelected, cursorValid, clear);
                        painter.clippop();
                        selected = 1;
                }
@@ -590,14 +592,14 @@ static void clearRegion(gPainter &painter, eWindowStyle &style, eListboxStyle *l
        else if (selected)
        {
                style.setStyle(painter, eWindowStyle::styleListboxSelected);
-               clearRegionSelectedHelper(painter, local_style, offset, pbackColorSelected, cursorValid);
+               clearRegionSelectedHelper(painter, local_style, offset, pbackColorSelected, cursorValid, clear);
                if (local_style && local_style->m_selection)
                        painter.blit(local_style->m_selection, offset, eRect(), gPainter::BT_ALPHATEST);
        }
        else
        {
                style.setStyle(painter, eWindowStyle::styleListboxNormal);
-               clearRegionHelper(painter, local_style, offset, pbackColor, cursorValid);
+               clearRegionHelper(painter, local_style, offset, pbackColor, cursorValid, clear);
        }
 
        if (selected)
@@ -820,7 +822,8 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
 
                                {
                                        gRegion rc(rect);
-                                       clearRegion(painter, style, local_style, pforeColor, pforeColorSelected, pbackColor, pbackColorSelected, selected, rc, sel_clip, offset, cursorValid);
+                                       bool mustClear = (selected && pbackColorSelected) || (!selected && pbackColor);
+                                       clearRegion(painter, style, local_style, pforeColor, pforeColorSelected, pbackColor, pbackColorSelected, selected, rc, sel_clip, offset, cursorValid, mustClear);
                                }
 
                                painter.setFont(m_font[fnt]);
@@ -854,6 +857,10 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
                                }
                                break;
                        }
+                       case TYPE_PROGRESS_PIXMAP: // Progress
+                       /*
+                               (1, x, y, width, height, filled_percent, pixmap [, borderWidth, foreColor, backColor, backColorSelected] )
+                       */
                        case TYPE_PROGRESS: // Progress
                        {
                        /*
@@ -864,41 +871,55 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
                                                        pwidth = PyTuple_GET_ITEM(item, 3),
                                                        pheight = PyTuple_GET_ITEM(item, 4),
                                                        pfilled_perc = PyTuple_GET_ITEM(item, 5),
-                                                       pborderWidth, pforeColor, pforeColorSelected, pbackColor, pbackColorSelected;
-
-                               if (!(px && py && pwidth && pheight && pfilled_perc))
+                                                       ppixmap, pborderWidth, pforeColor, pforeColorSelected, pbackColor, pbackColorSelected;
+                               int idx = 6;
+                               if (type == TYPE_PROGRESS)
                                {
-                                       eDebug("eListboxPythonMultiContent received too small tuple (must be (TYPE_PROGRESS, x, y, width, height, filled percent [,border width, foreColor, backColor, backColorSelected]))");
-                                       goto error_out;
+                                       if (!(px && py && pwidth && pheight && pfilled_perc))
+                                       {
+                                               eDebug("eListboxPythonMultiContent received too small tuple (must be (TYPE_PROGRESS, x, y, width, height, filled percent [,border width, foreColor, backColor, backColorSelected]))");
+                                               goto error_out;
+                                       }
+                               }
+                               else
+                               {
+                                       ppixmap = PyTuple_GET_ITEM(item, idx++);
+                                       if (ppixmap == Py_None)
+                                               continue;
+                                       if (!(px && py && pwidth && pheight && pfilled_perc, ppixmap))
+                                       {
+                                               eDebug("eListboxPythonMultiContent received too small tuple (must be (TYPE_PROGRESS_PIXMAP, x, y, width, height, filled percent, pixmap, [,border width, foreColor, backColor, backColorSelected]))");
+                                               goto error_out;
+                                       }
                                }
 
-                               if (size > 6)
+                               if (size > idx)
                                {
-                                       pborderWidth = PyTuple_GET_ITEM(item, 6);
+                                       pborderWidth = PyTuple_GET_ITEM(item, idx++);
                                        if (pborderWidth == Py_None)
                                                pborderWidth = ePyObject();
                                }
-                               if (size > 7)
+                               if (size > idx)
                                {
-                                       pforeColor = PyTuple_GET_ITEM(item, 7);
+                                       pforeColor = PyTuple_GET_ITEM(item, idx++);
                                        if (pforeColor == Py_None)
                                                pforeColor = ePyObject();
                                }
-                               if (size > 8)
+                               if (size > idx)
                                {
-                                       pforeColorSelected = PyTuple_GET_ITEM(item, 8);
+                                       pforeColorSelected = PyTuple_GET_ITEM(item, idx++);
                                        if (pforeColorSelected == Py_None)
                                                pforeColorSelected=ePyObject();
                                }
-                               if (size > 9)
+                               if (size > idx)
                                {
-                                       pbackColor = PyTuple_GET_ITEM(item, 9);
+                                       pbackColor = PyTuple_GET_ITEM(item, idx++);
                                        if (pbackColor == Py_None)
                                                pbackColor=ePyObject();
                                }
-                               if (size > 10)
+                               if (size > idx)
                                {
-                                       pbackColorSelected = PyTuple_GET_ITEM(item, 10);
+                                       pbackColorSelected = PyTuple_GET_ITEM(item, idx++);
                                        if (pbackColorSelected == Py_None)
                                                pbackColorSelected=ePyObject();
                                }
@@ -923,7 +944,8 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
 
                                {
                                        gRegion rc(rect);
-                                       clearRegion(painter, style, local_style, pforeColor, pforeColorSelected, pbackColor, pbackColorSelected, selected, rc, sel_clip, offset, cursorValid);
+                                       bool mustClear = (selected && pbackColorSelected) || (!selected && pbackColor);
+                                       clearRegion(painter, style, local_style, pforeColor, pforeColorSelected, pbackColor, pbackColorSelected, selected, rc, sel_clip, offset, cursorValid, mustClear);
                                }
 
                                // border
@@ -939,12 +961,24 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
                                rect.setRect(x+width-bwidth, y+bwidth, bwidth, height-bwidth);
                                painter.fill(rect);
 
-                               // progress
                                rect.setRect(x+bwidth, y+bwidth, (width-bwidth*2) * filled / 100, height-bwidth*2);
-                               painter.fill(rect);
 
-                               painter.clippop();
+                               // progress
+                               if (ppixmap)
+                               {
+                                       ePtr<gPixmap> pixmap;
+                                       if (SwigFromPython(pixmap, ppixmap))
+                                       {
+                                               eDebug("eListboxPythonMultiContent (Pixmap) get pixmap failed");
+                                               painter.clippop();
+                                               continue;
+                                       }
+                                       painter.blit(pixmap, rect.topLeft(), rect, 0);
+                               }
+                               else
+                                       painter.fill(rect);
 
+                               painter.clippop();
                                break;
                        }
                        case TYPE_PIXMAP_ALPHABLEND:
@@ -997,7 +1031,8 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
 
                                {
                                        gRegion rc(rect);
-                                       clearRegion(painter, style, local_style, ePyObject(), ePyObject(), pbackColor, pbackColorSelected, selected, rc, sel_clip, offset, cursorValid);
+                                       bool mustClear = (selected && pbackColorSelected) || (!selected && pbackColor);
+                                       clearRegion(painter, style, local_style, ePyObject(), ePyObject(), pbackColor, pbackColorSelected, selected, rc, sel_clip, offset, cursorValid, mustClear);
                                }
 
                                painter.blit(pixmap, rect.topLeft(), rect, (type == TYPE_PIXMAP_ALPHATEST) ? gPainter::BT_ALPHATEST : (type == TYPE_PIXMAP_ALPHABLEND) ? gPainter::BT_ALPHABLEND : 0);
index d3d2a08..2649c09 100644 (file)
@@ -69,7 +69,7 @@ class eListboxPythonMultiContent: public eListboxPythonStringContent
 public:
        eListboxPythonMultiContent();
        ~eListboxPythonMultiContent();
-       enum { TYPE_TEXT, TYPE_PROGRESS, TYPE_PIXMAP, TYPE_PIXMAP_ALPHATEST, TYPE_PIXMAP_ALPHABLEND };
+       enum { TYPE_TEXT, TYPE_PROGRESS, TYPE_PIXMAP, TYPE_PIXMAP_ALPHATEST, TYPE_PIXMAP_ALPHABLEND, TYPE_PROGRESS_PIXMAP };
        void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
        int currentCursorSelectable();
        void setList(SWIG_PYOBJECT(ePyObject) list);
index 418a1b6..24f917f 100755 (executable)
@@ -61,12 +61,13 @@ class ConfigList(HTMLComponent, GUIComponent, object):
        GUI_WIDGET = eListbox
        
        def selectionChanged(self):
-               if self.current:
+               if isinstance(self.current,tuple) and len(self.current) == 2:
                        self.current[1].onDeselect(self.session)
                self.current = self.getCurrent()
-               if self.current:
+               if isinstance(self.current,tuple) and len(self.current) == 2:
                        self.current[1].onSelect(self.session)
-
+               else:
+                       return
                for x in self.onSelectionChanged:
                        x()
 
@@ -75,11 +76,11 @@ class ConfigList(HTMLComponent, GUIComponent, object):
                instance.setContent(self.l)
        
        def preWidgetRemove(self, instance):
-               if self.current:
+               if isinstance(self.current,tuple) and len(self.current) == 2:
                        self.current[1].onDeselect(self.session)
                instance.selectionChanged.get().remove(self.selectionChanged)
                instance.setContent(None)
-       
+
        def setList(self, l):
                self.timer.stop()
                self.__list = l
@@ -87,7 +88,7 @@ class ConfigList(HTMLComponent, GUIComponent, object):
 
                if l is not None:
                        for x in l:
-                               assert isinstance(x[1], ConfigElement), "entry in ConfigList " + str(x[1]) + " must be a ConfigElement"
+                               assert len(x) < 2 or isinstance(x[1], ConfigElement), "entry in ConfigList " + str(x[1]) + " must be a ConfigElement"
 
        def getList(self):
                return self.__list
old mode 100644 (file)
new mode 100755 (executable)
index b5a9844..b1d89f5
@@ -53,14 +53,18 @@ class TemplatedMultiContent(StringList):
                        template = self.template.get("template")
                        itemheight = self.template["itemHeight"]
                        selectionEnabled = self.template.get("selectionEnabled", True)
+                       scrollbarMode = self.template.get("scrollbarMode", "showOnDemand")
 
                        if templates and style and style in templates: # if we have a custom style defined in the source, and different templates in the skin, look it up
                                template = templates[style][1]
                                itemheight = templates[style][0]
                                if len(templates[style]) > 2:
                                        selectionEnabled = templates[style][2]
+                               if len(templates[style]) > 3:
+                                       scrollbarMode = templates[style][3]
 
                        self.content.setTemplate(template)
                        self.content.setItemHeight(itemheight)
                        self.selectionEnabled = selectionEnabled
+                       self.scrollbarMode = scrollbarMode
                        self.active_style = style
index 0ba1165..7144777 100755 (executable)
@@ -1,4 +1,5 @@
 from enigma import eConsoleAppContainer
+from Tools.Directories import fileExists
 
 class IpkgComponent:
        EVENT_INSTALL = 0
@@ -20,7 +21,7 @@ class IpkgComponent:
        
        def __init__(self, ipkg = '/usr/bin/ipkg'):
                self.ipkg = ipkg
-               
+               self.opkgAvail = fileExists('/usr/bin/opkg')
                self.cmd = eConsoleAppContainer()
                self.cache = None
                self.callbackList = []
@@ -89,7 +90,10 @@ class IpkgComponent:
                        if data.find('Downloading') == 0:
                                self.callCallbacks(self.EVENT_DOWNLOAD, data.split(' ', 5)[1].strip())
                        elif data.find('Upgrading') == 0:
-                               self.callCallbacks(self.EVENT_UPGRADE, data.split('    ', 1)[1].split(' ')[0])
+                               if self.opkgAvail:
+                                       self.callCallbacks(self.EVENT_UPGRADE, data.split(' ', 1)[1].split(' ')[0])
+                               else:
+                                       self.callCallbacks(self.EVENT_UPGRADE, data.split('    ', 1)[1].split(' ')[0])
                        elif data.find('Installing') == 0:
                                self.callCallbacks(self.EVENT_INSTALL, data.split(' ', 1)[1].split(' ')[0])
                        elif data.find('Removing') == 0:
index b9da48d..e8a3d45 100755 (executable)
@@ -26,6 +26,9 @@ class Network:
                self.DnsConsole = Console()
                self.PingConsole = Console()
                self.config_ready = None
+               self.friendlyNames = {}
+               self.lan_interfaces = []
+               self.wlan_interfaces = []
                self.getInterfaces()
 
        def onRemoteRootFS(self):
@@ -309,13 +312,47 @@ class Network:
                return len(self.ifaces)
 
        def getFriendlyAdapterName(self, x):
-               # maybe this needs to be replaced by an external list.
-               friendlyNames = {
-                       "eth0": _("Integrated Ethernet"),
-                       "wlan0": _("Wireless"),
-                       "ath0": _("Integrated Wireless")
-               }
-               return friendlyNames.get(x, x) # when we have no friendly name, use adapter name
+               if x in self.friendlyNames.keys():
+                       return self.friendlyNames.get(x, x)
+               else:
+                       self.friendlyNames[x] = self.getFriendlyAdapterNaming(x)
+                       return self.friendlyNames.get(x, x) # when we have no friendly name, use adapter name
+
+       def getFriendlyAdapterNaming(self, iface):
+               if iface.startswith('eth'):
+                       if iface not in self.lan_interfaces and len(self.lan_interfaces) == 0:
+                               self.lan_interfaces.append(iface)
+                               return _("LAN connection")
+                       elif iface not in self.lan_interfaces and len(self.lan_interfaces) >= 1:
+                               self.lan_interfaces.append(iface)
+                               return _("LAN connection") + " " + str(len(self.lan_interfaces))
+               else:
+                       if iface not in self.wlan_interfaces and len(self.wlan_interfaces) == 0:
+                               self.wlan_interfaces.append(iface)
+                               return _("WLAN connection")
+                       elif iface not in self.wlan_interfaces and len(self.wlan_interfaces) >= 1:
+                               self.wlan_interfaces.append(iface)
+                               return _("WLAN connection") + " " + str(len(self.wlan_interfaces))
+
+       def getFriendlyAdapterDescription(self, iface):
+               if iface == 'eth0':
+                       return _("Internal LAN adapter.")
+               else:
+                       classdir = "/sys/class/net/" + iface + "/device/"
+                       driverdir = "/sys/class/net/" + iface + "/device/driver/"
+                       if os_path.exists(classdir):
+                               files = listdir(classdir)
+                               if 'driver' in files:
+                                       if os_path.realpath(driverdir).endswith('ath_pci'):
+                                               return _("Atheros")+ " " + str(os_path.basename(os_path.realpath(driverdir))) + " " + _("WLAN adapter.") 
+                                       elif os_path.realpath(driverdir).endswith('zd1211b'):
+                                               return _("Zydas")+ " " + str(os_path.basename(os_path.realpath(driverdir))) + " " + _("WLAN adapter.") 
+                                       elif os_path.realpath(driverdir).endswith('rt73'):
+                                               return _("Ralink")+ " " + str(os_path.basename(os_path.realpath(driverdir))) + " " + _("WLAN adapter.") 
+                                       else:
+                                               return _("Unknown network adapter.")
+                               else:
+                                       return _("Unknown network adapter.")
 
        def getAdapterName(self, iface):
                return iface
index 3c96fbb..805be4d 100644 (file)
@@ -16,6 +16,9 @@ from time import localtime, mktime
 from datetime import datetime
 from Tools.BoundFunction import boundFunction
 
+from Tools import Directories
+import xml.etree.cElementTree
+
 def getConfigSatlist(orbpos, satlist):
        default_orbpos = None
        for x in satlist:
@@ -234,6 +237,20 @@ class SecConfigure:
                print "sec config completed"
 
        def updateAdvanced(self, sec, slotid):
+               try:
+                       if config.Nims[slotid].advanced.unicableconnected is not None:
+                               if config.Nims[slotid].advanced.unicableconnected.value == True:
+                                       config.Nims[slotid].advanced.unicableconnectedTo.save_forced = True
+                                       self.linkNIMs(sec, slotid, int(config.Nims[slotid].advanced.unicableconnectedTo.value))
+                                       connto = self.getRoot(slotid, int(config.Nims[slotid].advanced.unicableconnectedTo.value))
+                                       if not self.linked.has_key(connto):
+                                               self.linked[connto] = []
+                                       self.linked[connto].append(slotid)
+                               else:
+                                       config.Nims[slotid].advanced.unicableconnectedTo.save_forced = False
+               except:
+                       pass
+
                lnbSat = {}
                for x in range(1,37):
                        lnbSat[x] = []
@@ -276,24 +293,32 @@ class SecConfigure:
                                        sec.setLNBLOFH(10600000)
                                        sec.setLNBThreshold(11700000)
                                elif currLnb.lof.value == "unicable":
-                                       sec.setLNBLOFL(9750000)
-                                       sec.setLNBLOFH(10600000)
-                                       sec.setLNBThreshold(11700000)
+                                       def setupUnicable(configManufacturer, ProductDict):
+                                               manufacturer_name = configManufacturer.value
+                                               manufacturer = ProductDict[manufacturer_name]
+                                               product_name = manufacturer.product.value
+                                               sec.setLNBSatCR(manufacturer.scr[product_name].index)
+                                               sec.setLNBSatCRvco(manufacturer.vco[product_name][manufacturer.scr[product_name].index].value*1000)
+                                               sec.setLNBSatCRpositions(manufacturer.positions[product_name][0].value)
+                                               sec.setLNBLOFL(manufacturer.lofl[product_name][0].value * 1000)
+                                               sec.setLNBLOFH(manufacturer.lofh[product_name][0].value * 1000)
+                                               sec.setLNBThreshold(manufacturer.loft[product_name][0].value * 1000)
+                                               configManufacturer.save_forced = True
+                                               manufacturer.product.save_forced = True
+                                               manufacturer.vco[product_name][manufacturer.scr[product_name].index].save_forced = True
+
                                        if currLnb.unicable.value == "unicable_user":
+#TODO satpositions for satcruser
+                                               sec.setLNBLOFL(currLnb.lofl.value * 1000)
+                                               sec.setLNBLOFH(currLnb.lofh.value * 1000)
+                                               sec.setLNBThreshold(currLnb.threshold.value * 1000)
                                                sec.setLNBSatCR(currLnb.satcruser.index)
                                                sec.setLNBSatCRvco(currLnb.satcrvcouser[currLnb.satcruser.index].value*1000)
+                                               sec.setLNBSatCRpositions(1)     #HACK
                                        elif currLnb.unicable.value == "unicable_matrix":
-                                               manufacturer_name = currLnb.unicableMatrixManufacturer.value
-                                               manufacturer = currLnb.unicableMatrix[manufacturer_name]
-                                               product_name = manufacturer.product.value
-                                               sec.setLNBSatCR(manufacturer.scr[product_name].index)
-                                               sec.setLNBSatCRvco(manufacturer.vco[product_name][manufacturer.scr[product_name].index].value*1000)
+                                               setupUnicable(currLnb.unicableMatrixManufacturer, currLnb.unicableMatrix)
                                        elif currLnb.unicable.value == "unicable_lnb":
-                                               manufacturer_name = currLnb.unicableLnbManufacturer.value
-                                               manufacturer = currLnb.unicableLnb[manufacturer_name]
-                                               product_name = manufacturer.product.value
-                                               sec.setLNBSatCR(manufacturer.scr[product_name].index)
-                                               sec.setLNBSatCRvco(manufacturer.vco[product_name][manufacturer.scr[product_name].index].value*1000)
+                                               setupUnicable(currLnb.unicableLnbManufacturer, currLnb.unicableLnb)
                                elif currLnb.lof.value == "c_band":
                                        sec.setLNBLOFL(5150000)
                                        sec.setLNBLOFH(5150000)
@@ -982,61 +1007,63 @@ def InitNimManager(nimmgr):
 
        lnb_choices = {
                "universal_lnb": _("Universal LNB"),
-#              "unicable": _("Unicable"),
+               "unicable": _("Unicable"),
                "c_band": _("C-Band"),
                "user_defined": _("User defined")}
 
        lnb_choices_default = "universal_lnb"
 
-       unicablelnbproducts = {
-               "Humax": {"150 SCR":("1210","1420","1680","2040")},
-               "Inverto": {"IDLP-40UNIQD+S":("1680","1420","2040","1210")},
-               "Kathrein": {"UAS481":("1400","1516","1632","1748")},
-               "Kreiling": {"KR1440":("1680","1420","2040","1210")},
-               "Radix": {"Unicable LNB":("1680","1420","2040","1210")},
-               "Wisi": {"OC 05":("1210","1420","1680","2040")}}
+       unicablelnbproducts = {}
+       unicablematrixproducts = {}
+       doc = xml.etree.cElementTree.parse("/usr/share/enigma2/unicable.xml")
+       root = doc.getroot()
+
+       entry = root.find("lnb")
+       for manufacturer in entry.getchildren():
+               m={}
+               for product in manufacturer.getchildren():
+                       scr=[]
+                       lscr=("scr1","scr2","scr3","scr4","scr5","scr6","scr7","scr8")
+                       for i in range(len(lscr)):
+                               scr.append(product.get(lscr[i],"0"))
+                       for i in range(len(lscr)):
+                               if scr[len(lscr)-i-1] == "0":
+                                       scr.pop()
+                               else:
+                                       break;
+                       lof=[]
+                       lof.append(int(product.get("positions",1)))
+                       lof.append(int(product.get("lofl",9750)))
+                       lof.append(int(product.get("lofh",10600)))
+                       lof.append(int(product.get("threshold",11700)))
+                       scr.append(tuple(lof))
+                       m.update({product.get("name"):tuple(scr)})
+               unicablelnbproducts.update({manufacturer.get("name"):m})
+
+       entry = root.find("matrix")
+       for manufacturer in entry.getchildren():
+               m={}
+               for product in manufacturer.getchildren():
+                       scr=[]
+                       lscr=("scr1","scr2","scr3","scr4","scr5","scr6","scr7","scr8")
+                       for i in range(len(lscr)):
+                               scr.append(product.get(lscr[i],"0"))
+                       for i in range(len(lscr)):
+                               if scr[len(lscr)-i-1] == "0":
+                                       scr.pop()
+                               else:
+                                       break;
+                       lof=[]
+                       lof.append(int(product.get("positions",1)))
+                       lof.append(int(product.get("lofl",9750)))
+                       lof.append(int(product.get("lofh",10600)))
+                       lof.append(int(product.get("threshold",11700)))
+                       scr.append(tuple(lof))
+                       m.update({product.get("name"):tuple(scr)})
+               unicablematrixproducts.update({manufacturer.get("name"):m})
+
        UnicableLnbManufacturers = unicablelnbproducts.keys()
        UnicableLnbManufacturers.sort()
-
-       unicablematrixproducts = {
-               "Ankaro": {
-                       "UCS 51440":("1400","1632","1284","1516"),
-                       "UCS 51820":("1400","1632","1284","1516","1864","2096","1748","1980"),
-                       "UCS 51840":("1400","1632","1284","1516","1864","2096","1748","1980"),
-                       "UCS 52240":("1400","1632"),
-                       "UCS 52420":("1400","1632","1284","1516"),
-                       "UCS 52440":("1400","1632","1284","1516"),
-                       "UCS 91440":("1400","1632","1284","1516"),
-                       "UCS 91820":("1400","1632","1284","1516","1864","2096","1748","1980"),
-                       "UCS 91840":("1400","1632","1284","1516","1864","2096","1748","1980"),
-                       "UCS 92240":("1400","1632"),
-                       "UCS 92420":("1400","1632","1284","1516"),
-                       "UCS 92440":("1400","1632","1284","1516")},
-               "DCT Delta": {
-                       "SUM518":("1284","1400","1516","1632","1748","1864","1980","2096"),
-                       "SUM918":("1284","1400","1516","1632","1748","1864","1980","2096"),
-                       "SUM928":("1284","1400","1516","1632","1748","1864","1980","2096")},
-               "Inverto": {
-                       "IDLP-UST11O-CUO1O-8PP":("1076","1178","1280","1382","1484","1586","1688","1790")},
-               "Kathrein": {
-                       "EXR501":("1400","1516","1632","1748"),
-                       "EXR551":("1400","1516","1632","1748"),
-                       "EXR552":("1400","1516")},
-               "ROTEK": {
-                       "EKL2/1":("1400","1516"),
-                       "EKL2/1E":("0","0","1632","1748")},
-               "Smart": {
-                       "DPA 51":("1284","1400","1516","1632","1748","1864","1980","2096")},
-               "Technisat": {
-                       "TechniRouter 5/1x8 G":("1284","1400","1516","1632","1748","1864","1980","2096"),
-                       "TechniRouter 5/1x8 K":("1284","1400","1516","1632","1748","1864","1980","2096"),
-                       "TechniRouter 5/2x4 G":("1284","1400","1516","1632"),
-                       "TechniRouter 5/2x4 K":("1284","1400","1516","1632")},
-               "Telstar": {
-                       "SCR 5/1x8 G":("1284","1400","1516","1632","1748","1864","1980","2096"),
-                       "SCR 5/1x8 K":("1284","1400","1516","1632","1748","1864","1980","2096"),
-                       "SCR 5/2x4 G":("1284","1400","1516","1632"),
-                       "SCR 5/2x4 K":("1284","1400","1516","1632")}}
        UnicableMatrixManufacturers = unicablematrixproducts.keys()
        UnicableMatrixManufacturers.sort()
 
@@ -1103,63 +1130,76 @@ def InitNimManager(nimmgr):
                                else:
                                        section.unicable = ConfigSelection(choices = {"unicable_user": _("User defined")}, default = "unicable_user")
 
-                               if lnb < 3:
-                                       section.unicableMatrix = ConfigSubDict()
-                                       section.unicableMatrixManufacturer = ConfigSelection(choices = UnicableMatrixManufacturers, default = UnicableMatrixManufacturers[0])
-                                       for y in unicablematrixproducts:
-                                               products = unicablematrixproducts[y].keys()
+                               def fillUnicableConf(sectionDict, unicableproducts, vco_null_check):
+                                       for y in unicableproducts:
+                                               products = unicableproducts[y].keys()
                                                products.sort()
                                                tmp = ConfigSubsection()
                                                tmp.product = ConfigSelection(choices = products, default = products[0])
                                                tmp.scr = ConfigSubDict()
                                                tmp.vco = ConfigSubDict()
+                                               tmp.lofl = ConfigSubDict()
+                                               tmp.lofh = ConfigSubDict()
+                                               tmp.loft = ConfigSubDict()
+                                               tmp.positions = ConfigSubDict()
                                                for z in products:
                                                        scrlist = []
-                                                       vcolist = unicablematrixproducts[y][z]
+                                                       vcolist = unicableproducts[y][z]
                                                        tmp.vco[z] = ConfigSubList()
-                                                       for cnt in range(1,1+len(vcolist)):
+                                                       for cnt in range(1,1+len(vcolist)-1):
                                                                vcofreq = int(vcolist[cnt-1])
-                                                               if vcofreq == 0:
+                                                               if vcofreq == 0 and vco_null_check:
                                                                        scrlist.append(("%d" %cnt,"SCR %d " %cnt +_("not used")))
                                                                else:
                                                                        scrlist.append(("%d" %cnt,"SCR %d" %cnt))
                                                                tmp.vco[z].append(ConfigInteger(default=vcofreq, limits = (vcofreq, vcofreq)))
-                                                       tmp.scr[z] = ConfigSelection(choices = scrlist, default = scrlist[0][0])
-                                               section.unicableMatrix[y] = tmp
+                                                               tmp.scr[z] = ConfigSelection(choices = scrlist, default = scrlist[0][0])
+
+                                                               positions = int(vcolist[len(vcolist)-1][0])
+                                                               tmp.positions[z] = ConfigSubList()
+                                                               tmp.positions[z].append(ConfigInteger(default=positions, limits = (positions, positions)))
+
+                                                               lofl = vcolist[len(vcolist)-1][1]
+                                                               tmp.lofl[z] = ConfigSubList()
+                                                               tmp.lofl[z].append(ConfigInteger(default=lofl, limits = (lofl, lofl)))
+
+                                                               lofh = int(vcolist[len(vcolist)-1][2])
+                                                               tmp.lofh[z] = ConfigSubList()
+                                                               tmp.lofh[z].append(ConfigInteger(default=lofh, limits = (lofh, lofh)))
+
+                                                               loft = int(vcolist[len(vcolist)-1][3])
+                                                               tmp.loft[z] = ConfigSubList()
+                                                               tmp.loft[z].append(ConfigInteger(default=loft, limits = (loft, loft)))
+                                               sectionDict[y] = tmp
+
+                               if lnb < 3:
+                                       print "MATRIX"
+                                       section.unicableMatrix = ConfigSubDict()
+                                       section.unicableMatrixManufacturer = ConfigSelection(UnicableMatrixManufacturers, UnicableMatrixManufacturers[0])
+                                       fillUnicableConf(section.unicableMatrix, unicablematrixproducts, True)
 
                                if lnb < 2:
+                                       print "LNB"
                                        section.unicableLnb = ConfigSubDict()
                                        section.unicableLnbManufacturer = ConfigSelection(UnicableLnbManufacturers, UnicableLnbManufacturers[0])
-                                       for y in unicablelnbproducts:
-                                               products = unicablelnbproducts[y].keys()
-                                               products.sort()
-                                               tmp = ConfigSubsection()
-                                               tmp.product = ConfigSelection(choices = products, default = products[0])
-                                               tmp.scr = ConfigSubDict()
-                                               tmp.vco = ConfigSubDict()
-                                               for z in products:
-                                                       scrlist = []
-                                                       vcolist = unicablelnbproducts[y][z]
-                                                       tmp.vco[z] = ConfigSubList()
-                                                       for cnt in range(1,1+len(vcolist)):
-                                                               scrlist.append(("%d" %cnt,"SCR %d" %cnt))
-                                                               vcofreq = int(vcolist[cnt-1])
-                                                               tmp.vco[z].append(ConfigInteger(default=vcofreq, limits = (vcofreq, vcofreq)))
-                                                       tmp.scr[z] = ConfigSelection(choices = scrlist, default = scrlist[0][0])
-                                               section.unicableLnb[y] = tmp
+                                       fillUnicableConf(section.unicableLnb, unicablelnbproducts, False)
 
+#TODO satpositions for satcruser
                                section.satcruser = ConfigSelection(advanced_lnb_satcruser_choices, default="1")
                                tmp = ConfigSubList()
-                               tmp.append(ConfigInteger(default=1284, limits = (0, 9999)))
-                               tmp.append(ConfigInteger(default=1400, limits = (0, 9999)))
-                               tmp.append(ConfigInteger(default=1516, limits = (0, 9999)))
-                               tmp.append(ConfigInteger(default=1632, limits = (0, 9999)))
-                               tmp.append(ConfigInteger(default=1748, limits = (0, 9999)))
-                               tmp.append(ConfigInteger(default=1864, limits = (0, 9999)))
-                               tmp.append(ConfigInteger(default=1980, limits = (0, 9999)))
-                               tmp.append(ConfigInteger(default=2096, limits = (0, 9999)))
+                               tmp.append(ConfigInteger(default=1284, limits = (950, 2150)))
+                               tmp.append(ConfigInteger(default=1400, limits = (950, 2150)))
+                               tmp.append(ConfigInteger(default=1516, limits = (950, 2150)))
+                               tmp.append(ConfigInteger(default=1632, limits = (950, 2150)))
+                               tmp.append(ConfigInteger(default=1748, limits = (950, 2150)))
+                               tmp.append(ConfigInteger(default=1864, limits = (950, 2150)))
+                               tmp.append(ConfigInteger(default=1980, limits = (950, 2150)))
+                               tmp.append(ConfigInteger(default=2096, limits = (950, 2150)))
                                section.satcrvcouser = tmp 
 
+                               nim.advanced.unicableconnected = ConfigYesNo(default=False)
+                               nim.advanced.unicableconnectedTo = ConfigSelection([(str(id), nimmgr.getNimDescription(id)) for id in nimmgr.getNimListOfType("DVB-S") if id != x])
+       
        def configDiSEqCModeChanged(configElement):
                section = configElement.section
                if configElement.value == "1_2" and isinstance(section.longitude, ConfigNothing):
@@ -1168,7 +1208,7 @@ def InitNimManager(nimmgr):
                        section.latitude = ConfigFloat(default = [50,767], limits = [(0,359),(0,999)])
                        section.latitudeOrientation = ConfigSelection(latitude_orientation_choices, "north")
                        section.powerMeasurement = ConfigYesNo(default=True)
-                       section.powerThreshold = ConfigInteger(default=hw.get_device_name() == "dm8000" and 15 or 50, limits=(0, 100))
+                       section.powerThreshold = ConfigInteger(default=hw.get_device_name() == "dm7025" and 50 or 15, limits=(0, 100))
                        section.turningSpeed = ConfigSelection(turning_speed_choices, "fast")
                        section.fastTurningBegin = ConfigDateTime(default=advanced_lnb_fast_turning_btime, formatstring = _("%H:%M"), increment = 600)
                        section.fastTurningEnd = ConfigDateTime(default=advanced_lnb_fast_turning_etime, formatstring = _("%H:%M"), increment = 600)
index 9942bca..63b5ccf 100644 (file)
@@ -55,11 +55,10 @@ def InitParentalControl():
 class ParentalControl:
        def __init__(self):
                #Do not call open on init, because bouquets are not ready at that moment 
-#              self.open()
+               self.open()
                self.serviceLevel = {}
                #Instead: Use Flags to see, if we already initialized config and called open
                self.configInitialized = False
-               self.filesOpened = False
                #This is the timer that is used to see, if the time for caching the pin is over
                #Of course we could also work without a timer and compare the times every
                #time we call isServicePlayable. But this might probably slow down zapping, 
@@ -89,9 +88,6 @@ class ParentalControl:
        def isServicePlayable(self, ref, callback):
                if not config.ParentalControl.configured.value or not config.ParentalControl.servicepinactive.value:
                        return True
-               #Check if we already read the whitelists and blacklists. If not: call open
-               if self.filesOpened == False:
-                       self.open()
                #Check if configuration has already been read or if the significant values have changed.
                #If true: read the configuration 
                if self.configInitialized == False or self.storeServicePin != config.ParentalControl.storeservicepin.value or self.storeServicePinCancel != config.ParentalControl.storeservicepincancel.value:
@@ -153,8 +149,6 @@ class ParentalControl:
        def getProtectionType(self, service):
                #New method used in ParentalControlList: This method does not only return
                #if a service is protected or not, it also returns, why (whitelist or blacklist, service or bouquet)
-               if self.filesOpened == False:
-                       self.open()
                sImage = ""
                if (config.ParentalControl.type.value == LIST_WHITELIST):
                        if self.whitelist.has_key(service):
@@ -319,14 +313,11 @@ class ParentalControl:
                
        def save(self):
                # we need to open the files in case we havent's read them yet
-               if not self.filesOpened:
-                       self.open()
                self.saveListToFile(LIST_BLACKLIST)
                self.saveListToFile(LIST_WHITELIST)
                
        def open(self):
                self.openListFromFile(LIST_BLACKLIST)
                self.openListFromFile(LIST_WHITELIST)
-               self.filesOpened = True
 
 parentalControl = ParentalControl()
old mode 100644 (file)
new mode 100755 (executable)
index fe9284d..40dfb2c
@@ -1,4 +1,4 @@
-from config import ConfigNumber, ConfigYesNo, ConfigSubsection, config
+from config import ConfigNumber, ConfigYesNo, ConfigSubsection, ConfigSelection, config
 
 def InitRecordingConfig():
        config.recording = ConfigSubsection();
@@ -8,3 +8,7 @@ def InitRecordingConfig():
        config.recording.margin_after = ConfigNumber(default=0)
        config.recording.debug = ConfigYesNo(default = False)
        config.recording.ascii_filenames = ConfigYesNo(default = False)
+       config.recording.filename_composition = ConfigSelection(default = "standard", choices = [
+               ("standard", _("standard")),
+               ("short", _("Short filenames")),
+               ("long", _("Long filenames")) ] )
\ No newline at end of file
old mode 100644 (file)
new mode 100755 (executable)
index 640121e..716fe44
@@ -19,6 +19,7 @@ class Listbox(Renderer, object):
                self.__content = None
                self.__wrap_around = False
                self.__selection_enabled = True
+               self.__scrollbarMode = "showOnDemand"
 
        GUI_WIDGET = eListbox
 
@@ -38,6 +39,7 @@ class Listbox(Renderer, object):
                instance.selectionChanged.get().append(self.selectionChanged)
                self.wrap_around = self.wrap_around # trigger
                self.selection_enabled = self.selection_enabled # trigger
+               self.scrollbarMode = self.scrollbarMode # trigger
 
        def preWidgetRemove(self, instance):
                instance.setContent(None)
@@ -76,9 +78,22 @@ class Listbox(Renderer, object):
 
        selection_enabled = property(lambda self: self.__selection_enabled, setSelectionEnabled)
 
+       def setScrollbarMode(self, mode):
+               self.__scrollbarMode = mode
+               if self.instance is not None:
+                       self.instance.setScrollbarMode(int(
+                               { "showOnDemand": 0,
+                                 "showAlways": 1,
+                                 "showNever": 2,
+                               }[mode]))
+
+       scrollbarMode = property(lambda self: self.__scrollbarMode, setScrollbarMode)
+       
        def changed(self, what):
                if hasattr(self.source, "selectionEnabled"):
                        self.selection_enabled = self.source.selectionEnabled
+               if hasattr(self.source, "scrollbarMode"):
+                       self.scrollbarMode = self.source.scrollbarMode
                if len(what) > 1 and isinstance(what[1], str) and what[1] == "style":
                        return
                self.content = self.source.content
old mode 100755 (executable)
new mode 100644 (file)
index 6095812..cd055a8
@@ -7,6 +7,8 @@ from Tools.LoadPixmap import LoadPixmap
 
 from Tools.Directories import resolveFilename, SCOPE_CURRENT_SKIN
 
+from Components.config import config
+
 class ServiceList(HTMLComponent, GUIComponent):
        MODE_NORMAL = 0
        MODE_FAVOURITES = 1
@@ -62,6 +64,22 @@ class ServiceList(HTMLComponent, GUIComponent):
                                        self.l.setColor(eListboxServiceContent.markedBackgroundSelected, parseColor(value))
                                elif attrib == "foregroundColorServiceNotAvail":
                                        self.l.setColor(eListboxServiceContent.serviceNotAvail, parseColor(value))
+                               elif attrib == "colorEventProgressbar":
+                                       self.l.setColor(eListboxServiceContent.serviceEventProgressbarColor, parseColor(value))
+                               elif attrib == "colorEventProgressbarSelected":
+                                       self.l.setColor(eListboxServiceContent.serviceEventProgressbarColorSelected, parseColor(value))
+                               elif attrib == "colorEventProgressbarBorder":
+                                       self.l.setColor(eListboxServiceContent.serviceEventProgressbarBorderColor, parseColor(value))
+                               elif attrib == "colorEventProgressbarBorderSelected":
+                                       self.l.setColor(eListboxServiceContent.serviceEventProgressbarBorderColorSelected, parseColor(value))
+                               elif attrib == "colorServiceDescription":
+                                       self.l.setColor(eListboxServiceContent.serviceDescriptionColor, parseColor(value))
+                               elif attrib == "colorServiceDescriptionSelected":
+                                       self.l.setColor(eListboxServiceContent.serviceDescriptionColorSelected, parseColor(value))
+                               elif attrib == "picServiceEventProgressbar":
+                                       pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, value))
+                                       if pic:
+                                               self.l.setPixmap(self.l.picServiceEventProgressbar, pic)
                                elif attrib == "serviceItemHeight":
                                        self.ItemHeight = int(value)
                                elif attrib == "serviceNameFont":
@@ -213,17 +231,24 @@ class ServiceList(HTMLComponent, GUIComponent):
 
        def setMode(self, mode):
                self.mode = mode
+               self.l.setItemHeight(self.ItemHeight)
+               self.l.setVisualMode(eListboxServiceContent.visModeComplex)
                if mode == self.MODE_NORMAL:
-                       self.l.setItemHeight(self.ItemHeight)
-                       self.l.setVisualMode(eListboxServiceContent.visModeComplex)
+                       if config.usage.show_event_progress_in_servicelist.value:
+                               self.l.setElementPosition(self.l.celServiceEventProgressbar, eRect(0, 0, 52, self.ItemHeight))
+                       else:
+                               self.l.setElementPosition(self.l.celServiceEventProgressbar, eRect(0, 0, 0, 0))
                        self.l.setElementFont(self.l.celServiceName, self.ServiceNameFont)
                        self.l.setElementPosition(self.l.celServiceName, eRect(0, 0, self.instance.size().width(), self.ItemHeight))
                        self.l.setElementFont(self.l.celServiceInfo, self.ServiceInfoFont)
                else:
-                       self.l.setItemHeight(self.ItemHeight)
-                       self.l.setVisualMode(eListboxServiceContent.visModeComplex)
+                       if config.usage.show_event_progress_in_servicelist.value:
+                               self.l.setElementPosition(self.l.celServiceEventProgressbar, eRect(60, 0, 52, self.ItemHeight))
+                       else:
+                               self.l.setElementPosition(self.l.celServiceEventProgressbar, eRect(60, 0, 0, 0))
                        self.l.setElementFont(self.l.celServiceNumber, self.ServiceNumberFont)
                        self.l.setElementPosition(self.l.celServiceNumber, eRect(0, 0, 50, self.ItemHeight))
                        self.l.setElementFont(self.l.celServiceName, self.ServiceNameFont)
                        self.l.setElementPosition(self.l.celServiceName, eRect(60, 0, self.instance.size().width()-60, self.ItemHeight))
                        self.l.setElementFont(self.l.celServiceInfo, self.ServiceInfoFont)
+
index 6082710..b86c1a1 100644 (file)
@@ -51,7 +51,14 @@ def InitUsageConfig():
 
        config.usage.on_long_powerpress = ConfigSelection(default = "show_menu", choices = [
                ("show_menu", _("show shutdown menu")),
-               ("shutdown", _("immediate shutdown")) ] )
+               ("shutdown", _("immediate shutdown")),
+               ("standby", _("Standby")) ] )
+       
+       config.usage.on_short_powerpress = ConfigSelection(default = "standby", choices = [
+               ("show_menu", _("show shutdown menu")),
+               ("shutdown", _("immediate shutdown")),
+               ("standby", _("Standby")) ] )
+
 
        config.usage.alternatives_priority = ConfigSelection(default = "0", choices = [
                ("0", "DVB-S/-C/-T"),
@@ -61,6 +68,8 @@ def InitUsageConfig():
                ("4", "DVB-T/-C/-S"),
                ("5", "DVB-T/-S/-C") ])
 
+       config.usage.show_event_progress_in_servicelist = ConfigYesNo(default = False)
+
        config.usage.blinking_display_clock_during_recording = ConfigYesNo(default = False)
 
        config.usage.show_message_when_recording_starts = ConfigYesNo(default = True)
index 471b59e..d7506e3 100755 (executable)
@@ -29,6 +29,7 @@ from time import localtime, strftime
 class ConfigElement(object):
        def __init__(self):
                self.saved_value = None
+               self.save_forced = False
                self.last_value = None
                self.save_disabled = False
                self.__notifiers = None
@@ -83,7 +84,7 @@ class ConfigElement(object):
 
        # you need to override this if str(self.value) doesn't work
        def save(self):
-               if self.save_disabled or self.value == self.default:
+               if self.save_disabled or (self.value == self.default and not self.save_forced):
                        self.saved_value = None
                else:
                        self.saved_value = self.tostring(self.value)
index aace17c..9e16bfc 100755 (executable)
@@ -1,6 +1,8 @@
 installdir = $(pkglibdir)/python/Plugins/DemoPlugins
 
-SUBDIRS = TestPlugin
+SUBDIRS = TestPlugin TPMDemo
 
 install_PYTHON =       \
-       __init__.py
\ No newline at end of file
+       __init__.py
+
+       
\ No newline at end of file
diff --git a/lib/python/Plugins/DemoPlugins/TPMDemo/Makefile.am b/lib/python/Plugins/DemoPlugins/TPMDemo/Makefile.am
new file mode 100644 (file)
index 0000000..3ccca98
--- /dev/null
@@ -0,0 +1,5 @@
+installdir = $(LIBDIR)/enigma2/python/Plugins/DemoPlugins/TPMDemo
+
+install_PYTHON = \
+       __init__.py \
+       plugin.py
diff --git a/lib/python/Plugins/DemoPlugins/TPMDemo/README b/lib/python/Plugins/DemoPlugins/TPMDemo/README
new file mode 100644 (file)
index 0000000..89a972a
--- /dev/null
@@ -0,0 +1 @@
+Please read enigma2/doc/TPM for further instructions on how to integrate this into your own plugins.
\ No newline at end of file
diff --git a/lib/python/Plugins/DemoPlugins/TPMDemo/__init__.py b/lib/python/Plugins/DemoPlugins/TPMDemo/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/lib/python/Plugins/DemoPlugins/TPMDemo/plugin.py b/lib/python/Plugins/DemoPlugins/TPMDemo/plugin.py
new file mode 100644 (file)
index 0000000..2c078d3
--- /dev/null
@@ -0,0 +1,87 @@
+from Screens.Screen import Screen
+from Plugins.Plugin import PluginDescriptor
+from enigma import eTPM
+import sha
+
+def bin2long(s):
+       return reduce( lambda x,y:(x<<8L)+y, map(ord, s))
+
+def long2bin(l):
+       res = ""
+       for byte in range(128):
+               res += chr((l >> (1024 - (byte + 1) * 8)) & 0xff)
+       return res
+
+def rsa_pub1024(src, mod):
+       return long2bin(pow(bin2long(src), 65537, bin2long(mod)))
+       
+def decrypt_block(src, mod):
+       if len(src) != 128 and len(src) != 202:
+               return None
+       dest = rsa_pub1024(src[:128], mod)
+       hash = sha.new(dest[1:107])
+       if len(src) == 202:
+               hash.update(src[131:192])       
+       result = hash.digest()
+       if result == dest[107:127]:
+               return dest
+       return None
+
+def validate_cert(cert, key):
+       buf = decrypt_block(cert[8:], key) 
+       if buf is None:
+               return None
+       return buf[36:107] + cert[139:196]
+
+def read_random():
+       try:
+               fd = open("/dev/urandom", "r")
+               buf = fd.read(8)
+               fd.close()
+               return buf
+       except:
+               return None
+
+def main(session, **kwargs):
+       try:
+               device = open("/proc/stb/info/model", "r").readline().strip()
+       except:
+               device = ""     
+       if device != "dm7025":
+               rootkey = ['\x9f', '|', '\xe4', 'G', '\xc9', '\xb4', '\xf4', '#', '&', '\xce', '\xb3', '\xfe', '\xda', '\xc9', 'U', '`', '\xd8', '\x8c', 's', 'o', '\x90', '\x9b', '\\', 'b', '\xc0', '\x89', '\xd1', '\x8c', '\x9e', 'J', 'T', '\xc5', 'X', '\xa1', '\xb8', '\x13', '5', 'E', '\x02', '\xc9', '\xb2', '\xe6', 't', '\x89', '\xde', '\xcd', '\x9d', '\x11', '\xdd', '\xc7', '\xf4', '\xe4', '\xe4', '\xbc', '\xdb', '\x9c', '\xea', '}', '\xad', '\xda', 't', 'r', '\x9b', '\xdc', '\xbc', '\x18', '3', '\xe7', '\xaf', '|', '\xae', '\x0c', '\xe3', '\xb5', '\x84', '\x8d', '\r', '\x8d', '\x9d', '2', '\xd0', '\xce', '\xd5', 'q', '\t', '\x84', 'c', '\xa8', ')', '\x99', '\xdc', '<', '"', 'x', '\xe8', '\x87', '\x8f', '\x02', ';', 'S', 'm', '\xd5', '\xf0', '\xa3', '_', '\xb7', 'T', '\t', '\xde', '\xa7', '\xf1', '\xc9', '\xae', '\x8a', '\xd7', '\xd2', '\xcf', '\xb2', '.', '\x13', '\xfb', '\xac', 'j', '\xdf', '\xb1', '\x1d', ':', '?']
+               
+               etpm = eTPM()
+               l2cert = etpm.getCert(eTPM.TPMD_DT_LEVEL2_CERT)
+               if l2cert is None:
+                       print "l2cert not found"
+                       return
+       
+               l2key = validate_cert(l2cert, rootkey)
+               if l2key is None:
+                       print "l2cert invalid"
+                       return
+               
+               l3cert = etpm.getCert(eTPM.TPMD_DT_LEVEL3_CERT)
+               if l3cert is None:
+                       print "l3cert not found (can be fixed by running the genuine dreambox plugin and running the offered update)"
+                       return
+               
+               l3key = validate_cert(l3cert, l2key)
+               if l3key is None:
+                       print "l3cert invalid"
+                       return
+               
+               rnd = read_random()
+               if rnd is None:
+                       print "random error"
+                       return
+               val = etpm.challenge(rnd)
+               result = decrypt_block(val, l3key)
+       if device == "dm7025" or result[80:88] == rnd:
+               print "successfully finished the tpm test"
+                       # would start your plugin here
+
+def Plugins(**kwargs):
+       return [PluginDescriptor(name = "TPM Demo", description = _("A demo plugin for TPM usage."), where = PluginDescriptor.WHERE_EXTENSIONSMENU, fnc = main),
+               PluginDescriptor(name = "TPM Demo", description = _("A demo plugin for TPM usage."), icon = "plugin.png", where = PluginDescriptor.WHERE_PLUGINMENU, fnc = main)]
+       
\ No newline at end of file
index e092e82..64b4ae5 100755 (executable)
@@ -88,8 +88,8 @@ class FileBrowser(Screen):
                self.close(None)
 
 class DVDSummary(Screen):
-       skin = """
-       <screen position="0,0" size="132,64">
+       skin = (
+       """<screen name="DVDSummary" position="0,0" size="132,64" id="1">
                <widget source="session.CurrentService" render="Label" position="5,4" size="120,28" font="Regular;12" transparent="1" >
                        <convert type="ServiceName">Name</convert>
                </widget>
@@ -101,7 +101,20 @@ class DVDSummary(Screen):
                <widget source="session.CurrentService" render="Progress" position="6,46" size="60,18" borderWidth="1" >
                        <convert type="ServicePosition">Position</convert>
                </widget>
-       </screen>"""
+       </screen>""",
+       """<screen name="DVDSummary" position="0,0" size="96,64" id="2">
+               <widget source="session.CurrentService" render="Label" position="0,0" size="96,25" font="Regular;12" transparent="1" >
+                       <convert type="ServiceName">Name</convert>
+               </widget>
+               <widget name="DVDPlayer" position="0,26" size="96,12" font="Regular;10" transparent="1" />
+               <widget name="Chapter" position="0,40" size="66,12" font="Regular;10" transparent="1" halign="left" />
+               <widget source="session.CurrentService" render="Label" position="66,40" size="30,12" font="Regular;10" transparent="1" halign="right" >
+                       <convert type="ServicePosition">Position</convert>
+               </widget>
+               <widget source="session.CurrentService" render="Progress" position="0,52" size="96,12" borderWidth="1" >
+                       <convert type="ServicePosition">Position</convert>
+               </widget>
+       </screen>""")
 
        def __init__(self, session, parent):
                Screen.__init__(self, session, parent)
index 7e3a334..7363e5e 100755 (executable)
@@ -110,7 +110,7 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
 
                # '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|divx|m4v|mkv|mp4|m4a|dat|flac|mov)", useServiceRef = True, additionalExtensions = "4098:m3u 4098:e2pls 4098:pls")
+               self.filelist = FileList(defaultDir, matchingPattern = "(?i)^.*\.(mp2|mp3|ogg|ts|m2ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|divx|m4v|mkv|mp4|m4a|dat|flac|mov)", useServiceRef = True, additionalExtensions = "4098:m3u 4098:e2pls 4098:pls")
                self["filelist"] = self.filelist
 
                self.playlist = MyPlayList()
@@ -906,11 +906,11 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
 
        def unPauseService(self):
                self.setSeekState(self.SEEK_STATE_PLAY)
-               
+
        def subtitleSelection(self):
-               from Screens.Subtitles import Subtitles
-               self.session.open(Subtitles, self)
-       
+               from Screens.AudioSelection import SubtitleSelection
+               self.session.open(SubtitleSelection, self)
+
        def hotplugCB(self, dev, media_state):
                if dev == harddiskmanager.getCD():
                        if media_state == "1":
@@ -930,12 +930,17 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
                                        self.clear_playlist()
 
 class MediaPlayerLCDScreen(Screen):
-       skin = """
-       <screen position="0,0" size="132,64" title="LCD Text">
+       skin = (
+       """<screen name="MediaPlayerLCDScreen" position="0,0" size="132,64" id="1">
                <widget name="text1" position="4,0" size="132,35" font="Regular;16"/>
                <widget name="text3" position="4,36" size="132,14" font="Regular;10"/>
                <widget name="text4" position="4,49" size="132,14" font="Regular;10"/>
-       </screen>"""
+       </screen>""",
+       """<screen name="MediaPlayerLCDScreen" position="0,0" size="96,64" id="2">
+               <widget name="text1" position="0,0" size="96,35" font="Regular;14"/>
+               <widget name="text3" position="0,36" size="96,14" font="Regular;10"/>
+               <widget name="text4" position="0,49" size="96,14" font="Regular;10"/>
+       </screen>""")
 
        def __init__(self, session, parent):
                Screen.__init__(self, session)
index f043503..79d2b0b 100644 (file)
@@ -4,3 +4,4 @@ SUBDIRS = Extensions SystemPlugins DemoPlugins
 
 install_PYTHON =       \
        __init__.py Plugin.py 
+
old mode 100644 (file)
new mode 100755 (executable)
index 8986560..7a0da85
@@ -39,13 +39,19 @@ class writeNAND(Task):
                        self.output_line = data
 
 class NFISummary(Screen):
-       skin = """
-       <screen position="0,0" size="132,64">
+       skin = (
+       """<screen name="NFISummary" position="0,0" size="132,64" id="1">
                <widget source="title" render="Label" position="2,0" size="120,14" valign="center" font="Regular;12" />
                <widget source="content" render="Label" position="2,14" size="120,34" font="Regular;12" transparent="1" zPosition="1"  />
-               <widget source="job_progresslabel" render="Label" position="66,50" size="60,14" font="Regular;12" transparent="1" halign="right" zPosition="0" />
                <widget source="job_progressbar" render="Progress" position="2,50" size="66,14" borderWidth="1" />
-       </screen>"""
+               <widget source="job_progresslabel" render="Label" position="66,50" size="60,14" font="Regular;12" transparent="1" halign="right" zPosition="0" />
+       </screen>""",
+       """<screen name="NFISummary" position="0,0" size="96,64" id="2">
+               <widget source="title" render="Label" position="0,0" size="96,14" valign="center" font="Regular;10" />
+               <widget source="content" render="Label" position="0,14" size="96,34" font="Regular;10" transparent="1" zPosition="1"  />
+               <widget source="job_progressbar" render="Progress" position="0,50" size="50,14" borderWidth="1" />
+               <widget source="job_progresslabel" render="Label" position="50,50" size="46,14" font="Regular;10" transparent="1" halign="right" zPosition="0" />
+       </screen>""")
 
        def __init__(self, session, parent):
                Screen.__init__(self, session, parent)
index 6096ca8..a8b34ac 100755 (executable)
@@ -421,3 +421,4 @@ class NetworkWizard(WizardLanguage, Rc):
 
        def ChoicesSelectionMoved(self):
                pass
+
index e3b902f..59c5047 100644 (file)
@@ -239,9 +239,9 @@ class VideoHardware:
                portlist = self.getPortList()
                for port in portlist:
                        descr = port
-                       if descr == 'DVI' and hw_type == 'dm500hd':
+                       if descr == 'DVI' and hw_type in ('dm500hd', 'dm800se'):
                                descr = 'HDMI'
-                       elif descr == 'DVI-PC' and hw_type == 'dm500hd':
+                       elif descr == 'DVI-PC' and hw_type in ('dm500hd', 'dm800se'):
                                descr = 'HDMI-PC'
                        lst.append((port, descr))
 
old mode 100644 (file)
new mode 100755 (executable)
index 15f4d51..9b9044e
@@ -12,14 +12,22 @@ from Tools.HardwareInfo import HardwareInfo
 config.misc.showtestcard = ConfigBoolean(default = False)
 
 class VideoWizardSummary(WizardSummary):
-       skin = """
-       <screen position="0,0" size="132,64">
+       skin = (
+       """<screen name="VideoWizardSummary" position="0,0" size="132,64" id="1">
                <widget name="text" position="6,4" size="120,40" font="Regular;12" transparent="1" />
                <widget source="parent.list" render="Label" position="6,40" size="120,21" font="Regular;14">
                        <convert type="StringListSelection" />
                </widget>
                <!--widget name="pic" pixmap="%s" position="6,22" zPosition="10" size="64,64" transparent="1" alphatest="on"/-->
-       </screen>""" #% (resolveFilename(SCOPE_PLUGINS, "SystemPlugins/Videomode/lcd_Scart.png"))
+       </screen>""",
+       """<screen name="VideoWizardSummary" position="0,0" size="96,64" id="2">
+               <widget name="text" position="0,4" size="96,40" font="Regular;12" transparent="1" />
+               <widget source="parent.list" render="Label" position="0,40" size="96,21" font="Regular;14">
+                       <convert type="StringListSelection" />
+               </widget>
+               <!--widget name="pic" pixmap="%s" position="0,22" zPosition="10" size="64,64" transparent="1" alphatest="on"/-->
+       </screen>""")
+       #% (resolveFilename(SCOPE_PLUGINS, "SystemPlugins/Videomode/lcd_Scart.png"))
        
        def __init__(self, session, parent):
                WizardSummary.__init__(self, session, parent)
@@ -82,7 +90,7 @@ class VideoWizard(WizardLanguage, Rc):
                for port in self.hw.getPortList():
                        if self.hw.isPortUsed(port):
                                descr = port
-                               if descr == 'DVI' and hw_type == 'dm500hd':
+                               if descr == 'DVI' and hw_type in ('dm500hd', 'dm800se'):
                                        descr = 'HDMI'
                                if port != "DVI-PC":
                                        list.append((descr,port))
@@ -100,7 +108,7 @@ class VideoWizard(WizardLanguage, Rc):
                self.inputSelect(self.selection)
                if self["portpic"].instance is not None:
                        picname = self.selection
-                       if picname == "DVI" and HardwareInfo().get_device_name() == "dm500hd":
+                       if picname == "DVI" and HardwareInfo().get_device_name() in ("dm500hd", "dm800se"):
                                picname = "HDMI"
                        self["portpic"].instance.setPixmapFromFile(resolveFilename(SCOPE_PLUGINS, "SystemPlugins/Videomode/" + picname + ".png"))
                
index a687714..2df5814 100755 (executable)
@@ -399,4 +399,3 @@ def configStrings(iface):
 
 def Plugins(**kwargs):
        return PluginDescriptor(name=_("Wireless LAN"), description=_("Connect to a Wireless Network"), where = PluginDescriptor.WHERE_NETWORKSETUP, fnc={"ifaceSupported": callFunction, "configStrings": configStrings, "WlanPluginEntry": lambda x: "Wireless Network Configuartion..."})
-       
\ No newline at end of file
diff --git a/lib/python/Screens/AudioSelection.py b/lib/python/Screens/AudioSelection.py
new file mode 100644 (file)
index 0000000..a0bfcab
--- /dev/null
@@ -0,0 +1,314 @@
+from Screen import Screen
+from Components.ServiceEventTracker import ServiceEventTracker
+from Components.ActionMap import ActionMap
+from Components.ConfigList import ConfigListScreen
+from Components.ChoiceList import ChoiceList, ChoiceEntryComponent
+from Components.config import config, ConfigSubsection, getConfigListEntry, ConfigNothing, ConfigSelection, ConfigOnOff
+from Components.MultiContent import MultiContentEntryText
+from Components.Sources.List import List
+from Components.Sources.Boolean import Boolean
+from Components.SystemInfo import SystemInfo
+
+from enigma import iPlayableService
+
+from Tools.ISO639 import LanguageCodes
+from Tools.BoundFunction import boundFunction
+FOCUS_CONFIG, FOCUS_STREAMS = range(2)
+[PAGE_AUDIO, PAGE_SUBTITLES] = ["audio", "subtitles"]
+
+class AudioSelection(Screen, ConfigListScreen):
+       def __init__(self, session, infobar=None, page=PAGE_AUDIO):
+               Screen.__init__(self, session)
+
+               self["streams"] = List([])
+               self["key_red"] = Boolean(False)
+               self["key_green"] = Boolean(False)
+               self["key_yellow"] = Boolean(True)
+               self["key_blue"] = Boolean(False)
+               
+               ConfigListScreen.__init__(self, [])
+               self.infobar = infobar or self.session.infobar
+
+               self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
+                       {
+                               iPlayableService.evUpdatedInfo: self.__updatedInfo
+                       })
+               self.cached_subtitle_checked = False
+               self.__selected_subtitle = None
+        
+               self["actions"] = ActionMap(["ColorActions", "SetupActions", "DirectionActions"],
+               {
+                       "red": self.keyRed,
+                       "green": self.keyGreen,
+                       "yellow": self.keyYellow,
+                       "blue": self.keyBlue,
+                       "ok": self.keyOk,
+                       "cancel": self.cancel,
+                       "up": self.keyUp,
+                       "down": self.keyDown,
+               }, -3)
+
+               self.settings = ConfigSubsection()
+               choicelist = [(PAGE_AUDIO,_("audio tracks")), (PAGE_SUBTITLES,_("Subtitles"))]
+               self.settings.menupage = ConfigSelection(choices = choicelist, default=page)
+               self.onLayoutFinish.append(self.__layoutFinished)
+
+       def __layoutFinished(self):
+               self["config"].instance.setSelectionEnable(False)
+               self.focus = FOCUS_STREAMS
+               self.settings.menupage.addNotifier(self.fillList)
+
+       def fillList(self, arg=None):
+               streams = []
+               conflist = []
+               selectedidx = 0
+               
+               service = self.session.nav.getCurrentService()
+               self.audioTracks = audio = service and service.audioTracks()
+               n = audio and audio.getNumberOfTracks() or 0
+               
+               if self.settings.menupage.getValue() == PAGE_AUDIO:
+                       self.setTitle(_("Select audio track"))
+                       if SystemInfo["CanDownmixAC3"]:
+                               self.settings.downmix = ConfigOnOff(default=config.av.downmix_ac3.value)
+                               self.settings.downmix.addNotifier(self.changeAC3Downmix, initial_call = False)
+                               conflist.append(getConfigListEntry(_("AC3 downmix"), self.settings.downmix))
+                               self["key_red"].setBoolean(True)
+
+                       if n > 0:
+                               self.audioChannel = service.audioChannel()
+                               choicelist = [("0",_("left")), ("1",_("stereo")), ("2", _("right"))]
+                               self.settings.channelmode = ConfigSelection(choices = choicelist, default = str(self.audioChannel.getCurrentChannel()))
+                               self.settings.channelmode.addNotifier(self.changeMode, initial_call = False)
+                               conflist.append(getConfigListEntry(_("Channel"), self.settings.channelmode))
+                               self["key_green"].setBoolean(True)
+                               selectedAudio = self.audioTracks.getCurrentTrack()
+                               for x in range(n):
+                                       number = str(x)
+                                       i = audio.getTrackInfo(x)
+                                       languages = i.getLanguage().split('/')
+                                       description = i.getDescription() or _("<unknown>")
+                                       selected = ""
+                                       language = ""
+
+                                       if selectedAudio == x:
+                                               selected = _("Running")
+                                               selectedidx = x
+
+                                       cnt = 0
+                                       for lang in languages:
+                                               if cnt:
+                                                       language += ' / '
+                                               if LanguageCodes.has_key(lang):
+                                                       language += LanguageCodes[lang][0]
+                                               elif lang == "und":
+                                                       _("<unknown>")
+                                               else:
+                                                       language += lang
+                                               cnt += 1
+
+                                       streams.append((x, "", number, description, language, selected))
+
+                       else:
+                               streams = []
+                               conflist.append(('',))
+                               self["key_green"].setBoolean(False)
+
+               elif self.settings.menupage.getValue() == PAGE_SUBTITLES:
+                       self.setTitle(_("Subtitle selection"))
+                       conflist.append(('',))
+                       conflist.append(('',))
+                       self["key_red"].setBoolean(False)
+                       self["key_green"].setBoolean(False)
+
+                       if self.subtitlesEnabled():
+                               sel = self.infobar.selected_subtitle
+                       else:
+                               sel = None
+
+                       idx = 0
+                       
+                       subtitlelist = self.getSubtitleList()
+
+                       if len(subtitlelist):
+                               for x in subtitlelist:
+                                       number = str(x[1])
+                                       description = "?"
+                                       language = _("<unknown>")
+                                       selected = ""
+
+                                       if sel and x[:4] == sel[:4]:
+                                               selected = _("Running")
+                                               selectedidx = idx
+                                       
+                                       if x[4] != "und":
+                                               if LanguageCodes.has_key(x[4]):
+                                                       language = LanguageCodes[x[4]][0]
+                                               else:
+                                                       language = x[4]
+
+                                       if x[0] == 0:
+                                               description = "DVB"
+                                               number = "%x" % (x[1])
+
+                                       elif x[0] == 1:
+                                               description = "TTX"
+                                               number = "%x%02x" % (x[3],x[2])
+
+                                       elif x[0] == 2:
+                                               types = ("UTF-8 text","SSA / AAS",".SRT file")
+                                               description = types[x[2]]
+
+                                       streams.append((x, "", number, description, language, selected))
+                                       idx += 1
+                       
+                       else:
+                               streams = []
+
+               conflist.append(getConfigListEntry(_("Menu"), self.settings.menupage))
+               
+               from Components.PluginComponent import plugins
+               from Plugins.Plugin import PluginDescriptor
+               
+               if hasattr(self.infobar, "runPlugin"):
+                       class PluginCaller:
+                               def __init__(self, fnc, *args):
+                                       self.fnc = fnc
+                                       self.args = args
+                               def __call__(self, *args, **kwargs):
+                                       self.fnc(*self.args)
+
+                       Plugins = [ (p.name, PluginCaller(self.infobar.runPlugin, p)) for p in plugins.getPlugins(where = PluginDescriptor.WHERE_AUDIOMENU) ]
+
+                       if len(Plugins):
+                               self["key_blue"].setBoolean(True)
+                               conflist.append(getConfigListEntry(Plugins[0][0], ConfigNothing()))
+                               self.plugincallfunc = Plugins[0][1]
+                       if len(Plugins) > 1:
+                               print "these plugins are installed but not displayed in the dialog box:", Plugins[1:]
+
+               self["config"].list = conflist
+               self["config"].l.setList(conflist)
+
+               self["streams"].list = streams
+               self["streams"].setIndex(selectedidx)
+
+       def __updatedInfo(self):
+               self.fillList()
+
+       def getSubtitleList(self):
+               s = self.infobar and self.infobar.getCurrentServiceSubtitle()
+               l = s and s.getSubtitleList() or [ ]
+               return l
+
+       def subtitlesEnabled(self):
+               return self.infobar.subtitles_enabled
+
+       def enableSubtitle(self, subtitles):
+               if self.infobar.selected_subtitle != subtitles:
+                       self.infobar.subtitles_enabled = False
+                       self.infobar.selected_subtitle = subtitles
+                       if subtitles:
+                               self.infobar.subtitles_enabled = True
+
+       def changeAC3Downmix(self, downmix):
+               if downmix.getValue() == True:
+                       config.av.downmix_ac3.value = True
+               else:
+                       config.av.downmix_ac3.value = False
+               config.av.downmix_ac3.save()
+
+       def changeMode(self, mode):
+               if mode is not None:
+                       self.audioChannel.selectChannel(int(mode.getValue()))
+
+       def changeAudio(self, audio):
+               track = int(audio)
+               if isinstance(track, int):
+                       if self.session.nav.getCurrentService().audioTracks().getNumberOfTracks() > track:
+                               self.audioTracks.selectTrack(track)
+
+       def keyLeft(self):
+               if self.focus == FOCUS_CONFIG:
+                       ConfigListScreen.keyLeft(self)
+               elif self.focus == FOCUS_STREAMS:
+                       self["streams"].setIndex(0)
+
+       def keyRight(self, config = False):
+               if config or self.focus == FOCUS_CONFIG:
+                       if self["config"].getCurrentIndex() < 3:
+                               ConfigListScreen.keyRight(self)
+                       elif hasattr(self, "plugincallfunc"):
+                               self.plugincallfunc()
+               if self.focus == FOCUS_STREAMS and self["streams"].count() and config == False:
+                       self["streams"].setIndex(self["streams"].count()-1)
+
+       def keyRed(self):
+               if self["key_red"].getBoolean():
+                       self.colorkey(0)
+
+       def keyGreen(self):
+               if self["key_green"].getBoolean():
+                       self.colorkey(1)
+
+       def keyYellow(self):
+               if self["key_yellow"].getBoolean():
+                       self.colorkey(2)
+
+       def keyBlue(self):
+               if self["key_blue"].getBoolean():
+                       self.colorkey(3)
+
+       def colorkey(self, idx):
+               self["config"].setCurrentIndex(idx)
+               self.keyRight(True)
+
+       def keyUp(self):
+               if self.focus == FOCUS_CONFIG:
+                       self["config"].instance.moveSelection(self["config"].instance.moveUp)
+               elif self.focus == FOCUS_STREAMS:
+                       if self["streams"].getIndex() == 0:
+                               self["config"].instance.setSelectionEnable(True)
+                               self["streams"].style = "notselected"
+                               self["config"].setCurrentIndex(len(self["config"].getList())-1)
+                               self.focus = FOCUS_CONFIG
+                       else:
+                               self["streams"].selectPrevious()
+
+       def keyDown(self):
+               if self.focus == FOCUS_CONFIG:
+                       if self["config"].getCurrentIndex() < len(self["config"].getList())-1:
+                               self["config"].instance.moveSelection(self["config"].instance.moveDown)
+                       else:
+                               self["config"].instance.setSelectionEnable(False)
+                               self["streams"].style = "default"
+                               self.focus = FOCUS_STREAMS
+               elif self.focus == FOCUS_STREAMS:
+                       self["streams"].selectNext()
+
+       def keyOk(self):
+               if self.focus == FOCUS_STREAMS and self["streams"].list:
+                       cur = self["streams"].getCurrent()
+                       if self.settings.menupage.getValue() == PAGE_AUDIO and cur[0] is not None:
+                               self.changeAudio(cur[2])
+                               self.__updatedInfo()
+                       if self.settings.menupage.getValue() == PAGE_SUBTITLES and cur[0] is not None:
+                               if self.infobar.selected_subtitle == cur[0]:
+                                       self.enableSubtitle(None)
+                                       selectedidx = self["streams"].getIndex()
+                                       self.__updatedInfo()
+                                       self["streams"].setIndex(selectedidx)
+                               else:
+                                       self.enableSubtitle(cur[0])
+                                       self.__updatedInfo()
+                       self.close(0)
+               elif self.focus == FOCUS_CONFIG:
+                       self.keyRight()
+
+       def cancel(self):
+               self.close(0)
+
+class SubtitleSelection(AudioSelection):
+       def __init__(self, session, infobar=None):
+               AudioSelection.__init__(self, session, infobar, page=PAGE_SUBTITLES)
+               self.skinName = ["AudioSelection"]
index 4be0cbc..6619bbc 100755 (executable)
@@ -598,6 +598,7 @@ class InfoBarEPG:
 
                if list:
                        list.append((_("show single service EPG..."), self.openSingleServiceEPG))
+                       list.append((_("Multi EPG"), self.openMultiServiceEPG))
                        self.session.openWithCallback(self.EventInfoPluginChosen, ChoiceBox, title=_("Please choose an extension..."), list = list, skin_name = "EPGExtensionsList")
                else:
                        self.openSingleServiceEPG()
@@ -1677,126 +1678,11 @@ class InfoBarAudioSelection:
                        })
 
        def audioSelection(self):
-               service = self.session.nav.getCurrentService()
-               self.audioTracks = audio = service and service.audioTracks()
-               n = audio and audio.getNumberOfTracks() or 0
-               tlist = []
-               if n > 0:
-                       self.audioChannel = service.audioChannel()
-
-                       idx = 0
-                       while idx < n:
-                               cnt = 0
-                               i = audio.getTrackInfo(idx)
-                               languages = i.getLanguage().split('/')
-                               description = i.getDescription()
-                               language = ""
-
-                               for lang in languages:
-                                       if cnt:
-                                               language += ' / '
-                                       if LanguageCodes.has_key(lang):
-                                               language += LanguageCodes[lang][0]
-                                       else:
-                                               language += lang
-                                       cnt += 1
-
-                               if len(description):
-                                       description += " (" + language + ")"
-                               else:
-                                       description = language
-
-                               tlist.append((description, idx))
-                               idx += 1
-
-                       tlist.sort(key=lambda x: x[0])
-
-                       selectedAudio = self.audioTracks.getCurrentTrack()
-
-                       selection = 0
-
-                       for x in tlist:
-                               if x[1] != selectedAudio:
-                                       selection += 1
-                               else:
-                                       break
-
-                       availableKeys = []
-                       usedKeys = []
-
-                       if SystemInfo["CanDownmixAC3"]:
-                               flist = [(_("AC3 downmix") + " - " +(_("Off"), _("On"))[config.av.downmix_ac3.value and 1 or 0], "CALLFUNC", self.changeAC3Downmix),
-                                       ((_("Left"), _("Stereo"), _("Right"))[self.audioChannel.getCurrentChannel()], "mode")]
-                               usedKeys.extend(["red", "green"])
-                               availableKeys.extend(["yellow", "blue"])
-                               selection += 2
-                       else:
-                               flist = [((_("Left"), _("Stereo"), _("Right"))[self.audioChannel.getCurrentChannel()], "mode")]
-                               usedKeys.extend(["red"])
-                               availableKeys.extend(["green", "yellow", "blue"])
-                               selection += 1
-
-                       if hasattr(self, "runPlugin"):
-                               class PluginCaller:
-                                       def __init__(self, fnc, *args):
-                                               self.fnc = fnc
-                                               self.args = args
-                                       def __call__(self, *args, **kwargs):
-                                               self.fnc(*self.args)
-
-                               Plugins = [ (p.name, PluginCaller(self.runPlugin, p)) for p in plugins.getPlugins(where = PluginDescriptor.WHERE_AUDIOMENU) ]
-
-                               for p in Plugins:
-                                       selection += 1
-                                       flist.append((p[0], "CALLFUNC", p[1]))
-                                       if availableKeys:
-                                               usedKeys.append(availableKeys[0])
-                                               del availableKeys[0]
-                                       else:
-                                               usedKeys.append("")
-
-                       flist.append(("--", ""))
-                       usedKeys.append("")
-                       selection += 1
-
-                       keys = usedKeys + [ "1", "2", "3", "4", "5", "6", "7", "8", "9", "0" ] + [""] * n
-                       self.session.openWithCallback(self.audioSelected, ChoiceBox, title=_("Select audio track"), list = flist + tlist, selection = selection, keys = keys, skin_name = "AudioTrackSelection")
-               else:
-                       del self.audioTracks
-
-       def changeAC3Downmix(self, arg):
-               choicelist = self.session.current_dialog["list"]
-               list = choicelist.list
-               t = list[0][1]
-               list[0][1]=(t[0], t[1], t[2], t[3], t[4], t[5], t[6],
-                       _("AC3 downmix") + " - " + (_("On"), _("Off"))[config.av.downmix_ac3.value and 1 or 0])
-               choicelist.setList(list)
-               if config.av.downmix_ac3.value:
-                       config.av.downmix_ac3.value = False
-               else:
-                       config.av.downmix_ac3.value = True
-               config.av.downmix_ac3.save()
-
-       def audioSelected(self, audio):
-               if audio is not None:
-                       if isinstance(audio[1], str):
-                               if audio[1] == "mode":
-                                       keys = ["red", "green", "yellow"]
-                                       selection = self.audioChannel.getCurrentChannel()
-                                       tlist = ((_("left"), 0), (_("stereo"), 1), (_("right"), 2))
-                                       self.session.openWithCallback(self.modeSelected, ChoiceBox, title=_("Select audio mode"), list = tlist, selection = selection, keys = keys, skin_name ="AudioModeSelection")
-                       else:
-                               del self.audioChannel
-                               if self.session.nav.getCurrentService().audioTracks().getNumberOfTracks() > audio[1]:
-                                       self.audioTracks.selectTrack(audio[1])
-               else:
-                       del self.audioChannel
-               del self.audioTracks
-
-       def modeSelected(self, mode):
-               if mode is not None:
-                       self.audioChannel.selectChannel(mode[1])
-               del self.audioChannel
+               from Screens.AudioSelection import AudioSelection
+               self.session.openWithCallback(self.audioSelected, AudioSelection, infobar=self)
+               
+       def audioSelected(self, ret=None):
+               print "[infobar::audioSelected]", ret
 
 class InfoBarSubserviceSelection:
        def __init__(self):
index d96b491..5cec512 100755 (executable)
@@ -1,13 +1,13 @@
 installdir = $(pkglibdir)/python/Screens
 
 install_PYTHON = \
-       ChannelSelection.py ClockDisplay.py ConfigMenu.py InfoBar.py Menu.py    \
-       MessageBox.py Screen.py ServiceScan.py TimerEdit.py \
+       AudioSelection.py ChannelSelection.py ClockDisplay.py ConfigMenu.py InfoBar.py \
+       Menu.py MessageBox.py Screen.py ServiceScan.py TimerEdit.py \
        MovieSelection.py Setup.py About.py HarddiskSetup.py FixedMenu.py \
        Satconfig.py ScanSetup.py NetworkSetup.py Ci.py TimerEntry.py Volume.py \
        EpgSelection.py EventView.py Mute.py Standby.py ServiceInfo.py \
        InfoBarGenerics.py HelpMenu.py Wizard.py __init__.py \
-       Dish.py LanguageSelection.py StartWizard.py PiPSetup.py Subtitles.py \
+       Dish.py LanguageSelection.py StartWizard.py PiPSetup.py \
        TutorialWizard.py PluginBrowser.py MinuteInput.py Scart.py PVRState.py \
        Console.py InputBox.py ChoiceBox.py SimpleSummary.py \
        TimerSelection.py PictureInPicture.py TimeDateInput.py \
index 08aa1c8..b9be442 100755 (executable)
@@ -7,6 +7,7 @@ from Screens.HelpMenu import HelpableScreen
 from Components.Network import iNetwork
 from Components.Sources.StaticText import StaticText
 from Components.Sources.Boolean import Boolean
+from Components.Sources.List import List
 from Components.Label import Label,MultiColorLabel
 from Components.Pixmap import Pixmap,MultiPixmap
 from Components.MenuList import MenuList
@@ -23,32 +24,6 @@ from os import path as os_path, system as os_system, unlink
 from re import compile as re_compile, search as re_search
 
 
-class InterfaceList(MenuList):
-       def __init__(self, list, enableWrapAround=False):
-               MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent)
-               self.l.setFont(0, gFont("Regular", 20))
-               self.l.setItemHeight(30)
-
-def InterfaceEntryComponent(index,name,default,active ):
-       res = [
-               (index),
-               MultiContentEntryText(pos=(80, 5), size=(430, 25), font=0, text=name)
-       ]
-       num_configured_if = len(iNetwork.getConfiguredAdapters())
-       if num_configured_if >= 2:
-               if default is True:
-                       png = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/buttons/button_blue.png"))
-               if default is False:
-                       png = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/buttons/button_blue_off.png"))
-               res.append(MultiContentEntryPixmapAlphaTest(pos=(10, 5), size=(25, 25), png = png))
-       if active is True:
-               png2 = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/lock_on.png"))
-       if active is False:
-               png2 = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/lock_error.png"))
-       res.append(MultiContentEntryPixmapAlphaTest(pos=(40, 1), size=(25, 25), png = png2))
-       return res
-
-
 class NetworkAdapterSelection(Screen,HelpableScreen):
        def __init__(self, session):
                Screen.__init__(self, session)
@@ -91,13 +66,49 @@ class NetworkAdapterSelection(Screen,HelpableScreen):
                        })
 
                self.list = []
-               self["list"] = InterfaceList(self.list)
+               self["list"] = List(self.list)
                self.updateList()
 
                if len(self.adapters) == 1:
                        self.onFirstExecBegin.append(self.okbuttonClick)
                self.onClose.append(self.cleanup)
 
+       def buildInterfaceList(self,iface,name,default,active ):
+               divpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/div-h.png"))
+               defaultpng = None
+               activepng = None
+               description = None
+               interfacepng = None
+
+               if iface in iNetwork.lan_interfaces:
+                       if active is True:
+                               interfacepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/network_wired-active.png"))
+                       elif active is False:
+                               interfacepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/network_wired-inactive.png"))
+                       else:
+                               interfacepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/network_wired.png"))
+               elif iface in iNetwork.wlan_interfaces:
+                       if active is True:
+                               interfacepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/network_wireless-active.png"))
+                       elif active is False:
+                               interfacepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/network_wireless-inactive.png"))
+                       else:
+                               interfacepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/network_wireless.png"))
+
+               num_configured_if = len(iNetwork.getConfiguredAdapters())
+               if num_configured_if >= 2:
+                       if default is True:
+                               defaultpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/buttons/button_blue.png"))
+                       elif default is False:
+                               defaultpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/buttons/button_blue_off.png"))
+               if active is True:
+                       activepng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/lock_on.png"))
+               elif active is False:
+                       activepng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/lock_error.png"))
+               
+               description = iNetwork.getFriendlyAdapterDescription(iface)
+
+               return((iface, name, description, interfacepng, defaultpng, activepng, divpng)) 
 
        def updateList(self):
                self.list = []
@@ -122,7 +133,7 @@ class NetworkAdapterSelection(Screen,HelpableScreen):
                        default_gw = result
                                        
                if len(self.adapters) == 0: # no interface available => display only eth0
-                       self.list.append(InterfaceEntryComponent("eth0",iNetwork.getFriendlyAdapterName('eth0'),True,True ))
+                       self.list.append(self.buildInterfaceList("eth0",iNetwork.getFriendlyAdapterName('eth0'),True,True ))
                else:
                        for x in self.adapters:
                                if x[1] == default_gw:
@@ -133,11 +144,11 @@ class NetworkAdapterSelection(Screen,HelpableScreen):
                                        active_int = True
                                else:
                                        active_int = False
-                               self.list.append(InterfaceEntryComponent(index = x[1],name = _(x[0]),default=default_int,active=active_int ))
+                               self.list.append(self.buildInterfaceList(x[1],_(x[0]),default_int,active_int ))
                
                if os_path.exists(resolveFilename(SCOPE_PLUGINS, "SystemPlugins/NetworkWizard/networkwizard.xml")):
                        self["key_blue"].setText(_("NetworkWizard"))
-               self["list"].l.setList(self.list)
+               self["list"].setList(self.list)
 
        def setDefaultInterface(self):
                selection = self["list"].getCurrent()
@@ -253,7 +264,7 @@ class NameserverSetup(Screen, ConfigListScreen, HelpableScreen):
                self.list = []
                ConfigListScreen.__init__(self, self.list)
                self.createSetup()
-
+               
        def createConfig(self):
                self.nameservers = iNetwork.getNameserverList()
                self.nameserverEntries = [ NoSave(ConfigIP(default=nameserver)) for nameserver in self.nameservers]
@@ -412,7 +423,7 @@ class AdapterSetup(Screen, ConfigListScreen, HelpableScreen):
                self.wsconfig = None
                self.default = None
 
-               if self.iface == "wlan0" or self.iface == "ath0" :
+               if self.iface in iNetwork.wlan_interfaces:
                        from Plugins.SystemPlugins.WirelessLan.Wlan import wpaSupplicant,Wlan
                        self.w = Wlan(self.iface)
                        self.ws = wpaSupplicant()
@@ -535,7 +546,7 @@ class AdapterSetup(Screen, ConfigListScreen, HelpableScreen):
                        self.createSetup()
                if self["config"].getCurrent() == self.gatewayEntry:
                        self.createSetup()
-               if self.iface == "wlan0" or self.iface == "ath0" :
+               if self.iface in iNetwork.wlan_interfaces:
                        if self["config"].getCurrent() == self.wlanSSID:
                                self.createSetup()
                        if self["config"].getCurrent() == self.encryptionEnabled:
@@ -731,7 +742,7 @@ class AdapterSetupConfiguration(Screen, HelpableScreen):
        def ok(self):
                self.cleanup()
                if self["menulist"].getCurrent()[1] == 'edit':
-                       if self.iface == 'wlan0' or self.iface == 'ath0':
+                       if self.iface in iNetwork.wlan_interfaces:
                                try:
                                        from Plugins.SystemPlugins.WirelessLan.plugin import WlanScan
                                        from Plugins.SystemPlugins.WirelessLan.iwlibs import Wireless
@@ -817,7 +828,7 @@ class AdapterSetupConfiguration(Screen, HelpableScreen):
                if self["menulist"].getCurrent()[1] == 'dns':
                        self["description"].setText(_("Edit the Nameserver configuration of your STB.\n" ) + self.oktext )
                if self["menulist"].getCurrent()[1] == 'scanwlan':
-                       self["description"].setText(_("Scan your network for wireless Access Points and connect to them using your selected wireless device.\n" ) + self.oktext )
+                       self["description"].setText(_("Scan your network for wireless access points and connect to them using your selected wireless device.\n" ) + self.oktext )
                if self["menulist"].getCurrent()[1] == 'wlanstatus':
                        self["description"].setText(_("Shows the state of your wireless LAN connection.\n" ) + self.oktext )
                if self["menulist"].getCurrent()[1] == 'lanrestart':
@@ -834,7 +845,7 @@ class AdapterSetupConfiguration(Screen, HelpableScreen):
                self["IF"].setText(iNetwork.getFriendlyAdapterName(self.iface))
                self["Statustext"].setText(_("Link:"))
                
-               if self.iface == 'wlan0' or self.iface == 'ath0':
+               if self.iface in iNetwork.wlan_interfaces:
                        try:
                                from Plugins.SystemPlugins.WirelessLan.Wlan import iStatus
                        except:
@@ -884,7 +895,7 @@ class AdapterSetupConfiguration(Screen, HelpableScreen):
 
        def AdapterSetupClosed(self, *ret):
                if ret is not None and len(ret):
-                       if ret[0] == 'ok' and (self.iface == 'wlan0' or self.iface == 'ath0') and iNetwork.getAdapterAttribute(self.iface, "up") is True:
+                       if ret[0] == 'ok' and (self.iface in iNetwork.wlan_interfaces) and iNetwork.getAdapterAttribute(self.iface, "up") is True:
                                try:
                                        from Plugins.SystemPlugins.WirelessLan.plugin import WlanStatus
                                        from Plugins.SystemPlugins.WirelessLan.iwlibs import Wireless
@@ -1263,6 +1274,7 @@ class NetworkAdapterTest(Screen):
                self.nextStepTimer.stop()
 
        def layoutFinished(self):
+               self.setTitle(_("Network test: ") + iNetwork.getFriendlyAdapterName(self.iface) )
                self["shortcutsyellow"].setEnabled(False)
                self["AdapterInfo_OK"].hide()
                self["NetworkInfo_Check"].hide()
@@ -1282,7 +1294,7 @@ class NetworkAdapterTest(Screen):
                self["AdapterInfo_Text"] = MultiColorLabel(_("Show Info"))
                self["AdapterInfo_OK"] = Pixmap()
                
-               if self.iface == 'wlan0' or self.iface == 'ath0':
+               if self.iface in iNetwork.wlan_interfaces:
                        self["Networktext"] = MultiColorLabel(_("Wireless Network"))
                else:
                        self["Networktext"] = MultiColorLabel(_("Local Network"))
@@ -1321,7 +1333,7 @@ class NetworkAdapterTest(Screen):
                self["InfoText"] = Label()
 
        def getLinkState(self,iface):
-               if iface == 'wlan0' or iface == 'ath0':
+               if iface in iNetwork.wlan_interfaces:
                        try:
                                from Plugins.SystemPlugins.WirelessLan.Wlan import iStatus,Status
                        except:
index 87d65e5..44f4251 100644 (file)
@@ -95,6 +95,7 @@ class NimSetup(Screen, ConfigListScreen, ServiceStopScreen):
                self.advancedType = None
                self.advancedManufacturer = None
                self.advancedSCR = None
+               self.advancedConnected = None
                
                if self.nim.isMultiType():
                        multiType = self.nimConfig.multiType
@@ -205,7 +206,7 @@ class NimSetup(Screen, ConfigListScreen, ServiceStopScreen):
                checkList = (self.configMode, self.diseqcModeEntry, self.advancedSatsEntry, \
                        self.advancedLnbsEntry, self.advancedDiseqcMode, self.advancedUsalsEntry, \
                        self.advancedLof, self.advancedPowerMeasurement, self.turningSpeed, \
-                       self.advancedType, self.advancedSCR, self.advancedManufacturer, self.advancedUnicable, \
+                       self.advancedType, self.advancedSCR, self.advancedManufacturer, self.advancedUnicable, self.advancedConnected, \
                        self.uncommittedDiseqcCommand, self.cableScanType, self.multiType)
                if self["config"].getCurrent() == self.multiType:
                        from Components.NimManager import InitNimManager
@@ -285,6 +286,18 @@ class NimSetup(Screen, ConfigListScreen, ServiceStopScreen):
                                        self.list.append(self.advancedType)
                                        self.list.append(self.advancedSCR)
                                        self.list.append(getConfigListEntry(_("Frequency"), manufacturer.vco[product_name][manufacturer.scr[product_name].index])) 
+
+                               choices = []
+                               connectable = nimmanager.canConnectTo(self.slotid)
+                               for id in connectable:
+                                       choices.append((str(id), nimmanager.getNimDescription(id)))
+                               if len(choices):
+                                       self.advancedConnected = getConfigListEntry(_("connected"), self.nimConfig.advanced.unicableconnected)
+                                       self.list.append(self.advancedConnected)
+                                       if self.nimConfig.advanced.unicableconnected.value == True:
+                                               self.nimConfig.advanced.unicableconnectedTo.setChoices(choices)
+                                               self.list.append(getConfigListEntry(_("Connected to"),self.nimConfig.advanced.unicableconnectedTo))
+
                        else:   #kein Unicable
                                self.list.append(getConfigListEntry(_("Voltage mode"), Sat.voltage))
                                self.list.append(getConfigListEntry(_("Increased voltage"), currLnb.increased_voltage))
@@ -360,7 +373,6 @@ class NimSetup(Screen, ConfigListScreen, ServiceStopScreen):
                new_configured_sats = nimmanager.getConfiguredSats()
                self.unconfed_sats = old_configured_sats - new_configured_sats
                self.satpos_to_remove = None
-               self.restoreService(_("Zap back to service before tuner setup?"))
                self.deleteConfirmed((None, "no"))
 
        def deleteConfirmed(self, confirmed):
@@ -390,7 +402,9 @@ class NimSetup(Screen, ConfigListScreen, ServiceStopScreen):
                        if confirmed[1] == "yestoall" or confirmed[1] == "notoall":
                                self.deleteConfirmed(confirmed)
                        break
-               
+               else:
+                       self.restoreService(_("Zap back to service before tuner setup?"))
+
        def __init__(self, session, slotid):
                Screen.__init__(self, session)
                self.list = [ ]
index 1dbc150..f482808 100644 (file)
@@ -8,6 +8,7 @@ from Components.ConfigList import ConfigListScreen
 from Components.NimManager import nimmanager, getConfigSatlist
 from Components.Label import Label
 from Tools.Directories import resolveFilename, SCOPE_DEFAULTPARTITIONMOUNTDIR, SCOPE_DEFAULTDIR, SCOPE_DEFAULTPARTITION
+from Tools.HardwareInfo import HardwareInfo
 from Screens.MessageBox import MessageBox
 from enigma import eTimer, eDVBFrontendParametersSatellite, eComponentScan, \
        eDVBSatelliteEquipmentControl, eDVBFrontendParametersTerrestrial, \
@@ -113,6 +114,7 @@ class CableTransponderSearchSupport:
 
        def cableTransponderSearchSessionClosed(self, *val):
                print "cableTransponderSearchSessionClosed, val", val
+               self.resetTimeout()
                self.cable_search_container.appClosed.remove(self.cableTransponderSearchClosed)
                self.cable_search_container.dataAvail.remove(self.getCableTransponderData)
                self.cable_search_container = None
@@ -160,6 +162,19 @@ class CableTransponderSearchSupport:
                tmpstr += " kHz "
                tmpstr += data[0]
                self.cable_search_session["text"].setText(tmpstr)
+               
+       def setTimeout(self):
+               try:
+                       self.oldtimeoutvalue = open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "r").readline()
+                       open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "w").write("0")
+               except:
+                       print "[info] no /sys/module/dvb_core/parameters/dvb_shutdown_timeout available"                
+               
+       def resetTimeout(self):
+               try:
+                       open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "w").write(self.oldtimeoutvalue)
+               except:
+                       print "[info] no /sys/module/dvb_core/parameters/dvb_shutdown_timeout available"
 
        def startCableTransponderSearch(self, nim_idx):
                if not self.tryGetRawFrontend(nim_idx):
@@ -176,10 +191,17 @@ class CableTransponderSearchSupport:
                self.cable_search_container.appClosed.append(self.cableTransponderSearchClosed)
                self.cable_search_container.dataAvail.append(self.getCableTransponderData)
                cableConfig = config.Nims[nim_idx].cable
-               cmd = "tda1002x --init --scan --verbose --wakeup --inv 2 --bus "
+               tunername = nimmanager.getNimName(nim_idx)
+               if tunername == "CXD1981":
+                       cmd = "cxd1978 --init --scan --verbose --wakeup --inv 2 --bus "
+               else:
+                       cmd = "tda1002x --init --scan --verbose --wakeup --inv 2 --bus "
                #FIXMEEEEEE hardcoded i2c devices for dm7025 and dm8000
                if nim_idx < 2:
-                       cmd += str(nim_idx)
+                       if HardwareInfo().get_device_name() == "dm500hd":
+                               cmd += "2"
+                       else:
+                               cmd += str(nim_idx)
                else:
                        if nim_idx == 2:
                                cmd += "2" # first nim socket on DM8000 use /dev/i2c/2
@@ -243,6 +265,7 @@ class CableTransponderSearchSupport:
                self.cable_search_container.execute(cmd)
                tmpstr = _("Try to find used transponders in cable network.. please wait...")
                tmpstr += "\n\n..."
+               self.setTimeout()
                self.cable_search_session = self.session.openWithCallback(self.cableTransponderSearchSessionClosed, MessageBox, tmpstr, MessageBox.TYPE_INFO)
 
 class DefaultSatLists(DefaultWizard):
index 1fd32e0..e64c3b8 100644 (file)
@@ -39,19 +39,6 @@ class ServiceScan(Screen):
                self.resetTimeout()
                self.close()
                
-       def setTimeout(self):
-               try:
-                       self.oldtimeoutvalue = open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "r").readline()
-                       open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "w").write("0")
-               except:
-                       print "[info] no /sys/module/dvb_core/parameters/dvb_shutdown_timeout available"                
-               
-       def resetTimeout(self):
-               try:
-                       open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "w").write(self.oldtimeoutvalue)
-               except:
-                       print "[info] no /sys/module/dvb_core/parameters/dvb_shutdown_timeout available"
-       
        def __init__(self, session, scanList):
                Screen.__init__(self, session)
                
@@ -73,9 +60,7 @@ class ServiceScan(Screen):
                                "ok": self.ok,
                                "cancel": self.cancel
                        })
-               
-               self.setTimeout()
-               
+
                self.onFirstExecBegin.append(self.doServiceScan)
 
        def doServiceScan(self):
@@ -83,4 +68,4 @@ class ServiceScan(Screen):
 
        def createSummary(self):
                print "ServiceScanCreateSummary"
-               return ServiceScanSummary
\ No newline at end of file
+               return ServiceScanSummary
index 406b87c..1a7ebbd 100644 (file)
@@ -3,6 +3,7 @@ from Components.ActionMap import ActionMap
 from Components.config import config
 from Components.AVSwitch import AVSwitch
 from Components.SystemInfo import SystemInfo
+from GlobalActions import globalActionMap
 from enigma import eDVBVolumecontrol
 
 inStandby = None
@@ -41,6 +42,8 @@ class Standby(Screen):
                        "power": self.Power
                }, -1)
 
+               globalActionMap.setEnabled(False)
+
                #mute adc
                self.setMute()
 
@@ -72,6 +75,7 @@ class Standby(Screen):
                elif self.paused_service:
                        self.paused_service.unPauseService()
                self.session.screen["Standby"].boolean = False
+               globalActionMap.setEnabled(True)
 
        def __onFirstExecBegin(self):
                global inStandby
index f3e67d9..0bddce1 100755 (executable)
@@ -39,6 +39,7 @@ is usually caused by not marking PSignals as immutable.
 #include <lib/base/ebase.h>
 #include <lib/base/smartptr.h>
 #include <lib/base/eerror.h>
+#include <lib/base/etpm.h>
 #include <lib/base/nconfig.h>
 #include <lib/base/message.h>
 #include <lib/driver/rc.h>
@@ -160,6 +161,7 @@ typedef long time_t;
 %immutable ePythonMessagePump::recv_msg;
 %immutable eDVBLocalTimeHandler::m_timeUpdated;
 %include <lib/base/message.h>
+%include <lib/base/etpm.h>
 %include <lib/base/nconfig.h>
 %include <lib/driver/rc.h>
 %include <lib/gdi/fb.h>
index 05aaf73..cc8c32b 100644 (file)
@@ -526,7 +526,12 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const
                ePtr<iStaticServiceInformation> service_info;
                m_service_center->info(*m_cursor, service_info);
                eServiceReference ref = *m_cursor;
-               bool isPlayable = !(ref.flags & eServiceReference::isDirectory || ref.flags & eServiceReference::isMarker);
+               bool isMarker = ref.flags & eServiceReference::isMarker;
+               bool isPlayable = !(ref.flags & eServiceReference::isDirectory || isMarker);
+               bool paintProgress = false;
+               ePtr<eServiceEvent> evt;
+
+               bool serviceAvail = true;
 
                if (!marked && isPlayable && service_info && m_is_playable_ignore.valid() && !service_info->isPlayable(*m_cursor, m_is_playable_ignore))
                {
@@ -534,12 +539,13 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const
                                painter.setForegroundColor(m_color[serviceNotAvail]);
                        else
                                painter.setForegroundColor(gRGB(0xbbbbbb));
+                       serviceAvail = false;
                }
 
                if (selected && local_style && local_style->m_selection)
                        painter.blit(local_style->m_selection, offset, eRect(), gPainter::BT_ALPHATEST);
 
-               int xoffset=0;  // used as offset when painting the folder/marker symbol
+               int xoffset=0;  // used as offset when painting the folder/marker symbol or the serviceevent progress
 
                for (int e = 0; e < celElements; ++e)
                {
@@ -583,13 +589,19 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const
                                }
                                case celServiceInfo:
                                {
-                                       ePtr<eServiceEvent> evt;
-                                       if ( isPlayable && service_info && !service_info->getEvent(*m_cursor, evt) )
+                                       if ( isPlayable && !service_info->getEvent(*m_cursor, evt) )
                                        {
                                                std::string name = evt->getEventName();
                                                if (!name.length())
                                                        continue;
                                                text = '(' + evt->getEventName() + ')';
+                                               if (serviceAvail)
+                                               {
+                                                       if (!selected && m_color_set[serviceDescriptionColor])
+                                                               painter.setForegroundColor(m_color[serviceDescriptionColor]);
+                                                       else if (selected && m_color_set[serviceDescriptionColorSelected])
+                                                               painter.setForegroundColor(m_color[serviceDescriptionColorSelected]);
+                                               }
                                        }
                                        else
                                                continue;
@@ -608,9 +620,9 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const
                                {
                                        eRect bbox = para->getBoundBox();
                                        int name_width = bbox.width()+8;
-                                       m_element_position[celServiceInfo].setLeft(area.left()+name_width);
+                                       m_element_position[celServiceInfo].setLeft(area.left()+name_width+xoffs);
                                        m_element_position[celServiceInfo].setTop(area.top());
-                                       m_element_position[celServiceInfo].setWidth(area.width()-name_width);
+                                       m_element_position[celServiceInfo].setWidth(area.width()-(name_width+xoffs));
                                        m_element_position[celServiceInfo].setHeight(area.height());
                                }
 
@@ -678,12 +690,62 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const
                                        painter.clippop();
                                }
                        }
+                       else if (e == celServiceEventProgressbar)
+                       {
+                               eRect area = m_element_position[celServiceEventProgressbar];
+                               if (area.width() > 0 && (isPlayable || isMarker))
+                               {
+                                       // we schedule it to paint it as last element.. so we dont need to reset fore/background color
+                                       paintProgress = isPlayable;
+                                       xoffset = area.width() + 10;
+                               }
+                       }
                }
-               
                if (selected && (!local_style || !local_style->m_selection))
                        style.drawFrame(painter, eRect(offset, m_itemsize), eWindowStyle::frameListboxEntry);
+               if (paintProgress && evt)
+               {
+                       eRect area = m_element_position[celServiceEventProgressbar];
+                       if (!selected && m_color_set[serviceEventProgressbarBorderColor])
+                               painter.setForegroundColor(m_color[serviceEventProgressbarBorderColor]);
+                       else if (selected && m_color_set[serviceEventProgressbarBorderColorSelected])
+                               painter.setForegroundColor(m_color[serviceEventProgressbarBorderColorSelected]);
+
+                       int border = 1;
+                       int progressH = 6;
+                       int progressX = area.left() + offset.x();
+                       int progressW = area.width() - 2 * border;
+                       int progressT = offset.y() + (m_itemsize.height() - progressH - 2*border) / 2;
+
+                       // paint progressbar frame
+                       painter.fill(eRect(progressX, progressT, area.width(), border));
+                       painter.fill(eRect(progressX, progressT + border, border, progressH));
+                       painter.fill(eRect(progressX, progressT + progressH + border, area.width(), border));
+                       painter.fill(eRect(progressX + area.width() - border, progressT + border, border, progressH));
+
+                       // calculate value
+                       time_t now = time(0);
+                       int value = progressW * (now - evt->getBeginTime()) / evt->getDuration();
+
+                       eRect tmp = eRect(progressX + border, progressT + border, value, progressH);
+                       ePtr<gPixmap> &pixmap = m_pixmaps[picServiceEventProgressbar];
+                       if (pixmap)
+                       {
+                               area.moveBy(offset);
+                               painter.clip(area);
+                               painter.blit(pixmap, ePoint(progressX + border, progressT + border), tmp, gPainter::BT_ALPHATEST);
+                               painter.clippop();
+                       }
+                       else
+                       {
+                               if (!selected && m_color_set[serviceEventProgressbarColor])
+                                       painter.setForegroundColor(m_color[serviceEventProgressbarColor]);
+                               else if (selected && m_color_set[serviceEventProgressbarColorSelected])
+                                       painter.setForegroundColor(m_color[serviceEventProgressbarColorSelected]);
+                               painter.fill(tmp);
+                       }
+               }
        }
-       
        painter.clippop();
 }
 
index 5228a2f..589afba 100644 (file)
@@ -49,6 +49,7 @@ public:
                celServiceNumber,
                celMarkerPixmap,
                celFolderPixmap,
+               celServiceEventProgressbar,
                celServiceName,
                celServiceTypePixmap,
                celServiceInfo, // "now" event
@@ -62,6 +63,7 @@ public:
                picServiceGroup,
                picFolder,
                picMarker,
+               picServiceEventProgressbar,
                picElements
        };
 
@@ -84,6 +86,12 @@ public:
                markedBackground,
                markedBackgroundSelected,
                serviceNotAvail,
+               serviceEventProgressbarColor,
+               serviceEventProgressbarColorSelected,
+               serviceEventProgressbarBorderColor,
+               serviceEventProgressbarBorderColorSelected,
+               serviceDescriptionColor,
+               serviceDescriptionColorSelected,
                colorElements
        };
        
index 154f486..4ecbd76 100644 (file)
@@ -46,6 +46,7 @@ eServiceFactoryMP3::eServiceFactoryMP3()
                extensions.push_back("mp4");
                extensions.push_back("mov");
                extensions.push_back("m4a");
+               extensions.push_back("m2ts");
                sc->addServiceFactory(eServiceFactoryMP3::id, this, extensions);
        }
 
@@ -327,6 +328,7 @@ eServiceMP3::eServiceMP3(eServiceReference ref)
        else
        {
                m_subs_to_pull_handler_id = g_signal_connect (subsink, "new-buffer", G_CALLBACK (gstCBsubtitleAvail), this);
+               g_object_set (G_OBJECT (subsink), "caps", gst_caps_from_string("text/plain; text/x-plain; text/x-pango-markup"), NULL);
                g_object_set (G_OBJECT (m_gst_playbin), "text-sink", subsink, NULL);
        }
 
index 3f420b4..b8554d5 100644 (file)
@@ -172,11 +172,11 @@ int main(int argc, char **argv)
                eTextPara::forceReplacementGlyph(i);
 
        eWidgetDesktop dsk(eSize(720, 576));
-       eWidgetDesktop dsk_lcd(eSize(132, 64));
-       
+       eWidgetDesktop dsk_lcd(my_lcd_dc->size());
+
        dsk.setStyleID(0);
-       dsk_lcd.setStyleID(1);
-       
+       dsk_lcd.setStyleID(my_lcd_dc->size().width() == 96 ? 2 : 1);
+
 /*     if (double_buffer)
        {
                eDebug(" - double buffering found, enable buffered graphics mode.");
index c748538..a3cfb5a 100755 (executable)
--- a/mytest.py
+++ b/mytest.py
@@ -30,6 +30,9 @@ from Screens.SimpleSummary import SimpleSummary
 
 from sys import stdout, exc_info
 
+profile("Bouquets")
+eDVBDB.getInstance().reloadBouquets()
+
 profile("ParentalControl")
 from Components.ParentalControl import InitParentalControl
 InitParentalControl()
@@ -45,8 +48,7 @@ from Tools.Directories import InitFallbackFiles, resolveFilename, SCOPE_PLUGINS,
 from Components.config import config, configfile, ConfigText, ConfigYesNo, ConfigInteger, NoSave
 InitFallbackFiles()
 
-profile("ReloadProfiles")
-eDVBDB.getInstance().reloadBouquets()
+profile("config.misc")
 
 config.misc.radiopic = ConfigText(default = resolveFilename(SCOPE_CURRENT_SKIN, "radio.mvi"))
 config.misc.isNextRecordTimerAfterEventActionAuto = ConfigYesNo(default=False)
@@ -363,9 +365,10 @@ class PowerKey:
        def powerlong(self):
                if Screens.Standby.inTryQuitMainloop or (self.session.current_dialog and not self.session.current_dialog.ALLOW_SUSPEND):
                        return
+               self.doAction(action = config.usage.on_long_powerpress.value)
 
+       def doAction(self, action):
                self.standbyblocked = 1
-               action = config.usage.on_long_powerpress.value
                if action == "shutdown":
                        self.shutdown()
                elif action == "show_menu":
@@ -380,14 +383,15 @@ class PowerKey:
                                                menu_screen = self.session.openWithCallback(self.MenuClosed, MainMenu, x)
                                                menu_screen.setTitle(_("Standby / Restart"))
                                                return
+               elif action == "standby":
+                       self.standby()
 
        def powerdown(self):
                self.standbyblocked = 0
 
        def powerup(self):
                if self.standbyblocked == 0:
-                       self.standbyblocked = 1
-                       self.standby()
+                       self.doAction(action = config.usage.on_short_powerpress.value)
 
        def standby(self):
                if not Screens.Standby.inStandby and self.session.current_dialog and self.session.current_dialog.ALLOW_SUSPEND and self.session.in_exec:
index 5702df8..143f3a0 100755 (executable)
--- a/po/nl.po
+++ b/po/nl.po
@@ -5274,7 +5274,7 @@ msgstr "Rotor draaisnelheid"
 
 #
 msgid "Running"
-msgstr "In behandeling"
+msgstr "Geactiveerd"
 
 #
 msgid "Russia"
diff --git a/skin.py b/skin.py
index 064fd21..b490f73 100755 (executable)
--- a/skin.py
+++ b/skin.py
@@ -241,6 +241,8 @@ def applySingleAttribute(guiObject, desktop, attrib, value, scale = ((1,1),(1,1)
                        guiObject.setShadowOffset(parsePosition(value, scale))
                elif attrib == 'noWrap':
                        guiObject.setNoWrap(1)
+               elif attrib == 'id':
+                       pass
                else:
                        raise SkinError("unsupported attribute " + attrib + "=" + value)
        except int:
@@ -395,12 +397,16 @@ def loadSkinData(desktop):
        for (path, dom_skin) in skins:
                loadSingleSkinData(desktop, dom_skin, path)
 
-def lookupScreen(name):
+def lookupScreen(name, style_id):
        for (path, skin) in dom_skins:
                # first, find the corresponding screen element
                for x in skin.findall("screen"):
                        if x.attrib.get('name', '') == name:
-                               return x, path
+                               screen_style_id = x.attrib.get('id', '-1')
+                               if screen_style_id == '-1' and name.find('ummary') > 0:
+                                       screen_style_id = '1'
+                               if (style_id != 2 and int(screen_style_id) == -1) or int(screen_style_id) == style_id:
+                                       return x, path
        return None, None
 
 class additionalWidget:
@@ -412,9 +418,11 @@ def readSkin(screen, skin, names, desktop):
 
        name = "<embedded-in-'%s'>" % screen.__class__.__name__
 
+       style_id = desktop.getStyleID();
+
        # try all skins, first existing one have priority
        for n in names:
-               myscreen, path = lookupScreen(n)
+               myscreen, path = lookupScreen(n, style_id)
                if myscreen is not None:
                        # use this name for debug output
                        name = n
@@ -427,7 +435,15 @@ def readSkin(screen, skin, names, desktop):
        # try uncompiled embedded skin
        if myscreen is None and getattr(screen, "skin", None):
                print "Looking for embedded skin"
-               myscreen = screen.parsedSkin = xml.etree.cElementTree.fromstring(screen.skin)
+               skin_tuple = screen.skin
+               if not isinstance(skin_tuple, tuple):
+                       skin_tuple = (skin_tuple,)
+               for sskin in skin_tuple:
+                       parsedSkin = xml.etree.cElementTree.fromstring(sskin)
+                       screen_style_id = parsedSkin.attrib.get('id', '-1')
+                       if (style_id != 2 and int(screen_style_id) == -1) or int(screen_style_id) == style_id:
+                               myscreen = screen.parsedSkin = parsedSkin
+                               break
 
        #assert myscreen is not None, "no skin for screen '" + repr(names) + "' found!"
        if myscreen is None: