summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY20
-rw-r--r--LIESMICH.bitte38
-rw-r--r--inforx.c288
3 files changed, 184 insertions, 162 deletions
diff --git a/HISTORY b/HISTORY
index 425be34..8e0e7dc 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,10 +1,10 @@
VDR Plugin 'radio' Revision History
-----------------------------------
-
-2018-02-xx: Version 1.x.x
+2018-02-23: Version 1.1.0
Ulrich Eckhardt <uli-vdr@uli-eckhardt.de>
- Enhancements for osd2web by Jörg Wendel
-- Add new service identifier RadioTextService-v1.1
+- Add new service interface with identifier RadioTextService-v1.1
+ with several new fields.
- Convert all *.po to UTF-8
- Bugfixes from Jörg Wendel
- Fix compile problems on VDR 2.2.0
@@ -51,7 +51,7 @@ VDR Plugin 'radio' Revision History
U.Hanke <egal@gmx.info>
- new transponder (TID) for premiere radio-channels (+ epg fixed)
- create/checks temp. data-dir /tmp/vdr-radio.xxxxxx if not specified,
- thanks to Tobias Grimm & Thomas G�nther
+ thanks to Tobias Grimm & Thomas Günther
- cleanup for gcc-4.2.1 (some const char*)
- debug print cleanups -> dsyslog
- update for RT+Specification 2.1, RT+Classes changed
@@ -93,7 +93,7 @@ VDR Plugin 'radio' Revision History
- first implementation of tmc-parser Alert-C coding
(start with --verbose=32 or greater and watch console-output)
- some changes like RDS-ODA IDs for RT+ & TMC_Alert-C
-- add hungarian-translation text, thanks to F�ley Istv�n
+- add hungarian-translation text, thanks to Füley István
- add Skin-Themes: Soppalusikka-Blackberry/Citron,
Enigma-WineRed/AppleGreen/WomansLike/YellowSun,
Elchi_Plugin, EgalsTry~default/~blue
@@ -113,7 +113,7 @@ VDR Plugin 'radio' Revision History
slideshow with mpeg-stills as backgroundimage & save datafiles,
archiv with OSD & Navigation
- Bugfix: now stopping correct rds-receiver on multiple tunerdevices,
- thanks to Reinhard Ni�l
+ thanks to Reinhard Nißl
2006-08-14: Version 0.1.4
U.Hanke <egal@gmx.info>
@@ -126,11 +126,11 @@ VDR Plugin 'radio' Revision History
U.Hanke <egal@gmx.info>
- add Service/OSD-Symbol from audiorecorder for title-recording
- exchange localtime() with thread-safe localtime_r()
-- add french-translation text, thanks to Micha�l Nival
+- add french-translation text, thanks to Michaël Nival
2006-04-27: Version 0.1.2
U.Hanke <egal@gmx.info>
-- Bugfix in fopen for DataDir-files, thanks to Thomas G�nther
+- Bugfix in fopen for DataDir-files, thanks to Thomas Günther
- New command-options --live/--replay = mpegfile for default-mpegs @ live-/replaymode,
(mpegfile as absolute incl. Path), suggested by Tobias Grimm
- Add -fPIC to compiler-flags, thanks to Tobias Grimm
@@ -153,12 +153,12 @@ VDR Plugin 'radio' Revision History
- Makefile-Defines for vdr-patches
- RTplus-Memory with seperate OSDs added
- detecting radio in file @ replaymode,
- thanks to Reinhard Ni�l for providing the patch
+ thanks to Reinhard Nißl for providing the patch
- cleanup code, vdr < 1.3.43 no longer supported
- no more own tansferthread -> changing to audiothread,
radiotext @ replaymode now possible,
better handling of transfer-start,
- thanks to Reinhard Ni�l for providing all the patches
+ thanks to Reinhard Nißl for providing all the patches
2006-01-09: Version 0.0.9
U.Hanke <egal@gmx.info>
diff --git a/LIESMICH.bitte b/LIESMICH.bitte
index 150f3ce..9a7508d 100644
--- a/LIESMICH.bitte
+++ b/LIESMICH.bitte
@@ -1,39 +1,39 @@
Plugin radio for vdr >= 1.7.37
-MPEG-Standbilder als Beispiele beigefügt (siehe SubDir ../config/mpgestill),
-(überarbeitete Vorlage von kleo @ vdrportal);
+MPEG-Standbilder als Beispiele beigefügt (siehe SubDir ../config/mpgestill),
+(überarbeitete Vorlage von kleo @ vdrportal);
zur Benutzung kopiere/installiere nach $VDRCONFIG/plugins/radio (-f <DIR>).
-Externe Scriptabfragen für Titel/Interpret-Infos unter ../config/scripts),
-(für Funktion/Aufbau siehe ../config/scripts/LIESMICH.Scripts);
+Externe Scriptabfragen für Titel/Interpret-Infos unter ../config/scripts),
+(für Funktion/Aufbau siehe ../config/scripts/LIESMICH.Scripts);
zur Benutzung kopiere/installiere nach $VDRCONFIG/plugins/radio (-f <DIR>).
----------------------------
-Grundsätzlich zur Bedienung:
+Grundsätzlich zur Bedienung:
----------------------------
Wenn im OSD entweder der Radiotext/Info oder der RaSS-Archivhinweis aktiv ist,
-kann mit der Taste 'Zurück' das OSD getoggelt werden, soll heißen:
+kann mit der Taste 'Zurück' das OSD getoggelt werden, soll heißen:
RaSS-Hinweis/Radiotext -> kein OSD -> RaSS-Hinweis/Radiotext usw.
-----------------------------
Bedienung/Tasten RTplus-Menu:
-----------------------------
Wenn im OSD der Radiotext/Info zu sehen ist, kann mit der Taste '0'
-das zusätzliche RTplus-Menu + evtl. weitere aufgerufen werden.
-Die Übersicht wird automatisch alle 60 Sekunden aktualisiert;
+das zusätzliche RTplus-Menu + evtl. weitere aufgerufen werden.
+Die Ãœbersicht wird automatisch alle 60 Sekunden aktualisiert;
evtl. Untermenus ca. alle 20s, wenn aktiviert.
Tasten in den Menus:
0 = Aktualisieren
- OK/Zurück = Schließen
+ OK/Zurück = Schließen
8 = RTplus-Infos speichern (nur im 1.Menu)
-----------------------------
Bedienung/Tasten RaSS-Archiv:
-----------------------------
-Wenn im OSD der Hinweis 'Archiv verfügbar' zu sehen ist, kann mit der Taste '0'
-das zusätzliche RaSS-Archiv aufgerufen werden.
+Wenn im OSD der Hinweis 'Archiv verfügbar' zu sehen ist, kann mit der Taste '0'
+das zusätzliche RaSS-Archiv aufgerufen werden.
Auf der linken Seite erscheint das Archiv-Menu mit den Bedienungstasten 0-9/OK,
dabei bedeuten folgende Symbole:
@@ -42,18 +42,18 @@ dabei bedeuten folgende Symbole:
| | xx = Gallery, xx Anzahl Bilder (OK)
> = Standort
-Folgende zusätzliche Tasten stehen zur Verfügung:
+Folgende zusätzliche Tasten stehen zur Verfügung:
Auf/Ab = Scrollen innerhalb Archivmenu (0-9/OK)
Links/Rechts = Scrollen innerhalb der Subseiten/Gallery
Rot = Speichert angezeigte Seite als JPEG-Bild (1024x576)
- Grün = Speichert alle Subseiten/Gallery als JPEG-Bilder (1024x576),
+ Grün = Speichert alle Subseiten/Gallery als JPEG-Bilder (1024x576),
- Seitenname = RaSS_Sendername-Seitennr_MonatTagStundeMinute.jpg
- Gallerynamen = RaSS_Sendername-GallerySeitennr_MonatTag.jpg
Gelb = todo, was ?
Blau/Exit = Archiv verlassen
-Alle anderen Tasten schließen das RaSS-Archiv ebenso.
+Alle anderen Tasten schließen das RaSS-Archiv ebenso.
Hinweis: Die JPEG-Speicherung/Wandlung erfolgt nur, wenn auf dem System
das Programm 'ffmpeg' installiert ist.
@@ -63,20 +63,20 @@ Hinweis: Die JPEG-Speicherung/Wandlung erfolgt nur, wenn auf dem System
SVDRP-Befehle:
--------------
RTINFO = Ausgabe der Radiotext Information
- RTCLOSE = Radiotext-OSD schließen. Erneutes Öffnen nur über Menü oder Kanalwechsel
- RTTCLOSE = Radiotext-OSD zeitweise schließen. Wiederöffnen automatisch nach OSD-Timeout
+ RTCLOSE = Radiotext-OSD schließen. Erneutes Öffnen nur über Menü oder Kanalwechsel
+ RTTCLOSE = Radiotext-OSD zeitweise schließen. Wiederöffnen automatisch nach OSD-Timeout
----------------
Ausrufparameter:
----------------
-f <DIR> --files=<DIR> Bilderverzeichnis (Standard: $VDRCONFIG/plugins/radio)
- -d <DIR> --data=<DIR> Datenverzeichnis temporär (Standard: /tmp/vdr-radio.XXXXXX)
+ -d <DIR> --data=<DIR> Datenverzeichnis temporär (Standard: /tmp/vdr-radio.XXXXXX)
-l <DATEI> --live=<DATEI> benutze <DATEI> im Livemodus (Standard: $VDRCONFIG/plugins/radio/radio.mpg)
-r <DATEI> --replay=<DATE> benutze <DATEI> im Wiedergabemodus (Standard: $VDRCONFIG/plugins/radio/replay.mpg)
- -e 1 --encrypted=1 benutze Transfermode auch bei verschlüsselten Sendern
+ -e 1 --encrypted=1 benutze Transfermode auch bei verschlüsselten Sendern
-v <LEVEL> --verbose=<LEVEL> Console-Printouts: 0 keine Meldungen, 1 RDS-Text+Tags (Voreinstellung), 2 +RDS-Telegram/Debug,
3 +RawData 0xfd, |=16 Rass-Info, |=32 TMC-Info
-Viel Spaß...
+Viel Spaß...
Uwe <egal at egal-vdr dot de>
diff --git a/inforx.c b/inforx.c
index ea0f492..1c49035 100644
--- a/inforx.c
+++ b/inforx.c
@@ -11,151 +11,173 @@
void fill_rtpbuffer(char *text1, char *text2) {
- if (++rtp_content.rt_Index >= 2*MAX_RTPC)
- rtp_content.rt_Index = 0;
+ if (++rtp_content.rt_Index >= 2 * MAX_RTPC)
+ rtp_content.rt_Index = 0;
asprintf(&rtp_content.radiotext[rtp_content.rt_Index], "%s", text1);
- snprintf(RT_Text[RT_Index], RT_MEL, "%s", rtp_content.radiotext[rtp_content.rt_Index]);
- RT_Index +=1; if (RT_Index >= S_RtOsdRows) RT_Index = 0;
+ snprintf(RT_Text[RT_Index], RT_MEL, "%s",
+ rtp_content.radiotext[rtp_content.rt_Index]);
+ RT_Index += 1;
+ if (RT_Index >= S_RtOsdRows)
+ RT_Index = 0;
- if (++rtp_content.rt_Index >= 2*MAX_RTPC)
- rtp_content.rt_Index = 0;
+ if (++rtp_content.rt_Index >= 2 * MAX_RTPC)
+ rtp_content.rt_Index = 0;
asprintf(&rtp_content.radiotext[rtp_content.rt_Index], "%s", text2);
- snprintf(RT_Text[RT_Index], RT_MEL, "%s", rtp_content.radiotext[rtp_content.rt_Index]);
- RT_Index +=1; if (RT_Index >= S_RtOsdRows) RT_Index = 0;
+ snprintf(RT_Text[RT_Index], RT_MEL, "%s",
+ rtp_content.radiotext[rtp_content.rt_Index]);
+ RT_Index += 1;
+ if (RT_Index >= S_RtOsdRows) {
+ RT_Index = 0;
+ }
- if (++rtp_content.item_Index >= MAX_RTPC)
- rtp_content.item_Index = 0;
+ if (++rtp_content.item_Index >= MAX_RTPC) {
+ rtp_content.item_Index = 0;
+ }
if (rtp_content.item_Index >= 0) {
- rtp_content.item_Start[rtp_content.item_Index] = RTP_Starttime;
- asprintf(&rtp_content.item_Artist[rtp_content.item_Index], "%s", RTP_Artist);
- asprintf(&rtp_content.item_Title[rtp_content.item_Index], "%s", RTP_Title);
- }
+ rtp_content.item_Start[rtp_content.item_Index] = RTP_Starttime;
+ asprintf(&rtp_content.item_Artist[rtp_content.item_Index], "%s",
+ RTP_Artist);
+ asprintf(&rtp_content.item_Title[rtp_content.item_Index], "%s",
+ RTP_Title);
+ }
- if ((S_Verbose & 0x0f) >= 1)
- printf("radio-inforx: %s / %s\n", RTP_Artist, RTP_Title);
+ if ((S_Verbose & 0x0f) >= 1) {
+ dsyslog("radio-inforx: %s / %s\n", RTP_Artist, RTP_Title);
+ }
}
int info_request(int chantid, int chanapid) {
- char ident[80];
- char artist[RT_MEL], titel[RT_MEL];
- struct tm tm_store;
- static int repeat = 0;
- char temp[2][2*RT_MEL];
-
- char *command, *tempfile;
- asprintf(&command, "%s/radioinfo-%d-%d", ConfigDir, chantid, chanapid);
- asprintf(&tempfile, "%s/%s", DataDir, RadioInfofile);
- dsyslog("radio: inforxcall '%s'\n", command);
-
- DoInfoReq = false;
- if (file_exists(command)) {
- if (file_exists(tempfile)) { // delete tempfile
- char *delcmd;
- asprintf(&delcmd, "rm -f \"%s\"", tempfile);
- system(delcmd);
- free(delcmd);
- }
- asprintf(&command, "%s \"%s\"", command, tempfile);
- if (!system(command)) { // execute script && read tempfile
- if (file_exists(tempfile)) {
- std::ifstream infile(tempfile);
- if (infile.is_open()) {
- infile.getline(ident, 80);
- infile.getline(artist, RT_MEL);
- infile.getline(titel, RT_MEL);
- }
- infile.close();
- DoInfoReq = true;
- }
- else
- esyslog("radio: ERROR inforx tempfile = %s\n", command);
- }
- else
- esyslog("radio: ERROR inforx command = %s\n", command);
- }
- free(command);
- free(tempfile);
-
- if (!DoInfoReq) {
- dsyslog("radio: inforxcall cancled !\n");
- return -1;
- }
-
- // Info empty?
- if (strcmp(artist, "") == 0 && strcmp(titel, "") == 0) {
- if (repeat < 700) { // ~ 6x switch off
- repeat += 120;
- sprintf(RTP_Artist, "---");
- sprintf(RTP_Title, "---");
- RTP_Starttime = time(NULL);
- sprintf(temp[0], "%s Error :-(", ident);
- struct tm *ts = localtime_r(&RTP_Starttime, &tm_store);
- sprintf(temp[1], "%02d:%02d no Songinfo received !", ts->tm_hour, ts->tm_min);
- fill_rtpbuffer(temp[0], temp[1]);
- RT_MsgShow = true;
- RT_PlusShow = false;
- (RT_Info > 0) ? : RT_Info = 1;
- radioStatusMsg();
- return 120;
- }
- else {
- RTP_Starttime = time(NULL);
- sprintf(temp[0], "%s Error :-(", ident);
- struct tm *ts = localtime_r(&RTP_Starttime, &tm_store);
- sprintf(temp[1], "%02d:%02d no Songinfo received, switching off !", ts->tm_hour, ts->tm_min);
- asprintf(&rtp_content.info_Url, "%02d:%02d no Songinfo, switched off!", ts->tm_hour, ts->tm_min);
- fill_rtpbuffer(temp[0], temp[1]);
- RT_MsgShow = true;
- RT_PlusShow = false;
- (RT_Info > 0) ? : RT_Info = 1;
- radioStatusMsg();
- DoInfoReq = false;
- return 60;
- }
- }
-
- // Info
+ char ident[80];
+ char artist[RT_MEL], titel[RT_MEL];
+ struct tm tm_store;
+ static int repeat = 0;
+ char temp[2][2 * RT_MEL];
+
+ char *command, *tempfile;
+ asprintf(&command, "%s/radioinfo-%d-%d", ConfigDir, chantid, chanapid);
+ asprintf(&tempfile, "%s/%s", DataDir, RadioInfofile);
+ dsyslog("radio: inforxcall '%s'\n", command);
+
+ DoInfoReq = false;
+ if (file_exists(command)) {
+ if (file_exists(tempfile)) { // delete tempfile
+ char *delcmd;
+ asprintf(&delcmd, "rm -f \"%s\"", tempfile);
+ system(delcmd);
+ free(delcmd);
+ }
+ asprintf(&command, "%s \"%s\"", command, tempfile);
+ if (!system(command)) { // execute script && read tempfile
+ if (file_exists(tempfile)) {
+ std::ifstream infile(tempfile);
+ if (infile.is_open()) {
+ infile.getline(ident, 80);
+ infile.getline(artist, RT_MEL);
+ infile.getline(titel, RT_MEL);
+ }
+ infile.close();
+ DoInfoReq = true;
+ }
+ else {
+ esyslog("radio: ERROR inforx tempfile = %s\n", command);
+ }
+ }
+ else {
+ esyslog("radio: ERROR inforx command = %s\n", command);
+ }
+ }
+ free(command);
+ free(tempfile);
+
+ if (!DoInfoReq) {
+ dsyslog("radio: inforxcall cancled !\n");
+ return -1;
+ }
+
+ // Info empty?
+ if (strcmp(artist, "") == 0 && strcmp(titel, "") == 0) {
+ if (repeat < 700) { // ~ 6x switch off
+ repeat += 120;
+ sprintf(RTP_Artist, "---");
+ sprintf(RTP_Title, "---");
+ RTP_Starttime = time(NULL);
+ sprintf(temp[0], "%s Error :-(", ident);
+ struct tm *ts = localtime_r(&RTP_Starttime, &tm_store);
+ sprintf(temp[1], "%02d:%02d no Songinfo received !", ts->tm_hour,
+ ts->tm_min);
+ fill_rtpbuffer(temp[0], temp[1]);
+ RT_MsgShow = true;
+ RT_PlusShow = false;
+ (RT_Info > 0) ? : RT_Info = 1;
+ radioStatusMsg();
+ return 120;
+ }
+ else {
+ RTP_Starttime = time(NULL);
+ sprintf(temp[0], "%s Error :-(", ident);
+ struct tm *ts = localtime_r(&RTP_Starttime, &tm_store);
+ sprintf(temp[1], "%02d:%02d no Songinfo received, switching off !",
+ ts->tm_hour, ts->tm_min);
+ asprintf(&rtp_content.info_Url,
+ "%02d:%02d no Songinfo, switched off!", ts->tm_hour,
+ ts->tm_min);
+ fill_rtpbuffer(temp[0], temp[1]);
+ RT_MsgShow = true;
+ RT_PlusShow = false;
+ (RT_Info > 0) ? : RT_Info = 1;
+ radioStatusMsg();
+ DoInfoReq = false;
+ return 60;
+ }
+ }
+
+ // Info
xhtml2text(artist);
xhtml2text(titel);
- if (strcmp(RTP_Artist, artist) != 0 || strcmp(RTP_Title, titel) != 0) {
- snprintf(RTP_Artist, RT_MEL, "%s", artist);
- snprintf(RTP_Title, RT_MEL, "%s", titel);
- RTP_Starttime = time(NULL);
- sprintf(temp[0], "%s ok :-)", ident);
- struct tm *ts = localtime_r(&RTP_Starttime, &tm_store);
- snprintf(temp[1], 2*RT_MEL, "%02d:%02d %s: %s", ts->tm_hour, ts->tm_min, RTP_Artist, RTP_Title);
- fill_rtpbuffer(temp[0], temp[1]);
- RT_MsgShow = RT_PlusShow = true;
- (RT_Info > 0) ? : RT_Info = 2;
- radioStatusMsg();
- repeat = 0;
- return 90;
- }
- else {
- if (repeat < 1200) { // ~20 Min. timeout
- repeat += 10;
- return 10;
- }
- else {
- sprintf(RTP_Artist, "---");
- sprintf(RTP_Title, "---");
- RTP_Starttime = time(NULL);
- sprintf(temp[0], "%s Error :-(", ident);
- struct tm *ts = localtime_r(&RTP_Starttime, &tm_store);
- sprintf(temp[1], "%02d:%02d no more different Songinfo received, switching off !", ts->tm_hour, ts->tm_min);
- asprintf(&rtp_content.info_Url, "%02d:%02d no more Songinfo, switched off!", ts->tm_hour, ts->tm_min);
- fill_rtpbuffer(temp[0], temp[1]);
- RT_MsgShow = true;
- RT_PlusShow = false;
- (RT_Info > 0) ? : RT_Info = 1;
- radioStatusMsg();
- DoInfoReq = false;
- return 60;
- }
- }
-
- return 10;
+ if (strcmp(RTP_Artist, artist) != 0 || strcmp(RTP_Title, titel) != 0) {
+ snprintf(RTP_Artist, RT_MEL, "%s", artist);
+ snprintf(RTP_Title, RT_MEL, "%s", titel);
+ RTP_Starttime = time(NULL);
+ sprintf(temp[0], "%s ok :-)", ident);
+ struct tm *ts = localtime_r(&RTP_Starttime, &tm_store);
+ snprintf(temp[1], 2 * RT_MEL, "%02d:%02d %s: %s", ts->tm_hour,
+ ts->tm_min, RTP_Artist, RTP_Title);
+ fill_rtpbuffer(temp[0], temp[1]);
+ RT_MsgShow = RT_PlusShow = true;
+ (RT_Info > 0) ? : RT_Info = 2;
+ radioStatusMsg();
+ repeat = 0;
+ return 90;
+ }
+ else {
+ if (repeat < 1200) { // ~20 Min. timeout
+ repeat += 10;
+ return 10;
+ }
+ else {
+ sprintf(RTP_Artist, "---");
+ sprintf(RTP_Title, "---");
+ RTP_Starttime = time(NULL);
+ sprintf(temp[0], "%s Error :-(", ident);
+ struct tm *ts = localtime_r(&RTP_Starttime, &tm_store);
+ sprintf(temp[1],
+ "%02d:%02d no more different Songinfo received, switching off !",
+ ts->tm_hour, ts->tm_min);
+ asprintf(&rtp_content.info_Url,
+ "%02d:%02d no more Songinfo, switched off!", ts->tm_hour,
+ ts->tm_min);
+ fill_rtpbuffer(temp[0], temp[1]);
+ RT_MsgShow = true;
+ RT_PlusShow = false;
+ (RT_Info > 0) ? : RT_Info = 1;
+ radioStatusMsg();
+ DoInfoReq = false;
+ return 60;
+ }
+ }
+
+ return 10;
}