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
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)
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
skin_default.xml \
skin.xml \
startwizard.xml \
- tutorialwizard.xml
+ tutorialwizard.xml \
+ unicable.xml
dist_install_DATA = \
bouquets.tv \
+ dm800se.info \
dm500hd.info \
dm7025.info \
dm8000.info \
dm800.info \
+ settings.800se \
settings.500hd \
settings.7025 \
settings.800 \
--- /dev/null
+<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>
--- /dev/null
+config.misc.rcused=1
\ No newline at end of file
<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>
<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>
<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>
<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" /> -->
<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">
</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" />
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" />
<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>
</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 -->
<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>
<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>
<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>
<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>
<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" />
<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>
b_tl.png \
b_t.png \
b_tr.png \
+ celserviceeventprogressbar.png \
div-h.png \
div-v.png \
epg_more.png \
expanded-plugins.png \
info-bg_mp.png \
info-bg.png \
- lock.png \
- lockBouquet.png \
mediaplayer_bg.png \
mute.png \
nim_active.png \
timeline-now.png \
timeline.png \
unhandled-key.png \
- unlock.png \
- unlockBouquet.png \
verticalline-plugins.png \
vkey_backspace.png \
vkey_bg.png \
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 \
scan-c.png \
scan-s.png \
scan-t.png \
- selectioncross.png
+ selectioncross.png \
+ unlock.png \
+ unlockBouquet.png
--- /dev/null
+<?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>
--- /dev/null
+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.
+
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
--- /dev/null
+#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 "";
+}
--- /dev/null
+#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
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)
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)
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))
DECLARE_REF(eDVBResourceManager);
int avail, busy;
- enum { DM7025, DM800, DM500HD, DM8000 };
+ enum { DM7025, DM800, DM500HD, DM800SE, DM8000 };
int m_boxtype;
int getUseCount() { return m_use_count; }
RESULT requestTsidOnid(ePyObject callback);
+ int reserveDemux();
private:
ePtr<eDVBAllocatedFrontend> m_frontend;
ePtr<eDVBAllocatedDemux> m_demux, m_decoder_demux;
{
__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))
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))
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))
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)
{
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))
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);
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];
{
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:
++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);
regFE->dec_use();
if (m_simulate && m_sec_sequence.current() != m_sec_sequence.end())
tuneLoop();
+ return delay;
}
void eDVBFrontend::setFrontend(bool recvEvents)
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;
}
"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;
-}
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;
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);
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
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;
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;
{
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;
};
/* 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
{
{
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;
eSecDebugNoSimulate("ret1 %d", ret);
- if (linked_in_use)
+ if (linked_in_use && !is_unicable)
{
// compare tuner data
if ( (csw != linked_csw) ||
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;
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;
{
// 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
}
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)
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;
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()");
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() )
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
{
secSequence.push_back(cmd);
}
+ void push_back(eSecCommandList &list)
+ {
+ secSequence.insert(end(), list.begin(), list.end());
+ }
void clear()
{
secSequence.clear();
{
return secSequence.size();
}
+ eSecCommandList &operator=(const eSecCommandList &lst)
+ {
+ secSequence = lst.secSequence;
+ cur = begin();
+ return *this;
+ }
};
#endif
#define MAX_SATCR 8
#define MAX_LNBNUM 32
+ int SatCR_positions;
int SatCR_idx;
unsigned int SatCRvco;
unsigned int UnicableTuningWord;
#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
/* 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);
#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>
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
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))
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;
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;
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;
}
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)
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))
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;
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;
}
+ }
}
}
}
typedef FTC_SBitCache FTC_SBit_Cache;
#endif
#include <vector>
+#include <list>
#include <lib/gdi/fb.h>
#include <lib/gdi/esize.h>
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);
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();
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);
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);
}
#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)
{
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;
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--)
{
}
}
+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)
{
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);
}
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);
} else
swap=0;
e = 2*dy-dx;
-
+
int lasthit = 0;
for(i=1; i<=dx; i++)
{
} 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;
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()
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;
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)
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
#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);
+ }
}
}
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;
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
};
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)
{
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)
{
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())
{
{
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;
}
{
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;
}
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)
{
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]);
}
break;
}
+ case TYPE_PROGRESS_PIXMAP: // Progress
+ /*
+ (1, x, y, width, height, filled_percent, pixmap [, borderWidth, foreColor, backColor, backColorSelected] )
+ */
case TYPE_PROGRESS: // Progress
{
/*
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();
}
{
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
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:
{
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);
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);
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()
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
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
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
from enigma import eConsoleAppContainer
+from Tools.Directories import fileExists
class IpkgComponent:
EVENT_INSTALL = 0
def __init__(self, ipkg = '/usr/bin/ipkg'):
self.ipkg = ipkg
-
+ self.opkgAvail = fileExists('/usr/bin/opkg')
self.cmd = eConsoleAppContainer()
self.cache = None
self.callbackList = []
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:
self.DnsConsole = Console()
self.PingConsole = Console()
self.config_ready = None
+ self.friendlyNames = {}
+ self.lan_interfaces = []
+ self.wlan_interfaces = []
self.getInterfaces()
def onRemoteRootFS(self):
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
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:
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] = []
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)
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()
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):
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)
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,
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:
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):
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()
-from config import ConfigNumber, ConfigYesNo, ConfigSubsection, config
+from config import ConfigNumber, ConfigYesNo, ConfigSubsection, ConfigSelection, config
def InitRecordingConfig():
config.recording = ConfigSubsection();
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
self.__content = None
self.__wrap_around = False
self.__selection_enabled = True
+ self.__scrollbarMode = "showOnDemand"
GUI_WIDGET = eListbox
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)
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
from Tools.Directories import resolveFilename, SCOPE_CURRENT_SKIN
+from Components.config import config
+
class ServiceList(HTMLComponent, GUIComponent):
MODE_NORMAL = 0
MODE_FAVOURITES = 1
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":
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)
+
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"),
("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)
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
# 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)
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
--- /dev/null
+installdir = $(LIBDIR)/enigma2/python/Plugins/DemoPlugins/TPMDemo
+
+install_PYTHON = \
+ __init__.py \
+ plugin.py
--- /dev/null
+Please read enigma2/doc/TPM for further instructions on how to integrate this into your own plugins.
\ No newline at end of file
--- /dev/null
+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
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>
<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)
# '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()
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":
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)
install_PYTHON = \
__init__.py Plugin.py
+
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)
def ChoicesSelectionMoved(self):
pass
+
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))
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)
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))
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"))
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
--- /dev/null
+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"]
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()
})
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):
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 \
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
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)
})
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 = []
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:
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()
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]
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()
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:
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
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':
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:
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
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()
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"))
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:
self.advancedType = None
self.advancedManufacturer = None
self.advancedSCR = None
+ self.advancedConnected = None
if self.nim.isMultiType():
multiType = self.nimConfig.multiType
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
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))
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):
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 = [ ]
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, \
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
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):
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
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):
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)
"ok": self.ok,
"cancel": self.cancel
})
-
- self.setTimeout()
-
+
self.onFirstExecBegin.append(self.doServiceScan)
def doServiceScan(self):
def createSummary(self):
print "ServiceScanCreateSummary"
- return ServiceScanSummary
\ No newline at end of file
+ return ServiceScanSummary
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
"power": self.Power
}, -1)
+ globalActionMap.setEnabled(False)
+
#mute adc
self.setMute()
elif self.paused_service:
self.paused_service.unPauseService()
self.session.screen["Standby"].boolean = False
+ globalActionMap.setEnabled(True)
def __onFirstExecBegin(self):
global inStandby
#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>
%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>
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))
{
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)
{
}
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;
{
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());
}
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();
}
celServiceNumber,
celMarkerPixmap,
celFolderPixmap,
+ celServiceEventProgressbar,
celServiceName,
celServiceTypePixmap,
celServiceInfo, // "now" event
picServiceGroup,
picFolder,
picMarker,
+ picServiceEventProgressbar,
picElements
};
markedBackground,
markedBackgroundSelected,
serviceNotAvail,
+ serviceEventProgressbarColor,
+ serviceEventProgressbarColorSelected,
+ serviceEventProgressbarBorderColor,
+ serviceEventProgressbarBorderColorSelected,
+ serviceDescriptionColor,
+ serviceDescriptionColorSelected,
colorElements
};
extensions.push_back("mp4");
extensions.push_back("mov");
extensions.push_back("m4a");
+ extensions.push_back("m2ts");
sc->addServiceFactory(eServiceFactoryMP3::id, this, extensions);
}
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);
}
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.");
from sys import stdout, exc_info
+profile("Bouquets")
+eDVBDB.getInstance().reloadBouquets()
+
profile("ParentalControl")
from Components.ParentalControl import InitParentalControl
InitParentalControl()
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)
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":
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:
#
msgid "Running"
-msgstr "In behandeling"
+msgstr "Geactiveerd"
#
msgid "Russia"
guiObject.setShadowOffset(parsePosition(value, scale))
elif attrib == 'noWrap':
guiObject.setNoWrap(1)
+ elif attrib == 'id':
+ pass
else:
raise SkinError("unsupported attribute " + attrib + "=" + value)
except int:
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:
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
# 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: