summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile3
-rw-r--r--po/de_DE.po314
-rw-r--r--po/fi_FI.po316
-rw-r--r--po/fr_FR.po316
-rw-r--r--po/hu_HU.po316
-rw-r--r--po/it_IT.po314
-rw-r--r--radioaudio.c1909
-rw-r--r--radioaudio.h18
-rw-r--r--radioimage.c131
-rw-r--r--radiotextosd.c874
-rw-r--r--rdsreceiver.c219
-rw-r--r--rtpluslist.c256
-rw-r--r--rtplusosd.c507
13 files changed, 2789 insertions, 2704 deletions
diff --git a/Makefile b/Makefile
index 3fe2a3a..b291818 100644
--- a/Makefile
+++ b/Makefile
@@ -60,7 +60,8 @@ DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' \
### The object files (add further files here):
-OBJS = $(PLUGIN).o radioaudio.o radioskin.o radiotools.o radioepg.o inforx.o
+OBJS = $(PLUGIN).o radioaudio.o radioskin.o radiotools.o radioepg.o inforx.o \
+ radiotextosd.o rtplusosd.o rtpluslist.o rdsreceiver.o radioimage.o
### The main target:
diff --git a/po/de_DE.po b/po/de_DE.po
index 6ef7ac4..8ae683c 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: VDR 1.5.7\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2018-02-19 13:55+0100\n"
+"POT-Creation-Date: 2018-05-27 14:19+0200\n"
"PO-Revision-Date: 2007-09-20 15:30+0200\n"
"Last-Translator: Uwe Hanke <egal@egal-vdr.de>\n"
"Language-Team: <vdr@linuxtv.org>\n"
@@ -16,162 +16,6 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-msgid "ext. Info"
-msgstr "zus. Info"
-
-msgid "RTplus"
-msgstr "RTplus"
-
-msgid "Radiotext"
-msgstr "Radiotext"
-
-msgid " [waiting ...]"
-msgstr " [warte ...]"
-
-msgid "Title :"
-msgstr "Titel :"
-
-msgid "Artist :"
-msgstr "Interpret :"
-
-msgid "Records"
-msgstr "Archiv"
-
-msgid "Rass-Image(s) saved from Archiv "
-msgstr "Rass-Bild(er)speicherung von Archiv "
-
-msgid "Rass-Image(s) saved from Gallery"
-msgstr "Rass-Bild(er) der Gallery gespeichert"
-
-msgid "Rass-Image saved"
-msgstr "Rass-Bildspeich."
-
-msgid "Rass-Image failed"
-msgstr "Rass-Bildspeicherfehler"
-
-msgid "Playlist"
-msgstr "Titelliste"
-
-msgid "Sports"
-msgstr "Sport"
-
-msgid "Lottery"
-msgstr "Lotterie"
-
-msgid "Weather"
-msgstr "Wetter"
-
-msgid "Stockmarket"
-msgstr "Bösenkurse"
-
-msgid "Other"
-msgstr "Sonstiges"
-
-msgid "extra Info since"
-msgstr "zusätzl. Info seit"
-
-msgid "RTplus Memory since"
-msgstr "RTplus Speicher seit"
-
-msgid "Programme"
-msgstr "Pogramminfo"
-
-msgid "Stat.Short"
-msgstr "Sender kurz"
-
-msgid "Station"
-msgstr "Sendername"
-
-msgid "Now"
-msgstr "Jetzt"
-
-msgid "...Part"
-msgstr "...Detail"
-
-msgid "Next"
-msgstr "Demnächst"
-
-msgid "Host"
-msgstr "Moderator"
-
-msgid "Edit.Staff"
-msgstr "Person(en)"
-
-msgid "Homepage"
-msgstr "Homepage"
-
-msgid "Interactivity"
-msgstr "Interaktiv (tu' was :)"
-
-msgid "Phone-Hotline"
-msgstr "Tel.-Hotline"
-
-msgid "Phone-Studio"
-msgstr "Tel.-Studio"
-
-msgid "SMS-Studio"
-msgstr "SMS-Studio"
-
-msgid "Email-Hotline"
-msgstr "EMail-Hotline"
-
-msgid "Email-Studio"
-msgstr "EMail-Studio"
-
-msgid "Info"
-msgstr "weitere Information"
-
-msgid "News"
-msgstr "Nachrichten"
-
-msgid "NewsLocal"
-msgstr "Nachricht.Lokal"
-
-msgid "DateTime"
-msgstr "Datum-Zeit"
-
-msgid "Traffic"
-msgstr "Verkehr"
-
-msgid "Alarm"
-msgstr "Alarm (!)"
-
-msgid "Advertising"
-msgstr "Hinweis/Reklame"
-
-msgid "Url"
-msgstr "Url/Webseite"
-
-msgid "Exit"
-msgstr "Beenden"
-
-msgid "Info-File saved"
-msgstr "Info-Datei gespeichert"
-
-msgid "RTplus-File saved"
-msgstr "RTplus-Datei gespeichert"
-
-msgid "last seen Radiotext"
-msgstr "die letzten Radiotexte"
-
-msgid "Time"
-msgstr "Zeit"
-
-msgid "Title"
-msgstr "Titel"
-
-msgid "Artist"
-msgstr "Interpret"
-
-msgid "Refresh Off"
-msgstr "Aktualis. Aus"
-
-msgid "Refresh On"
-msgstr "Aktualis. Ein"
-
-msgid "Back"
-msgstr "Zurück"
-
msgid "Radio Background-Image/RDS-Text"
msgstr "Hintergr.Bilder/RDS-Text für Radiosender"
@@ -301,9 +145,45 @@ msgstr "RDSText Rass-Funktion"
msgid "External Info-Request"
msgstr "Externe Info-Abfrage"
+msgid "ext. Info"
+msgstr "zus. Info"
+
+msgid "RTplus"
+msgstr "RTplus"
+
+msgid "Radiotext"
+msgstr "Radiotext"
+
+msgid " [waiting ...]"
+msgstr " [warte ...]"
+
+msgid "Title :"
+msgstr "Titel :"
+
+msgid "Artist :"
+msgstr "Interpret :"
+
+msgid "Records"
+msgstr "Archiv"
+
+msgid "Rass-Image(s) saved from Archiv "
+msgstr "Rass-Bild(er)speicherung von Archiv "
+
+msgid "Rass-Image(s) saved from Gallery"
+msgstr "Rass-Bild(er) der Gallery gespeichert"
+
+msgid "Rass-Image saved"
+msgstr "Rass-Bildspeich."
+
+msgid "Rass-Image failed"
+msgstr "Rass-Bildspeicherfehler"
+
msgid "unknown program type"
msgstr "Unbekannte Programmart"
+msgid "News"
+msgstr "Nachrichten"
+
msgid "Current affairs"
msgstr "Aktuelles"
@@ -346,5 +226,125 @@ msgstr "Ernste Klassik"
msgid "Other music"
msgstr "Sonstige Musik"
+msgid "Alarm"
+msgstr "Alarm (!)"
+
+msgid "last seen Radiotext"
+msgstr "die letzten Radiotexte"
+
+msgid "Playlist"
+msgstr "Titelliste"
+
+msgid "Time"
+msgstr "Zeit"
+
+msgid "Title"
+msgstr "Titel"
+
+msgid "Artist"
+msgstr "Interpret"
+
+msgid "Sports"
+msgstr "Sport"
+
+msgid "Lottery"
+msgstr "Lotterie"
+
+msgid "Weather"
+msgstr "Wetter"
+
+msgid "Stockmarket"
+msgstr "Bösenkurse"
+
+msgid "Other"
+msgstr "Sonstiges"
+
+msgid "Refresh Off"
+msgstr "Aktualis. Aus"
+
+msgid "Refresh On"
+msgstr "Aktualis. Ein"
+
+msgid "Back"
+msgstr "Zurück"
+
+msgid "extra Info since"
+msgstr "zusätzl. Info seit"
+
+msgid "RTplus Memory since"
+msgstr "RTplus Speicher seit"
+
+msgid "Programme"
+msgstr "Pogramminfo"
+
+msgid "Stat.Short"
+msgstr "Sender kurz"
+
+msgid "Station"
+msgstr "Sendername"
+
+msgid "Now"
+msgstr "Jetzt"
+
+msgid "...Part"
+msgstr "...Detail"
+
+msgid "Next"
+msgstr "Demnächst"
+
+msgid "Host"
+msgstr "Moderator"
+
+msgid "Edit.Staff"
+msgstr "Person(en)"
+
+msgid "Homepage"
+msgstr "Homepage"
+
+msgid "Interactivity"
+msgstr "Interaktiv (tu' was :)"
+
+msgid "Phone-Hotline"
+msgstr "Tel.-Hotline"
+
+msgid "Phone-Studio"
+msgstr "Tel.-Studio"
+
+msgid "SMS-Studio"
+msgstr "SMS-Studio"
+
+msgid "Email-Hotline"
+msgstr "EMail-Hotline"
+
+msgid "Email-Studio"
+msgstr "EMail-Studio"
+
+msgid "Info"
+msgstr "weitere Information"
+
+msgid "NewsLocal"
+msgstr "Nachricht.Lokal"
+
+msgid "DateTime"
+msgstr "Datum-Zeit"
+
+msgid "Traffic"
+msgstr "Verkehr"
+
+msgid "Advertising"
+msgstr "Hinweis/Reklame"
+
+msgid "Url"
+msgstr "Url/Webseite"
+
+msgid "Exit"
+msgstr "Beenden"
+
+msgid "Info-File saved"
+msgstr "Info-Datei gespeichert"
+
+msgid "RTplus-File saved"
+msgstr "RTplus-Datei gespeichert"
+
#~ msgid "with <0>"
#~ msgstr "mit <0>"
diff --git a/po/fi_FI.po b/po/fi_FI.po
index 832889c..182882f 100644
--- a/po/fi_FI.po
+++ b/po/fi_FI.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: VDR 1.5.7\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2018-02-19 13:55+0100\n"
+"POT-Creation-Date: 2018-05-27 14:19+0200\n"
"PO-Revision-Date: 2007-08-13 19:21+0200\n"
"Last-Translator: Rolf Ahrenberg <rahrenbe@cc.hut.fi>\n"
"Language-Team: <vdr@linuxtv.org>\n"
@@ -16,163 +16,6 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-msgid "ext. Info"
-msgstr ""
-
-msgid "RTplus"
-msgstr "RTplus"
-
-msgid "Radiotext"
-msgstr "Radioteksti"
-
-msgid " [waiting ...]"
-msgstr " [odota ...]"
-
-msgid "Title :"
-msgstr "Kappale :"
-
-msgid "Artist :"
-msgstr "Esittäjä :"
-
-msgid "Records"
-msgstr "Rass-tallenteet"
-
-msgid "Rass-Image(s) saved from Archiv "
-msgstr ""
-
-msgid "Rass-Image(s) saved from Gallery"
-msgstr ""
-
-msgid "Rass-Image saved"
-msgstr ""
-
-msgid "Rass-Image failed"
-msgstr ""
-
-msgid "Playlist"
-msgstr "Soittolista"
-
-msgid "Sports"
-msgstr "Urheilu"
-
-msgid "Lottery"
-msgstr "Arvonta"
-
-msgid "Weather"
-msgstr "Sää"
-
-msgid "Stockmarket"
-msgstr "Pörssikurssit"
-
-msgid "Other"
-msgstr "Sekalaiset"
-
-msgid "extra Info since"
-msgstr ""
-
-msgid "RTplus Memory since"
-msgstr "RTplus-muisti alkaen"
-
-msgid "Programme"
-msgstr "Ohjelma"
-
-msgid "Stat.Short"
-msgstr ""
-
-msgid "Station"
-msgstr "Asema"
-
-msgid "Now"
-msgstr "Nyt"
-
-msgid "...Part"
-msgstr "...osa"
-
-msgid "Next"
-msgstr "Seuraavaksi"
-
-msgid "Host"
-msgstr "Juontaja"
-
-msgid "Edit.Staff"
-msgstr "Henkilökunta"
-
-msgid "Homepage"
-msgstr "Kotisivu"
-
-msgid "Interactivity"
-msgstr "Interaktiivinen"
-
-msgid "Phone-Hotline"
-msgstr "Suoralinja puhelimelle"
-
-msgid "Phone-Studio"
-msgstr "Puhelin studioon"
-
-#, fuzzy
-msgid "SMS-Studio"
-msgstr "Puhelin studioon"
-
-msgid "Email-Hotline"
-msgstr "Suoralinja sähköpostille"
-
-msgid "Email-Studio"
-msgstr "Sähköposti studioon"
-
-msgid "Info"
-msgstr "Lisätiedot"
-
-msgid "News"
-msgstr "Uutiset"
-
-msgid "NewsLocal"
-msgstr "Paikallisuutiset"
-
-msgid "DateTime"
-msgstr "Ajankohtaista"
-
-msgid "Traffic"
-msgstr "Liikenne"
-
-msgid "Alarm"
-msgstr "Hälytys"
-
-msgid "Advertising"
-msgstr "Mainos"
-
-msgid "Url"
-msgstr "Linkki"
-
-msgid "Exit"
-msgstr "Lopeta"
-
-msgid "Info-File saved"
-msgstr ""
-
-msgid "RTplus-File saved"
-msgstr "RTplus-tiedosto tallennettu"
-
-msgid "last seen Radiotext"
-msgstr "viimeksi nähty radioteksti"
-
-msgid "Time"
-msgstr "Kellonaika"
-
-msgid "Title"
-msgstr "Kappale"
-
-msgid "Artist"
-msgstr "Esittäjä"
-
-msgid "Refresh Off"
-msgstr "Älä päivitä"
-
-msgid "Refresh On"
-msgstr "Päivitä"
-
-msgid "Back"
-msgstr "Takaisin"
-
msgid "Radio Background-Image/RDS-Text"
msgstr "Taustakuva ja RDS-teksti radiokanaville"
@@ -302,9 +145,45 @@ msgstr "Käytä RDS-tekstin Rass-toimintoa"
msgid "External Info-Request"
msgstr ""
+msgid "ext. Info"
+msgstr ""
+
+msgid "RTplus"
+msgstr "RTplus"
+
+msgid "Radiotext"
+msgstr "Radioteksti"
+
+msgid " [waiting ...]"
+msgstr " [odota ...]"
+
+msgid "Title :"
+msgstr "Kappale :"
+
+msgid "Artist :"
+msgstr "Esittäjä :"
+
+msgid "Records"
+msgstr "Rass-tallenteet"
+
+msgid "Rass-Image(s) saved from Archiv "
+msgstr ""
+
+msgid "Rass-Image(s) saved from Gallery"
+msgstr ""
+
+msgid "Rass-Image saved"
+msgstr ""
+
+msgid "Rass-Image failed"
+msgstr ""
+
msgid "unknown program type"
msgstr "tuntematon ohjelmatyyppi"
+msgid "News"
+msgstr "Uutiset"
+
msgid "Current affairs"
msgstr "ajankohtaista"
@@ -347,5 +226,126 @@ msgstr "klassista"
msgid "Other music"
msgstr "musiikkia"
+msgid "Alarm"
+msgstr "Hälytys"
+
+msgid "last seen Radiotext"
+msgstr "viimeksi nähty radioteksti"
+
+msgid "Playlist"
+msgstr "Soittolista"
+
+msgid "Time"
+msgstr "Kellonaika"
+
+msgid "Title"
+msgstr "Kappale"
+
+msgid "Artist"
+msgstr "Esittäjä"
+
+msgid "Sports"
+msgstr "Urheilu"
+
+msgid "Lottery"
+msgstr "Arvonta"
+
+msgid "Weather"
+msgstr "Sää"
+
+msgid "Stockmarket"
+msgstr "Pörssikurssit"
+
+msgid "Other"
+msgstr "Sekalaiset"
+
+msgid "Refresh Off"
+msgstr "Älä päivitä"
+
+msgid "Refresh On"
+msgstr "Päivitä"
+
+msgid "Back"
+msgstr "Takaisin"
+
+msgid "extra Info since"
+msgstr ""
+
+msgid "RTplus Memory since"
+msgstr "RTplus-muisti alkaen"
+
+msgid "Programme"
+msgstr "Ohjelma"
+
+msgid "Stat.Short"
+msgstr ""
+
+msgid "Station"
+msgstr "Asema"
+
+msgid "Now"
+msgstr "Nyt"
+
+msgid "...Part"
+msgstr "...osa"
+
+msgid "Next"
+msgstr "Seuraavaksi"
+
+msgid "Host"
+msgstr "Juontaja"
+
+msgid "Edit.Staff"
+msgstr "Henkilökunta"
+
+msgid "Homepage"
+msgstr "Kotisivu"
+
+msgid "Interactivity"
+msgstr "Interaktiivinen"
+
+msgid "Phone-Hotline"
+msgstr "Suoralinja puhelimelle"
+
+msgid "Phone-Studio"
+msgstr "Puhelin studioon"
+
+#, fuzzy
+msgid "SMS-Studio"
+msgstr "Puhelin studioon"
+
+msgid "Email-Hotline"
+msgstr "Suoralinja sähköpostille"
+
+msgid "Email-Studio"
+msgstr "Sähköposti studioon"
+
+msgid "Info"
+msgstr "Lisätiedot"
+
+msgid "NewsLocal"
+msgstr "Paikallisuutiset"
+
+msgid "DateTime"
+msgstr "Ajankohtaista"
+
+msgid "Traffic"
+msgstr "Liikenne"
+
+msgid "Advertising"
+msgstr "Mainos"
+
+msgid "Url"
+msgstr "Linkki"
+
+msgid "Exit"
+msgstr "Lopeta"
+
+msgid "Info-File saved"
+msgstr ""
+
+msgid "RTplus-File saved"
+msgstr "RTplus-tiedosto tallennettu"
+
#~ msgid "with <0>"
#~ msgstr "'0'-näppäimellä"
diff --git a/po/fr_FR.po b/po/fr_FR.po
index a55158a..8def2f9 100644
--- a/po/fr_FR.po
+++ b/po/fr_FR.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: VDR 1.5.7\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2018-02-19 13:55+0100\n"
+"POT-Creation-Date: 2018-05-27 14:19+0200\n"
"PO-Revision-Date: 2007-09-14 16:12+0200\n"
"Last-Translator: Michaël Nival, Patrice Staudt\n"
"Language-Team: <vdr@linuxtv.org>\n"
@@ -15,163 +15,6 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-msgid "ext. Info"
-msgstr "Infos externe"
-
-msgid "RTplus"
-msgstr "RTplus"
-
-msgid "Radiotext"
-msgstr "Radio Texte"
-
-msgid " [waiting ...]"
-msgstr " [attente ...]"
-
-msgid "Title :"
-msgstr "Titre :"
-
-msgid "Artist :"
-msgstr "Artiste :"
-
-msgid "Records"
-msgstr "Archive"
-
-msgid "Rass-Image(s) saved from Archiv "
-msgstr "Rass-image(2) saugarde de l'archive"
-
-msgid "Rass-Image(s) saved from Gallery"
-msgstr "Rass-image(2) saugarde de la gallerie"
-
-msgid "Rass-Image saved"
-msgstr "Rass-Image sauvegarder"
-
-msgid "Rass-Image failed"
-msgstr "Rass-Image erreur"
-
-msgid "Playlist"
-msgstr "Playlist"
-
-msgid "Sports"
-msgstr "Sports"
-
-msgid "Lottery"
-msgstr "Loterie"
-
-msgid "Weather"
-msgstr "Météo"
-
-msgid "Stockmarket"
-msgstr "Bourse"
-
-msgid "Other"
-msgstr "Autre"
-
-msgid "extra Info since"
-msgstr "Info extern depuis"
-
-msgid "RTplus Memory since"
-msgstr "Mémoire de RTplus depuis"
-
-msgid "Programme"
-msgstr "Programme"
-
-msgid "Stat.Short"
-msgstr ""
-
-msgid "Station"
-msgstr "Station"
-
-msgid "Now"
-msgstr "Maintenant"
-
-msgid "...Part"
-msgstr "...Détail"
-
-msgid "Next"
-msgstr "Suivant"
-
-msgid "Host"
-msgstr "Animateur"
-
-msgid "Edit.Staff"
-msgstr "Personne"
-
-msgid "Homepage"
-msgstr "Page d'accueil"
-
-msgid "Interactivity"
-msgstr "Interactivité"
-
-msgid "Phone-Hotline"
-msgstr "Téléphone hotline"
-
-msgid "Phone-Studio"
-msgstr "Téléphone studio"
-
-#, fuzzy
-msgid "SMS-Studio"
-msgstr "Téléphone studio"
-
-msgid "Email-Hotline"
-msgstr "E-mail hotline"
-
-msgid "Email-Studio"
-msgstr "E-mail studio"
-
-msgid "Info"
-msgstr "D'autres informations"
-
-msgid "News"
-msgstr "Informations"
-
-msgid "NewsLocal"
-msgstr "Information local"
-
-msgid "DateTime"
-msgstr "Date-Heure"
-
-msgid "Traffic"
-msgstr "Traffic"
-
-msgid "Alarm"
-msgstr "Alarme"
-
-msgid "Advertising"
-msgstr "Publicité"
-
-msgid "Url"
-msgstr "Url"
-
-msgid "Exit"
-msgstr "Sortir"
-
-msgid "Info-File saved"
-msgstr "Sauvegarde du fichier inf"
-
-msgid "RTplus-File saved"
-msgstr "Sauvé fichier TTplus"
-
-msgid "last seen Radiotext"
-msgstr "Dernier Radio-texte"
-
-msgid "Time"
-msgstr "Temps"
-
-msgid "Title"
-msgstr "Titre"
-
-msgid "Artist"
-msgstr "Artiste"
-
-msgid "Refresh Off"
-msgstr "Arrêter actualisation"
-
-msgid "Refresh On"
-msgstr "Démarrer actualisation"
-
-msgid "Back"
-msgstr "Retour"
-
msgid "Radio Background-Image/RDS-Text"
msgstr "Image de fond pour les radio/RDS-Texte"
@@ -301,9 +144,45 @@ msgstr "Fonction Rass de RDSTexte"
msgid "External Info-Request"
msgstr "Demande d'infos externe"
+msgid "ext. Info"
+msgstr "Infos externe"
+
+msgid "RTplus"
+msgstr "RTplus"
+
+msgid "Radiotext"
+msgstr "Radio Texte"
+
+msgid " [waiting ...]"
+msgstr " [attente ...]"
+
+msgid "Title :"
+msgstr "Titre :"
+
+msgid "Artist :"
+msgstr "Artiste :"
+
+msgid "Records"
+msgstr "Archive"
+
+msgid "Rass-Image(s) saved from Archiv "
+msgstr "Rass-image(2) saugarde de l'archive"
+
+msgid "Rass-Image(s) saved from Gallery"
+msgstr "Rass-image(2) saugarde de la gallerie"
+
+msgid "Rass-Image saved"
+msgstr "Rass-Image sauvegarder"
+
+msgid "Rass-Image failed"
+msgstr "Rass-Image erreur"
+
msgid "unknown program type"
msgstr "Type de programme inconnu"
+msgid "News"
+msgstr "Informations"
+
msgid "Current affairs"
msgstr "Affaires courantes"
@@ -346,5 +225,126 @@ msgstr "Classique sérieux"
msgid "Other music"
msgstr "Autre musique"
+msgid "Alarm"
+msgstr "Alarme"
+
+msgid "last seen Radiotext"
+msgstr "Dernier Radio-texte"
+
+msgid "Playlist"
+msgstr "Playlist"
+
+msgid "Time"
+msgstr "Temps"
+
+msgid "Title"
+msgstr "Titre"
+
+msgid "Artist"
+msgstr "Artiste"
+
+msgid "Sports"
+msgstr "Sports"
+
+msgid "Lottery"
+msgstr "Loterie"
+
+msgid "Weather"
+msgstr "Météo"
+
+msgid "Stockmarket"
+msgstr "Bourse"
+
+msgid "Other"
+msgstr "Autre"
+
+msgid "Refresh Off"
+msgstr "Arrêter actualisation"
+
+msgid "Refresh On"
+msgstr "Démarrer actualisation"
+
+msgid "Back"
+msgstr "Retour"
+
+msgid "extra Info since"
+msgstr "Info extern depuis"
+
+msgid "RTplus Memory since"
+msgstr "Mémoire de RTplus depuis"
+
+msgid "Programme"
+msgstr "Programme"
+
+msgid "Stat.Short"
+msgstr ""
+
+msgid "Station"
+msgstr "Station"
+
+msgid "Now"
+msgstr "Maintenant"
+
+msgid "...Part"
+msgstr "...Détail"
+
+msgid "Next"
+msgstr "Suivant"
+
+msgid "Host"
+msgstr "Animateur"
+
+msgid "Edit.Staff"
+msgstr "Personne"
+
+msgid "Homepage"
+msgstr "Page d'accueil"
+
+msgid "Interactivity"
+msgstr "Interactivité"
+
+msgid "Phone-Hotline"
+msgstr "Téléphone hotline"
+
+msgid "Phone-Studio"
+msgstr "Téléphone studio"
+
+#, fuzzy
+msgid "SMS-Studio"
+msgstr "Téléphone studio"
+
+msgid "Email-Hotline"
+msgstr "E-mail hotline"
+
+msgid "Email-Studio"
+msgstr "E-mail studio"
+
+msgid "Info"
+msgstr "D'autres informations"
+
+msgid "NewsLocal"
+msgstr "Information local"
+
+msgid "DateTime"
+msgstr "Date-Heure"
+
+msgid "Traffic"
+msgstr "Traffic"
+
+msgid "Advertising"
+msgstr "Publicité"
+
+msgid "Url"
+msgstr "Url"
+
+msgid "Exit"
+msgstr "Sortir"
+
+msgid "Info-File saved"
+msgstr "Sauvegarde du fichier inf"
+
+msgid "RTplus-File saved"
+msgstr "Sauvé fichier TTplus"
+
#~ msgid "with <0>"
#~ msgstr "avec <0>"
diff --git a/po/hu_HU.po b/po/hu_HU.po
index 65a7642..997281b 100644
--- a/po/hu_HU.po
+++ b/po/hu_HU.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: VDR 1.5.7\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2018-02-19 13:55+0100\n"
+"POT-Creation-Date: 2018-05-27 14:19+0200\n"
"PO-Revision-Date: 2007-08-13 19:21+0200\n"
"Last-Translator: Füley István\n"
"Language-Team: <vdr@linuxtv.org>\n"
@@ -15,163 +15,6 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-msgid "ext. Info"
-msgstr ""
-
-msgid "RTplus"
-msgstr "RTplus"
-
-msgid "Radiotext"
-msgstr "Rádiótext"
-
-msgid " [waiting ...]"
-msgstr "[várakozás...]"
-
-msgid "Title :"
-msgstr "Cím :"
-
-msgid "Artist :"
-msgstr "Előadó :"
-
-msgid "Records"
-msgstr "Archívum"
-
-msgid "Rass-Image(s) saved from Archiv "
-msgstr "Rass-kép(ek) elmentve az archívumból"
-
-msgid "Rass-Image(s) saved from Gallery"
-msgstr "Rass-kép(ek) elmentve a galériából"
-
-msgid "Rass-Image saved"
-msgstr "Rass-Kép elmentve."
-
-msgid "Rass-Image failed"
-msgstr "Sikertelen Rass-Kép mentés"
-
-msgid "Playlist"
-msgstr "Playlist"
-
-msgid "Sports"
-msgstr "Sport"
-
-msgid "Lottery"
-msgstr "Lottó"
-
-msgid "Weather"
-msgstr "Időjárás"
-
-msgid "Stockmarket"
-msgstr "Börze"
-
-msgid "Other"
-msgstr "Egyéb"
-
-msgid "extra Info since"
-msgstr ""
-
-msgid "RTplus Memory since"
-msgstr "RTplus innen kezdve"
-
-msgid "Programme"
-msgstr "Programinfó"
-
-msgid "Stat.Short"
-msgstr ""
-
-msgid "Station"
-msgstr "Rádióadó"
-
-msgid "Now"
-msgstr "Most"
-
-msgid "...Part"
-msgstr "...rész"
-
-msgid "Next"
-msgstr "Következő"
-
-msgid "Host"
-msgstr "Müsorvezető"
-
-msgid "Edit.Staff"
-msgstr "Stáb"
-
-msgid "Homepage"
-msgstr "Honlap"
-
-msgid "Interactivity"
-msgstr "Interaktivitás"
-
-msgid "Phone-Hotline"
-msgstr "Telefonos forródrót"
-
-msgid "Phone-Studio"
-msgstr "Telefon studió"
-
-#, fuzzy
-msgid "SMS-Studio"
-msgstr "Telefon studió"
-
-msgid "Email-Hotline"
-msgstr "E-mail forródrót"
-
-msgid "Email-Studio"
-msgstr "E-mail studió"
-
-msgid "Info"
-msgstr "Egyéb információ"
-
-msgid "News"
-msgstr "Hírek"
-
-msgid "NewsLocal"
-msgstr "Helyi hírek"
-
-msgid "DateTime"
-msgstr "Dátum-óra"
-
-msgid "Traffic"
-msgstr "Forgalom"
-
-msgid "Alarm"
-msgstr "Riasztó"
-
-msgid "Advertising"
-msgstr "Reklám"
-
-msgid "Url"
-msgstr "Weblink"
-
-msgid "Exit"
-msgstr "Kilépés"
-
-msgid "Info-File saved"
-msgstr ""
-
-msgid "RTplus-File saved"
-msgstr "RTplus-file elmentve"
-
-msgid "last seen Radiotext"
-msgstr "utoljára vett rádiótext"
-
-msgid "Time"
-msgstr "Idő"
-
-msgid "Title"
-msgstr "Cím"
-
-msgid "Artist"
-msgstr "Előadó"
-
-msgid "Refresh Off"
-msgstr "Frissítés ki"
-
-msgid "Refresh On"
-msgstr "Frissítés be"
-
-msgid "Back"
-msgstr "Vissza"
-
msgid "Radio Background-Image/RDS-Text"
msgstr "Rádió háttérkép/RDS-Text"
@@ -301,9 +144,45 @@ msgstr "RDS Rass funkció"
msgid "External Info-Request"
msgstr ""
+msgid "ext. Info"
+msgstr ""
+
+msgid "RTplus"
+msgstr "RTplus"
+
+msgid "Radiotext"
+msgstr "Rádiótext"
+
+msgid " [waiting ...]"
+msgstr "[várakozás...]"
+
+msgid "Title :"
+msgstr "Cím :"
+
+msgid "Artist :"
+msgstr "Előadó :"
+
+msgid "Records"
+msgstr "Archívum"
+
+msgid "Rass-Image(s) saved from Archiv "
+msgstr "Rass-kép(ek) elmentve az archívumból"
+
+msgid "Rass-Image(s) saved from Gallery"
+msgstr "Rass-kép(ek) elmentve a galériából"
+
+msgid "Rass-Image saved"
+msgstr "Rass-Kép elmentve."
+
+msgid "Rass-Image failed"
+msgstr "Sikertelen Rass-Kép mentés"
+
msgid "unknown program type"
msgstr "ismeretlen adástipus"
+msgid "News"
+msgstr "Hírek"
+
msgid "Current affairs"
msgstr "aktuális"
@@ -346,5 +225,126 @@ msgstr "komolyzene"
msgid "Other music"
msgstr "egyéb zene"
+msgid "Alarm"
+msgstr "Riasztó"
+
+msgid "last seen Radiotext"
+msgstr "utoljára vett rádiótext"
+
+msgid "Playlist"
+msgstr "Playlist"
+
+msgid "Time"
+msgstr "Idő"
+
+msgid "Title"
+msgstr "Cím"
+
+msgid "Artist"
+msgstr "Előadó"
+
+msgid "Sports"
+msgstr "Sport"
+
+msgid "Lottery"
+msgstr "Lottó"
+
+msgid "Weather"
+msgstr "Időjárás"
+
+msgid "Stockmarket"
+msgstr "Börze"
+
+msgid "Other"
+msgstr "Egyéb"
+
+msgid "Refresh Off"
+msgstr "Frissítés ki"
+
+msgid "Refresh On"
+msgstr "Frissítés be"
+
+msgid "Back"
+msgstr "Vissza"
+
+msgid "extra Info since"
+msgstr ""
+
+msgid "RTplus Memory since"
+msgstr "RTplus innen kezdve"
+
+msgid "Programme"
+msgstr "Programinfó"
+
+msgid "Stat.Short"
+msgstr ""
+
+msgid "Station"
+msgstr "Rádióadó"
+
+msgid "Now"
+msgstr "Most"
+
+msgid "...Part"
+msgstr "...rész"
+
+msgid "Next"
+msgstr "Következő"
+
+msgid "Host"
+msgstr "Müsorvezető"
+
+msgid "Edit.Staff"
+msgstr "Stáb"
+
+msgid "Homepage"
+msgstr "Honlap"
+
+msgid "Interactivity"
+msgstr "Interaktivitás"
+
+msgid "Phone-Hotline"
+msgstr "Telefonos forródrót"
+
+msgid "Phone-Studio"
+msgstr "Telefon studió"
+
+#, fuzzy
+msgid "SMS-Studio"
+msgstr "Telefon studió"
+
+msgid "Email-Hotline"
+msgstr "E-mail forródrót"
+
+msgid "Email-Studio"
+msgstr "E-mail studió"
+
+msgid "Info"
+msgstr "Egyéb információ"
+
+msgid "NewsLocal"
+msgstr "Helyi hírek"
+
+msgid "DateTime"
+msgstr "Dátum-óra"
+
+msgid "Traffic"
+msgstr "Forgalom"
+
+msgid "Advertising"
+msgstr "Reklám"
+
+msgid "Url"
+msgstr "Weblink"
+
+msgid "Exit"
+msgstr "Kilépés"
+
+msgid "Info-File saved"
+msgstr ""
+
+msgid "RTplus-File saved"
+msgstr "RTplus-file elmentve"
+
#~ msgid "with <0>"
#~ msgstr "<0> bill."
diff --git a/po/it_IT.po b/po/it_IT.po
index 8b916be..b1ff231 100644
--- a/po/it_IT.po
+++ b/po/it_IT.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: VDR 1.5.7\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2018-02-19 13:55+0100\n"
+"POT-Creation-Date: 2018-05-27 14:19+0200\n"
"PO-Revision-Date: 2008-06-15 22:39+0100\n"
"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
"Language-Team: <vdr@linuxtv.org>\n"
@@ -16,162 +16,6 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-msgid "ext. Info"
-msgstr "Info esterne"
-
-msgid "RTplus"
-msgstr "RTplus"
-
-msgid "Radiotext"
-msgstr "Radio testo"
-
-msgid " [waiting ...]"
-msgstr " [attendere ...]"
-
-msgid "Title :"
-msgstr "Titolo :"
-
-msgid "Artist :"
-msgstr "Artista :"
-
-msgid "Records"
-msgstr "Archivio"
-
-msgid "Rass-Image(s) saved from Archiv "
-msgstr "Immagini Rass salvate dall'Archivio"
-
-msgid "Rass-Image(s) saved from Gallery"
-msgstr "Immagini Rass salvate dalla Galleria"
-
-msgid "Rass-Image saved"
-msgstr "Immagine Rass salvata"
-
-msgid "Rass-Image failed"
-msgstr "Immagine Rass fallita"
-
-msgid "Playlist"
-msgstr "Lista esecuzione"
-
-msgid "Sports"
-msgstr "Sport"
-
-msgid "Lottery"
-msgstr "Lotteria"
-
-msgid "Weather"
-msgstr "Meteo"
-
-msgid "Stockmarket"
-msgstr "Borse"
-
-msgid "Other"
-msgstr "Altro"
-
-msgid "extra Info since"
-msgstr "Info extra da"
-
-msgid "RTplus Memory since"
-msgstr "Memoria RTplus da"
-
-msgid "Programme"
-msgstr "Programma"
-
-msgid "Stat.Short"
-msgstr "Brevi statistiche"
-
-msgid "Station"
-msgstr "Stazione"
-
-msgid "Now"
-msgstr "Adesso"
-
-msgid "...Part"
-msgstr "...Dettaglio"
-
-msgid "Next"
-msgstr "Prossimo"
-
-msgid "Host"
-msgstr "Animatore"
-
-msgid "Edit.Staff"
-msgstr "Staff"
-
-msgid "Homepage"
-msgstr "Pagina princ."
-
-msgid "Interactivity"
-msgstr "Interattività"
-
-msgid "Phone-Hotline"
-msgstr "Telefono assistenza"
-
-msgid "Phone-Studio"
-msgstr "Telefono studio"
-
-msgid "SMS-Studio"
-msgstr "SMS studio"
-
-msgid "Email-Hotline"
-msgstr "Email assistenza"
-
-msgid "Email-Studio"
-msgstr "Email studio"
-
-msgid "Info"
-msgstr "Informazioni"
-
-msgid "News"
-msgstr "Notizie"
-
-msgid "NewsLocal"
-msgstr "Notizie locali"
-
-msgid "DateTime"
-msgstr "Data-Ora"
-
-msgid "Traffic"
-msgstr "Traffico"
-
-msgid "Alarm"
-msgstr "Allarme"
-
-msgid "Advertising"
-msgstr "Pubblicità"
-
-msgid "Url"
-msgstr "Sito web"
-
-msgid "Exit"
-msgstr "Esci"
-
-msgid "Info-File saved"
-msgstr "Info file salvate"
-
-msgid "RTplus-File saved"
-msgstr "File RTplus salvato"
-
-msgid "last seen Radiotext"
-msgstr "ultimo radio testo letto"
-
-msgid "Time"
-msgstr "Ora"
-
-msgid "Title"
-msgstr "Titolo"
-
-msgid "Artist"
-msgstr "Artista"
-
-msgid "Refresh Off"
-msgstr "Disattiva aggiornamenti"
-
-msgid "Refresh On"
-msgstr "Attiva aggiornamenti"
-
-msgid "Back"
-msgstr "Indietro"
-
msgid "Radio Background-Image/RDS-Text"
msgstr "Immagine sfondo per Radio/Testo RDS"
@@ -301,9 +145,45 @@ msgstr "Funzione Rass testo RDS"
msgid "External Info-Request"
msgstr "Richiesta info esterna"
+msgid "ext. Info"
+msgstr "Info esterne"
+
+msgid "RTplus"
+msgstr "RTplus"
+
+msgid "Radiotext"
+msgstr "Radio testo"
+
+msgid " [waiting ...]"
+msgstr " [attendere ...]"
+
+msgid "Title :"
+msgstr "Titolo :"
+
+msgid "Artist :"
+msgstr "Artista :"
+
+msgid "Records"
+msgstr "Archivio"
+
+msgid "Rass-Image(s) saved from Archiv "
+msgstr "Immagini Rass salvate dall'Archivio"
+
+msgid "Rass-Image(s) saved from Gallery"
+msgstr "Immagini Rass salvate dalla Galleria"
+
+msgid "Rass-Image saved"
+msgstr "Immagine Rass salvata"
+
+msgid "Rass-Image failed"
+msgstr "Immagine Rass fallita"
+
msgid "unknown program type"
msgstr "tipo programma sconosciuto"
+msgid "News"
+msgstr "Notizie"
+
msgid "Current affairs"
msgstr "Attualità"
@@ -346,5 +226,125 @@ msgstr "Classica seria"
msgid "Other music"
msgstr "Altra musica"
+msgid "Alarm"
+msgstr "Allarme"
+
+msgid "last seen Radiotext"
+msgstr "ultimo radio testo letto"
+
+msgid "Playlist"
+msgstr "Lista esecuzione"
+
+msgid "Time"
+msgstr "Ora"
+
+msgid "Title"
+msgstr "Titolo"
+
+msgid "Artist"
+msgstr "Artista"
+
+msgid "Sports"
+msgstr "Sport"
+
+msgid "Lottery"
+msgstr "Lotteria"
+
+msgid "Weather"
+msgstr "Meteo"
+
+msgid "Stockmarket"
+msgstr "Borse"
+
+msgid "Other"
+msgstr "Altro"
+
+msgid "Refresh Off"
+msgstr "Disattiva aggiornamenti"
+
+msgid "Refresh On"
+msgstr "Attiva aggiornamenti"
+
+msgid "Back"
+msgstr "Indietro"
+
+msgid "extra Info since"
+msgstr "Info extra da"
+
+msgid "RTplus Memory since"
+msgstr "Memoria RTplus da"
+
+msgid "Programme"
+msgstr "Programma"
+
+msgid "Stat.Short"
+msgstr "Brevi statistiche"
+
+msgid "Station"
+msgstr "Stazione"
+
+msgid "Now"
+msgstr "Adesso"
+
+msgid "...Part"
+msgstr "...Dettaglio"
+
+msgid "Next"
+msgstr "Prossimo"
+
+msgid "Host"
+msgstr "Animatore"
+
+msgid "Edit.Staff"
+msgstr "Staff"
+
+msgid "Homepage"
+msgstr "Pagina princ."
+
+msgid "Interactivity"
+msgstr "Interattività"
+
+msgid "Phone-Hotline"
+msgstr "Telefono assistenza"
+
+msgid "Phone-Studio"
+msgstr "Telefono studio"
+
+msgid "SMS-Studio"
+msgstr "SMS studio"
+
+msgid "Email-Hotline"
+msgstr "Email assistenza"
+
+msgid "Email-Studio"
+msgstr "Email studio"
+
+msgid "Info"
+msgstr "Informazioni"
+
+msgid "NewsLocal"
+msgstr "Notizie locali"
+
+msgid "DateTime"
+msgstr "Data-Ora"
+
+msgid "Traffic"
+msgstr "Traffico"
+
+msgid "Advertising"
+msgstr "Pubblicità"
+
+msgid "Url"
+msgstr "Sito web"
+
+msgid "Exit"
+msgstr "Esci"
+
+msgid "Info-File saved"
+msgstr "Info file salvate"
+
+msgid "RTplus-File saved"
+msgstr "File RTplus salvato"
+
#~ msgid "with <0>"
#~ msgstr "con <0>"
diff --git a/radioaudio.c b/radioaudio.c
index 0092114..1823e26 100644
--- a/radioaudio.c
+++ b/radioaudio.c
@@ -14,30 +14,6 @@
#include "service.h"
#include <math.h>
-// OSD-Symbols
-#include "symbols/rds.xpm"
-#include "symbols/arec.xpm"
-#include "symbols/rass.xpm"
-#include "symbols/radio.xpm"
-#include "symbols/index.xpm"
-#include "symbols/marker.xpm"
-#include "symbols/page1.xpm"
-#include "symbols/pages2.xpm"
-#include "symbols/pages3.xpm"
-#include "symbols/pages4.xpm"
-#include "symbols/no0.xpm"
-#include "symbols/no1.xpm"
-#include "symbols/no2.xpm"
-#include "symbols/no3.xpm"
-#include "symbols/no4.xpm"
-#include "symbols/no5.xpm"
-#include "symbols/no6.xpm"
-#include "symbols/no7.xpm"
-#include "symbols/no8.xpm"
-#include "symbols/no9.xpm"
-#include "symbols/bok.xpm"
-#include "symbols/pageE.xpm"
-
// Radiotext
int RTP_ItemToggle = 1, RTP_TToggle = 0;
bool RT_MsgShow = false, RT_PlusShow = false;
@@ -56,10 +32,9 @@ bool ARec_Receive = false, ARec_Record = false;
int Rass_Show = -1; // -1=No, 0=Yes, 1=display
int Rass_Archiv = -1; // -1=Off, 0=Index, 1000-9990=Slidenr.
bool Rass_Flags[11][4]; // Slides+Gallery existent
-// ... Gallery (1..999)
-#define RASS_GALMAX 999
bool Rass_Gallery[RASS_GALMAX + 1];
int Rass_GalStart, Rass_GalEnd, Rass_GalCount, Rass_SlideFoto;
+// ... Gallery (1..999)
cRadioImage *RadioImage;
cRDSReceiver *RDSReceiver;
@@ -102,333 +77,6 @@ void radioStatusMsg(void) {
}
}
-// --- cRadioImage -------------------------------------------------------
-
-cRadioImage::cRadioImage(void) :
- cThread("radioimage") {
- imagepath = 0;
- imageShown = false;
- RadioImage = this;
-}
-
-cRadioImage::~cRadioImage() {
- if (Running())
- Stop();
- free(imagepath);
-}
-
-void cRadioImage::Init(void) {
- RadioImage->Start();
-}
-
-void cRadioImage::Exit(void) {
- if (RadioImage != NULL) {
- RadioImage->Stop();
- DELETENULL(RadioImage);
- }
-}
-
-void cRadioImage::Stop(void) {
- Cancel(2);
-}
-
-void cRadioImage::Action(void) {
- if ((S_Verbose & 0x0f) >= 2)
- printf("vdr-radio: image-showing starts\n");
-
- while (Running()) {
- cCondWait::SleepMs(333);
- if ((IsRadioOrReplay == 1) && imagepath && !imageShown) { // only live $20090905
- imageShown = true;
- Show(imagepath);
- }
- }
-
- if ((S_Verbose & 0x0f) >= 2) {
- printf("vdr-radio: image-showing ends\n");
- }
-}
-
-void cRadioImage::Show(const char *file) {
- uchar *buffer;
- int fd;
- struct stat st;
- struct video_still_picture sp;
- if ((fd = open(file, O_RDONLY)) >= 0) {
- fstat(fd, &st);
- sp.iFrame = (char *) malloc(st.st_size);
- if (sp.iFrame) {
- sp.size = st.st_size;
- if (read(fd, sp.iFrame, sp.size) > 0) {
- buffer = (uchar *) sp.iFrame;
- if (S_StillPic > 0)
- cDevice::PrimaryDevice()->StillPicture(buffer, sp.size);
- else {
- for (int i = 1; i <= 25; i++)
- send_pes_packet(buffer, sp.size, i);
- }
- }
- free(sp.iFrame);
- }
- close(fd);
- }
-}
-
-void cRadioImage::send_pes_packet(unsigned char *data, int len, int timestamp) {
-#define PES_MAX_SIZE 2048
- int ptslen = timestamp ? 5 : 1;
- static unsigned char pes_header[PES_MAX_SIZE];
- pes_header[0] = pes_header[1] = 0;
- pes_header[2] = 1;
- pes_header[3] = 0xe0;
-
- while (len > 0) {
- int payload_size = len;
- if (6 + ptslen + payload_size > PES_MAX_SIZE) {
- payload_size = PES_MAX_SIZE - (6 + ptslen);
- }
- pes_header[4] = (ptslen + payload_size) >> 8;
- pes_header[5] = (ptslen + payload_size) & 255;
- if (ptslen == 5) {
- int x;
- x = (0x02 << 4) | (((timestamp >> 30) & 0x07) << 1) | 1;
- pes_header[8] = x;
- x = ((((timestamp >> 15) & 0x7fff) << 1) | 1);
- pes_header[7] = x >> 8;
- pes_header[8] = x & 255;
- x = ((((timestamp) & 0x7fff) < 1) | 1);
- pes_header[9] = x >> 8;
- pes_header[10] = x & 255;
- } else {
- pes_header[6] = 0x0f;
- }
-
- memcpy(&pes_header[6 + ptslen], data, payload_size);
- cDevice::PrimaryDevice()->PlayPes(pes_header,
- 6 + ptslen + payload_size);
- len -= payload_size;
- data += payload_size;
- ptslen = 1;
- }
-}
-
-void cRadioImage::SetBackgroundImage(const char *Image) {
- free(imagepath);
- imagepath = 0;
-
- if (Image) {
- imageShown = false;
- asprintf(&imagepath, "%s", Image);
- }
-}
-
-// --- cRDSReceiver ------------------------------------------------------------
-
-cRDSReceiver::cRDSReceiver(int Pid) {
- dsyslog("radio: additional RDS-Receiver starts on Pid=%d", Pid);
-
- pid = Pid;
- rt_start = rt_bstuff = false;
-}
-
-cRDSReceiver::~cRDSReceiver() {
- dsyslog("radio: additional RDS-Receiver stopped");
-}
-
-#if VDRVERSNUM >= 20300
-void cRDSReceiver::Receive(const uchar *Data, int Length)
-#else
- void cRDSReceiver::Receive(uchar *Data, int Length)
-#endif
- {
- const int mframel = 263; // max. 255(MSG)+4(ADD/SQC/MFL)+2(CRC)+2(Start/Stop) of RDS-data
- static unsigned char mtext[mframel + 1];
- static int index;
- static int mec = 0;
-
- // check TS-Size, -Sync, PID, Payload
- if (Length != TS_SIZE || Data[0] != 0x47
- || pid != ((Data[1] & 0x1f) << 8) + Data[2] || !(Data[3] & 0x10)) {
- return;
- }
-
- int offset;
- if (Data[1] & 0x40) { // 1.TS-Frame, payload-unit-start
- offset = (Data[3] & 0x20) ? Data[4] + 11 : 10; // Header + ADFL + 6 byte: PES-Startcode, -StreamID, -PacketLength
- if (Data[offset - 3] == 0xbd) { // StreamID = Private stream 1 (for rds)
- offset += 3; // 3 byte: Extension + Headerlength
- offset += Data[offset - 1];
- } else {
- return;
- }
- } else {
- offset = (Data[3] & 0x20) ? Data[4] + 5 : 4; // Header + ADFL
- }
-
- if ((TS_SIZE - offset) <= 0) {
- return;
- }
- // print TS-RawData with RDS
- if ((S_Verbose & 0x02) == 0x02) {
- printf("\n\nTS-Data(%d):\n", Length);
- int cnt = 0;
- for (int a = 0; a < Length; a++) {
- printf("%02x ", Data[a]);
- cnt++;
- if (cnt > 15) {
- cnt = 0;
- printf("\n");
- }
- }
- printf("(End)\n");
- }
-
- for (int i = 0, val = 0; i < (TS_SIZE - offset); i++) {
- val = Data[offset + i];
-
- if (val == 0xfe) { // Start
- index = -1;
- rt_start = true;
- rt_bstuff = false;
- mec = 0;
- if ((S_Verbose & 0x0f) >= 2) {
- printf("\nRDS-Start: ");
- }
- }
-
- if (rt_start) {
- if ((S_Verbose & 0x0f) >= 2) {
- printf("%02x ", val);
- }
- // byte-stuffing reverse: 0xfd00->0xfd, 0xfd01->0xfe, 0xfd02->0xff
- if (rt_bstuff) {
- switch (val) {
- case 0x00:
- mtext[index] = 0xfd;
- break;
- case 0x01:
- mtext[index] = 0xfe;
- break;
- case 0x02:
- mtext[index] = 0xff;
- break;
- default:
- mtext[++index] = val; // should never be
- }
- rt_bstuff = false;
- if ((S_Verbose & 0x0f) >= 2) {
- printf("(Bytestuffing -> %02x) ", mtext[index]);
- }
- } else {
- mtext[++index] = val;
- }
- if (val == 0xfd && index > 0) { // stuffing found
- rt_bstuff = true;
- }
- // early check for used MEC
- if (index == 5) {
- //mec = val;
- switch (val) {
- case 0x0a: // RT
- case 0x46: // ODA-Data
- case 0x07: // PTY
- case 0x3e: // PTYN
- case 0x30: // TMC
- case 0x02:
- mec = val; // PS
- RdsLogo = true;
- break;
- default:
- rt_start = false;
- if ((S_Verbose & 0x0f) >= 2) {
- printf("[RDS-MEC '%02x' not used -> End]\n", val);
- }
- }
- }
- if (index >= mframel) { // max. rdslength, garbage ?
- rt_start = false;
- if ((S_Verbose & 0x0f) >= 2) {
- printf("(RDS-Error: too long, garbage ?)\n");
- }
- }
- }
-
- if (rt_start && val == 0xff) { // End
- rt_start = false;
- if ((S_Verbose & 0x0f) >= 2) {
- printf("(RDS-End)\n");
- }
- if (index < 9) { // min. rdslength, garbage ?
- if ((S_Verbose & 0x0f) >= 1) {
- printf("RDS-Error: too short -> garbage ?\n");
- }
- } else {
- // crc16-check
- unsigned short crc16 = crc16_ccitt(mtext, index - 3, true);
- if (crc16 != (mtext[index - 2] << 8) + mtext[index - 1]) {
- if ((S_Verbose & 0x0f) >= 1) {
- printf(
- "RDS-Error: wrong CRC # calc = %04x <> transmit = %02x%02x\n",
- crc16, mtext[index - 2], mtext[index - 1]);
- }
- } else {
- switch (mec) {
- case 0x0a:
- RadioAudio->RadiotextDecode(mtext, index); // Radiotext
- break;
- case 0x46:
- switch ((mtext[7] << 8) + mtext[8]) { // ODA-ID
- case 0x4bd7:
- RadioAudio->RadiotextDecode(mtext, index); // RT+
- break;
- case 0x0d45:
- case 0xcd46:
- if ((S_Verbose & 0x20) > 0) {
- unsigned char tmc[6]; // TMC Alert-C
- int i;
- for (i = 9; i <= (index - 3); i++) {
- tmc[i - 9] = mtext[i];
- }
- tmc_parser(tmc, i - 8);
- }
- break;
- default:
- if ((S_Verbose & 0x0f) >= 2) {
- printf(
- "[RDS-ODA AID '%02x%02x' not used -> End]\n",
- mtext[7], mtext[8]);
- }
- }
- break;
- case 0x07:
- RT_PTY = mtext[8]; // PTY
- if ((S_Verbose & 0x0f) >= 1) {
- printf("RDS-PTY set to '%s'\n",
- ptynr2string(RT_PTY));
- }
- break;
- case 0x3e:
- RadioAudio->RDS_PsPtynDecode(true, mtext, index); // PTYN
- break;
- case 0x02:
- RadioAudio->RDS_PsPtynDecode(false, mtext, index); // PS
- break;
- case 0x30:
- if ((S_Verbose & 0x20) > 0) { // TMC Alert-C
- unsigned char tmc[6];
- int i;
- for (i = 7; i <= (index - 3); i++) {
- tmc[i - 7] = mtext[i];
- }
- tmc_parser(tmc, i - 6);
- }
- break;
- }
- }
- }
- }
- }
-}
// --- cRadioAudio -------------------------------------------------------------
@@ -1739,1559 +1387,4 @@ void cRadioAudio::DisableRadioTextProcessing() {
}
}
-// --- cRadioTextOsd ------------------------------------------------------
-
-cBitmap cRadioTextOsd::rds(rds_xpm);
-cBitmap cRadioTextOsd::arec(arec_xpm);
-cBitmap cRadioTextOsd::rass(rass_xpm);
-cBitmap cRadioTextOsd::index(index_xpm);
-cBitmap cRadioTextOsd::radio(radio_xpm);
-cBitmap cRadioTextOsd::marker(marker_xpm);
-cBitmap cRadioTextOsd::page1(page1_xpm);
-cBitmap cRadioTextOsd::pages2(pages2_xpm);
-cBitmap cRadioTextOsd::pages3(pages3_xpm);
-cBitmap cRadioTextOsd::pages4(pages4_xpm);
-cBitmap cRadioTextOsd::no0(no0_xpm);
-cBitmap cRadioTextOsd::no1(no1_xpm);
-cBitmap cRadioTextOsd::no2(no2_xpm);
-cBitmap cRadioTextOsd::no3(no3_xpm);
-cBitmap cRadioTextOsd::no4(no4_xpm);
-cBitmap cRadioTextOsd::no5(no5_xpm);
-cBitmap cRadioTextOsd::no6(no6_xpm);
-cBitmap cRadioTextOsd::no7(no7_xpm);
-cBitmap cRadioTextOsd::no8(no8_xpm);
-cBitmap cRadioTextOsd::no9(no9_xpm);
-cBitmap cRadioTextOsd::bok(bok_xpm);
-cBitmap cRadioTextOsd::pageE(pageE_xpm);
-
-cRadioTextOsd::cRadioTextOsd() :
- cCharSetConv((RT_Charset == 0) ? "ISO-8859-1" : NULL) {
- RadioTextOsd = this;
- osd = NULL;
- qosd = NULL;
- qiosd = NULL;
- rtclosed = rassclosed = false;
- RT_ReOpen = false;
- ftext = NULL;
- ftitel = NULL;
- LastKey = kNone;
- fheight = 0;
- bheight = 0;
-}
-
-cRadioTextOsd::~cRadioTextOsd() {
- if (Rass_Archiv >= 0) {
- if (!RT_Replay) {
- Rass_Archiv = RassImage(-1, -1, false);
- }
- else {
- Rass_Archiv = -1;
- RadioImage->SetBackgroundImage(ReplayFile);
- }
- }
-
- if (osd != NULL) {
- delete osd;
- osd = NULL;
- }
- if (qosd != NULL) {
- delete qosd;
- qosd = NULL;
-
- }
- if (qiosd != NULL) {
- delete qiosd;
- qiosd = NULL;
- }
- RadioTextOsd = NULL;
- RT_ReOpen = !RT_OsdTO;
-
- cRemote::Put(LastKey);
-}
-
-void cRadioTextOsd::Show(void) {
- LastKey = kNone;
- RT_OsdTO = false;
- osdtimer.Set();
-
- ftext = cFont::GetFont(fontSml);
- fheight = ftext->Height() + 4;
- bheight =
- (S_RtOsdTags >= 1) ?
- fheight * (S_RtOsdRows + 3) : fheight * (S_RtOsdRows + 1);
- bheight += 20;
-
- asprintf(&RTp_Titel, "%s - %s",
- InfoRequest ? tr("ext. Info") : tr("RTplus"), RT_Titel);
-
- if (S_RtDispl >= 1 && (!Rass_Flags[0][0] || S_RassText >= 2)) { // Rass_Show == -1
- RT_MsgShow = (RT_Info >= 1);
- ShowText();
- }
-}
-
-void cRadioTextOsd::Hide(void) {
- RTOsdClose();
- RassOsdClose();
-}
-
-void cRadioTextOsd::RTOsdClose(void) {
- if (osd != NULL) {
- delete osd;
- osd = NULL;
- }
-}
-
-void cRadioTextOsd::ShowText(void) {
- char stext[3][100];
- int yoff = 17, ii = 1;
-
- if (!osd && !qosd && !Skins.IsOpen() && !cOsd::IsOpen()) {
- if (S_RtOsdPos == 1)
- osd = cOsdProvider::NewOsd(Setup.OSDLeft,
- Setup.OSDTop + Setup.OSDHeight - bheight);
- else
- osd = cOsdProvider::NewOsd(Setup.OSDLeft, Setup.OSDTop);
- tArea Area = { 0, 0, Setup.OSDWidth - 1, bheight - 1, 4 };
- osd->SetAreas(&Area, 1);
- }
-
- if (osd) {
- uint32_t bcolor, fcolor;
- int skin = theme_skin();
- ftitel = cFont::GetFont(fontOsd);
- ftext = cFont::GetFont(fontSml);
- if (S_RtOsdTitle == 1) {
- // Title
- bcolor =
- (S_RtSkinColor > 0) ?
- radioSkin[skin].clrTitleBack :
- (0x00FFFFFF | S_RtBgTra << 24)
- & rt_color[S_RtBgCol];
- fcolor =
- (S_RtSkinColor > 0) ?
- radioSkin[skin].clrTitleText : rt_color[S_RtFgCol];
- osd->DrawRectangle(0, 0, Setup.OSDWidth - 1, ftitel->Height() + 9,
- bcolor);
- osd->DrawEllipse(0, 0, 5, 5, 0x00000000, -2);
- osd->DrawEllipse(Setup.OSDWidth - 6, 0, Setup.OSDWidth - 1, 5,
- 0x00000000, -1);
- sprintf(stext[0], RT_PTY == 0 ? "%s - %s %s%s" : "%s - %s (%s)%s",
- RT_Titel, InfoRequest ? tr("ext. Info") : tr("Radiotext"),
- RT_PTY == 0 ? RDS_PTYN : ptynr2string(RT_PTY),
- RT_MsgShow ? ":" : tr(" [waiting ...]"));
- osd->DrawText(4, 5, stext[0], fcolor, clrTransparent, ftitel,
- Setup.OSDWidth - 4, ftitel->Height());
- // Radio, RDS- or Rass-Symbol, ARec-Symbol or Bitrate
- int inloff = (ftitel->Height() + 9 - 20) / 2;
- if (Rass_Flags[0][0]) {
- osd->DrawBitmap(Setup.OSDWidth - 51, inloff, rass, bcolor,
- fcolor);
- if (ARec_Record)
- osd->DrawBitmap(Setup.OSDWidth - 107, inloff, arec, bcolor,
- 0xFFFC1414); // FG=Red
- else {
- inloff = (ftitel->Height() + 9 - ftext->Height()) / 2;
- osd->DrawText(4, inloff, RadioAudio->bitrate, fcolor,
- clrTransparent, ftext, Setup.OSDWidth - 59,
- ftext->Height(), taRight);
- }
- } else {
- if (InfoRequest && !RdsLogo) {
- osd->DrawBitmap(Setup.OSDWidth - 72, inloff + 1, radio,
- fcolor, bcolor);
- osd->DrawBitmap(Setup.OSDWidth - 48, inloff - 1, radio,
- fcolor, bcolor);
- }
- else {
- osd->DrawBitmap(Setup.OSDWidth - 84, inloff, rds, bcolor,
- fcolor);
- }
- if (ARec_Record) {
- osd->DrawBitmap(Setup.OSDWidth - 140, inloff, arec, bcolor,
- 0xFFFC1414); // FG=Red
- }
- else {
- inloff = (ftitel->Height() + 9 - ftext->Height()) / 2;
- osd->DrawText(4, inloff, RadioAudio->bitrate, fcolor,
- clrTransparent, ftext, Setup.OSDWidth - 92,
- ftext->Height(), taRight);
- }
- }
- } else {
- osd->DrawRectangle(0, 0, Setup.OSDWidth - 1, ftitel->Height() + 9,
- 0x00000000);
- }
- // Body
- bcolor =
- (S_RtSkinColor > 0) ?
- radioSkin[skin].clrBack :
- (0x00FFFFFF | S_RtBgTra << 24) & rt_color[S_RtBgCol];
- fcolor =
- (S_RtSkinColor > 0) ?
- radioSkin[skin].clrText : rt_color[S_RtFgCol];
- osd->DrawRectangle(0, ftitel->Height() + 10, Setup.OSDWidth - 1,
- bheight - 1, bcolor);
- osd->DrawEllipse(0, bheight - 6, 5, bheight - 1, 0x00000000, -3);
- osd->DrawEllipse(Setup.OSDWidth - 6, bheight - 6, Setup.OSDWidth - 1,
- bheight - 1, 0x00000000, -4);
- if (S_RtOsdTitle == 1) {
- osd->DrawRectangle(5, ftitel->Height() + 9, Setup.OSDWidth - 6,
- ftitel->Height() + 9, fcolor);
- }
- if (RT_MsgShow) {
- // RT-Text roundloop
- int ind = (RT_Index == 0) ? S_RtOsdRows - 1 : RT_Index - 1;
- if (S_RtOsdLoop == 1) { // latest bottom
- for (int i = ind + 1; i < S_RtOsdRows; i++) {
- osd->DrawText(5, yoff + fheight * (ii++),
- Convert(RT_Text[i]), fcolor, clrTransparent, ftext,
- Setup.OSDWidth - 4, ftext->Height());
- }
- for (int i = 0; i <= ind; i++) {
- osd->DrawText(5, yoff + fheight * (ii++),
- Convert(RT_Text[i]), fcolor, clrTransparent, ftext,
- Setup.OSDWidth - 4, ftext->Height());
- }
- }
- else { // latest top
- for (int i = ind; i >= 0; i--) {
- osd->DrawText(5, yoff + fheight * (ii++),
- Convert(RT_Text[i]), fcolor, clrTransparent, ftext,
- Setup.OSDWidth - 4, ftext->Height());
- }
- for (int i = S_RtOsdRows - 1; i > ind; i--) {
- osd->DrawText(5, yoff + fheight * (ii++),
- Convert(RT_Text[i]), fcolor, clrTransparent, ftext,
- Setup.OSDWidth - 4, ftext->Height());
- }
- }
- // + RT-Plus or PS-Text = 2 rows
- if ((S_RtOsdTags == 1 && RT_PlusShow) || S_RtOsdTags >= 2) {
- if (!RDS_PSShow || !strstr(RTP_Title, "---")
- || !strstr(RTP_Artist, "---")) {
- sprintf(stext[1], "> %s", tr("Title :"));
- sprintf(stext[2], "> %s", tr("Artist :"));
- int fwidth = ftext->Width(stext[1]);
- fwidth = max(fwidth, ftext->Width(stext[2])) + 15;
- osd->DrawText(4, 6 + yoff + fheight * (ii), stext[1],
- fcolor, clrTransparent, ftext, fwidth - 5,
- ftext->Height());
- osd->DrawText(fwidth, 6 + yoff + fheight * (ii++),
- Convert(RTP_Title), fcolor, clrTransparent, ftext,
- Setup.OSDWidth - 4, ftext->Height());
- osd->DrawText(4, 3 + yoff + fheight * (ii), stext[2],
- fcolor, clrTransparent, ftext, fwidth - 5,
- ftext->Height());
- osd->DrawText(fwidth, 3 + yoff + fheight * (ii++),
- Convert(RTP_Artist), fcolor, clrTransparent, ftext,
- Setup.OSDWidth - 4, ftext->Height());
- }
- else {
- char *temp;
- asprintf(&temp, "%s", "");
- int ind = (RDS_PSIndex == 0) ? 11 : RDS_PSIndex - 1;
- for (int i = ind + 1; i < 12; i++) {
- asprintf(&temp, "%s%s ", temp, RDS_PSText[i]);
- }
- for (int i = 0; i <= ind; i++) {
- asprintf(&temp, "%s%s ", temp, RDS_PSText[i]);
- }
- snprintf(stext[1], 6 * 9, "%s", temp);
- snprintf(stext[2], 6 * 9, "%s", temp + (6 * 9));
- free(temp);
- osd->DrawText(6, 6 + yoff + fheight * ii, "[", fcolor,
- clrTransparent, ftext, 12, ftext->Height());
- osd->DrawText(Setup.OSDWidth - 12, 6 + yoff + fheight * ii,
- "]", fcolor, clrTransparent, ftext,
- Setup.OSDWidth - 6, ftext->Height());
- osd->DrawText(16, 6 + yoff + fheight * (ii++), stext[1],
- fcolor, clrTransparent, ftext, Setup.OSDWidth - 16,
- ftext->Height(), taCenter);
- osd->DrawText(6, 3 + yoff + fheight * ii, "[", fcolor,
- clrTransparent, ftext, 12, ftext->Height());
- osd->DrawText(Setup.OSDWidth - 12, 3 + yoff + fheight * ii,
- "]", fcolor, clrTransparent, ftext,
- Setup.OSDWidth - 6, ftext->Height());
- osd->DrawText(16, 3 + yoff + fheight * (ii++), stext[2],
- fcolor, clrTransparent, ftext, Setup.OSDWidth - 16,
- ftext->Height(), taCenter);
- }
- }
- }
- osd->Flush();
- }
-
- RT_MsgShow = false;
-}
-
-int cRadioTextOsd::RassImage(int QArchiv, int QKey, bool DirUp) {
- int i;
-
- if (QKey >= 0 && QKey <= 9) {
- if (QArchiv == 0) {
- (Rass_Flags[QKey][0]) ? QArchiv = QKey * 1000 : QArchiv = 0;
- }
- else if (QArchiv > 0) {
- if (floor(QArchiv / 1000) == QKey) {
- for (i = 3; i >= 0; i--) {
- if (fmod(QArchiv, pow(10, i)) == 0)
- break;
- }
- (i > 0) ?
- QArchiv += QKey * (int) pow(10, --i) :
- QArchiv = QKey * 1000;
- (Rass_Flags[QKey][3 - i]) ? : QArchiv = QKey * 1000;
- }
- else {
- (Rass_Flags[QKey][0]) ? QArchiv = QKey * 1000 : QArchiv = 0;
- }
- }
- }
- // Gallery
- else if (QKey > 9 && Rass_GalCount >= 0) {
- if (QArchiv < Rass_GalStart || QArchiv > Rass_GalEnd) {
- QArchiv = Rass_GalStart - 1;
- }
- if (DirUp) {
- for (i = QArchiv + 1; i <= Rass_GalEnd; i++) {
- if (Rass_Gallery[i])
- break;
- }
- QArchiv = (i <= Rass_GalEnd) ? i : Rass_GalStart;
- }
- else {
- for (i = QArchiv - 1; i >= Rass_GalStart; i--) {
- if (Rass_Gallery[i])
- break;
- }
- QArchiv = (i >= Rass_GalStart) ? i : Rass_GalEnd;
- }
- }
-
- // show mpeg-still
- char *image;
- if (QArchiv >= 0) {
- asprintf(&image, "%s/Rass_%d.mpg", DataDir, QArchiv);
- }
- else {
- asprintf(&image, "%s/Rass_show.mpg", DataDir);
- }
- RadioImage->SetBackgroundImage(image);
- free(image);
-
- return QArchiv;
-}
-
-void cRadioTextOsd::RassOsd(void) {
- ftext = cFont::GetFont(fontSml);
- int fh = ftext->Height();
-
- if (!qosd && !osd && !Skins.IsOpen() && !cOsd::IsOpen()) {
- qosd = cOsdProvider::NewOsd(Setup.OSDLeft,
- Setup.OSDTop + Setup.OSDHeight - (29 + 264 - 6 + 36));
- tArea Area = { 0, 0, 97, 29 + 264 + 5, 4 };
- qosd->SetAreas(&Area, 1);
- }
-
- if (qosd) {
- uint32_t bcolor, fcolor;
- int skin = theme_skin();
- // Logo
- bcolor = radioSkin[skin].clrTitleBack;
- fcolor = radioSkin[skin].clrTitleText;
- qosd->DrawRectangle(0, 1, 97, 29, bcolor);
- qosd->DrawEllipse(0, 0, 5, 5, 0x00000000, -2);
- qosd->DrawEllipse(92, 0, 97, 5, 0x00000000, -1);
- qosd->DrawBitmap(25, 5, rass, bcolor, fcolor);
- // Body
- bcolor = radioSkin[skin].clrBack;
- fcolor = radioSkin[skin].clrText;
- int offs = 29 + 2;
- qosd->DrawRectangle(0, offs, 97, 29 + 264 + 5, bcolor);
- qosd->DrawEllipse(0, 29 + 264, 5, 29 + 264 + 5, 0x00000000, -3);
- qosd->DrawEllipse(92, 29 + 264, 97, 29 + 264 + 5, 0x00000000, -4);
- qosd->DrawRectangle(5, 29, 92, 29, fcolor);
- // Keys+Index
- offs += 4;
- qosd->DrawBitmap(4, offs, no0, bcolor, fcolor);
- qosd->DrawBitmap(44, offs, index, bcolor, fcolor);
- qosd->DrawBitmap(4, 24 + offs, no1, bcolor, fcolor);
- qosd->DrawBitmap(4, 48 + offs, no2, bcolor, fcolor);
- qosd->DrawBitmap(4, 72 + offs, no3, bcolor, fcolor);
- qosd->DrawBitmap(4, 96 + offs, no4, bcolor, fcolor);
- qosd->DrawBitmap(4, 120 + offs, no5, bcolor, fcolor);
- qosd->DrawBitmap(4, 144 + offs, no6, bcolor, fcolor);
- qosd->DrawBitmap(4, 168 + offs, no7, bcolor, fcolor);
- qosd->DrawBitmap(4, 192 + offs, no8, bcolor, fcolor);
- qosd->DrawBitmap(4, 216 + offs, no9, bcolor, fcolor);
- qosd->DrawBitmap(4, 240 + offs, bok, bcolor, fcolor);
- // Content
- bool mark = false;
- for (int i = 1; i <= 9; i++) {
- // Pages
- if (Rass_Flags[i][0] && Rass_Flags[i][1] && Rass_Flags[i][2]
- && Rass_Flags[i][3]) {
- qosd->DrawBitmap(48, (i * 24) + offs, pages4, bcolor, fcolor);
- }
- else if (Rass_Flags[i][0] && Rass_Flags[i][1] && Rass_Flags[i][2]) {
- qosd->DrawBitmap(48, (i * 24) + offs, pages3, bcolor, fcolor);
- }
- else if (Rass_Flags[i][0] && Rass_Flags[i][1]) {
- qosd->DrawBitmap(48, (i * 24) + offs, pages2, bcolor, fcolor);
- }
- else if (Rass_Flags[i][0]) {
- qosd->DrawBitmap(48, (i * 24) + offs, page1, bcolor, fcolor);
- }
- // Marker
- if (floor(Rass_Archiv / 1000) == i) {
- qosd->DrawBitmap(28, (i * 24) + offs, marker, bcolor, fcolor);
- mark = true;
- }
- }
- // Gallery
- if (Rass_GalCount > 0) {
- char *temp;
- qosd->DrawBitmap(48, 240 + offs, pageE, bcolor, fcolor);
- asprintf(&temp, "%d", Rass_GalCount);
- qosd->DrawText(67, 240 + offs + (20 - fh), temp, fcolor,
- clrTransparent, ftext, 97, fh);
- free(temp);
- }
- // Marker gallery/index
- if (!mark) {
- if (Rass_Archiv > 0 && Rass_Archiv <= RASS_GALMAX)
- qosd->DrawBitmap(30, 240 + offs, marker, bcolor, fcolor);
- else
- qosd->DrawBitmap(28, offs, marker, bcolor, fcolor);
- }
- qosd->Flush();
- }
-}
-
-void cRadioTextOsd::RassOsdTip(void) {
- ftext = cFont::GetFont(fontSml);
- int fh = ftext->Height();
-
- if (!qosd && !osd && !Skins.IsOpen() && !cOsd::IsOpen()) {
- qosd = cOsdProvider::NewOsd(Setup.OSDLeft,
- Setup.OSDTop + Setup.OSDHeight - (29 + (2 * fh) - 6 + 36));
- tArea Area = { 0, 0, 97, 29 + (2 * fh) + 5, 4 };
- qosd->SetAreas(&Area, 1);
- }
-
- if (qosd) {
- uint32_t bcolor, fcolor;
- int skin = theme_skin();
- // Title
- bcolor = radioSkin[skin].clrTitleBack;
- fcolor = radioSkin[skin].clrTitleText;
- qosd->DrawRectangle(0, 0, 97, 29, bcolor);
- qosd->DrawEllipse(0, 0, 5, 5, 0x00000000, -2);
- qosd->DrawEllipse(92, 0, 97, 5, 0x00000000, -1);
- qosd->DrawBitmap(25, 5, rass, bcolor, fcolor);
- // Body
- bcolor = radioSkin[skin].clrBack;
- fcolor = radioSkin[skin].clrText;
- qosd->DrawRectangle(0, 29 + 2, 97, 29 + (2 * fh) + 5, bcolor);
- qosd->DrawEllipse(0, 29 + (2 * fh), 5, 29 + (2 * fh) + 5, 0x00000000,
- -3);
- qosd->DrawEllipse(92, 29 + (2 * fh), 97, 29 + (2 * fh) + 5, 0x00000000,
- -4);
- qosd->DrawRectangle(5, 29, 92, 29, fcolor);
- qosd->DrawText(5, 29 + 4, tr("Records"), fcolor, clrTransparent, ftext,
- 97, fh);
- qosd->DrawText(5, 29 + fh + 4, ".. <0>", fcolor, clrTransparent, ftext,
- 97, fh);
- qosd->Flush();
- }
-}
-
-void cRadioTextOsd::RassOsdClose(void) {
- if (qosd != NULL) {
- delete qosd;
- qosd = NULL;
- }
-}
-
-void cRadioTextOsd::RassImgSave(const char *size, int pos) {
- char *infile, *outfile, *cmd;
- int filenr = 0, error = 0;
- struct tm *ts, tm_store;
-
- if (!enforce_directory(DataDir))
- return;
-
- time_t t = time(NULL);
- ts = localtime_r(&t, &tm_store);
- switch (pos) {
- // all from 1-9
- case 1 ... 9:
- for (int i = 3; i >= 0; i--) {
- filenr += (int) (pos * pow(10, i));
- if (Rass_Flags[pos][3 - i]) {
- asprintf(&infile, "%s/Rass_%d.mpg", DataDir, filenr);
- asprintf(&outfile, "%s/Rass_%s-%04d_%02d%02d%02d%02d.jpg",
- DataDir, RT_Titel, filenr, ts->tm_mon + 1, ts->tm_mday,
- ts->tm_hour, ts->tm_min);
- asprintf(&cmd, "ffmpeg -i \"%s\" -s %s -f mjpeg -y \"%s\"",
- infile, size, outfile);
- if ((error = system(cmd)))
- i = -1;
- }
- }
- asprintf(&cmd, "%s '%d'", tr("Rass-Image(s) saved from Archiv "), pos);
- break;
- // all from gallery
- case 10:
- for (int i = Rass_GalStart; i <= Rass_GalEnd; i++) {
- if (Rass_Gallery[i]) {
- asprintf(&infile, "%s/Rass_%d.mpg", DataDir, i);
- asprintf(&outfile, "%s/Rass_%s-Gallery%04d_%02d%02d.jpg",
- DataDir, RT_Titel, i, ts->tm_mon + 1, ts->tm_mday);
- asprintf(&cmd, "ffmpeg -i \"%s\" -s %s -f mjpeg -y \"%s\"",
- infile, size, outfile);
- if ((error = system(cmd))) {
- i = Rass_GalEnd + 1;
- }
- }
- }
- asprintf(&cmd, "%s", tr("Rass-Image(s) saved from Gallery"));
- break;
- // single
- default:
- asprintf(&infile, "%s/Rass_%d.mpg", DataDir, Rass_Archiv);
- asprintf(&outfile, "%s/Rass_%s-%04d_%02d%02d%02d%02d.jpg", DataDir,
- RT_Titel, Rass_Archiv, ts->tm_mon + 1, ts->tm_mday, ts->tm_hour,
- ts->tm_min);
- asprintf(&cmd, "ffmpeg -i \"%s\" -s %s -f mjpeg -y \"%s\"", infile,
- size, outfile);
- error = system(cmd);
- asprintf(&cmd, "%s: %s", tr("Rass-Image saved"), outfile);
- }
- free(infile);
-
- // Info
- RassOsdClose();
- if (error) {
- asprintf(&cmd, "%s: %s", tr("Rass-Image failed"), outfile);
- Skins.Message(mtError, cmd, Setup.OSDMessageTime);
- }
- else {
- Skins.Message(mtInfo, cmd, Setup.OSDMessageTime);
- }
-
- free(outfile);
- free(cmd);
-}
-
-void cRadioTextOsd::rtp_print(void) {
- struct tm tm_store;
- time_t t = time(NULL);
- printf("\n>>> %s-Memoryclasses @ %s", InfoRequest ? "Info" : "RTplus",
- asctime(localtime_r(&t, &tm_store)));
- printf(" on '%s' since %s", RT_Titel,
- asctime(localtime_r(&rtp_content.start, &tm_store)));
-
- printf("--- Programme ---\n");
- if (rtp_content.prog_StatShort != NULL)
- printf("StationShort: %s\n", rtp_content.prog_StatShort);
- if (rtp_content.prog_Station != NULL)
- printf(" Station: %s\n", rtp_content.prog_Station);
- if (rtp_content.prog_Now != NULL)
- printf(" Now: %s\n", rtp_content.prog_Now);
- if (rtp_content.prog_Next != NULL)
- printf(" Next: %s\n", rtp_content.prog_Next);
- if (rtp_content.prog_Part != NULL)
- printf(" Part: %s\n", rtp_content.prog_Part);
- if (rtp_content.prog_Host != NULL)
- printf(" Host: %s\n", rtp_content.prog_Host);
- if (rtp_content.prog_EditStaff != NULL)
- printf(" Ed.Staff: %s\n", rtp_content.prog_EditStaff);
- if (rtp_content.prog_Homepage != NULL)
- printf(" Homepage: %s\n", rtp_content.prog_Homepage);
-
- printf("--- Interactivity ---\n");
- if (rtp_content.phone_Hotline != NULL)
- printf(" Phone-Hotline: %s\n", rtp_content.phone_Hotline);
- if (rtp_content.phone_Studio != NULL)
- printf(" Phone-Studio: %s\n", rtp_content.phone_Studio);
- if (rtp_content.sms_Studio != NULL)
- printf(" SMS-Studio: %s\n", rtp_content.sms_Studio);
- if (rtp_content.email_Hotline != NULL)
- printf(" Email-Hotline: %s\n", rtp_content.email_Hotline);
- if (rtp_content.email_Studio != NULL)
- printf(" Email-Studio: %s\n", rtp_content.email_Studio);
-
- printf("--- Info ---\n");
- if (rtp_content.info_News != NULL)
- printf(" News: %s\n", rtp_content.info_News);
- if (rtp_content.info_NewsLocal != NULL)
- printf(" NewsLocal: %s\n", rtp_content.info_NewsLocal);
- if (rtp_content.info_DateTime != NULL)
- printf(" DateTime: %s\n", rtp_content.info_DateTime);
- if (rtp_content.info_Traffic != NULL)
- printf(" Traffic: %s\n", rtp_content.info_Traffic);
- if (rtp_content.info_Alarm != NULL)
- printf(" Alarm: %s\n", rtp_content.info_Alarm);
- if (rtp_content.info_Advert != NULL)
- printf(" Advertisg: %s\n", rtp_content.info_Advert);
- if (rtp_content.info_Url != NULL)
- printf(" Url: %s\n", rtp_content.info_Url);
- // no sorting
- for (int i = 0; i < MAX_RTPC; i++)
- if (rtp_content.info_Stock[i] != NULL)
- printf(" Stock[%02d]: %s\n", i, rtp_content.info_Stock[i]);
- for (int i = 0; i < MAX_RTPC; i++)
- if (rtp_content.info_Sport[i] != NULL)
- printf(" Sport[%02d]: %s\n", i, rtp_content.info_Sport[i]);
- for (int i = 0; i < MAX_RTPC; i++)
- if (rtp_content.info_Lottery[i] != NULL)
- printf(" Lottery[%02d]: %s\n", i, rtp_content.info_Lottery[i]);
- for (int i = 0; i < MAX_RTPC; i++)
- if (rtp_content.info_Weather[i] != NULL)
- printf(" Weather[%02d]: %s\n", i, rtp_content.info_Weather[i]);
- for (int i = 0; i < MAX_RTPC; i++)
- if (rtp_content.info_Other[i] != NULL)
- printf(" Other[%02d]: %s\n", i, rtp_content.info_Other[i]);
- /*
- printf("--- Item-Playlist ---\n");
- // no sorting
- if (rtp_content.item_Index >= 0) {
- for (int i = 0; i < MAX_RTPC; i++) {
- if (rtp_content.item_Title[i] != NULL && rtp_content.item_Artist[i] != NULL) {
- struct tm tm_store;
- struct tm *ts = localtime_r(&rtp_content.item_Start[i], &tm_store);
- printf(" [%02d] %02d:%02d Title: %s | Artist: %s\n",
- i, ts->tm_hour, ts->tm_min, rtp_content.item_Title[i], rtp_content.item_Artist[i]);
- }
- }
- }
-
- printf("--- Last seen Radiotext ---\n");
- // no sorting
- if (rtp_content.rt_Index >= 0) {
- for (int i = 0; i < 2*MAX_RTPC; i++)
- if (rtp_content.radiotext[i] != NULL) printf(" [%03d] %s\n", i, rtp_content.radiotext[i]);
- }
- */
- printf("<<<\n");
-}
-
-#define rtplog 0
-eOSState cRadioTextOsd::ProcessKey(eKeys Key) {
- // RTplus Infolog
- if (rtplog == 1 && (S_Verbose & 0x0f) >= 1) {
- static int ct = 0;
- if (++ct >= 60) {
- ct = 0;
- rtp_print();
- }
- }
-
- // check end @ replay
- if (RT_Replay) {
- int rplayCur, rplayTot;
- cControl::Control()->GetIndex(rplayCur, rplayTot, false);
- if (rplayCur >= rplayTot - 1) {
- Hide();
- return osEnd;
- }
- }
-
- // Timeout or no Info/Rass
- if (RT_OsdTO || (RT_OsdTOTemp > 0) || (RT_Info < 0)) {
- Hide();
- return osEnd;
- }
-
- eOSState state = cOsdObject::ProcessKey(Key);
- if (state != osUnknown)
- return state;
-
- // Key pressed ...
- if ((Key != kNone) && (Key < k_Release)) {
- if (osd) { // Radiotext, -plus Osd
- switch (Key) {
- case kBack:
- RTOsdClose();
- rtclosed = true;
- //rassclosed = false;
- break;
- case k0:
- RTOsdClose();
- RTplus_Osd = true;
- cRemote::CallPlugin("radio");
- return osEnd;
- default:
- Hide();
- LastKey = (Key == kChanUp || Key == kChanDn) ? kNone : Key;
- return osEnd;
- }
- }
- else if (qosd && Rass_Archiv >= 0) { // Rass-Archiv Osd
- int i, pos;
- pos = (Rass_Archiv > 0 && Rass_Archiv <= RASS_GALMAX) ?
- 10 : (int) floor(Rass_Archiv / 1000);
- switch (Key) {
- // back to Slideshow
- case kBlue:
- case kBack:
- if (!RT_Replay) {
- Rass_Archiv = RassImage(-1, 0, false);
- }
- else {
- Rass_Archiv = -1;
- RadioImage->SetBackgroundImage(ReplayFile);
- }
- RassOsdClose();
- rassclosed = rtclosed = false;
- break;
- // Archiv-Sides
- case k0 ... k9:
- Rass_Archiv = RassImage(Rass_Archiv, Key - k0, false);
- RassOsd();
- break;
- case kOk:
- if (Rass_Flags[10][0]) {
- Rass_Archiv = RassImage(Rass_Archiv, 10, true);
- RassOsd();
- }
- break;
- case kLeft:
- case kRight:
- Rass_Archiv = RassImage(Rass_Archiv, pos,
- (Key == kRight) ? true : false);
- RassOsd();
- break;
- case kDown:
- (pos == 10) ? i = 0 : i = pos + 1;
- while (i != pos) {
- if (Rass_Flags[i][0]) {
- Rass_Archiv = RassImage(Rass_Archiv, i, true);
- RassOsd();
- return osContinue;
- }
- if (++i > 10) {
- i = 0;
- }
- }
- break;
- case kUp:
- (pos == 0) ? i = 10 : i = pos - 1;
- while (i != pos) {
- if (Rass_Flags[i][0]) {
- Rass_Archiv = RassImage(Rass_Archiv, i, true);
- RassOsd();
- return osContinue;
- }
- if (--i < 0) {
- i = 10;
- }
- }
- break;
- case kRed:
- RassImgSave("1024x576", 0);
- break;
- case kGreen:
- RassImgSave("1024x576", pos);
- break;
- case kYellow:
- break; // todo, what ?
- default:
- Hide();
- LastKey = (Key == kChanUp || Key == kChanDn) ? kNone : Key;
- return osEnd;
- }
- }
- else if (qosd && Rass_Archiv == -1) { // Rass-Slideshow Osd
- switch (Key) {
- // close
- case kBack:
- RassOsdClose();
- rassclosed = true;
- //rtclosed = false;
- break;
- // Archiv-Index
- case k0:
- if (Rass_Flags[0][0]) {
- RassOsdClose();
- Rass_Archiv = RassImage(0, 0, false);
- RassOsd();
- }
- break;
- default:
- Hide();
- LastKey = (Key == kChanUp || Key == kChanDn) ? kNone : Key;
- return osEnd;
- }
- }
- else { // no RT && no Rass
- Hide();
- LastKey = (Key == kChanUp || Key == kChanDn) ? kNone : Key;
- return osEnd;
- }
- }
- // no Key pressed ...
- else if (S_RtOsdTO > 0
- && osdtimer.Elapsed() / 1000 / 60 >= (uint) S_RtOsdTO) {
- RT_OsdTO = true;
- Hide();
- return osEnd;
- }
- else if (Rass_Archiv >= 0) {
- RassOsd();
- }
- else if (RT_MsgShow && !rtclosed
- && (!Rass_Flags[0][0] || S_RassText >= 2 || rassclosed)) { // Rass_Show == -1
- RassOsdClose();
- ShowText();
- }
- else if (Rass_Flags[0][0] && !rassclosed
- && (S_RassText < 2 || rtclosed)) {
- RTOsdClose();
- RassOsdTip();
- }
-
- return osContinue;
-}
-
-// --- cRTplusOsd ------------------------------------------------------
-
-cRTplusOsd::cRTplusOsd(void) :
- cOsdMenu(RTp_Titel, 3, 12), cCharSetConv(
- (RT_Charset == 0) ? "ISO-8859-1" : NULL) {
- RTplus_Osd = false;
-
- bcount = helpmode = 0;
- listtyp[0] = tr("Radiotext");
- listtyp[1] = tr("Playlist");
- listtyp[2] = tr("Sports");
- listtyp[3] = tr("Lottery");
- listtyp[4] = tr("Weather");
- listtyp[5] = tr("Stockmarket");
- listtyp[6] = tr("Other");
-
- Load();
- Display();
-}
-
-cRTplusOsd::~cRTplusOsd() {
-}
-
-void cRTplusOsd::Load(void) {
- char text[80];
-
- struct tm tm_store;
- struct tm *ts = localtime_r(&rtp_content.start, &tm_store);
- snprintf(text, sizeof(text), "%s %02d:%02d",
- InfoRequest ? tr("extra Info since") : tr("RTplus Memory since"),
- ts->tm_hour, ts->tm_min);
- Add(new cOsdItem(hk(text)));
- snprintf(text, sizeof(text), "%s", " ");
- Add(new cOsdItem(hk(text)));
-
- snprintf(text, sizeof(text), "-- %s --", tr("Programme"));
- Add(new cOsdItem(hk(text)));
- if (rtp_content.prog_StatShort != NULL) {
- snprintf(text, sizeof(text), "\t%s:\t%s", tr("Stat.Short"),
- Convert(rtp_content.prog_StatShort));
- Add(new cOsdItem(hk(text)));
- }
- if (rtp_content.prog_Station != NULL) {
- snprintf(text, sizeof(text), "\t%s:\t%s", tr("Station"),
- Convert(rtp_content.prog_Station));
- Add(new cOsdItem(hk(text)));
- }
- if (rtp_content.prog_Now != NULL) {
- snprintf(text, sizeof(text), "\t%s:\t%s", tr("Now"),
- Convert(rtp_content.prog_Now));
- Add(new cOsdItem(hk(text)));
- }
- if (rtp_content.prog_Part != NULL) {
- snprintf(text, sizeof(text), "\t%s:\t%s", tr("...Part"),
- Convert(rtp_content.prog_Part));
- Add(new cOsdItem(hk(text)));
- }
- if (rtp_content.prog_Next != NULL) {
- snprintf(text, sizeof(text), "\t%s:\t%s", tr("Next"),
- Convert(rtp_content.prog_Next));
- Add(new cOsdItem(hk(text)));
- }
- if (rtp_content.prog_Host != NULL) {
- snprintf(text, sizeof(text), "\t%s:\t%s", tr("Host"),
- Convert(rtp_content.prog_Host));
- Add(new cOsdItem(hk(text)));
- }
- if (rtp_content.prog_EditStaff != NULL) {
- snprintf(text, sizeof(text), "\t%s:\t%s", tr("Edit.Staff"),
- Convert(rtp_content.prog_EditStaff));
- Add(new cOsdItem(hk(text)));
- }
- if (rtp_content.prog_Homepage != NULL) {
- snprintf(text, sizeof(text), "\t%s:\t%s", tr("Homepage"),
- Convert(rtp_content.prog_Homepage));
- Add(new cOsdItem(hk(text)));
- }
- snprintf(text, sizeof(text), "%s", " ");
- Add(new cOsdItem(hk(text)));
-
- snprintf(text, sizeof(text), "-- %s --", tr("Interactivity"));
- Add(new cOsdItem(hk(text)));
- if (rtp_content.phone_Hotline != NULL) {
- snprintf(text, sizeof(text), "\t%s:\t%s", tr("Phone-Hotline"),
- Convert(rtp_content.phone_Hotline));
- Add(new cOsdItem(hk(text)));
- }
- if (rtp_content.phone_Studio != NULL) {
- snprintf(text, sizeof(text), "\t%s:\t%s", tr("Phone-Studio"),
- Convert(rtp_content.phone_Studio));
- Add(new cOsdItem(hk(text)));
- }
- if (rtp_content.sms_Studio != NULL) {
- snprintf(text, sizeof(text), "\t%s:\t%s", tr("SMS-Studio"),
- Convert(rtp_content.sms_Studio));
- Add(new cOsdItem(hk(text)));
- }
- if (rtp_content.email_Hotline != NULL) {
- snprintf(text, sizeof(text), "\t%s:\t%s", tr("Email-Hotline"),
- Convert(rtp_content.email_Hotline));
- Add(new cOsdItem(hk(text)));
- }
- if (rtp_content.email_Studio != NULL) {
- snprintf(text, sizeof(text), "\t%s:\t%s", tr("Email-Studio"),
- Convert(rtp_content.email_Studio));
- Add(new cOsdItem(hk(text)));
- }
- snprintf(text, sizeof(text), "%s", " ");
- Add(new cOsdItem(hk(text)));
-
- snprintf(text, sizeof(text), "-- %s --", tr("Info"));
- Add(new cOsdItem(hk(text)));
- if (rtp_content.info_News != NULL) {
- snprintf(text, sizeof(text), "\t%s:\t%s", tr("News"),
- Convert(rtp_content.info_News));
- Add(new cOsdItem(hk(text)));
- }
- if (rtp_content.info_NewsLocal != NULL) {
- snprintf(text, sizeof(text), "\t%s:\t%s", tr("NewsLocal"),
- Convert(rtp_content.info_NewsLocal));
- Add(new cOsdItem(hk(text)));
- }
- if (rtp_content.info_DateTime != NULL) {
- snprintf(text, sizeof(text), "\t%s:\t%s", tr("DateTime"),
- Convert(rtp_content.info_DateTime));
- Add(new cOsdItem(hk(text)));
- }
- if (rtp_content.info_Traffic != NULL) {
- snprintf(text, sizeof(text), "\t%s:\t%s", tr("Traffic"),
- Convert(rtp_content.info_Traffic));
- Add(new cOsdItem(hk(text)));
- }
- if (rtp_content.info_Alarm != NULL) {
- snprintf(text, sizeof(text), "\t%s:\t%s", tr("Alarm"),
- Convert(rtp_content.info_Alarm));
- Add(new cOsdItem(hk(text)));
- }
- if (rtp_content.info_Advert != NULL) {
- snprintf(text, sizeof(text), "\t%s:\t%s", tr("Advertising"),
- Convert(rtp_content.info_Advert));
- Add(new cOsdItem(hk(text)));
- }
- if (rtp_content.info_Url != NULL) {
- snprintf(text, sizeof(text), "\t%s:\t%s", tr("Url"),
- Convert(rtp_content.info_Url));
- Add(new cOsdItem(hk(text)));
- }
-
- for (int i = 0; i <= 6; i++)
- btext[i] = NULL;
- bcount = 0;
- asprintf(&btext[bcount++], "%s", listtyp[0]);
- if (rtp_content.item_Index >= 0)
- asprintf(&btext[bcount++], "%s", listtyp[1]);
- if (rtp_content.info_SportIndex >= 0)
- asprintf(&btext[bcount++], "%s", listtyp[2]);
- if (rtp_content.info_LotteryIndex >= 0)
- asprintf(&btext[bcount++], "%s", listtyp[3]);
- if (rtp_content.info_WeatherIndex >= 0)
- asprintf(&btext[bcount++], "%s", listtyp[4]);
- if (rtp_content.info_StockIndex >= 0)
- asprintf(&btext[bcount++], "%s", listtyp[5]);
- if (rtp_content.info_OtherIndex >= 0)
- asprintf(&btext[bcount++], "%s", listtyp[6]);
-
- switch (bcount) {
- case 4:
- if (helpmode == 0)
- SetHelp(btext[0], btext[1], btext[2], ">>");
- else if (helpmode == 1)
- SetHelp("<<", btext[3], NULL, tr("Exit"));
- break;
- case 5:
- if (helpmode == 0)
- SetHelp(btext[0], btext[1], btext[2], ">>");
- else if (helpmode == 1)
- SetHelp("<<", btext[3], btext[4], tr("Exit"));
- break;
- case 6:
- if (helpmode == 0)
- SetHelp(btext[0], btext[1], btext[2], ">>");
- else if (helpmode == 1)
- SetHelp("<<", btext[3], btext[4], ">>");
- else if (helpmode == 2)
- SetHelp("<<", btext[5], NULL, tr("Exit"));
- break;
- case 7:
- if (helpmode == 0)
- SetHelp(btext[0], btext[1], btext[2], ">>");
- else if (helpmode == 1)
- SetHelp("<<", btext[3], btext[4], ">>");
- else if (helpmode == 2)
- SetHelp("<<", btext[5], btext[6], tr("Exit"));
- break;
- default:
- helpmode = 0;
- SetHelp(btext[0], btext[1], btext[2], tr("Exit"));
- }
-}
-
-void cRTplusOsd::Update(void) {
- Clear();
- Load();
- Display();
-}
-
-int cRTplusOsd::rtptyp(char *btext) {
- for (int i = 0; i <= 6; i++) {
- if (strcmp(btext, listtyp[i]) == 0)
- return i;
- }
-
- return -1;
-}
-
-void cRTplusOsd::rtp_fileprint(void) {
- struct tm *ts, tm_store;
- char *fname, *fpath;
- FILE *fd;
- int ind, lfd = 0;
-
- if (!enforce_directory(DataDir))
- return;
-
- time_t t = time(NULL);
- ts = localtime_r(&t, &tm_store);
- asprintf(&fname, "%s_%s_%04d-%02d-%02d.%02d.%02d",
- InfoRequest ? "Info" : "RTplus", RT_Titel, ts->tm_year + 1900,
- ts->tm_mon + 1, ts->tm_mday, ts->tm_hour, ts->tm_min);
- asprintf(&fpath, "%s/%s", DataDir, fname);
- if ((fd = fopen(fpath, "w")) != NULL) {
-
- fprintf(fd, ">>> %s-Memoryclasses @ %s",
- InfoRequest ? "Info" : "RTplus",
- asctime(localtime_r(&t, &tm_store)));
- fprintf(fd, " on '%s' since %s", RT_Titel,
- asctime(localtime_r(&rtp_content.start, &tm_store)));
-
- fprintf(fd, "--- Programme ---\n");
- if (rtp_content.prog_StatShort != NULL)
- fprintf(fd, "StationShort: %s\n", rtp_content.prog_StatShort);
- if (rtp_content.prog_Station != NULL)
- fprintf(fd, " Station: %s\n", rtp_content.prog_Station);
- if (rtp_content.prog_Now != NULL)
- fprintf(fd, " Now: %s\n", rtp_content.prog_Now);
- if (rtp_content.prog_Part != NULL)
- fprintf(fd, " Part: %s\n", rtp_content.prog_Part);
- if (rtp_content.prog_Next != NULL)
- fprintf(fd, " Next: %s\n", rtp_content.prog_Next);
- if (rtp_content.prog_Host != NULL)
- fprintf(fd, " Host: %s\n", rtp_content.prog_Host);
- if (rtp_content.prog_EditStaff != NULL)
- fprintf(fd, " Ed.Staff: %s\n", rtp_content.prog_EditStaff);
- if (rtp_content.prog_Homepage != NULL)
- fprintf(fd, " Homepage: %s\n", rtp_content.prog_Homepage);
-
- fprintf(fd, "--- Interactivity ---\n");
- if (rtp_content.phone_Hotline != NULL)
- fprintf(fd, " Phone-Hotline: %s\n", rtp_content.phone_Hotline);
- if (rtp_content.phone_Studio != NULL)
- fprintf(fd, " Phone-Studio: %s\n", rtp_content.phone_Studio);
- if (rtp_content.sms_Studio != NULL)
- fprintf(fd, " SMS-Studio: %s\n", rtp_content.sms_Studio);
- if (rtp_content.email_Hotline != NULL)
- fprintf(fd, " Email-Hotline: %s\n", rtp_content.email_Hotline);
- if (rtp_content.email_Studio != NULL)
- fprintf(fd, " Email-Studio: %s\n", rtp_content.email_Studio);
-
- fprintf(fd, "--- Info ---\n");
- if (rtp_content.info_News != NULL)
- fprintf(fd, " News: %s\n", rtp_content.info_News);
- if (rtp_content.info_NewsLocal != NULL)
- fprintf(fd, " NewsLocal: %s\n", rtp_content.info_NewsLocal);
- if (rtp_content.info_DateTime != NULL)
- fprintf(fd, " DateTime: %s\n", rtp_content.info_DateTime);
- if (rtp_content.info_Traffic != NULL)
- fprintf(fd, " Traffic: %s\n", rtp_content.info_Traffic);
- if (rtp_content.info_Alarm != NULL)
- fprintf(fd, " Alarm: %s\n", rtp_content.info_Alarm);
- if (rtp_content.info_Advert != NULL)
- fprintf(fd, " Advertisg: %s\n", rtp_content.info_Advert);
- if (rtp_content.info_Url != NULL)
- fprintf(fd, " Url: %s\n", rtp_content.info_Url);
-
- if (rtp_content.item_Index >= 0) {
- fprintf(fd, "--- Item-Playlist ---\n");
- ind = rtp_content.item_Index;
- if (ind < (MAX_RTPC - 1) && rtp_content.item_Title[ind + 1] != NULL) {
- for (int i = ind + 1; i < MAX_RTPC; i++) {
- if (rtp_content.item_Title[i] != NULL
- && rtp_content.item_Artist[i] != NULL) {
- ts = localtime_r(&rtp_content.item_Start[i], &tm_store);
- fprintf(fd,
- " %02d:%02d Title: '%s' | Artist: '%s'\n",
- ts->tm_hour, ts->tm_min,
- rtp_content.item_Title[i],
- rtp_content.item_Artist[i]);
- }
- }
- }
- for (int i = 0; i <= ind; i++) {
- if (rtp_content.item_Title[i] != NULL
- && rtp_content.item_Artist[i] != NULL) {
- ts = localtime_r(&rtp_content.item_Start[i], &tm_store);
- fprintf(fd, " %02d:%02d Title: '%s' | Artist: '%s'\n",
- ts->tm_hour, ts->tm_min, rtp_content.item_Title[i],
- rtp_content.item_Artist[i]);
- }
- }
- }
-
- if (rtp_content.info_SportIndex >= 0) {
- fprintf(fd, "--- Sports ---\n");
- ind = rtp_content.info_SportIndex;
- if (ind < (MAX_RTPC - 1) && rtp_content.info_Sport[ind + 1] != NULL) {
- for (int i = ind + 1; i < MAX_RTPC; i++) {
- if (rtp_content.info_Sport[i] != NULL)
- fprintf(fd, " %02d. %s\n", ++lfd,
- rtp_content.info_Sport[i]);
- }
- }
- for (int i = 0; i <= ind; i++) {
- if (rtp_content.info_Sport[i] != NULL)
- fprintf(fd, " %02d. %s\n", ++lfd,
- rtp_content.info_Sport[i]);
- }
- }
-
- if (rtp_content.info_LotteryIndex >= 0) {
- fprintf(fd, "--- Lottery ---\n");
- ind = rtp_content.info_LotteryIndex;
- if (ind
- < (MAX_RTPC - 1)&& rtp_content.info_Lottery[ind+1] != NULL) {
- for (int i = ind + 1; i < MAX_RTPC; i++) {
- if (rtp_content.info_Lottery[i] != NULL)
- fprintf(fd, " %02d. %s\n", ++lfd,
- rtp_content.info_Lottery[i]);
- }
- }
- for (int i = 0; i <= ind; i++) {
- if (rtp_content.info_Lottery[i] != NULL)
- fprintf(fd, " %02d. %s\n", ++lfd,
- rtp_content.info_Lottery[i]);
- }
- }
-
- if (rtp_content.info_WeatherIndex >= 0) {
- fprintf(fd, "--- Weather ---\n");
- ind = rtp_content.info_WeatherIndex;
- if (ind
- < (MAX_RTPC - 1)&& rtp_content.info_Weather[ind+1] != NULL) {
- for (int i = ind + 1; i < MAX_RTPC; i++) {
- if (rtp_content.info_Weather[i] != NULL)
- fprintf(fd, " %02d. %s\n", ++lfd,
- rtp_content.info_Weather[i]);
- }
- }
- for (int i = 0; i <= ind; i++) {
- if (rtp_content.info_Weather[i] != NULL)
- fprintf(fd, " %02d. %s\n", ++lfd,
- rtp_content.info_Weather[i]);
- }
- }
-
- if (rtp_content.info_StockIndex >= 0) {
- fprintf(fd, "--- Stockmarket ---\n");
- ind = rtp_content.info_StockIndex;
- if (ind < (MAX_RTPC - 1) && rtp_content.info_Stock[ind + 1] != NULL) {
- for (int i = ind + 1; i < MAX_RTPC; i++) {
- if (rtp_content.info_Stock[i] != NULL)
- fprintf(fd, " %02d. %s\n", ++lfd,
- rtp_content.info_Stock[i]);
- }
- }
- for (int i = 0; i <= ind; i++) {
- if (rtp_content.info_Stock[i] != NULL)
- fprintf(fd, " %02d. %s\n", ++lfd,
- rtp_content.info_Stock[i]);
- }
- }
-
- if (rtp_content.info_OtherIndex >= 0) {
- fprintf(fd, "--- Other ---\n");
- ind = rtp_content.info_OtherIndex;
- if (ind < (MAX_RTPC - 1) && rtp_content.info_Other[ind + 1] != NULL) {
- for (int i = ind + 1; i < MAX_RTPC; i++) {
- if (rtp_content.info_Other[i] != NULL)
- fprintf(fd, " %02d. %s\n", ++lfd,
- rtp_content.info_Other[i]);
- }
- }
- for (int i = 0; i <= ind; i++) {
- if (rtp_content.info_Other[i] != NULL)
- fprintf(fd, " %02d. %s\n", ++lfd,
- rtp_content.info_Other[i]);
- }
- }
-
- fprintf(fd, "--- Last seen Radiotext ---\n");
- ind = rtp_content.rt_Index;
- if (ind < (2 * MAX_RTPC - 1) && rtp_content.radiotext[ind + 1] != NULL) {
- for (int i = ind + 1; i < 2 * MAX_RTPC; i++) {
- if (rtp_content.radiotext[i] != NULL)
- fprintf(fd, " %03d. %s\n", ++lfd,
- rtp_content.radiotext[i]);
- }
- }
- for (int i = 0; i <= ind; i++) {
- if (rtp_content.radiotext[i] != NULL)
- fprintf(fd, " %03d. %s\n", ++lfd, rtp_content.radiotext[i]);
- }
-
- fprintf(fd, "<<<\n");
- fclose(fd);
-
- char *infotext;
- asprintf(&infotext, "%s: %s",
- InfoRequest ? tr("Info-File saved") : tr("RTplus-File saved"),
- fpath);
- Skins.Message(mtInfo, infotext, Setup.OSDMessageTime);
- free(infotext);
- } else
- esyslog("radio: ERROR writing RTplus-File failed '%s'", fpath);
-
- free(fpath);
- free(fname);
-}
-
-eOSState cRTplusOsd::ProcessKey(eKeys Key) {
- int typ, ind;
- eOSState state = cOsdMenu::ProcessKey(Key);
-
- if (HasSubMenu())
- return osContinue;
-
- if (state == osUnknown) {
- switch (Key) {
- case kBack:
- case kOk:
- return osEnd;
- case kBlue:
- if (bcount >= 4 && helpmode == 0) {
- helpmode += 1;
- Update();
- } else if (bcount >= 6 && helpmode == 1) {
- helpmode += 1;
- Update();
- } else
- return osEnd;
- break;
- case k0:
- Update();
- break;
- case k8:
- rtp_fileprint();
- break;
- case kRed:
- if (helpmode == 0) {
- if (btext[0] != NULL)
- if ((typ = rtptyp(btext[0])) >= 0)
- AddSubMenu(new cRTplusList(typ));
- } else {
- helpmode -= 1;
- Update();
- }
- break;
- case kGreen:
- ind = (helpmode * 2) + 1;
- if (btext[ind] != NULL) {
- if ((typ = rtptyp(btext[ind])) >= 0)
- AddSubMenu(new cRTplusList(typ));
- }
- break;
- case kYellow:
- ind = (helpmode * 2) + 2;
- if (btext[ind] != NULL) {
- if ((typ = rtptyp(btext[ind])) >= 0)
- AddSubMenu(new cRTplusList(typ));
- }
- break;
- default:
- state = osContinue;
- }
- }
-
- static int ct;
- if (++ct >= 60) {
- ct = 0;
- Update();
- }
-
- return state;
-}
-
-// --- cRTplusList ------------------------------------------------------
-
-cRTplusList::cRTplusList(int Typ) :
- cOsdMenu(RTp_Titel, 4), cCharSetConv(
- (RT_Charset == 0) ? "ISO-8859-1" : NULL) {
- typ = Typ;
- refresh = false;
-
- Load();
- Display();
-}
-
-cRTplusList::~cRTplusList() {
- typ = 0;
-}
-
-void cRTplusList::Load(void) {
- char text[80];
- struct tm *ts, tm_store;
- int ind, lfd = 0;
- char ctitle[80];
-
- ts = localtime_r(&rtp_content.start, &tm_store);
- switch (typ) {
- case 0:
- snprintf(text, sizeof(text), "-- %s (max. %d) --",
- tr("last seen Radiotext"), 2 * MAX_RTPC);
- Add(new cOsdItem(hk(text)));
- snprintf(text, sizeof(text), "%s", " ");
- Add(new cOsdItem(hk(text)));
- ind = rtp_content.rt_Index;
- if (ind < (2 * MAX_RTPC - 1) && rtp_content.radiotext[ind + 1] != NULL) {
- for (int i = ind + 1; i < 2 * MAX_RTPC; i++) {
- if (rtp_content.radiotext[i] != NULL) {
- snprintf(text, sizeof(text), "%d.\t%s", ++lfd,
- Convert(rtp_content.radiotext[i]));
- Add(new cOsdItem(hk(text)));
- }
- }
- }
- for (int i = 0; i <= ind; i++) {
- if (rtp_content.radiotext[i] != NULL) {
- snprintf(text, sizeof(text), "%d.\t%s", ++lfd,
- Convert(rtp_content.radiotext[i]));
- Add(new cOsdItem(hk(text)), refresh);
- }
- }
- break;
- case 1:
- SetCols(6, 19, 1);
- snprintf(text, sizeof(text), "-- %s --", tr("Playlist"));
- Add(new cOsdItem(hk(text)));
- snprintf(text, sizeof(text), "%s\t%s\t\t%s", tr("Time"), tr("Title"),
- tr("Artist"));
- Add(new cOsdItem(hk(text)));
- snprintf(text, sizeof(text), "%s", " ");
- Add(new cOsdItem(hk(text)));
- ind = rtp_content.item_Index;
- if (ind < (MAX_RTPC - 1) && rtp_content.item_Title[ind + 1] != NULL) {
- for (int i = ind + 1; i < MAX_RTPC; i++) {
- if (rtp_content.item_Title[i] != NULL
- && rtp_content.item_Artist[i] != NULL) {
- ts = localtime_r(&rtp_content.item_Start[i], &tm_store);
- snprintf(ctitle, sizeof(ctitle), "%s",
- Convert(rtp_content.item_Title[i]));
- snprintf(text, sizeof(text), "%02d:%02d\t%s\t\t%s",
- ts->tm_hour, ts->tm_min, ctitle,
- Convert(rtp_content.item_Artist[i]));
- Add(new cOsdItem(hk(text)));
- }
- }
- }
- for (int i = 0; i <= ind; i++) {
- if (rtp_content.item_Title[i] != NULL
- && rtp_content.item_Artist[i] != NULL) {
- ts = localtime_r(&rtp_content.item_Start[i], &tm_store);
- snprintf(ctitle, sizeof(ctitle), "%s",
- Convert(rtp_content.item_Title[i]));
- snprintf(text, sizeof(text), "%02d:%02d\t%s\t\t%s", ts->tm_hour,
- ts->tm_min, ctitle,
- Convert(rtp_content.item_Artist[i]));
- Add(new cOsdItem(hk(text)), refresh);
- }
- }
- break;
- case 2:
- snprintf(text, sizeof(text), "-- %s --", tr("Sports"));
- Add(new cOsdItem(hk(text)));
- snprintf(text, sizeof(text), "%s", " ");
- Add(new cOsdItem(hk(text)));
- ind = rtp_content.info_SportIndex;
- if (ind < (MAX_RTPC - 1) && rtp_content.info_Sport[ind + 1] != NULL) {
- for (int i = ind + 1; i < MAX_RTPC; i++) {
- if (rtp_content.info_Sport[i] != NULL) {
- snprintf(text, sizeof(text), "%d.\t%s", ++lfd,
- Convert(rtp_content.info_Sport[i]));
- Add(new cOsdItem(hk(text)));
- }
- }
- }
- for (int i = 0; i <= ind; i++) {
- if (rtp_content.info_Sport[i] != NULL) {
- snprintf(text, sizeof(text), "%d.\t%s", ++lfd,
- Convert(rtp_content.info_Sport[i]));
- Add(new cOsdItem(hk(text)), refresh);
- }
- }
- break;
- case 3:
- snprintf(text, sizeof(text), "-- %s --", tr("Lottery"));
- Add(new cOsdItem(hk(text)));
- snprintf(text, sizeof(text), "%s", " ");
- Add(new cOsdItem(hk(text)));
- ind = rtp_content.info_LotteryIndex;
- if (ind < (MAX_RTPC - 1) && rtp_content.info_Lottery[ind + 1] != NULL) {
- for (int i = ind + 1; i < MAX_RTPC; i++) {
- if (rtp_content.info_Lottery[i] != NULL) {
- snprintf(text, sizeof(text), "%d.\t%s", ++lfd,
- Convert(rtp_content.info_Lottery[i]));
- Add(new cOsdItem(hk(text)));
- }
- }
- }
- for (int i = 0; i <= ind; i++) {
- if (rtp_content.info_Lottery[i] != NULL) {
- snprintf(text, sizeof(text), "%d.\t%s", ++lfd,
- Convert(rtp_content.info_Lottery[i]));
- Add(new cOsdItem(hk(text)), refresh);
- }
- }
- break;
- case 4:
- snprintf(text, sizeof(text), "-- %s --", tr("Weather"));
- Add(new cOsdItem(hk(text)));
- snprintf(text, sizeof(text), "%s", " ");
- Add(new cOsdItem(hk(text)));
- ind = rtp_content.info_WeatherIndex;
- if (ind < (MAX_RTPC - 1) && rtp_content.info_Weather[ind + 1] != NULL) {
- for (int i = ind + 1; i < MAX_RTPC; i++) {
- if (rtp_content.info_Weather[i] != NULL) {
- snprintf(text, sizeof(text), "%d.\t%s", ++lfd,
- Convert(rtp_content.info_Weather[i]));
- Add(new cOsdItem(hk(text)));
- }
- }
- }
- for (int i = 0; i <= ind; i++) {
- if (rtp_content.info_Weather[i] != NULL) {
- snprintf(text, sizeof(text), "%d.\t%s", ++lfd,
- Convert(rtp_content.info_Weather[i]));
- Add(new cOsdItem(hk(text)), refresh);
- }
- }
- break;
- case 5:
- snprintf(text, sizeof(text), "-- %s --", tr("Stockmarket"));
- Add(new cOsdItem(hk(text)));
- snprintf(text, sizeof(text), "%s", " ");
- Add(new cOsdItem(hk(text)));
- ind = rtp_content.info_StockIndex;
- if (ind < (MAX_RTPC - 1) && rtp_content.info_Stock[ind + 1] != NULL) {
- for (int i = ind + 1; i < MAX_RTPC; i++) {
- if (rtp_content.info_Stock[i] != NULL) {
- snprintf(text, sizeof(text), "%d.\t%s", ++lfd,
- Convert(rtp_content.info_Stock[i]));
- Add(new cOsdItem(hk(text)));
- }
- }
- }
- for (int i = 0; i <= ind; i++) {
- if (rtp_content.info_Stock[i] != NULL) {
- snprintf(text, sizeof(text), "%d.\t%s", ++lfd,
- Convert(rtp_content.info_Stock[i]));
- Add(new cOsdItem(hk(text)), refresh);
- }
- }
- break;
- case 6:
- snprintf(text, sizeof(text), "-- %s --", tr("Other"));
- Add(new cOsdItem(hk(text)));
- snprintf(text, sizeof(text), "%s", " ");
- Add(new cOsdItem(hk(text)));
- ind = rtp_content.info_OtherIndex;
- if (ind < (MAX_RTPC - 1) && rtp_content.info_Other[ind + 1] != NULL) {
- for (int i = ind + 1; i < MAX_RTPC; i++) {
- if (rtp_content.info_Other[i] != NULL) {
- snprintf(text, sizeof(text), "%d.\t%s", ++lfd,
- Convert(rtp_content.info_Other[i]));
- Add(new cOsdItem(hk(text)));
- }
- }
- }
- for (int i = 0; i <= ind; i++) {
- if (rtp_content.info_Other[i] != NULL) {
- snprintf(text, sizeof(text), "%d.\t%s", ++lfd,
- Convert(rtp_content.info_Other[i]));
- Add(new cOsdItem(hk(text)), refresh);
- }
- }
- break;
- }
-
- SetHelp(NULL, NULL, refresh ? tr("Refresh Off") : tr("Refresh On"),
- tr("Back"));
-}
-
-void cRTplusList::Update(void) {
- Clear();
- Load();
- Display();
-}
-
-eOSState cRTplusList::ProcessKey(eKeys Key) {
- eOSState state = cOsdMenu::ProcessKey(Key);
-
- if (state == osUnknown) {
- switch (Key) {
- case k0:
- Update();
- break;
- case kYellow:
- refresh = (refresh) ? false : true;
- Update();
- break;
- case kBack:
- case kOk:
- case kBlue:
- return osBack;
- default:
- state = osContinue;
- }
- }
-
- static int ct;
- if (refresh) {
- if (++ct >= 20) {
- ct = 0;
- Update();
- }
- }
-
- return state;
-}
-
//--------------- End -----------------------------------------------------------------
diff --git a/radioaudio.h b/radioaudio.h
index ab35307..a09d189 100644
--- a/radioaudio.h
+++ b/radioaudio.h
@@ -21,6 +21,10 @@ extern char *ConfigDir;
extern char *DataDir;
extern char *ReplayFile;
+#define RASS_GALMAX 999
+extern bool Rass_Gallery[];
+extern int Rass_GalStart, Rass_GalEnd, Rass_GalCount, Rass_SlideFoto;
+
//Setup-Params
extern int S_RtFunc;
extern int S_StillPic;
@@ -140,15 +144,15 @@ public:
~cRadioTextOsd();
virtual void Hide(void);
virtual void Show(void);
- virtual void ShowText(void);
- virtual void RTOsdClose(void);
+ void ShowText(void);
+ void RTOsdClose(void);
int RassImage(int QArchiv, int QKey, bool DirUp);
- virtual void RassOsd(void);
- virtual void RassOsdTip(void);
- virtual void RassOsdClose(void);
- virtual void RassImgSave(const char *size, int pos);
+ void RassOsd(void);
+ void RassOsdTip(void);
+ void RassOsdClose(void);
+ void RassImgSave(const char *size, int pos);
virtual eOSState ProcessKey(eKeys Key);
- virtual bool IsInteractive(void) { return false; }
+ virtual bool IsMenu(void) const { return false; }
};
class cRTplusOsd : public cOsdMenu, public cCharSetConv {
diff --git a/radioimage.c b/radioimage.c
new file mode 100644
index 0000000..a27b828
--- /dev/null
+++ b/radioimage.c
@@ -0,0 +1,131 @@
+#include <vdr/remote.h>
+#include <vdr/status.h>
+#include <vdr/plugin.h>
+#include "radioaudio.h"
+#include "radioskin.h"
+#include "radiotools.h"
+#include "service.h"
+#include <math.h>
+
+extern cRadioImage *RadioImage;
+
+// --- cRadioImage -------------------------------------------------------
+
+cRadioImage::cRadioImage(void) :
+ cThread("radioimage") {
+ imagepath = 0;
+ imageShown = false;
+ RadioImage = this;
+}
+
+cRadioImage::~cRadioImage() {
+ if (Running())
+ Stop();
+ free(imagepath);
+}
+
+void cRadioImage::Init(void) {
+ RadioImage->Start();
+}
+
+void cRadioImage::Exit(void) {
+ if (RadioImage != NULL) {
+ RadioImage->Stop();
+ DELETENULL(RadioImage);
+ }
+}
+
+void cRadioImage::Stop(void) {
+ Cancel(2);
+}
+
+void cRadioImage::Action(void) {
+ if ((S_Verbose & 0x0f) >= 2)
+ printf("vdr-radio: image-showing starts\n");
+
+ while (Running()) {
+ cCondWait::SleepMs(333);
+ if ((IsRadioOrReplay == 1) && imagepath && !imageShown) { // only live $20090905
+ imageShown = true;
+ Show(imagepath);
+ }
+ }
+
+ if ((S_Verbose & 0x0f) >= 2) {
+ printf("vdr-radio: image-showing ends\n");
+ }
+}
+
+void cRadioImage::Show(const char *file) {
+ uchar *buffer;
+ int fd;
+ struct stat st;
+ struct video_still_picture sp;
+ if ((fd = open(file, O_RDONLY)) >= 0) {
+ fstat(fd, &st);
+ sp.iFrame = (char *) malloc(st.st_size);
+ if (sp.iFrame) {
+ sp.size = st.st_size;
+ if (read(fd, sp.iFrame, sp.size) > 0) {
+ buffer = (uchar *) sp.iFrame;
+ if (S_StillPic > 0)
+ cDevice::PrimaryDevice()->StillPicture(buffer, sp.size);
+ else {
+ for (int i = 1; i <= 25; i++)
+ send_pes_packet(buffer, sp.size, i);
+ }
+ }
+ free(sp.iFrame);
+ }
+ close(fd);
+ }
+}
+
+void cRadioImage::send_pes_packet(unsigned char *data, int len, int timestamp) {
+#define PES_MAX_SIZE 2048
+ int ptslen = timestamp ? 5 : 1;
+ static unsigned char pes_header[PES_MAX_SIZE];
+ pes_header[0] = pes_header[1] = 0;
+ pes_header[2] = 1;
+ pes_header[3] = 0xe0;
+
+ while (len > 0) {
+ int payload_size = len;
+ if (6 + ptslen + payload_size > PES_MAX_SIZE) {
+ payload_size = PES_MAX_SIZE - (6 + ptslen);
+ }
+ pes_header[4] = (ptslen + payload_size) >> 8;
+ pes_header[5] = (ptslen + payload_size) & 255;
+ if (ptslen == 5) {
+ int x;
+ x = (0x02 << 4) | (((timestamp >> 30) & 0x07) << 1) | 1;
+ pes_header[8] = x;
+ x = ((((timestamp >> 15) & 0x7fff) << 1) | 1);
+ pes_header[7] = x >> 8;
+ pes_header[8] = x & 255;
+ x = ((((timestamp) & 0x7fff) < 1) | 1);
+ pes_header[9] = x >> 8;
+ pes_header[10] = x & 255;
+ } else {
+ pes_header[6] = 0x0f;
+ }
+
+ memcpy(&pes_header[6 + ptslen], data, payload_size);
+ cDevice::PrimaryDevice()->PlayPes(pes_header,
+ 6 + ptslen + payload_size);
+ len -= payload_size;
+ data += payload_size;
+ ptslen = 1;
+ }
+}
+
+void cRadioImage::SetBackgroundImage(const char *Image) {
+ free(imagepath);
+ imagepath = 0;
+
+ if (Image) {
+ imageShown = false;
+ asprintf(&imagepath, "%s", Image);
+ }
+}
+
diff --git a/radiotextosd.c b/radiotextosd.c
new file mode 100644
index 0000000..72c7fda
--- /dev/null
+++ b/radiotextosd.c
@@ -0,0 +1,874 @@
+/*
+ * radioaudio.c - part of radio.c, a plugin for the Video Disk Recorder
+ *
+ * See the README file for copyright information and how to reach the author.
+ *
+ */
+
+#include <vdr/remote.h>
+#include <vdr/status.h>
+#include <vdr/plugin.h>
+#include "radioaudio.h"
+#include "radioskin.h"
+#include "radiotools.h"
+#include "service.h"
+#include <math.h>
+
+// OSD-Symbols
+#include "symbols/rds.xpm"
+#include "symbols/arec.xpm"
+#include "symbols/rass.xpm"
+#include "symbols/radio.xpm"
+#include "symbols/index.xpm"
+#include "symbols/marker.xpm"
+#include "symbols/page1.xpm"
+#include "symbols/pages2.xpm"
+#include "symbols/pages3.xpm"
+#include "symbols/pages4.xpm"
+#include "symbols/no0.xpm"
+#include "symbols/no1.xpm"
+#include "symbols/no2.xpm"
+#include "symbols/no3.xpm"
+#include "symbols/no4.xpm"
+#include "symbols/no5.xpm"
+#include "symbols/no6.xpm"
+#include "symbols/no7.xpm"
+#include "symbols/no8.xpm"
+#include "symbols/no9.xpm"
+#include "symbols/bok.xpm"
+#include "symbols/pageE.xpm"
+
+// --- cRadioTextOsd ------------------------------------------------------
+
+cBitmap cRadioTextOsd::rds(rds_xpm);
+cBitmap cRadioTextOsd::arec(arec_xpm);
+cBitmap cRadioTextOsd::rass(rass_xpm);
+cBitmap cRadioTextOsd::index(index_xpm);
+cBitmap cRadioTextOsd::radio(radio_xpm);
+cBitmap cRadioTextOsd::marker(marker_xpm);
+cBitmap cRadioTextOsd::page1(page1_xpm);
+cBitmap cRadioTextOsd::pages2(pages2_xpm);
+cBitmap cRadioTextOsd::pages3(pages3_xpm);
+cBitmap cRadioTextOsd::pages4(pages4_xpm);
+cBitmap cRadioTextOsd::no0(no0_xpm);
+cBitmap cRadioTextOsd::no1(no1_xpm);
+cBitmap cRadioTextOsd::no2(no2_xpm);
+cBitmap cRadioTextOsd::no3(no3_xpm);
+cBitmap cRadioTextOsd::no4(no4_xpm);
+cBitmap cRadioTextOsd::no5(no5_xpm);
+cBitmap cRadioTextOsd::no6(no6_xpm);
+cBitmap cRadioTextOsd::no7(no7_xpm);
+cBitmap cRadioTextOsd::no8(no8_xpm);
+cBitmap cRadioTextOsd::no9(no9_xpm);
+cBitmap cRadioTextOsd::bok(bok_xpm);
+cBitmap cRadioTextOsd::pageE(pageE_xpm);
+
+extern cRadioAudio *RadioAudio;
+extern cRadioTextOsd *RadioTextOsd;
+extern cRadioImage *RadioImage;
+extern int Rass_Archiv;
+extern bool RT_Replay;
+extern char *RT_Titel, *RTp_Titel;
+extern bool RdsLogo;
+extern bool Rass_Flags[11][4];
+extern bool RT_MsgShow, RT_PlusShow;
+extern char RDS_PSText[12][9];
+extern char RDS_PTYN[];
+extern bool ARec_Record;
+extern int RDS_PSIndex;
+extern bool RDS_PSShow;
+extern rtp_classes rtp_content;
+
+cRadioTextOsd::cRadioTextOsd() :
+ cCharSetConv((RT_Charset == 0) ? "ISO-8859-1" : NULL) {
+ RadioTextOsd = this;
+ osd = NULL;
+ qosd = NULL;
+ qiosd = NULL;
+ rtclosed = rassclosed = false;
+ RT_ReOpen = false;
+ ftext = NULL;
+ ftitel = NULL;
+ LastKey = kNone;
+ fheight = 0;
+ bheight = 0;
+// TODO
+dsyslog("%s %d cRadioTextOsd::cRadioTextOsd", __FILE__, __LINE__);
+}
+
+cRadioTextOsd::~cRadioTextOsd() {
+ if (Rass_Archiv >= 0) {
+ if (!RT_Replay) {
+ Rass_Archiv = RassImage(-1, -1, false);
+ }
+ else {
+ Rass_Archiv = -1;
+ RadioImage->SetBackgroundImage(ReplayFile);
+ }
+ }
+
+ if (osd != NULL) {
+ delete osd;
+ osd = NULL;
+ }
+ if (qosd != NULL) {
+ delete qosd;
+ qosd = NULL;
+
+ }
+ if (qiosd != NULL) {
+ delete qiosd;
+ qiosd = NULL;
+ }
+ RadioTextOsd = NULL;
+ RT_ReOpen = !RT_OsdTO;
+
+ cRemote::Put(LastKey);
+}
+
+void cRadioTextOsd::Show(void) {
+ LastKey = kNone;
+ RT_OsdTO = false;
+ osdtimer.Set();
+
+ ftext = cFont::GetFont(fontSml);
+ fheight = ftext->Height() + 4;
+ bheight =
+ (S_RtOsdTags >= 1) ?
+ fheight * (S_RtOsdRows + 3) : fheight * (S_RtOsdRows + 1);
+ bheight += 20;
+
+ asprintf(&RTp_Titel, "%s - %s",
+ InfoRequest ? tr("ext. Info") : tr("RTplus"), RT_Titel);
+
+ if (S_RtDispl >= 1 && (!Rass_Flags[0][0] || S_RassText >= 2)) { // Rass_Show == -1
+ RT_MsgShow = (RT_Info >= 1);
+ ShowText();
+ }
+}
+
+void cRadioTextOsd::Hide(void) {
+ RTOsdClose();
+ RassOsdClose();
+}
+
+void cRadioTextOsd::RTOsdClose(void) {
+ if (osd != NULL) {
+ delete osd;
+ osd = NULL;
+ }
+}
+
+void cRadioTextOsd::ShowText(void) {
+ char stext[3][100];
+ int yoff = 17, ii = 1;
+
+ if (!osd && !qosd && !Skins.IsOpen() && !cOsd::IsOpen()) {
+ if (S_RtOsdPos == 1)
+ osd = cOsdProvider::NewOsd(Setup.OSDLeft,
+ Setup.OSDTop + Setup.OSDHeight - bheight);
+ else
+ osd = cOsdProvider::NewOsd(Setup.OSDLeft, Setup.OSDTop);
+ tArea Area = { 0, 0, Setup.OSDWidth - 1, bheight - 1, 4 };
+ osd->SetAreas(&Area, 1);
+ }
+
+ if (osd) {
+ uint32_t bcolor, fcolor;
+ int skin = theme_skin();
+ ftitel = cFont::GetFont(fontOsd);
+ ftext = cFont::GetFont(fontSml);
+ if (S_RtOsdTitle == 1) {
+ // Title
+ bcolor =
+ (S_RtSkinColor > 0) ?
+ radioSkin[skin].clrTitleBack :
+ (0x00FFFFFF | S_RtBgTra << 24)
+ & rt_color[S_RtBgCol];
+ fcolor =
+ (S_RtSkinColor > 0) ?
+ radioSkin[skin].clrTitleText : rt_color[S_RtFgCol];
+ osd->DrawRectangle(0, 0, Setup.OSDWidth - 1, ftitel->Height() + 9,
+ bcolor);
+ osd->DrawEllipse(0, 0, 5, 5, 0x00000000, -2);
+ osd->DrawEllipse(Setup.OSDWidth - 6, 0, Setup.OSDWidth - 1, 5,
+ 0x00000000, -1);
+ sprintf(stext[0], RT_PTY == 0 ? "%s - %s %s%s" : "%s - %s (%s)%s",
+ RT_Titel, InfoRequest ? tr("ext. Info") : tr("Radiotext"),
+ RT_PTY == 0 ? RDS_PTYN : ptynr2string(RT_PTY),
+ RT_MsgShow ? ":" : tr(" [waiting ...]"));
+ osd->DrawText(4, 5, stext[0], fcolor, clrTransparent, ftitel,
+ Setup.OSDWidth - 4, ftitel->Height());
+ // Radio, RDS- or Rass-Symbol, ARec-Symbol or Bitrate
+ int inloff = (ftitel->Height() + 9 - 20) / 2;
+ if (Rass_Flags[0][0]) {
+ osd->DrawBitmap(Setup.OSDWidth - 51, inloff, rass, bcolor,
+ fcolor);
+ if (ARec_Record)
+ osd->DrawBitmap(Setup.OSDWidth - 107, inloff, arec, bcolor,
+ 0xFFFC1414); // FG=Red
+ else {
+ inloff = (ftitel->Height() + 9 - ftext->Height()) / 2;
+ osd->DrawText(4, inloff, RadioAudio->bitrate, fcolor,
+ clrTransparent, ftext, Setup.OSDWidth - 59,
+ ftext->Height(), taRight);
+ }
+ } else {
+ if (InfoRequest && !RdsLogo) {
+ osd->DrawBitmap(Setup.OSDWidth - 72, inloff + 1, radio,
+ fcolor, bcolor);
+ osd->DrawBitmap(Setup.OSDWidth - 48, inloff - 1, radio,
+ fcolor, bcolor);
+ }
+ else {
+ osd->DrawBitmap(Setup.OSDWidth - 84, inloff, rds, bcolor,
+ fcolor);
+ }
+ if (ARec_Record) {
+ osd->DrawBitmap(Setup.OSDWidth - 140, inloff, arec, bcolor,
+ 0xFFFC1414); // FG=Red
+ }
+ else {
+ inloff = (ftitel->Height() + 9 - ftext->Height()) / 2;
+ osd->DrawText(4, inloff, RadioAudio->bitrate, fcolor,
+ clrTransparent, ftext, Setup.OSDWidth - 92,
+ ftext->Height(), taRight);
+ }
+ }
+ } else {
+ osd->DrawRectangle(0, 0, Setup.OSDWidth - 1, ftitel->Height() + 9,
+ 0x00000000);
+ }
+ // Body
+ bcolor =
+ (S_RtSkinColor > 0) ?
+ radioSkin[skin].clrBack :
+ (0x00FFFFFF | S_RtBgTra << 24) & rt_color[S_RtBgCol];
+ fcolor =
+ (S_RtSkinColor > 0) ?
+ radioSkin[skin].clrText : rt_color[S_RtFgCol];
+ osd->DrawRectangle(0, ftitel->Height() + 10, Setup.OSDWidth - 1,
+ bheight - 1, bcolor);
+ osd->DrawEllipse(0, bheight - 6, 5, bheight - 1, 0x00000000, -3);
+ osd->DrawEllipse(Setup.OSDWidth - 6, bheight - 6, Setup.OSDWidth - 1,
+ bheight - 1, 0x00000000, -4);
+ if (S_RtOsdTitle == 1) {
+ osd->DrawRectangle(5, ftitel->Height() + 9, Setup.OSDWidth - 6,
+ ftitel->Height() + 9, fcolor);
+ }
+ if (RT_MsgShow) {
+ // RT-Text roundloop
+ int ind = (RT_Index == 0) ? S_RtOsdRows - 1 : RT_Index - 1;
+ if (S_RtOsdLoop == 1) { // latest bottom
+ for (int i = ind + 1; i < S_RtOsdRows; i++) {
+ osd->DrawText(5, yoff + fheight * (ii++),
+ Convert(RT_Text[i]), fcolor, clrTransparent, ftext,
+ Setup.OSDWidth - 4, ftext->Height());
+ }
+ for (int i = 0; i <= ind; i++) {
+ osd->DrawText(5, yoff + fheight * (ii++),
+ Convert(RT_Text[i]), fcolor, clrTransparent, ftext,
+ Setup.OSDWidth - 4, ftext->Height());
+ }
+ }
+ else { // latest top
+ for (int i = ind; i >= 0; i--) {
+ osd->DrawText(5, yoff + fheight * (ii++),
+ Convert(RT_Text[i]), fcolor, clrTransparent, ftext,
+ Setup.OSDWidth - 4, ftext->Height());
+ }
+ for (int i = S_RtOsdRows - 1; i > ind; i--) {
+ osd->DrawText(5, yoff + fheight * (ii++),
+ Convert(RT_Text[i]), fcolor, clrTransparent, ftext,
+ Setup.OSDWidth - 4, ftext->Height());
+ }
+ }
+ // + RT-Plus or PS-Text = 2 rows
+ if ((S_RtOsdTags == 1 && RT_PlusShow) || S_RtOsdTags >= 2) {
+ if (!RDS_PSShow || !strstr(RTP_Title, "---")
+ || !strstr(RTP_Artist, "---")) {
+ sprintf(stext[1], "> %s", tr("Title :"));
+ sprintf(stext[2], "> %s", tr("Artist :"));
+ int fwidth = ftext->Width(stext[1]);
+ fwidth = max(fwidth, ftext->Width(stext[2])) + 15;
+ osd->DrawText(4, 6 + yoff + fheight * (ii), stext[1],
+ fcolor, clrTransparent, ftext, fwidth - 5,
+ ftext->Height());
+ osd->DrawText(fwidth, 6 + yoff + fheight * (ii++),
+ Convert(RTP_Title), fcolor, clrTransparent, ftext,
+ Setup.OSDWidth - 4, ftext->Height());
+ osd->DrawText(4, 3 + yoff + fheight * (ii), stext[2],
+ fcolor, clrTransparent, ftext, fwidth - 5,
+ ftext->Height());
+ osd->DrawText(fwidth, 3 + yoff + fheight * (ii++),
+ Convert(RTP_Artist), fcolor, clrTransparent, ftext,
+ Setup.OSDWidth - 4, ftext->Height());
+ }
+ else {
+ char *temp;
+ asprintf(&temp, "%s", "");
+ int ind = (RDS_PSIndex == 0) ? 11 : RDS_PSIndex - 1;
+ for (int i = ind + 1; i < 12; i++) {
+ asprintf(&temp, "%s%s ", temp, RDS_PSText[i]);
+ }
+ for (int i = 0; i <= ind; i++) {
+ asprintf(&temp, "%s%s ", temp, RDS_PSText[i]);
+ }
+ snprintf(stext[1], 6 * 9, "%s", temp);
+ snprintf(stext[2], 6 * 9, "%s", temp + (6 * 9));
+ free(temp);
+ osd->DrawText(6, 6 + yoff + fheight * ii, "[", fcolor,
+ clrTransparent, ftext, 12, ftext->Height());
+ osd->DrawText(Setup.OSDWidth - 12, 6 + yoff + fheight * ii,
+ "]", fcolor, clrTransparent, ftext,
+ Setup.OSDWidth - 6, ftext->Height());
+ osd->DrawText(16, 6 + yoff + fheight * (ii++), stext[1],
+ fcolor, clrTransparent, ftext, Setup.OSDWidth - 16,
+ ftext->Height(), taCenter);
+ osd->DrawText(6, 3 + yoff + fheight * ii, "[", fcolor,
+ clrTransparent, ftext, 12, ftext->Height());
+ osd->DrawText(Setup.OSDWidth - 12, 3 + yoff + fheight * ii,
+ "]", fcolor, clrTransparent, ftext,
+ Setup.OSDWidth - 6, ftext->Height());
+ osd->DrawText(16, 3 + yoff + fheight * (ii++), stext[2],
+ fcolor, clrTransparent, ftext, Setup.OSDWidth - 16,
+ ftext->Height(), taCenter);
+ }
+ }
+ }
+ osd->Flush();
+ }
+
+ RT_MsgShow = false;
+}
+
+int cRadioTextOsd::RassImage(int QArchiv, int QKey, bool DirUp) {
+ int i;
+
+ if (QKey >= 0 && QKey <= 9) {
+ if (QArchiv == 0) {
+ (Rass_Flags[QKey][0]) ? QArchiv = QKey * 1000 : QArchiv = 0;
+ }
+ else if (QArchiv > 0) {
+ if (floor(QArchiv / 1000) == QKey) {
+ for (i = 3; i >= 0; i--) {
+ if (fmod(QArchiv, pow(10, i)) == 0)
+ break;
+ }
+ (i > 0) ?
+ QArchiv += QKey * (int) pow(10, --i) :
+ QArchiv = QKey * 1000;
+ (Rass_Flags[QKey][3 - i]) ? : QArchiv = QKey * 1000;
+ }
+ else {
+ (Rass_Flags[QKey][0]) ? QArchiv = QKey * 1000 : QArchiv = 0;
+ }
+ }
+ }
+ // Gallery
+ else if (QKey > 9 && Rass_GalCount >= 0) {
+ if (QArchiv < Rass_GalStart || QArchiv > Rass_GalEnd) {
+ QArchiv = Rass_GalStart - 1;
+ }
+ if (DirUp) {
+ for (i = QArchiv + 1; i <= Rass_GalEnd; i++) {
+ if (Rass_Gallery[i])
+ break;
+ }
+ QArchiv = (i <= Rass_GalEnd) ? i : Rass_GalStart;
+ }
+ else {
+ for (i = QArchiv - 1; i >= Rass_GalStart; i--) {
+ if (Rass_Gallery[i])
+ break;
+ }
+ QArchiv = (i >= Rass_GalStart) ? i : Rass_GalEnd;
+ }
+ }
+
+ // show mpeg-still
+ char *image;
+ if (QArchiv >= 0) {
+ asprintf(&image, "%s/Rass_%d.mpg", DataDir, QArchiv);
+ }
+ else {
+ asprintf(&image, "%s/Rass_show.mpg", DataDir);
+ }
+ RadioImage->SetBackgroundImage(image);
+ free(image);
+
+ return QArchiv;
+}
+
+void cRadioTextOsd::RassOsd(void) {
+ ftext = cFont::GetFont(fontSml);
+ int fh = ftext->Height();
+
+ if (!qosd && !osd && !Skins.IsOpen() && !cOsd::IsOpen()) {
+ qosd = cOsdProvider::NewOsd(Setup.OSDLeft,
+ Setup.OSDTop + Setup.OSDHeight - (29 + 264 - 6 + 36));
+ tArea Area = { 0, 0, 97, 29 + 264 + 5, 4 };
+ qosd->SetAreas(&Area, 1);
+ }
+
+ if (qosd) {
+ uint32_t bcolor, fcolor;
+ int skin = theme_skin();
+ // Logo
+ bcolor = radioSkin[skin].clrTitleBack;
+ fcolor = radioSkin[skin].clrTitleText;
+ qosd->DrawRectangle(0, 1, 97, 29, bcolor);
+ qosd->DrawEllipse(0, 0, 5, 5, 0x00000000, -2);
+ qosd->DrawEllipse(92, 0, 97, 5, 0x00000000, -1);
+ qosd->DrawBitmap(25, 5, rass, bcolor, fcolor);
+ // Body
+ bcolor = radioSkin[skin].clrBack;
+ fcolor = radioSkin[skin].clrText;
+ int offs = 29 + 2;
+ qosd->DrawRectangle(0, offs, 97, 29 + 264 + 5, bcolor);
+ qosd->DrawEllipse(0, 29 + 264, 5, 29 + 264 + 5, 0x00000000, -3);
+ qosd->DrawEllipse(92, 29 + 264, 97, 29 + 264 + 5, 0x00000000, -4);
+ qosd->DrawRectangle(5, 29, 92, 29, fcolor);
+ // Keys+Index
+ offs += 4;
+ qosd->DrawBitmap(4, offs, no0, bcolor, fcolor);
+ qosd->DrawBitmap(44, offs, index, bcolor, fcolor);
+ qosd->DrawBitmap(4, 24 + offs, no1, bcolor, fcolor);
+ qosd->DrawBitmap(4, 48 + offs, no2, bcolor, fcolor);
+ qosd->DrawBitmap(4, 72 + offs, no3, bcolor, fcolor);
+ qosd->DrawBitmap(4, 96 + offs, no4, bcolor, fcolor);
+ qosd->DrawBitmap(4, 120 + offs, no5, bcolor, fcolor);
+ qosd->DrawBitmap(4, 144 + offs, no6, bcolor, fcolor);
+ qosd->DrawBitmap(4, 168 + offs, no7, bcolor, fcolor);
+ qosd->DrawBitmap(4, 192 + offs, no8, bcolor, fcolor);
+ qosd->DrawBitmap(4, 216 + offs, no9, bcolor, fcolor);
+ qosd->DrawBitmap(4, 240 + offs, bok, bcolor, fcolor);
+ // Content
+ bool mark = false;
+ for (int i = 1; i <= 9; i++) {
+ // Pages
+ if (Rass_Flags[i][0] && Rass_Flags[i][1] && Rass_Flags[i][2]
+ && Rass_Flags[i][3]) {
+ qosd->DrawBitmap(48, (i * 24) + offs, pages4, bcolor, fcolor);
+ }
+ else if (Rass_Flags[i][0] && Rass_Flags[i][1] && Rass_Flags[i][2]) {
+ qosd->DrawBitmap(48, (i * 24) + offs, pages3, bcolor, fcolor);
+ }
+ else if (Rass_Flags[i][0] && Rass_Flags[i][1]) {
+ qosd->DrawBitmap(48, (i * 24) + offs, pages2, bcolor, fcolor);
+ }
+ else if (Rass_Flags[i][0]) {
+ qosd->DrawBitmap(48, (i * 24) + offs, page1, bcolor, fcolor);
+ }
+ // Marker
+ if (floor(Rass_Archiv / 1000) == i) {
+ qosd->DrawBitmap(28, (i * 24) + offs, marker, bcolor, fcolor);
+ mark = true;
+ }
+ }
+ // Gallery
+ if (Rass_GalCount > 0) {
+ char *temp;
+ qosd->DrawBitmap(48, 240 + offs, pageE, bcolor, fcolor);
+ asprintf(&temp, "%d", Rass_GalCount);
+ qosd->DrawText(67, 240 + offs + (20 - fh), temp, fcolor,
+ clrTransparent, ftext, 97, fh);
+ free(temp);
+ }
+ // Marker gallery/index
+ if (!mark) {
+ if (Rass_Archiv > 0 && Rass_Archiv <= RASS_GALMAX)
+ qosd->DrawBitmap(30, 240 + offs, marker, bcolor, fcolor);
+ else
+ qosd->DrawBitmap(28, offs, marker, bcolor, fcolor);
+ }
+ qosd->Flush();
+ }
+}
+
+void cRadioTextOsd::RassOsdTip(void) {
+ ftext = cFont::GetFont(fontSml);
+ int fh = ftext->Height();
+
+ if (!qosd && !osd && !Skins.IsOpen() && !cOsd::IsOpen()) {
+ qosd = cOsdProvider::NewOsd(Setup.OSDLeft,
+ Setup.OSDTop + Setup.OSDHeight - (29 + (2 * fh) - 6 + 36));
+ tArea Area = { 0, 0, 97, 29 + (2 * fh) + 5, 4 };
+ qosd->SetAreas(&Area, 1);
+ }
+
+ if (qosd) {
+ uint32_t bcolor, fcolor;
+ int skin = theme_skin();
+ // Title
+ bcolor = radioSkin[skin].clrTitleBack;
+ fcolor = radioSkin[skin].clrTitleText;
+ qosd->DrawRectangle(0, 0, 97, 29, bcolor);
+ qosd->DrawEllipse(0, 0, 5, 5, 0x00000000, -2);
+ qosd->DrawEllipse(92, 0, 97, 5, 0x00000000, -1);
+ qosd->DrawBitmap(25, 5, rass, bcolor, fcolor);
+ // Body
+ bcolor = radioSkin[skin].clrBack;
+ fcolor = radioSkin[skin].clrText;
+ qosd->DrawRectangle(0, 29 + 2, 97, 29 + (2 * fh) + 5, bcolor);
+ qosd->DrawEllipse(0, 29 + (2 * fh), 5, 29 + (2 * fh) + 5, 0x00000000,
+ -3);
+ qosd->DrawEllipse(92, 29 + (2 * fh), 97, 29 + (2 * fh) + 5, 0x00000000,
+ -4);
+ qosd->DrawRectangle(5, 29, 92, 29, fcolor);
+ qosd->DrawText(5, 29 + 4, tr("Records"), fcolor, clrTransparent, ftext,
+ 97, fh);
+ qosd->DrawText(5, 29 + fh + 4, ".. <0>", fcolor, clrTransparent, ftext,
+ 97, fh);
+ qosd->Flush();
+ }
+}
+
+void cRadioTextOsd::RassOsdClose(void) {
+ if (qosd != NULL) {
+ delete qosd;
+ qosd = NULL;
+ }
+}
+
+void cRadioTextOsd::RassImgSave(const char *size, int pos) {
+ char *infile, *outfile, *cmd;
+ int filenr = 0, error = 0;
+ struct tm *ts, tm_store;
+
+ if (!enforce_directory(DataDir))
+ return;
+
+ time_t t = time(NULL);
+ ts = localtime_r(&t, &tm_store);
+ switch (pos) {
+ // all from 1-9
+ case 1 ... 9:
+ for (int i = 3; i >= 0; i--) {
+ filenr += (int) (pos * pow(10, i));
+ if (Rass_Flags[pos][3 - i]) {
+ asprintf(&infile, "%s/Rass_%d.mpg", DataDir, filenr);
+ asprintf(&outfile, "%s/Rass_%s-%04d_%02d%02d%02d%02d.jpg",
+ DataDir, RT_Titel, filenr, ts->tm_mon + 1, ts->tm_mday,
+ ts->tm_hour, ts->tm_min);
+ asprintf(&cmd, "ffmpeg -i \"%s\" -s %s -f mjpeg -y \"%s\"",
+ infile, size, outfile);
+ if ((error = system(cmd)))
+ i = -1;
+ }
+ }
+ asprintf(&cmd, "%s '%d'", tr("Rass-Image(s) saved from Archiv "), pos);
+ break;
+ // all from gallery
+ case 10:
+ for (int i = Rass_GalStart; i <= Rass_GalEnd; i++) {
+ if (Rass_Gallery[i]) {
+ asprintf(&infile, "%s/Rass_%d.mpg", DataDir, i);
+ asprintf(&outfile, "%s/Rass_%s-Gallery%04d_%02d%02d.jpg",
+ DataDir, RT_Titel, i, ts->tm_mon + 1, ts->tm_mday);
+ asprintf(&cmd, "ffmpeg -i \"%s\" -s %s -f mjpeg -y \"%s\"",
+ infile, size, outfile);
+ if ((error = system(cmd))) {
+ i = Rass_GalEnd + 1;
+ }
+ }
+ }
+ asprintf(&cmd, "%s", tr("Rass-Image(s) saved from Gallery"));
+ break;
+ // single
+ default:
+ asprintf(&infile, "%s/Rass_%d.mpg", DataDir, Rass_Archiv);
+ asprintf(&outfile, "%s/Rass_%s-%04d_%02d%02d%02d%02d.jpg", DataDir,
+ RT_Titel, Rass_Archiv, ts->tm_mon + 1, ts->tm_mday, ts->tm_hour,
+ ts->tm_min);
+ asprintf(&cmd, "ffmpeg -i \"%s\" -s %s -f mjpeg -y \"%s\"", infile,
+ size, outfile);
+ error = system(cmd);
+ asprintf(&cmd, "%s: %s", tr("Rass-Image saved"), outfile);
+ }
+ free(infile);
+
+ // Info
+ RassOsdClose();
+ if (error) {
+ asprintf(&cmd, "%s: %s", tr("Rass-Image failed"), outfile);
+ Skins.Message(mtError, cmd, Setup.OSDMessageTime);
+ }
+ else {
+ Skins.Message(mtInfo, cmd, Setup.OSDMessageTime);
+ }
+
+ free(outfile);
+ free(cmd);
+}
+
+void cRadioTextOsd::rtp_print(void) {
+ struct tm tm_store;
+ time_t t = time(NULL);
+ printf("\n>>> %s-Memoryclasses @ %s", InfoRequest ? "Info" : "RTplus",
+ asctime(localtime_r(&t, &tm_store)));
+ printf(" on '%s' since %s", RT_Titel,
+ asctime(localtime_r(&rtp_content.start, &tm_store)));
+
+ printf("--- Programme ---\n");
+ if (rtp_content.prog_StatShort != NULL)
+ printf("StationShort: %s\n", rtp_content.prog_StatShort);
+ if (rtp_content.prog_Station != NULL)
+ printf(" Station: %s\n", rtp_content.prog_Station);
+ if (rtp_content.prog_Now != NULL)
+ printf(" Now: %s\n", rtp_content.prog_Now);
+ if (rtp_content.prog_Next != NULL)
+ printf(" Next: %s\n", rtp_content.prog_Next);
+ if (rtp_content.prog_Part != NULL)
+ printf(" Part: %s\n", rtp_content.prog_Part);
+ if (rtp_content.prog_Host != NULL)
+ printf(" Host: %s\n", rtp_content.prog_Host);
+ if (rtp_content.prog_EditStaff != NULL)
+ printf(" Ed.Staff: %s\n", rtp_content.prog_EditStaff);
+ if (rtp_content.prog_Homepage != NULL)
+ printf(" Homepage: %s\n", rtp_content.prog_Homepage);
+
+ printf("--- Interactivity ---\n");
+ if (rtp_content.phone_Hotline != NULL)
+ printf(" Phone-Hotline: %s\n", rtp_content.phone_Hotline);
+ if (rtp_content.phone_Studio != NULL)
+ printf(" Phone-Studio: %s\n", rtp_content.phone_Studio);
+ if (rtp_content.sms_Studio != NULL)
+ printf(" SMS-Studio: %s\n", rtp_content.sms_Studio);
+ if (rtp_content.email_Hotline != NULL)
+ printf(" Email-Hotline: %s\n", rtp_content.email_Hotline);
+ if (rtp_content.email_Studio != NULL)
+ printf(" Email-Studio: %s\n", rtp_content.email_Studio);
+
+ printf("--- Info ---\n");
+ if (rtp_content.info_News != NULL)
+ printf(" News: %s\n", rtp_content.info_News);
+ if (rtp_content.info_NewsLocal != NULL)
+ printf(" NewsLocal: %s\n", rtp_content.info_NewsLocal);
+ if (rtp_content.info_DateTime != NULL)
+ printf(" DateTime: %s\n", rtp_content.info_DateTime);
+ if (rtp_content.info_Traffic != NULL)
+ printf(" Traffic: %s\n", rtp_content.info_Traffic);
+ if (rtp_content.info_Alarm != NULL)
+ printf(" Alarm: %s\n", rtp_content.info_Alarm);
+ if (rtp_content.info_Advert != NULL)
+ printf(" Advertisg: %s\n", rtp_content.info_Advert);
+ if (rtp_content.info_Url != NULL)
+ printf(" Url: %s\n", rtp_content.info_Url);
+ // no sorting
+ for (int i = 0; i < MAX_RTPC; i++)
+ if (rtp_content.info_Stock[i] != NULL)
+ printf(" Stock[%02d]: %s\n", i, rtp_content.info_Stock[i]);
+ for (int i = 0; i < MAX_RTPC; i++)
+ if (rtp_content.info_Sport[i] != NULL)
+ printf(" Sport[%02d]: %s\n", i, rtp_content.info_Sport[i]);
+ for (int i = 0; i < MAX_RTPC; i++)
+ if (rtp_content.info_Lottery[i] != NULL)
+ printf(" Lottery[%02d]: %s\n", i, rtp_content.info_Lottery[i]);
+ for (int i = 0; i < MAX_RTPC; i++)
+ if (rtp_content.info_Weather[i] != NULL)
+ printf(" Weather[%02d]: %s\n", i, rtp_content.info_Weather[i]);
+ for (int i = 0; i < MAX_RTPC; i++)
+ if (rtp_content.info_Other[i] != NULL)
+ printf(" Other[%02d]: %s\n", i, rtp_content.info_Other[i]);
+ /*
+ printf("--- Item-Playlist ---\n");
+ // no sorting
+ if (rtp_content.item_Index >= 0) {
+ for (int i = 0; i < MAX_RTPC; i++) {
+ if (rtp_content.item_Title[i] != NULL && rtp_content.item_Artist[i] != NULL) {
+ struct tm tm_store;
+ struct tm *ts = localtime_r(&rtp_content.item_Start[i], &tm_store);
+ printf(" [%02d] %02d:%02d Title: %s | Artist: %s\n",
+ i, ts->tm_hour, ts->tm_min, rtp_content.item_Title[i], rtp_content.item_Artist[i]);
+ }
+ }
+ }
+
+ printf("--- Last seen Radiotext ---\n");
+ // no sorting
+ if (rtp_content.rt_Index >= 0) {
+ for (int i = 0; i < 2*MAX_RTPC; i++)
+ if (rtp_content.radiotext[i] != NULL) printf(" [%03d] %s\n", i, rtp_content.radiotext[i]);
+ }
+ */
+ printf("<<<\n");
+}
+
+#define rtplog 0
+eOSState cRadioTextOsd::ProcessKey(eKeys Key) {
+ // RTplus Infolog
+ if (rtplog == 1 && (S_Verbose & 0x0f) >= 1) {
+ static int ct = 0;
+ if (++ct >= 60) {
+ ct = 0;
+ rtp_print();
+ }
+ }
+
+ // check end @ replay
+ if (RT_Replay) {
+ int rplayCur, rplayTot;
+ cControl::Control()->GetIndex(rplayCur, rplayTot, false);
+ if (rplayCur >= rplayTot - 1) {
+ Hide();
+ return osEnd;
+ }
+ }
+
+ // Timeout or no Info/Rass
+ if (RT_OsdTO || (RT_OsdTOTemp > 0) || (RT_Info < 0)) {
+ Hide();
+ return osEnd;
+ }
+
+ eOSState state = cOsdObject::ProcessKey(Key);
+ if (state != osUnknown)
+ return state;
+
+ // Key pressed ...
+ if ((Key != kNone) && (Key < k_Release)) {
+ if (osd) { // Radiotext, -plus Osd
+ switch (Key) {
+ case kBack:
+ RTOsdClose();
+ rtclosed = true;
+ //rassclosed = false;
+ break;
+ case k0:
+ RTOsdClose();
+ RTplus_Osd = true;
+ cRemote::CallPlugin("radio");
+ return osEnd;
+ default:
+ Hide();
+ LastKey = (Key == kChanUp || Key == kChanDn) ? kNone : Key;
+ return osEnd;
+ }
+ }
+ else if (qosd && Rass_Archiv >= 0) { // Rass-Archiv Osd
+ int i, pos;
+ pos = (Rass_Archiv > 0 && Rass_Archiv <= RASS_GALMAX) ?
+ 10 : (int) floor(Rass_Archiv / 1000);
+ switch (Key) {
+ // back to Slideshow
+ case kBlue:
+ case kBack:
+ if (!RT_Replay) {
+ Rass_Archiv = RassImage(-1, 0, false);
+ }
+ else {
+ Rass_Archiv = -1;
+ RadioImage->SetBackgroundImage(ReplayFile);
+ }
+ RassOsdClose();
+ rassclosed = rtclosed = false;
+ break;
+ // Archiv-Sides
+ case k0 ... k9:
+ Rass_Archiv = RassImage(Rass_Archiv, Key - k0, false);
+ RassOsd();
+ break;
+ case kOk:
+ if (Rass_Flags[10][0]) {
+ Rass_Archiv = RassImage(Rass_Archiv, 10, true);
+ RassOsd();
+ }
+ break;
+ case kLeft:
+ case kRight:
+ Rass_Archiv = RassImage(Rass_Archiv, pos,
+ (Key == kRight) ? true : false);
+ RassOsd();
+ break;
+ case kDown:
+ (pos == 10) ? i = 0 : i = pos + 1;
+ while (i != pos) {
+ if (Rass_Flags[i][0]) {
+ Rass_Archiv = RassImage(Rass_Archiv, i, true);
+ RassOsd();
+ return osContinue;
+ }
+ if (++i > 10) {
+ i = 0;
+ }
+ }
+ break;
+ case kUp:
+ (pos == 0) ? i = 10 : i = pos - 1;
+ while (i != pos) {
+ if (Rass_Flags[i][0]) {
+ Rass_Archiv = RassImage(Rass_Archiv, i, true);
+ RassOsd();
+ return osContinue;
+ }
+ if (--i < 0) {
+ i = 10;
+ }
+ }
+ break;
+ case kRed:
+ RassImgSave("1024x576", 0);
+ break;
+ case kGreen:
+ RassImgSave("1024x576", pos);
+ break;
+ case kYellow:
+ break; // todo, what ?
+ default:
+ Hide();
+ LastKey = (Key == kChanUp || Key == kChanDn) ? kNone : Key;
+ return osEnd;
+ }
+ }
+ else if (qosd && Rass_Archiv == -1) { // Rass-Slideshow Osd
+ switch (Key) {
+ // close
+ case kBack:
+ RassOsdClose();
+ rassclosed = true;
+ //rtclosed = false;
+ break;
+ // Archiv-Index
+ case k0:
+ if (Rass_Flags[0][0]) {
+ RassOsdClose();
+ Rass_Archiv = RassImage(0, 0, false);
+ RassOsd();
+ }
+ break;
+ default:
+ Hide();
+ LastKey = (Key == kChanUp || Key == kChanDn) ? kNone : Key;
+ return osEnd;
+ }
+ }
+ else { // no RT && no Rass
+ Hide();
+ LastKey = (Key == kChanUp || Key == kChanDn) ? kNone : Key;
+ return osEnd;
+ }
+ }
+ // no Key pressed ...
+ else if (S_RtOsdTO > 0
+ && osdtimer.Elapsed() / 1000 / 60 >= (uint) S_RtOsdTO) {
+ RT_OsdTO = true;
+ Hide();
+ return osEnd;
+ }
+ else if (Rass_Archiv >= 0) {
+ RassOsd();
+ }
+ else if (RT_MsgShow && !rtclosed
+ && (!Rass_Flags[0][0] || S_RassText >= 2 || rassclosed)) { // Rass_Show == -1
+ RassOsdClose();
+ ShowText();
+ }
+ else if (Rass_Flags[0][0] && !rassclosed
+ && (S_RassText < 2 || rtclosed)) {
+ RTOsdClose();
+ RassOsdTip();
+ }
+
+ return osContinue;
+}
diff --git a/rdsreceiver.c b/rdsreceiver.c
new file mode 100644
index 0000000..8c95474
--- /dev/null
+++ b/rdsreceiver.c
@@ -0,0 +1,219 @@
+#include <vdr/remote.h>
+#include <vdr/status.h>
+#include <vdr/plugin.h>
+#include "radioaudio.h"
+#include "radioskin.h"
+#include "radiotools.h"
+#include "service.h"
+#include <math.h>
+
+extern bool RdsLogo;
+extern cRadioAudio *RadioAudio;
+
+// --- cRDSReceiver ------------------------------------------------------------
+
+cRDSReceiver::cRDSReceiver(int Pid) {
+ dsyslog("radio: additional RDS-Receiver starts on Pid=%d", Pid);
+
+ pid = Pid;
+ rt_start = rt_bstuff = false;
+}
+
+cRDSReceiver::~cRDSReceiver() {
+ dsyslog("radio: additional RDS-Receiver stopped");
+}
+
+#if VDRVERSNUM >= 20300
+void cRDSReceiver::Receive(const uchar *Data, int Length)
+#else
+ void cRDSReceiver::Receive(uchar *Data, int Length)
+#endif
+ {
+ const int mframel = 263; // max. 255(MSG)+4(ADD/SQC/MFL)+2(CRC)+2(Start/Stop) of RDS-data
+ static unsigned char mtext[mframel + 1];
+ static int index;
+ static int mec = 0;
+
+ // check TS-Size, -Sync, PID, Payload
+ if (Length != TS_SIZE || Data[0] != 0x47
+ || pid != ((Data[1] & 0x1f) << 8) + Data[2] || !(Data[3] & 0x10)) {
+ return;
+ }
+
+ int offset;
+ if (Data[1] & 0x40) { // 1.TS-Frame, payload-unit-start
+ offset = (Data[3] & 0x20) ? Data[4] + 11 : 10; // Header + ADFL + 6 byte: PES-Startcode, -StreamID, -PacketLength
+ if (Data[offset - 3] == 0xbd) { // StreamID = Private stream 1 (for rds)
+ offset += 3; // 3 byte: Extension + Headerlength
+ offset += Data[offset - 1];
+ } else {
+ return;
+ }
+ } else {
+ offset = (Data[3] & 0x20) ? Data[4] + 5 : 4; // Header + ADFL
+ }
+
+ if ((TS_SIZE - offset) <= 0) {
+ return;
+ }
+ // print TS-RawData with RDS
+ if ((S_Verbose & 0x02) == 0x02) {
+ printf("\n\nTS-Data(%d):\n", Length);
+ int cnt = 0;
+ for (int a = 0; a < Length; a++) {
+ printf("%02x ", Data[a]);
+ cnt++;
+ if (cnt > 15) {
+ cnt = 0;
+ printf("\n");
+ }
+ }
+ printf("(End)\n");
+ }
+
+ for (int i = 0, val = 0; i < (TS_SIZE - offset); i++) {
+ val = Data[offset + i];
+
+ if (val == 0xfe) { // Start
+ index = -1;
+ rt_start = true;
+ rt_bstuff = false;
+ mec = 0;
+ if ((S_Verbose & 0x0f) >= 2) {
+ printf("\nRDS-Start: ");
+ }
+ }
+
+ if (rt_start) {
+ if ((S_Verbose & 0x0f) >= 2) {
+ printf("%02x ", val);
+ }
+ // byte-stuffing reverse: 0xfd00->0xfd, 0xfd01->0xfe, 0xfd02->0xff
+ if (rt_bstuff) {
+ switch (val) {
+ case 0x00:
+ mtext[index] = 0xfd;
+ break;
+ case 0x01:
+ mtext[index] = 0xfe;
+ break;
+ case 0x02:
+ mtext[index] = 0xff;
+ break;
+ default:
+ mtext[++index] = val; // should never be
+ }
+ rt_bstuff = false;
+ if ((S_Verbose & 0x0f) >= 2) {
+ printf("(Bytestuffing -> %02x) ", mtext[index]);
+ }
+ } else {
+ mtext[++index] = val;
+ }
+ if (val == 0xfd && index > 0) { // stuffing found
+ rt_bstuff = true;
+ }
+ // early check for used MEC
+ if (index == 5) {
+ //mec = val;
+ switch (val) {
+ case 0x0a: // RT
+ case 0x46: // ODA-Data
+ case 0x07: // PTY
+ case 0x3e: // PTYN
+ case 0x30: // TMC
+ case 0x02:
+ mec = val; // PS
+ RdsLogo = true;
+ break;
+ default:
+ rt_start = false;
+ if ((S_Verbose & 0x0f) >= 2) {
+ printf("[RDS-MEC '%02x' not used -> End]\n", val);
+ }
+ }
+ }
+ if (index >= mframel) { // max. rdslength, garbage ?
+ rt_start = false;
+ if ((S_Verbose & 0x0f) >= 2) {
+ printf("(RDS-Error: too long, garbage ?)\n");
+ }
+ }
+ }
+
+ if (rt_start && val == 0xff) { // End
+ rt_start = false;
+ if ((S_Verbose & 0x0f) >= 2) {
+ printf("(RDS-End)\n");
+ }
+ if (index < 9) { // min. rdslength, garbage ?
+ if ((S_Verbose & 0x0f) >= 1) {
+ printf("RDS-Error: too short -> garbage ?\n");
+ }
+ } else {
+ // crc16-check
+ unsigned short crc16 = crc16_ccitt(mtext, index - 3, true);
+ if (crc16 != (mtext[index - 2] << 8) + mtext[index - 1]) {
+ if ((S_Verbose & 0x0f) >= 1) {
+ printf(
+ "RDS-Error: wrong CRC # calc = %04x <> transmit = %02x%02x\n",
+ crc16, mtext[index - 2], mtext[index - 1]);
+ }
+ } else {
+ switch (mec) {
+ case 0x0a:
+ RadioAudio->RadiotextDecode(mtext, index); // Radiotext
+ break;
+ case 0x46:
+ switch ((mtext[7] << 8) + mtext[8]) { // ODA-ID
+ case 0x4bd7:
+ RadioAudio->RadiotextDecode(mtext, index); // RT+
+ break;
+ case 0x0d45:
+ case 0xcd46:
+ if ((S_Verbose & 0x20) > 0) {
+ unsigned char tmc[6]; // TMC Alert-C
+ int i;
+ for (i = 9; i <= (index - 3); i++) {
+ tmc[i - 9] = mtext[i];
+ }
+ tmc_parser(tmc, i - 8);
+ }
+ break;
+ default:
+ if ((S_Verbose & 0x0f) >= 2) {
+ printf(
+ "[RDS-ODA AID '%02x%02x' not used -> End]\n",
+ mtext[7], mtext[8]);
+ }
+ }
+ break;
+ case 0x07:
+ RT_PTY = mtext[8]; // PTY
+ if ((S_Verbose & 0x0f) >= 1) {
+ printf("RDS-PTY set to '%s'\n",
+ ptynr2string(RT_PTY));
+ }
+ break;
+ case 0x3e:
+ RadioAudio->RDS_PsPtynDecode(true, mtext, index); // PTYN
+ break;
+ case 0x02:
+ RadioAudio->RDS_PsPtynDecode(false, mtext, index); // PS
+ break;
+ case 0x30:
+ if ((S_Verbose & 0x20) > 0) { // TMC Alert-C
+ unsigned char tmc[6];
+ int i;
+ for (i = 7; i <= (index - 3); i++) {
+ tmc[i - 7] = mtext[i];
+ }
+ tmc_parser(tmc, i - 6);
+ }
+ break;
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/rtpluslist.c b/rtpluslist.c
new file mode 100644
index 0000000..97eb374
--- /dev/null
+++ b/rtpluslist.c
@@ -0,0 +1,256 @@
+#include <vdr/remote.h>
+#include <vdr/status.h>
+#include <vdr/plugin.h>
+#include "radioaudio.h"
+#include "radioskin.h"
+#include "radiotools.h"
+#include "service.h"
+#include <math.h>
+
+extern char *RTp_Titel;
+extern rtp_classes rtp_content;
+
+// --- cRTplusList ------------------------------------------------------
+
+cRTplusList::cRTplusList(int Typ) :
+ cOsdMenu(RTp_Titel, 4), cCharSetConv(
+ (RT_Charset == 0) ? "ISO-8859-1" : NULL) {
+ typ = Typ;
+ refresh = false;
+
+ Load();
+ Display();
+}
+
+cRTplusList::~cRTplusList() {
+ typ = 0;
+}
+
+void cRTplusList::Load(void) {
+ char text[80];
+ struct tm *ts, tm_store;
+ int ind, lfd = 0;
+ char ctitle[80];
+ // TODO
+ dsyslog("%s %d cRTplusList::Load", __FILE__, __LINE__);
+ ts = localtime_r(&rtp_content.start, &tm_store);
+ switch (typ) {
+ case 0:
+ snprintf(text, sizeof(text), "-- %s (max. %d) --",
+ tr("last seen Radiotext"), 2 * MAX_RTPC);
+ Add(new cOsdItem(hk(text)));
+ snprintf(text, sizeof(text), "%s", " ");
+ Add(new cOsdItem(hk(text)));
+ ind = rtp_content.rt_Index;
+ if (ind < (2 * MAX_RTPC - 1) && rtp_content.radiotext[ind + 1] != NULL) {
+ for (int i = ind + 1; i < 2 * MAX_RTPC; i++) {
+ if (rtp_content.radiotext[i] != NULL) {
+ snprintf(text, sizeof(text), "%d.\t%s", ++lfd,
+ Convert(rtp_content.radiotext[i]));
+ Add(new cOsdItem(hk(text)));
+ }
+ }
+ }
+ for (int i = 0; i <= ind; i++) {
+ if (rtp_content.radiotext[i] != NULL) {
+ snprintf(text, sizeof(text), "%d.\t%s", ++lfd,
+ Convert(rtp_content.radiotext[i]));
+ Add(new cOsdItem(hk(text)), refresh);
+ }
+ }
+ break;
+ case 1:
+ SetCols(6, 19, 1);
+ snprintf(text, sizeof(text), "-- %s --", tr("Playlist"));
+ Add(new cOsdItem(hk(text)));
+ snprintf(text, sizeof(text), "%s\t%s\t\t%s", tr("Time"), tr("Title"),
+ tr("Artist"));
+ Add(new cOsdItem(hk(text)));
+ snprintf(text, sizeof(text), "%s", " ");
+ Add(new cOsdItem(hk(text)));
+ ind = rtp_content.item_Index;
+ if (ind < (MAX_RTPC - 1) && rtp_content.item_Title[ind + 1] != NULL) {
+ for (int i = ind + 1; i < MAX_RTPC; i++) {
+ if (rtp_content.item_Title[i] != NULL
+ && rtp_content.item_Artist[i] != NULL) {
+ ts = localtime_r(&rtp_content.item_Start[i], &tm_store);
+ snprintf(ctitle, sizeof(ctitle), "%s",
+ Convert(rtp_content.item_Title[i]));
+ snprintf(text, sizeof(text), "%02d:%02d\t%s\t\t%s",
+ ts->tm_hour, ts->tm_min, ctitle,
+ Convert(rtp_content.item_Artist[i]));
+ Add(new cOsdItem(hk(text)));
+ }
+ }
+ }
+ for (int i = 0; i <= ind; i++) {
+ if (rtp_content.item_Title[i] != NULL
+ && rtp_content.item_Artist[i] != NULL) {
+ ts = localtime_r(&rtp_content.item_Start[i], &tm_store);
+ snprintf(ctitle, sizeof(ctitle), "%s",
+ Convert(rtp_content.item_Title[i]));
+ snprintf(text, sizeof(text), "%02d:%02d\t%s\t\t%s", ts->tm_hour,
+ ts->tm_min, ctitle,
+ Convert(rtp_content.item_Artist[i]));
+ Add(new cOsdItem(hk(text)), refresh);
+ }
+ }
+ break;
+ case 2:
+ snprintf(text, sizeof(text), "-- %s --", tr("Sports"));
+ Add(new cOsdItem(hk(text)));
+ snprintf(text, sizeof(text), "%s", " ");
+ Add(new cOsdItem(hk(text)));
+ ind = rtp_content.info_SportIndex;
+ if (ind < (MAX_RTPC - 1) && rtp_content.info_Sport[ind + 1] != NULL) {
+ for (int i = ind + 1; i < MAX_RTPC; i++) {
+ if (rtp_content.info_Sport[i] != NULL) {
+ snprintf(text, sizeof(text), "%d.\t%s", ++lfd,
+ Convert(rtp_content.info_Sport[i]));
+ Add(new cOsdItem(hk(text)));
+ }
+ }
+ }
+ for (int i = 0; i <= ind; i++) {
+ if (rtp_content.info_Sport[i] != NULL) {
+ snprintf(text, sizeof(text), "%d.\t%s", ++lfd,
+ Convert(rtp_content.info_Sport[i]));
+ Add(new cOsdItem(hk(text)), refresh);
+ }
+ }
+ break;
+ case 3:
+ snprintf(text, sizeof(text), "-- %s --", tr("Lottery"));
+ Add(new cOsdItem(hk(text)));
+ snprintf(text, sizeof(text), "%s", " ");
+ Add(new cOsdItem(hk(text)));
+ ind = rtp_content.info_LotteryIndex;
+ if (ind < (MAX_RTPC - 1) && rtp_content.info_Lottery[ind + 1] != NULL) {
+ for (int i = ind + 1; i < MAX_RTPC; i++) {
+ if (rtp_content.info_Lottery[i] != NULL) {
+ snprintf(text, sizeof(text), "%d.\t%s", ++lfd,
+ Convert(rtp_content.info_Lottery[i]));
+ Add(new cOsdItem(hk(text)));
+ }
+ }
+ }
+ for (int i = 0; i <= ind; i++) {
+ if (rtp_content.info_Lottery[i] != NULL) {
+ snprintf(text, sizeof(text), "%d.\t%s", ++lfd,
+ Convert(rtp_content.info_Lottery[i]));
+ Add(new cOsdItem(hk(text)), refresh);
+ }
+ }
+ break;
+ case 4:
+ snprintf(text, sizeof(text), "-- %s --", tr("Weather"));
+ Add(new cOsdItem(hk(text)));
+ snprintf(text, sizeof(text), "%s", " ");
+ Add(new cOsdItem(hk(text)));
+ ind = rtp_content.info_WeatherIndex;
+ if (ind < (MAX_RTPC - 1) && rtp_content.info_Weather[ind + 1] != NULL) {
+ for (int i = ind + 1; i < MAX_RTPC; i++) {
+ if (rtp_content.info_Weather[i] != NULL) {
+ snprintf(text, sizeof(text), "%d.\t%s", ++lfd,
+ Convert(rtp_content.info_Weather[i]));
+ Add(new cOsdItem(hk(text)));
+ }
+ }
+ }
+ for (int i = 0; i <= ind; i++) {
+ if (rtp_content.info_Weather[i] != NULL) {
+ snprintf(text, sizeof(text), "%d.\t%s", ++lfd,
+ Convert(rtp_content.info_Weather[i]));
+ Add(new cOsdItem(hk(text)), refresh);
+ }
+ }
+ break;
+ case 5:
+ snprintf(text, sizeof(text), "-- %s --", tr("Stockmarket"));
+ Add(new cOsdItem(hk(text)));
+ snprintf(text, sizeof(text), "%s", " ");
+ Add(new cOsdItem(hk(text)));
+ ind = rtp_content.info_StockIndex;
+ if (ind < (MAX_RTPC - 1) && rtp_content.info_Stock[ind + 1] != NULL) {
+ for (int i = ind + 1; i < MAX_RTPC; i++) {
+ if (rtp_content.info_Stock[i] != NULL) {
+ snprintf(text, sizeof(text), "%d.\t%s", ++lfd,
+ Convert(rtp_content.info_Stock[i]));
+ Add(new cOsdItem(hk(text)));
+ }
+ }
+ }
+ for (int i = 0; i <= ind; i++) {
+ if (rtp_content.info_Stock[i] != NULL) {
+ snprintf(text, sizeof(text), "%d.\t%s", ++lfd,
+ Convert(rtp_content.info_Stock[i]));
+ Add(new cOsdItem(hk(text)), refresh);
+ }
+ }
+ break;
+ case 6:
+ snprintf(text, sizeof(text), "-- %s --", tr("Other"));
+ Add(new cOsdItem(hk(text)));
+ snprintf(text, sizeof(text), "%s", " ");
+ Add(new cOsdItem(hk(text)));
+ ind = rtp_content.info_OtherIndex;
+ if (ind < (MAX_RTPC - 1) && rtp_content.info_Other[ind + 1] != NULL) {
+ for (int i = ind + 1; i < MAX_RTPC; i++) {
+ if (rtp_content.info_Other[i] != NULL) {
+ snprintf(text, sizeof(text), "%d.\t%s", ++lfd,
+ Convert(rtp_content.info_Other[i]));
+ Add(new cOsdItem(hk(text)));
+ }
+ }
+ }
+ for (int i = 0; i <= ind; i++) {
+ if (rtp_content.info_Other[i] != NULL) {
+ snprintf(text, sizeof(text), "%d.\t%s", ++lfd,
+ Convert(rtp_content.info_Other[i]));
+ Add(new cOsdItem(hk(text)), refresh);
+ }
+ }
+ break;
+ }
+
+ SetHelp(NULL, NULL, refresh ? tr("Refresh Off") : tr("Refresh On"),
+ tr("Back"));
+}
+
+void cRTplusList::Update(void) {
+ Clear();
+ Load();
+ Display();
+}
+
+eOSState cRTplusList::ProcessKey(eKeys Key) {
+ eOSState state = cOsdMenu::ProcessKey(Key);
+
+ if (state == osUnknown) {
+ switch (Key) {
+ case k0:
+ Update();
+ break;
+ case kYellow:
+ refresh = (refresh) ? false : true;
+ Update();
+ break;
+ case kBack:
+ case kOk:
+ case kBlue:
+ return osBack;
+ default:
+ state = osContinue;
+ }
+ }
+
+ static int ct;
+ if (refresh) {
+ if (++ct >= 20) {
+ ct = 0;
+ Update();
+ }
+ }
+
+ return state;
+}
diff --git a/rtplusosd.c b/rtplusosd.c
new file mode 100644
index 0000000..86a2cb7
--- /dev/null
+++ b/rtplusosd.c
@@ -0,0 +1,507 @@
+#include <vdr/remote.h>
+#include <vdr/status.h>
+#include <vdr/plugin.h>
+#include "radioaudio.h"
+#include "radioskin.h"
+#include "radiotools.h"
+#include "service.h"
+#include <math.h>
+
+extern char *RT_Titel, *RTp_Titel;
+extern rtp_classes rtp_content;
+
+// --- cRTplusOsd ------------------------------------------------------
+
+cRTplusOsd::cRTplusOsd(void) :
+ cOsdMenu(RTp_Titel, 3, 12), cCharSetConv(
+ (RT_Charset == 0) ? "ISO-8859-1" : NULL) {
+ RTplus_Osd = false;
+
+ bcount = helpmode = 0;
+ listtyp[0] = tr("Radiotext");
+ listtyp[1] = tr("Playlist");
+ listtyp[2] = tr("Sports");
+ listtyp[3] = tr("Lottery");
+ listtyp[4] = tr("Weather");
+ listtyp[5] = tr("Stockmarket");
+ listtyp[6] = tr("Other");
+
+ Load();
+ Display();
+// TODO
+dsyslog("%s %d cRTplusOsd::cRTplusOsd ", __FILE__, __LINE__);
+}
+
+cRTplusOsd::~cRTplusOsd() {
+}
+
+void cRTplusOsd::Load(void) {
+ char text[80];
+
+ struct tm tm_store;
+ struct tm *ts = localtime_r(&rtp_content.start, &tm_store);
+ snprintf(text, sizeof(text), "%s %02d:%02d",
+ InfoRequest ? tr("extra Info since") : tr("RTplus Memory since"),
+ ts->tm_hour, ts->tm_min);
+ Add(new cOsdItem(hk(text)));
+ snprintf(text, sizeof(text), "%s", " ");
+ Add(new cOsdItem(hk(text)));
+
+ snprintf(text, sizeof(text), "-- %s --", tr("Programme"));
+ Add(new cOsdItem(hk(text)));
+ if (rtp_content.prog_StatShort != NULL) {
+ snprintf(text, sizeof(text), "\t%s:\t%s", tr("Stat.Short"),
+ Convert(rtp_content.prog_StatShort));
+ Add(new cOsdItem(hk(text)));
+ }
+ if (rtp_content.prog_Station != NULL) {
+ snprintf(text, sizeof(text), "\t%s:\t%s", tr("Station"),
+ Convert(rtp_content.prog_Station));
+ Add(new cOsdItem(hk(text)));
+ }
+ if (rtp_content.prog_Now != NULL) {
+ snprintf(text, sizeof(text), "\t%s:\t%s", tr("Now"),
+ Convert(rtp_content.prog_Now));
+ Add(new cOsdItem(hk(text)));
+ }
+ if (rtp_content.prog_Part != NULL) {
+ snprintf(text, sizeof(text), "\t%s:\t%s", tr("...Part"),
+ Convert(rtp_content.prog_Part));
+ Add(new cOsdItem(hk(text)));
+ }
+ if (rtp_content.prog_Next != NULL) {
+ snprintf(text, sizeof(text), "\t%s:\t%s", tr("Next"),
+ Convert(rtp_content.prog_Next));
+ Add(new cOsdItem(hk(text)));
+ }
+ if (rtp_content.prog_Host != NULL) {
+ snprintf(text, sizeof(text), "\t%s:\t%s", tr("Host"),
+ Convert(rtp_content.prog_Host));
+ Add(new cOsdItem(hk(text)));
+ }
+ if (rtp_content.prog_EditStaff != NULL) {
+ snprintf(text, sizeof(text), "\t%s:\t%s", tr("Edit.Staff"),
+ Convert(rtp_content.prog_EditStaff));
+ Add(new cOsdItem(hk(text)));
+ }
+ if (rtp_content.prog_Homepage != NULL) {
+ snprintf(text, sizeof(text), "\t%s:\t%s", tr("Homepage"),
+ Convert(rtp_content.prog_Homepage));
+ Add(new cOsdItem(hk(text)));
+ }
+ snprintf(text, sizeof(text), "%s", " ");
+ Add(new cOsdItem(hk(text)));
+
+ snprintf(text, sizeof(text), "-- %s --", tr("Interactivity"));
+ Add(new cOsdItem(hk(text)));
+ if (rtp_content.phone_Hotline != NULL) {
+ snprintf(text, sizeof(text), "\t%s:\t%s", tr("Phone-Hotline"),
+ Convert(rtp_content.phone_Hotline));
+ Add(new cOsdItem(hk(text)));
+ }
+ if (rtp_content.phone_Studio != NULL) {
+ snprintf(text, sizeof(text), "\t%s:\t%s", tr("Phone-Studio"),
+ Convert(rtp_content.phone_Studio));
+ Add(new cOsdItem(hk(text)));
+ }
+ if (rtp_content.sms_Studio != NULL) {
+ snprintf(text, sizeof(text), "\t%s:\t%s", tr("SMS-Studio"),
+ Convert(rtp_content.sms_Studio));
+ Add(new cOsdItem(hk(text)));
+ }
+ if (rtp_content.email_Hotline != NULL) {
+ snprintf(text, sizeof(text), "\t%s:\t%s", tr("Email-Hotline"),
+ Convert(rtp_content.email_Hotline));
+ Add(new cOsdItem(hk(text)));
+ }
+ if (rtp_content.email_Studio != NULL) {
+ snprintf(text, sizeof(text), "\t%s:\t%s", tr("Email-Studio"),
+ Convert(rtp_content.email_Studio));
+ Add(new cOsdItem(hk(text)));
+ }
+ snprintf(text, sizeof(text), "%s", " ");
+ Add(new cOsdItem(hk(text)));
+
+ snprintf(text, sizeof(text), "-- %s --", tr("Info"));
+ Add(new cOsdItem(hk(text)));
+ if (rtp_content.info_News != NULL) {
+ snprintf(text, sizeof(text), "\t%s:\t%s", tr("News"),
+ Convert(rtp_content.info_News));
+ Add(new cOsdItem(hk(text)));
+ }
+ if (rtp_content.info_NewsLocal != NULL) {
+ snprintf(text, sizeof(text), "\t%s:\t%s", tr("NewsLocal"),
+ Convert(rtp_content.info_NewsLocal));
+ Add(new cOsdItem(hk(text)));
+ }
+ if (rtp_content.info_DateTime != NULL) {
+ snprintf(text, sizeof(text), "\t%s:\t%s", tr("DateTime"),
+ Convert(rtp_content.info_DateTime));
+ Add(new cOsdItem(hk(text)));
+ }
+ if (rtp_content.info_Traffic != NULL) {
+ snprintf(text, sizeof(text), "\t%s:\t%s", tr("Traffic"),
+ Convert(rtp_content.info_Traffic));
+ Add(new cOsdItem(hk(text)));
+ }
+ if (rtp_content.info_Alarm != NULL) {
+ snprintf(text, sizeof(text), "\t%s:\t%s", tr("Alarm"),
+ Convert(rtp_content.info_Alarm));
+ Add(new cOsdItem(hk(text)));
+ }
+ if (rtp_content.info_Advert != NULL) {
+ snprintf(text, sizeof(text), "\t%s:\t%s", tr("Advertising"),
+ Convert(rtp_content.info_Advert));
+ Add(new cOsdItem(hk(text)));
+ }
+ if (rtp_content.info_Url != NULL) {
+ snprintf(text, sizeof(text), "\t%s:\t%s", tr("Url"),
+ Convert(rtp_content.info_Url));
+ Add(new cOsdItem(hk(text)));
+ }
+
+ for (int i = 0; i <= 6; i++)
+ btext[i] = NULL;
+ bcount = 0;
+ asprintf(&btext[bcount++], "%s", listtyp[0]);
+ if (rtp_content.item_Index >= 0)
+ asprintf(&btext[bcount++], "%s", listtyp[1]);
+ if (rtp_content.info_SportIndex >= 0)
+ asprintf(&btext[bcount++], "%s", listtyp[2]);
+ if (rtp_content.info_LotteryIndex >= 0)
+ asprintf(&btext[bcount++], "%s", listtyp[3]);
+ if (rtp_content.info_WeatherIndex >= 0)
+ asprintf(&btext[bcount++], "%s", listtyp[4]);
+ if (rtp_content.info_StockIndex >= 0)
+ asprintf(&btext[bcount++], "%s", listtyp[5]);
+ if (rtp_content.info_OtherIndex >= 0)
+ asprintf(&btext[bcount++], "%s", listtyp[6]);
+
+ switch (bcount) {
+ case 4:
+ if (helpmode == 0)
+ SetHelp(btext[0], btext[1], btext[2], ">>");
+ else if (helpmode == 1)
+ SetHelp("<<", btext[3], NULL, tr("Exit"));
+ break;
+ case 5:
+ if (helpmode == 0)
+ SetHelp(btext[0], btext[1], btext[2], ">>");
+ else if (helpmode == 1)
+ SetHelp("<<", btext[3], btext[4], tr("Exit"));
+ break;
+ case 6:
+ if (helpmode == 0)
+ SetHelp(btext[0], btext[1], btext[2], ">>");
+ else if (helpmode == 1)
+ SetHelp("<<", btext[3], btext[4], ">>");
+ else if (helpmode == 2)
+ SetHelp("<<", btext[5], NULL, tr("Exit"));
+ break;
+ case 7:
+ if (helpmode == 0)
+ SetHelp(btext[0], btext[1], btext[2], ">>");
+ else if (helpmode == 1)
+ SetHelp("<<", btext[3], btext[4], ">>");
+ else if (helpmode == 2)
+ SetHelp("<<", btext[5], btext[6], tr("Exit"));
+ break;
+ default:
+ helpmode = 0;
+ SetHelp(btext[0], btext[1], btext[2], tr("Exit"));
+ }
+}
+
+void cRTplusOsd::Update(void) {
+ Clear();
+ Load();
+ Display();
+}
+
+int cRTplusOsd::rtptyp(char *btext) {
+ for (int i = 0; i <= 6; i++) {
+ if (strcmp(btext, listtyp[i]) == 0)
+ return i;
+ }
+
+ return -1;
+}
+
+void cRTplusOsd::rtp_fileprint(void) {
+ struct tm *ts, tm_store;
+ char *fname, *fpath;
+ FILE *fd;
+ int ind, lfd = 0;
+
+ if (!enforce_directory(DataDir))
+ return;
+
+ time_t t = time(NULL);
+ ts = localtime_r(&t, &tm_store);
+ asprintf(&fname, "%s_%s_%04d-%02d-%02d.%02d.%02d",
+ InfoRequest ? "Info" : "RTplus", RT_Titel, ts->tm_year + 1900,
+ ts->tm_mon + 1, ts->tm_mday, ts->tm_hour, ts->tm_min);
+ asprintf(&fpath, "%s/%s", DataDir, fname);
+ if ((fd = fopen(fpath, "w")) != NULL) {
+
+ fprintf(fd, ">>> %s-Memoryclasses @ %s",
+ InfoRequest ? "Info" : "RTplus",
+ asctime(localtime_r(&t, &tm_store)));
+ fprintf(fd, " on '%s' since %s", RT_Titel,
+ asctime(localtime_r(&rtp_content.start, &tm_store)));
+
+ fprintf(fd, "--- Programme ---\n");
+ if (rtp_content.prog_StatShort != NULL)
+ fprintf(fd, "StationShort: %s\n", rtp_content.prog_StatShort);
+ if (rtp_content.prog_Station != NULL)
+ fprintf(fd, " Station: %s\n", rtp_content.prog_Station);
+ if (rtp_content.prog_Now != NULL)
+ fprintf(fd, " Now: %s\n", rtp_content.prog_Now);
+ if (rtp_content.prog_Part != NULL)
+ fprintf(fd, " Part: %s\n", rtp_content.prog_Part);
+ if (rtp_content.prog_Next != NULL)
+ fprintf(fd, " Next: %s\n", rtp_content.prog_Next);
+ if (rtp_content.prog_Host != NULL)
+ fprintf(fd, " Host: %s\n", rtp_content.prog_Host);
+ if (rtp_content.prog_EditStaff != NULL)
+ fprintf(fd, " Ed.Staff: %s\n", rtp_content.prog_EditStaff);
+ if (rtp_content.prog_Homepage != NULL)
+ fprintf(fd, " Homepage: %s\n", rtp_content.prog_Homepage);
+
+ fprintf(fd, "--- Interactivity ---\n");
+ if (rtp_content.phone_Hotline != NULL)
+ fprintf(fd, " Phone-Hotline: %s\n", rtp_content.phone_Hotline);
+ if (rtp_content.phone_Studio != NULL)
+ fprintf(fd, " Phone-Studio: %s\n", rtp_content.phone_Studio);
+ if (rtp_content.sms_Studio != NULL)
+ fprintf(fd, " SMS-Studio: %s\n", rtp_content.sms_Studio);
+ if (rtp_content.email_Hotline != NULL)
+ fprintf(fd, " Email-Hotline: %s\n", rtp_content.email_Hotline);
+ if (rtp_content.email_Studio != NULL)
+ fprintf(fd, " Email-Studio: %s\n", rtp_content.email_Studio);
+
+ fprintf(fd, "--- Info ---\n");
+ if (rtp_content.info_News != NULL)
+ fprintf(fd, " News: %s\n", rtp_content.info_News);
+ if (rtp_content.info_NewsLocal != NULL)
+ fprintf(fd, " NewsLocal: %s\n", rtp_content.info_NewsLocal);
+ if (rtp_content.info_DateTime != NULL)
+ fprintf(fd, " DateTime: %s\n", rtp_content.info_DateTime);
+ if (rtp_content.info_Traffic != NULL)
+ fprintf(fd, " Traffic: %s\n", rtp_content.info_Traffic);
+ if (rtp_content.info_Alarm != NULL)
+ fprintf(fd, " Alarm: %s\n", rtp_content.info_Alarm);
+ if (rtp_content.info_Advert != NULL)
+ fprintf(fd, " Advertisg: %s\n", rtp_content.info_Advert);
+ if (rtp_content.info_Url != NULL)
+ fprintf(fd, " Url: %s\n", rtp_content.info_Url);
+
+ if (rtp_content.item_Index >= 0) {
+ fprintf(fd, "--- Item-Playlist ---\n");
+ ind = rtp_content.item_Index;
+ if (ind < (MAX_RTPC - 1) && rtp_content.item_Title[ind + 1] != NULL) {
+ for (int i = ind + 1; i < MAX_RTPC; i++) {
+ if (rtp_content.item_Title[i] != NULL
+ && rtp_content.item_Artist[i] != NULL) {
+ ts = localtime_r(&rtp_content.item_Start[i], &tm_store);
+ fprintf(fd,
+ " %02d:%02d Title: '%s' | Artist: '%s'\n",
+ ts->tm_hour, ts->tm_min,
+ rtp_content.item_Title[i],
+ rtp_content.item_Artist[i]);
+ }
+ }
+ }
+ for (int i = 0; i <= ind; i++) {
+ if (rtp_content.item_Title[i] != NULL
+ && rtp_content.item_Artist[i] != NULL) {
+ ts = localtime_r(&rtp_content.item_Start[i], &tm_store);
+ fprintf(fd, " %02d:%02d Title: '%s' | Artist: '%s'\n",
+ ts->tm_hour, ts->tm_min, rtp_content.item_Title[i],
+ rtp_content.item_Artist[i]);
+ }
+ }
+ }
+
+ if (rtp_content.info_SportIndex >= 0) {
+ fprintf(fd, "--- Sports ---\n");
+ ind = rtp_content.info_SportIndex;
+ if (ind < (MAX_RTPC - 1) && rtp_content.info_Sport[ind + 1] != NULL) {
+ for (int i = ind + 1; i < MAX_RTPC; i++) {
+ if (rtp_content.info_Sport[i] != NULL)
+ fprintf(fd, " %02d. %s\n", ++lfd,
+ rtp_content.info_Sport[i]);
+ }
+ }
+ for (int i = 0; i <= ind; i++) {
+ if (rtp_content.info_Sport[i] != NULL)
+ fprintf(fd, " %02d. %s\n", ++lfd,
+ rtp_content.info_Sport[i]);
+ }
+ }
+
+ if (rtp_content.info_LotteryIndex >= 0) {
+ fprintf(fd, "--- Lottery ---\n");
+ ind = rtp_content.info_LotteryIndex;
+ if (ind
+ < (MAX_RTPC - 1)&& rtp_content.info_Lottery[ind+1] != NULL) {
+ for (int i = ind + 1; i < MAX_RTPC; i++) {
+ if (rtp_content.info_Lottery[i] != NULL)
+ fprintf(fd, " %02d. %s\n", ++lfd,
+ rtp_content.info_Lottery[i]);
+ }
+ }
+ for (int i = 0; i <= ind; i++) {
+ if (rtp_content.info_Lottery[i] != NULL)
+ fprintf(fd, " %02d. %s\n", ++lfd,
+ rtp_content.info_Lottery[i]);
+ }
+ }
+
+ if (rtp_content.info_WeatherIndex >= 0) {
+ fprintf(fd, "--- Weather ---\n");
+ ind = rtp_content.info_WeatherIndex;
+ if (ind
+ < (MAX_RTPC - 1)&& rtp_content.info_Weather[ind+1] != NULL) {
+ for (int i = ind + 1; i < MAX_RTPC; i++) {
+ if (rtp_content.info_Weather[i] != NULL)
+ fprintf(fd, " %02d. %s\n", ++lfd,
+ rtp_content.info_Weather[i]);
+ }
+ }
+ for (int i = 0; i <= ind; i++) {
+ if (rtp_content.info_Weather[i] != NULL)
+ fprintf(fd, " %02d. %s\n", ++lfd,
+ rtp_content.info_Weather[i]);
+ }
+ }
+
+ if (rtp_content.info_StockIndex >= 0) {
+ fprintf(fd, "--- Stockmarket ---\n");
+ ind = rtp_content.info_StockIndex;
+ if (ind < (MAX_RTPC - 1) && rtp_content.info_Stock[ind + 1] != NULL) {
+ for (int i = ind + 1; i < MAX_RTPC; i++) {
+ if (rtp_content.info_Stock[i] != NULL)
+ fprintf(fd, " %02d. %s\n", ++lfd,
+ rtp_content.info_Stock[i]);
+ }
+ }
+ for (int i = 0; i <= ind; i++) {
+ if (rtp_content.info_Stock[i] != NULL)
+ fprintf(fd, " %02d. %s\n", ++lfd,
+ rtp_content.info_Stock[i]);
+ }
+ }
+
+ if (rtp_content.info_OtherIndex >= 0) {
+ fprintf(fd, "--- Other ---\n");
+ ind = rtp_content.info_OtherIndex;
+ if (ind < (MAX_RTPC - 1) && rtp_content.info_Other[ind + 1] != NULL) {
+ for (int i = ind + 1; i < MAX_RTPC; i++) {
+ if (rtp_content.info_Other[i] != NULL)
+ fprintf(fd, " %02d. %s\n", ++lfd,
+ rtp_content.info_Other[i]);
+ }
+ }
+ for (int i = 0; i <= ind; i++) {
+ if (rtp_content.info_Other[i] != NULL)
+ fprintf(fd, " %02d. %s\n", ++lfd,
+ rtp_content.info_Other[i]);
+ }
+ }
+
+ fprintf(fd, "--- Last seen Radiotext ---\n");
+ ind = rtp_content.rt_Index;
+ if (ind < (2 * MAX_RTPC - 1) && rtp_content.radiotext[ind + 1] != NULL) {
+ for (int i = ind + 1; i < 2 * MAX_RTPC; i++) {
+ if (rtp_content.radiotext[i] != NULL)
+ fprintf(fd, " %03d. %s\n", ++lfd,
+ rtp_content.radiotext[i]);
+ }
+ }
+ for (int i = 0; i <= ind; i++) {
+ if (rtp_content.radiotext[i] != NULL)
+ fprintf(fd, " %03d. %s\n", ++lfd, rtp_content.radiotext[i]);
+ }
+
+ fprintf(fd, "<<<\n");
+ fclose(fd);
+
+ char *infotext;
+ asprintf(&infotext, "%s: %s",
+ InfoRequest ? tr("Info-File saved") : tr("RTplus-File saved"),
+ fpath);
+ Skins.Message(mtInfo, infotext, Setup.OSDMessageTime);
+ free(infotext);
+ } else
+ esyslog("radio: ERROR writing RTplus-File failed '%s'", fpath);
+
+ free(fpath);
+ free(fname);
+}
+
+eOSState cRTplusOsd::ProcessKey(eKeys Key) {
+ int typ, ind;
+ eOSState state = cOsdMenu::ProcessKey(Key);
+
+ if (HasSubMenu())
+ return osContinue;
+
+ if (state == osUnknown) {
+ switch (Key) {
+ case kBack:
+ case kOk:
+ return osEnd;
+ case kBlue:
+ if (bcount >= 4 && helpmode == 0) {
+ helpmode += 1;
+ Update();
+ } else if (bcount >= 6 && helpmode == 1) {
+ helpmode += 1;
+ Update();
+ } else
+ return osEnd;
+ break;
+ case k0:
+ Update();
+ break;
+ case k8:
+ rtp_fileprint();
+ break;
+ case kRed:
+ if (helpmode == 0) {
+ if (btext[0] != NULL)
+ if ((typ = rtptyp(btext[0])) >= 0)
+ AddSubMenu(new cRTplusList(typ));
+ } else {
+ helpmode -= 1;
+ Update();
+ }
+ break;
+ case kGreen:
+ ind = (helpmode * 2) + 1;
+ if (btext[ind] != NULL) {
+ if ((typ = rtptyp(btext[ind])) >= 0)
+ AddSubMenu(new cRTplusList(typ));
+ }
+ break;
+ case kYellow:
+ ind = (helpmode * 2) + 2;
+ if (btext[ind] != NULL) {
+ if ((typ = rtptyp(btext[ind])) >= 0)
+ AddSubMenu(new cRTplusList(typ));
+ }
+ break;
+ default:
+ state = osContinue;
+ }
+ }
+
+ static int ct;
+ if (++ct >= 60) {
+ ct = 0;
+ Update();
+ }
+
+ return state;
+}