From 58d6446dd10bda93df6a5aaca144f3796d0b8178 Mon Sep 17 00:00:00 2001 From: Ulrich Eckhardt Date: Tue, 20 Feb 2018 18:42:50 +0100 Subject: =?UTF-8?q?Update=20trigger=20for=20service=20by=20J=C3=B6rg=20Wen?= =?UTF-8?q?del?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- radio.c | 18 +++++++++--------- radioaudio.c | 8 +++++--- service.h | 6 ++++++ 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/radio.c b/radio.c index 1a71d7d..521c2bf 100644 --- a/radio.c +++ b/radio.c @@ -419,7 +419,7 @@ cPluginRadio::cPluginRadio(void) DataDirParam = false; LiveFileParam = false; ReplayFileParam = false; - + rt_color[0] = 0xFF000000; //Black rt_color[1] = 0xFFFCFCFC; //White rt_color[2] = 0xFFFC1414; //Red @@ -470,7 +470,7 @@ bool cPluginRadio::ProcessArgs(int argc, char *argv[]) { "verbose", required_argument, NULL, 'v' }, { NULL } }; - + int c; while ((c = getopt_long(argc, argv, "f:d:l:r:e:v:", long_options, NULL)) != -1) { switch (c) { @@ -522,12 +522,12 @@ bool cPluginRadio::Start(void) if (!radioImage) return false; radioImage->Init(); - + radioAudio = new cRadioAudio; if (!radioAudio) return false; - - if (!ConfigDirParam) + + if (!ConfigDirParam) ConfigDir = strdup(ConfigDirectory(Name())); if (!DataDirParam) { DataDir = strdup("/tmp/vdr-radio.XXXXXX"); @@ -540,7 +540,7 @@ bool cPluginRadio::Start(void) asprintf(&ReplayFile, "%s/replay.mpg", ConfigDir); } - cRadioCheck::Init(); + cRadioCheck::Init(); return true; } @@ -558,7 +558,7 @@ void cPluginRadio::Stop(void) void cPluginRadio::Housekeeping(void) { // Perform any cleanup or other regular tasks. -} +} cOsdObject *cPluginRadio::MainMenuAction(void) { @@ -623,7 +623,7 @@ bool cPluginRadio::SetupParse(const char *Name, const char *Value) bool cPluginRadio::Service(const char *Id, void *Data) { static struct tm tm_store; - if ((strcmp(Id,"RadioTextService-v1.0") == 0) && (S_Activate > 0) && (S_RtFunc >= 1)) { + if ((strcmp(Id, RADIO_TEXT_SERVICE0) == 0) && (S_Activate > 0) && (S_RtFunc >= 1)) { if (Data) { RadioTextService_v1_0 *data = (RadioTextService_v1_0*)Data; data->rds_pty = RT_PTY; @@ -636,7 +636,7 @@ bool cPluginRadio::Service(const char *Id, void *Data) } return true; } - else if ((strcmp(Id,"RadioTextService-v1.1") == 0) && (S_Activate > 0) && (S_RtFunc >= 1)) { + else if ((strcmp(Id, RADIO_TEXT_SERVICE1) == 0) && (S_Activate > 0) && (S_RtFunc >= 1)) { if (Data) { cCharSetConv conf(RT_Charset == 0 ? "ISO-8859-1" : 0); RadioTextService_v1_1 *data = (RadioTextService_v1_1*)Data; diff --git a/radioaudio.c b/radioaudio.c index c8922c9..0092114 100644 --- a/radioaudio.c +++ b/radioaudio.c @@ -11,6 +11,7 @@ #include "radioaudio.h" #include "radioskin.h" #include "radiotools.h" +#include "service.h" #include // OSD-Symbols @@ -81,6 +82,7 @@ unsigned char rds_addchar[128] = { 0xe1, 0xe0, 0xe9, 0xe8, 0xed, 0xec, 0xf3, // announce text/items for lcdproc & other void radioStatusMsg(void) { + cPluginManager::CallAllServices(RADIO_TEXT_UPDATE, 0); if (!RT_MsgShow || S_RtMsgItems <= 0) return; @@ -934,7 +936,7 @@ void cRadioAudio::RadiotextDecode(unsigned char *mtext, int len) { // byte 5 = MEC (Message Element Code, 0x0a for RT, 0x46 for RTplus) if (mtext[5] == 0x0a) { - // byte 6+7 = DSN+PSN (DataSetNumber+ProgramServiceNumber, + // byte 6+7 = DSN+PSN (DataSetNumber+ProgramServiceNumber, // ignore here, always 0x00 ?) // byte 8 = MEL (MessageElementLength, max. 64+1 byte @ RT) if (mtext[8] == 0 || mtext[8] > RT_MEL || mtext[8] > leninfo - 4) { @@ -1360,7 +1362,7 @@ void cRadioAudio::RassDecode(unsigned char *mtext, int len) { // byte 1+2 = ADD (10bit SiteAdress + 6bit EncoderAdress) // byte 3 = SQC (Sequence Counter 0x00 = not used) - // byte 4 = MFL (Message Field Length), + // byte 4 = MFL (Message Field Length), if (len >= mtext[4] + 7) { // check complete length // byte 5 = MEC (0xda for Rass) // byte 6 = MEL @@ -2156,7 +2158,7 @@ void cRadioTextOsd::RassOsd(void) { clrTransparent, ftext, 97, fh); free(temp); } - // Marker gallery/index + // Marker gallery/index if (!mark) { if (Rass_Archiv > 0 && Rass_Archiv <= RASS_GALMAX) qosd->DrawBitmap(30, 240 + offs, marker, bcolor, fcolor); diff --git a/service.h b/service.h index 1665cbc..0fa612c 100644 --- a/service.h +++ b/service.h @@ -8,6 +8,8 @@ #ifndef __RADIO_SERVICE_H #define __RADIO_SERVICE_H +#include + // --- Service Interface ------------------------------------------------------- struct RadioTextService_v1_0 { @@ -29,4 +31,8 @@ struct RadioTextService_v1_1 { time_t title_start; }; +#define RADIO_TEXT_SERVICE0 "RadioTextService-v1.0" +#define RADIO_TEXT_SERVICE1 "RadioTextService-v1.1" +#define RADIO_TEXT_UPDATE "RadioTextUpdate-v1.0" + #endif // __RADIO_SERVICE_H -- cgit v1.2.3