[tuxdroid-svn] r4933 - in software_suite_v3/software/plugin/plugin-webradio/trunk: executables res
Status: Beta
Brought to you by:
ks156
|
From: remi <c2m...@c2...> - 2009-06-29 10:08:53
|
Author: remi
Date: 2009-06-29 12:08:46 +0200 (Mon, 29 Jun 2009)
New Revision: 4933
Added:
software_suite_v3/software/plugin/plugin-webradio/trunk/resources/en.po
Modified:
software_suite_v3/software/plugin/plugin-webradio/trunk/executables/plugin-webradio.py
software_suite_v3/software/plugin/plugin-webradio/trunk/resources/fr.po
software_suite_v3/software/plugin/plugin-webradio/trunk/resources/plugin.pot
software_suite_v3/software/plugin/plugin-webradio/trunk/resources/plugin.xml
Log:
* added support of webradio address mode
Modified: software_suite_v3/software/plugin/plugin-webradio/trunk/executables/plugin-webradio.py
===================================================================
--- software_suite_v3/software/plugin/plugin-webradio/trunk/executables/plugin-webradio.py 2009-06-29 09:50:20 UTC (rev 4932)
+++ software_suite_v3/software/plugin/plugin-webradio/trunk/executables/plugin-webradio.py 2009-06-29 10:08:46 UTC (rev 4933)
@@ -52,11 +52,14 @@
2009/06/05 - version 0.0.7:
- Converted to plugin format
- Added remote and Tux Droid flippers events
+
+2009/06/29 - version 0.0.8:
+ - Added support of webradio address
"""
__author__ = "Eric Lescaudron AKA Gwadavel"
__appname__ = "tux web radio"
-__version__ = "0.0.7"
+__version__ = "0.0.8"
__date__ = "2009/06/05"
__license__ = "GPL"
@@ -76,6 +79,8 @@
def __init__(self):
SimplePluginConfiguration.__init__(self)
self.__radio = "France-Inter"
+ self.__url = "http://viphttp.yacast.net/V4/radiofrance/franceinter_hd.m3u"
+ self.__modeUrl = False
def getRadio(self):
return self.__radio
@@ -83,6 +88,18 @@
def setRadio(self, radio):
self.__radio = radio
+ def getUrl(self):
+ return self.__url
+
+ def setUrl(self, url):
+ self.__url = url
+
+ def getModeUrl(self):
+ return self.__modeUrl
+
+ def setModeUrl(self, modeUrl):
+ self.__modeUrl = modeUrl
+
class WebRadioPlugin(SimplePlugin):
def __init__(self):
@@ -108,15 +125,18 @@
time.sleep(0.5)
def __defaultWebRadio(self):
- self.__currentRadioIndex = 0
- myRadio = self.configuration().getRadio()
- radioUrl = myRadio
- for i, radio in enumerate(WEBRADIO):
- if radio[0] == myRadio:
- self.__currentRadioIndex = i
- radioUrl = radio[1]
- self.__speakRadioName(myRadio)
- self.__player.start(radioUrl, True)
+ if self.configuration().getModeUrl():
+ self.__player.start(self.configuration().getUrl(), True)
+ else:
+ self.__currentRadioIndex = 0
+ myRadio = self.configuration().getRadio()
+ radioUrl = myRadio
+ for i, radio in enumerate(WEBRADIO):
+ if radio[0] == myRadio:
+ self.__currentRadioIndex = i
+ radioUrl = radio[1]
+ self.__speakRadioName(myRadio)
+ self.__player.start(radioUrl, True)
def __nextWebRadio(self):
# Get next webradio url
@@ -160,21 +180,33 @@
elif eventValues[0] == "K_VOLUMEMINUS":
self.__player.sendCommand("volume -6")
elif eventValues[0] == "K_CHANNELPLUS":
+ if self.configuration().getModeUrl():
+ return
self.throwActuation("playSound", 11, 100.0)
self.__nextWebRadio()
elif eventValues[0] == "K_CHANNELMINUS":
+ if self.configuration().getModeUrl():
+ return
self.throwActuation("playSound", 11, 100.0)
self.__previousWebRadio()
elif eventValues[0] == "K_NEXT":
+ if self.configuration().getModeUrl():
+ return
self.throwActuation("playSound", 11, 100.0)
self.__nextWebRadio()
elif eventValues[0] == "K_PREVIOUS":
+ if self.configuration().getModeUrl():
+ return
self.throwActuation("playSound", 11, 100.0)
self.__previousWebRadio()
elif eventValues[0] == "K_RIGHT":
+ if self.configuration().getModeUrl():
+ return
self.throwActuation("playSound", 11, 100.0)
self.__nextWebRadio()
elif eventValues[0] == "K_LEFT":
+ if self.configuration().getModeUrl():
+ return
self.throwActuation("playSound", 11, 100.0)
self.__previousWebRadio()
elif eventValues[0] == "K_PLAYPAUSE":
@@ -183,10 +215,14 @@
self.__player.sendCommand("pause")
elif eventName == "left":
if eventValues[0] == "True":
+ if self.configuration().getModeUrl():
+ return
self.throwActuation("playSound", 11, 100.0)
self.__nextWebRadio()
elif eventName == "right":
if eventValues[0] == "True":
+ if self.configuration().getModeUrl():
+ return
self.throwActuation("playSound", 11, 100.0)
self.__previousWebRadio()
Added: software_suite_v3/software/plugin/plugin-webradio/trunk/resources/en.po
===================================================================
--- software_suite_v3/software/plugin/plugin-webradio/trunk/resources/en.po (rev 0)
+++ software_suite_v3/software/plugin/plugin-webradio/trunk/resources/en.po 2009-06-29 10:08:46 UTC (rev 4933)
@@ -0,0 +1,23 @@
+msgid "Plugin webradio"
+msgstr "Plugin webradio"
+
+msgid "Plugin webradio."
+msgstr "Plugin webradio."
+
+msgid "This plugin controls the webradios."
+msgstr "This plugin controls the webradios."
+
+msgid "Select a webradio"
+msgstr "Select a webradio"
+
+msgid "Select a webradio URL"
+msgstr "Webradio address"
+
+msgid "Using the webradio URL"
+msgstr "Using address mode"
+
+msgid "Clock radio"
+msgstr "Clock radio"
+
+msgid "Uses webradio as alarm"
+msgstr "Using webradio as alarm"
Modified: software_suite_v3/software/plugin/plugin-webradio/trunk/resources/fr.po
===================================================================
--- software_suite_v3/software/plugin/plugin-webradio/trunk/resources/fr.po 2009-06-29 09:50:20 UTC (rev 4932)
+++ software_suite_v3/software/plugin/plugin-webradio/trunk/resources/fr.po 2009-06-29 10:08:46 UTC (rev 4933)
@@ -8,4 +8,16 @@
msgstr "Ce plugin contrôle les radios internet."
msgid "Select a webradio"
-msgstr "Sélectionner une webradio"
+msgstr "Sélectionner une webradio"
+
+msgid "Select a webradio URL"
+msgstr "Adresse de la radio internet."
+
+msgid "Using the webradio URL"
+msgstr "Utiliser en mode adresse"
+
+msgid "Clock radio"
+msgstr "Radio réveil"
+
+msgid "Uses webradio as alarm"
+msgstr "Utiliser une webradio en tant que réveil"
Modified: software_suite_v3/software/plugin/plugin-webradio/trunk/resources/plugin.pot
===================================================================
--- software_suite_v3/software/plugin/plugin-webradio/trunk/resources/plugin.pot 2009-06-29 09:50:20 UTC (rev 4932)
+++ software_suite_v3/software/plugin/plugin-webradio/trunk/resources/plugin.pot 2009-06-29 10:08:46 UTC (rev 4933)
@@ -8,4 +8,16 @@
msgstr ""
msgid "Select a webradio"
+msgstr ""
+
+msgid "Select a webradio URL"
+msgstr ""
+
+msgid "Using the webradio URL"
msgstr ""
+
+msgid "Clock radio"
+msgstr ""
+
+msgid "Uses webradio as alarm"
+msgstr ""
Modified: software_suite_v3/software/plugin/plugin-webradio/trunk/resources/plugin.xml
===================================================================
--- software_suite_v3/software/plugin/plugin-webradio/trunk/resources/plugin.xml 2009-06-29 09:50:20 UTC (rev 4932)
+++ software_suite_v3/software/plugin/plugin-webradio/trunk/resources/plugin.xml 2009-06-29 10:08:46 UTC (rev 4933)
@@ -8,7 +8,7 @@
<ttsName>Plugin webradio.</ttsName>
<description>This plugin controls the webradios.</description>
<author>Gwadavel and Kysoh</author>
- <version>0.0.7</version>
+ <version>0.0.8</version>
<iconFile>resources/icon.png</iconFile>
<uuid>8349ed52-572d-4c3f-a7b8-05c2a8aec2c6</uuid>
<platform>all</platform>
@@ -19,6 +19,16 @@
description="Select a webradio"
type="enum(BBC2,France-Bleu-Ile-de-France,France-Culture,France-Info,France-Inter,France-Musique,Le-Mouv,RFM,RMC-Info,Click'And'rock)"
defaultValue="France-Inter" />
+ <parameter
+ name="url"
+ description="Select a webradio URL"
+ type="string"
+ defaultValue="http://viphttp.yacast.net/V4/radiofrance/franceinter_hd.m3u" />
+ <parameter
+ name="modeUrl"
+ description="Using the webradio URL"
+ type="boolean"
+ defaultValue="false" />
</parameters>
<commands>
<command
@@ -30,7 +40,7 @@
<tasks>
<task
name="Clock radio"
- description="User webradio as alarm"
+ description="Uses webradio as alarm"
command="run"
type="daily at"
activated="false"
|