From 056238169736f96c252cf7feb7891f0282bf8db5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Strasdas?= Date: Sat, 28 May 2011 09:26:20 +0200 Subject: [PATCH] [SHOUTcast] Screen layout enhanced - Menu button added - Screen layout modified to adjust dynamically to resolution - Options to configure plugin menu location, name and description added to setup - Plugin icon added --- shoutcast/CONTROL/conffiles | 1 + shoutcast/CONTROL/control | 2 +- shoutcast/meta/plugin_shoutcast.xml | 5 +- shoutcast/src/Makefile.am | 2 +- shoutcast/src/plugin.png | Bin 0 -> 2827 bytes shoutcast/src/plugin.py | 170 ++++++++++++++-------------- 6 files changed, 92 insertions(+), 88 deletions(-) create mode 100644 shoutcast/CONTROL/conffiles create mode 100644 shoutcast/src/plugin.png diff --git a/shoutcast/CONTROL/conffiles b/shoutcast/CONTROL/conffiles new file mode 100644 index 00000000..267c9bde --- /dev/null +++ b/shoutcast/CONTROL/conffiles @@ -0,0 +1 @@ +/usr/lib/enigma2/python/Plugins/Extensions/SHOUTcast/favorites diff --git a/shoutcast/CONTROL/control b/shoutcast/CONTROL/control index 500cc9c3..0454d31b 100644 --- a/shoutcast/CONTROL/control +++ b/shoutcast/CONTROL/control @@ -1,6 +1,6 @@ Package: enigma2-plugin-extensions-shoutcast Version: 1.0 -Description: E2 SHOUTcast Plugin +Description: A client to listen and record SHOUTcast internet radio Maintainer: Dr. Best Homepage: http://www.dreambox-tools.info Depends: enigma2 (>> 2.6git20091201), python-twisted-web, streamripper diff --git a/shoutcast/meta/plugin_shoutcast.xml b/shoutcast/meta/plugin_shoutcast.xml index 0dd6f5d5..dbf8634e 100644 --- a/shoutcast/meta/plugin_shoutcast.xml +++ b/shoutcast/meta/plugin_shoutcast.xml @@ -1,13 +1,14 @@ + Dr.Best SHOUTcast enigma2-plugin-extensions-shoutcast - Listen and record internet radio - Listen and record shoutcast internet radio on your Dreambox. + Play Internet Radio downloaded from ShoutCast + Listen and record Shoutcast Internet Radio on your Dreambox. diff --git a/shoutcast/src/Makefile.am b/shoutcast/src/Makefile.am index 5858ead8..7e55cf06 100644 --- a/shoutcast/src/Makefile.am +++ b/shoutcast/src/Makefile.am @@ -2,4 +2,4 @@ installdir = $(libdir)/enigma2/python/Plugins/Extensions/SHOUTcast install_PYTHON = *.py -install_DATA = maintainer.info shoutcast-logo1-fs8.png favorites +install_DATA = maintainer.info plugin.png shoutcast-logo1-fs8.png favorites diff --git a/shoutcast/src/plugin.png b/shoutcast/src/plugin.png new file mode 100644 index 0000000000000000000000000000000000000000..a946943a4a11ceecf65672448729a1071f9cf503 GIT binary patch literal 2827 zcmV+m3-t7fP)01TA?2z3AkQynaf85|)d zC?_B%KqD=T6&!F87+n+^N;N(~Dl<729bi;iT^k@G0umY}I;u2AmnSbXNmN-cIz&TM zhC^4RE=74dN`5d$Xf8f(L{C%%AuR(LWdawO0~m<~C#C}%CIc5X0~&c3CuRc}Ml(T7 z7%V*l7+IQ10wfv~1}BFGCRzn4L}NV>1HqbOd=*4*a$$aYF^ZYXk{2XyvLl{jm$*pdF@h z3g?{;<)=P>MPgh^99g82vf?Lay$(m53OA<< zIGYtfS`<80B28!%N|+~7h#*XZ7)E*+NMj;VZ75fk6Gpu_cGf_B;D4y*C~)8@T*9Zi z#%6?^3zLu=GR*KI}gUfE1)wplANc$n~fkhgM#z~B@0Q`GdIeB=#2IYg%|&G@!|!$ zMO6q;%pe#{NiLn<01fho`cwPnKq?3_=j7N6pFZ)h*dV zhSi94&H)BMEICG_!Qnl0?%c_fe|@v8)M~Tm(=3>YK%g_JQTYm8I zv!nkydVXyB_*>`Se(UXN`hSe}eu@Ez*=Pj&cn|IV?eBj7hZDQpjLY@Mp+(%})aw(c zr~dR>`i=C+_|!|gj+}b)#XrA#FnuO{=J?sOXD0uGi5)fPRuSF2UOAmUkpB5Erd}KV<*z1A9eCl_uRoVQ{Knq#^lz3k z+UES<9h&tI0zwd-wx{?1;Dioe(|O9?4y(Bt@vWvMuxlWkv4;jV&t_WxG;eyyd}AO(M~_ zY8J%i#O!Bp*(}9YR($SmhAk^+{k>sHlteMoElRO4;cH?d0pWp-NMelVaFZD3K@(`V zBoYyt4|P($$d))5ArZf)sf7wjVh>GXoMtYYi{)^exVfU@-r@x;>nV4GTl*rlqFCK7 z1~(w8S`7Av#bCtA@}eki62&S%M|X)~(4;jeMm9-Oh`|(fUrdU}q*y(%f>K;*|d>gvLVz?(LL=YqfRTG4)h0eCM6%{w-7Oit*+FGQG2vH%} z5RJxs&CzIxrK_XS_55woXs}j@##*TLQDB9rxPjs5jnU{`6fEV=_FyZw*Q5`IY#(UPSWE#bJ6lb=nX zByOsQ(Wr;zGFF?-W``W9Crit}rqBuk97RPpTAeueQy4FYTE==Kq!1DY;i)ld($`wE z1ko$oAS2X5_zDoL#(urQpx3F@fhFgfk1t+)?UL(0@yVsvEm?vVUb|@7vZYI}U%Kdq zg^M%Ua3(FPZBlNikmM%8SH0m<^Cf_g<4nq)x9V#jhp}8V0RaM6= 64 kbps")), ("128",_(">= 128 kbps")), ("192",_(">= 192 kbps")), ("256",_(">= 256 kbps"))]) config.plugins.shoutcast.reloadstationlist = ConfigSelection(default="0", choices = [("0",_("Off")), ("1",_("every minute")), ("3",_("every three minutes")), ("5",_("every five minutes"))]) config.plugins.shoutcast.dirname = ConfigDirectory(default = "/hdd/streamripper/") @@ -108,7 +112,23 @@ def main(session,**kwargs): session.open(SHOUTcastWidget) def Plugins(**kwargs): - list = [PluginDescriptor(name="SHOUTcast", description=_("listen to shoutcast internet-radio"), where = [PluginDescriptor.WHERE_EXTENSIONSMENU], fnc=main)] + list = [] + if config.plugins.shoutcast.menu.value == "plugin": + list.append (PluginDescriptor( + name = config.plugins.shoutcast.name.value, + description = config.plugins.shoutcast.description.value + " " + _("Ver.") + " " + shoutcast_pluginversion, + icon="plugin.png", + where = PluginDescriptor.WHERE_PLUGINMENU, + fnc=main) + ) + else: + list.append (PluginDescriptor( + name = config.plugins.shoutcast.name.value, + description = config.plugins.shoutcast.description.value + " " + _("Ver.") + " " + shoutcast_pluginversion, + where = PluginDescriptor.WHERE_EXTENSIONSMENU, + fnc=main) + ) + return list class SHOUTcastWidget(Screen, InfoBarSeek): @@ -123,70 +143,42 @@ class SHOUTcastWidget(Screen, InfoBarSeek): FAVORITE_FILE_DEFAULT = '/usr/lib/enigma2/python/Plugins/Extensions/SHOUTcast/favorites' FAVORITE_FILE = '/usr/lib/enigma2/python/Plugins/Extensions/SHOUTcast/favorites.user' - sz_w = getDesktop(0).size().width() - if sz_w == 1280: - skin = """ - - - - - - - - - - - - - - - - - - """ - - elif sz_w == 1024: - skin = """ - - - - - - - - - - - - - - - - - - """ - else: - - skin = """ - - - - - - - - - - - - - - - - - - """ - + sz_w = getDesktop(0).size().width() - 90 + sz_h = getDesktop(0).size().height() - 100 + skin = """ + + + + + + + + + + + + + + + + + + + """ %( + config.plugins.shoutcast.name.value + " " + _("Ver.") + " " + shoutcast_pluginversion, # title + sz_w, sz_h, # size + sz_w - 135, # size headertext + sz_w - 100, # size statustext + sz_w - 10, sz_h - 205, # size list + sz_h - 105, # position titel + sz_w - 125, # size titel + sz_h - 70, # position station + sz_w - 125, # size station + sz_h - 25, # position console + sz_w - 125, # size console + sz_h - 105, # position cover + sz_w - 125, # position logo + ) def __init__(self, session): self.session = session @@ -835,14 +827,16 @@ class SHOUTcastList(GUIComponent, object): class SHOUTcastLCDScreen(Screen): skin = """ - + - """ + """ %( + config.plugins.shoutcast.name.value # title + ) def __init__(self, session, parent): Screen.__init__(self, session) - self["text1"] = Label("SHOUTcast") + self["text1"] = Label(config.plugins.shoutcast.name.value) self["text2"] = Label("") def setText(self, text): @@ -852,15 +846,17 @@ class SHOUTcastLCDScreen(Screen): class SHOUTcastSetup(Screen, ConfigListScreen): skin = """ - - - - - - - - - """ + + + + + + + + + """ %( + config.plugins.shoutcast.name.value + " " + _("Setup") # title + ) def __init__(self, session): Screen.__init__(self, session) @@ -868,15 +864,20 @@ class SHOUTcastSetup(Screen, ConfigListScreen): self["key_red"] = StaticText(_("Cancel")) self["key_green"] = StaticText(_("OK")) - - self.list = [ ] - self.list.append(getConfigListEntry(_("Streaming rate:"), config.plugins.shoutcast.streamingrate)) - self.list.append(getConfigListEntry(_("Reload station list:"), config.plugins.shoutcast.reloadstationlist)) - self.list.append(getConfigListEntry(_("Rip to single file, name is timestamped"), config.plugins.shoutcast.riptosinglefile)) - self.list.append(getConfigListEntry(_("Create a directory for each stream"), config.plugins.shoutcast.createdirforeachstream)) - self.list.append(getConfigListEntry(_("Add sequence number to output file"), config.plugins.shoutcast.addsequenceoutputfile)) + self.list = [ + getConfigListEntry(_("Show in (needs GUI restart):"), config.plugins.shoutcast.menu), + getConfigListEntry(_("Name (needs GUI restart):"), config.plugins.shoutcast.name), + getConfigListEntry(_("Description:"), config.plugins.shoutcast.description), + getConfigListEntry(_("Streaming rate:"), config.plugins.shoutcast.streamingrate), + getConfigListEntry(_("Reload station list:"), config.plugins.shoutcast.reloadstationlist), + getConfigListEntry(_("Rip to single file, name is timestamped"), config.plugins.shoutcast.riptosinglefile), + getConfigListEntry(_("Create a directory for each stream"), config.plugins.shoutcast.createdirforeachstream), + getConfigListEntry(_("Add sequence number to output file"), config.plugins.shoutcast.addsequenceoutputfile), + ] + self.dirname = getConfigListEntry(_("Recording location:"), config.plugins.shoutcast.dirname) self.list.append(self.dirname) + ConfigListScreen.__init__(self, self.list, session) self["setupActions"] = ActionMap(["SetupActions", "ColorActions"], { @@ -917,6 +918,7 @@ class SHOUTcastStreamripperRecordingPath(Screen): """ + def __init__(self, session, initDir): Screen.__init__(self, session) inhibitDirs = ["/bin", "/boot", "/dev", "/etc", "/lib", "/proc", "/sbin", "/sys", "/usr", "/var"] -- 2.20.1