diff --git a/src/driver/radiotext.cpp b/src/driver/radiotext.cpp index 2079481f6..3e1a19a58 100644 --- a/src/driver/radiotext.cpp +++ b/src/driver/radiotext.cpp @@ -59,24 +59,6 @@ #include #include -#if 0 -#ifdef HAVE_TRIPLEDRAGON -#include -#include -#define DMXDEV "/dev/" DEVICE_NAME_DEMUX "1" -#elif HAVE_DVB_API_VERSION < 3 -#include -#define DMXDEV "/dev/dvb/card0/demux0" -#define DVRDEV "/dev/dvb/card0/dvr0" -#define dmx_pes_filter_params dmxPesFilterParams -#define pes_type pesType -#else -#include -#define DMXDEV "/dev/dvb/adapter0/demux0" -#define DVRDEV "/dev/dvb/adapter0/dvr0" -#endif -#endif - #include #include #include @@ -96,18 +78,8 @@ char RDS_PSText[12][9]; // plugin audiorecorder service bool ARec_Receive = false, ARec_Record = false; -#if ENABLE_RASS -// ... Gallery (1..999) -#define RASS_GALMAX 999 -bool Rass_Gallery[RASS_GALMAX+1]; -int Rass_GalStart, Rass_GalEnd, Rass_GalCount, Rass_SlideFoto; -#endif - #define floor const char *DataDir = "./"; -//cRadioAudio *RadioAudio; -//cRadioTextOsd *RadioTextOsd; -//cRDSReceiver *RDSReceiver; // RDS-Chartranslation: 0x80..0xff unsigned char rds_addchar[128] = { @@ -349,9 +321,6 @@ if (i < 0) { fprintf(stderr, "RT %s: i < 0 (%d)\n", __FUNCTION__, i); break; } RDS_PsPtynDecode(false, mtext, index); // PS break; case 0xda: -#if ENABLE_RASS - RassDecode(mtext, index); // Rass -#endif break; } } @@ -627,7 +596,6 @@ fprintf(stderr, "MEC=0x%02x DSN=0x%02x PSN=0x%02x MEL=%02d STATUS=0x%02x MFL=%02 rtp_itoggle = false; rtp_idiffs = 0; RadioStatusMsg(); -// AudioRecorderService(); } RTP_TToggle = 0; } @@ -677,1616 +645,13 @@ void CRadioText::RadioStatusMsg(void) int ind = (RT_Index == 0) ? S_RtOsdRows - 1 : RT_Index - 1; strcpy(temp, RT_Text[ind]); printf("RadioStatusMsg = %s\n", temp); -// cStatus::MsgOsdTextItem(rtrim(temp), false); } if ((S_RtMsgItems == 1 || S_RtMsgItems >= 3) && ((S_RtOsdTags == 1 && RT_PlusShow) || S_RtOsdTags >= 2)) { -// struct tm tm_store; -// struct tm *ts = localtime_r(&RTP_Starttime, &tm_store); -// cStatus::MsgOsdProgramme(mktime(ts), RTP_Title, RTP_Artist, 0, NULL, NULL); printf("RTP_Title = %s, RTP_Artist = %s\n", RTP_Title, RTP_Artist); } } - -#if ENABLE_RASS -// add of DVB Radio Slides Specification 1.0, 20061228 -void CRadioText::RassDecode(unsigned char *mtext, int len) -{ - static uint splfd = 0, spmax = 0, index = 0; - static uint afiles, slidenumr, slideelem, filemax, fileoffp; - static int filetype, fileoffb; - static bool slideshow = false, slidesave = false, slidecan = false, slidedel = false, start = false; - static uchar daten[65536]; // mpegs-stills defined <= 50kB - FILE *fd; - - // byte 1+2 = ADD (10bit SiteAdress + 6bit EncoderAdress) - // byte 3 = SQC (Sequence Counter 0x00 = not used) - // byte 4 = MFL (Message Field Length), - if (len >= mtext[4]+7) { // check complete length - // byte 5 = MEC (0xda for Rass) - // byte 6 = MEL - if (mtext[6] == 0 || mtext[6] > mtext[4]-2) { - if ((S_Verbose && 0x0f) >= 1) - printf("Rass-Error: Length = 0 or not correct !\n"); - return; - } - // byte 7+8 = Service-ID zugehöriger Datenkanal - // byte 9-11 = Nummer aktuelles Paket, - uint plfd = mtext[11] + mtext[10]*256 + mtext[9]*65536; - // byte 12-14 = Anzahl Pakete, - uint pmax = mtext[14] + mtext[13]*256 + mtext[12]*65536; - - // byte 15+16 = Rass-Kennung = Header, - if (mtext[15] == 0x40 && mtext[16] == 0xda) { // first - // byte 17+18 = Anzahl Dateien im Archiv, - afiles = mtext[18] + mtext[17]*256; - // byte 19+20 = Slide-Nummer, - slidenumr = mtext[20] + mtext[19]*256; - // byte 21+22 = Element-Nummer im Slide, - slideelem = mtext[22] + mtext[21]*256; - // byte 23 = Slide-Steuerbyte, : bit0 = Anzeige, bit1 = Speichern, bit2 = DarfAnzeige bei Senderwechsel, bit3 = Löschen - slideshow = mtext[23] & 0x01; - slidesave = mtext[23] & 0x02; - slidecan = mtext[23] & 0x04; - slidedel = mtext[23] & 0x08; - // byte 24 = Dateiart, : 0=unbekannt/1=MPEG-Still/2=Definition - filetype = mtext[24]; - if (filetype != 1 && filetype != 2) { - if ((S_Verbose && 0x0f) >= 1) - printf("Rass-Error: Filetype unknown !\n"); - return; - } - // byte 25-28 = Dateilänge, - filemax = mtext[28] + mtext[27]*256 + mtext[26]*65536 + mtext[25]*65536*256; - if (filemax >= 65536) { - if ((S_Verbose && 0x0f) >= 1) - printf("Rass-Error: Filesize will be too big !\n"); - return; - } - // byte 29-31 = Dateioffset Paketnr, - fileoffp = mtext[31] + mtext[30]*256 + mtext[29]*65536; - // byte 32 = Dateioffset Bytenr, - fileoffb = mtext[32]; - if (S_Verbose >= 2) - printf("Rass-Header: afiles= %d\n slidenumr= %d, slideelem= %d\n slideshow= %d, -save= %d, -canschow= %d, -delete= %d\n filetype= %d, filemax= %d\n fileoffp= %d, fileoffb= %d\n", - afiles, slidenumr, slideelem, slideshow, slidesave, slidecan, slidedel, filetype, filemax, fileoffp, fileoffb); - - if (fileoffp == 0) { // First - if (S_Verbose >= 2) - printf("Rass-Start@0 ...\n"); - start = true; - index = 0; - for (int i=fileoffb; i < len-2; i++) { - if (index < filemax) - daten[index++] = mtext[i]; - else - start = false; - } - } - splfd = plfd; - } - else if (plfd < pmax && plfd == splfd+1) { // Between - splfd = plfd; - if (!start && fileoffp == plfd) { // Data start, - if (S_Verbose >= 2) - printf("Rass-Start@%d ...\n", fileoffp); - start = true; - index = 0; - } - else - fileoffb = 15; - if (start) { - for (int i=fileoffb; i < len-2; i++) { - if (index < filemax) - daten[index++] = mtext[i]; - else - start = false; - } - } - } - else if (plfd == pmax && plfd == splfd+1) { // Last - fileoffb = 15; - if (start) { - for (int i=fileoffb; i < len-4; i++) { - if (index <= filemax) - daten[index++] = mtext[i]; - else { - start = false; - return; - } - } - if (S_Verbose >= 2) - printf("... Rass-End (%d bytes)\n", index); - } - - if (filemax > 0) { // nothing todo, if 0 byte file - // crc-check with bytes 'len-4/3' - unsigned short crc16 = crc16_ccitt(daten, filemax, false); - if (crc16 != (mtext[len-4]<<8)+mtext[len-3]) { - if ((S_Verbose && 0x0f) >= 1) - printf("Rass-Error: wrong CRC # calc = %04x <> transmit = %02x%02x\n", crc16, mtext[len-4], mtext[len-3]); - start = false; - return; - } - } - - // show & save file ? - if (index == filemax) { - if (slideshow || (slidecan && Rass_Show == -1)) { - if (filetype == 1) { // show only mpeg-still - char *filepath; - asprintf(&filepath, "%s/%s", DataDir, "Rass_show.mpg"); - if ((fd = fopen(filepath, "wb")) != NULL) { - fwrite(daten, 1, filemax, fd); - //fflush(fd); // for test in replaymode - fclose(fd); - Rass_Show = 1; - if (S_Verbose >= 2) - printf("Rass-File: ready for displaying :-)\n"); - } - else - printf("ERROR vdr-radio: writing imagefile failed '%s'", filepath); - free(filepath); - } - } - if (slidesave || slidedel || slidenumr < RASS_GALMAX) { - // lfd. Fotogallery 100.. ??? - if (slidenumr >= 100 && slidenumr < RASS_GALMAX) { - (Rass_SlideFoto < RASS_GALMAX) ? Rass_SlideFoto++ : Rass_SlideFoto = 100; - slidenumr = Rass_SlideFoto; - } - // - char *filepath = NULL; - (filetype == 2) ? asprintf(&filepath, "%s/Rass_%d.def", DataDir, slidenumr) - : asprintf(&filepath, "%s/Rass_%d.mpg", DataDir, slidenumr); - if ((fd = fopen(filepath, "wb")) != NULL) { - fwrite(daten, 1, filemax, fd); - fclose(fd); - if (S_Verbose >= 1) - printf("Rass-File: saving '%s'\n", filepath); - // archivemarker mpeg-stills - if (filetype == 1) { - // 0, 1000/1100/1110/1111..9000/9900/9990/9999 - if (slidenumr == 0 || slidenumr > RASS_GALMAX) { - if (slidenumr == 0) { - Rass_Flags[0][0] = !slidedel; - (RT_Info > 0) ? : RT_Info = 0; // open RadioTextOsd for ArchivTip - } - else { - int islide = (int) floor(slidenumr/1000); - for (int i = 3; i >= 0; i--) { - if ((slidenumr % (i==3 ? 1000 : i==2 ? 100 : i==1 ? 10 : 1)) == 0) { - Rass_Flags[islide][3-i] = !slidedel; //true; - break; - } - } - } - } - // gallery - else { - Rass_Gallery[slidenumr] = !slidedel; - if (!slidedel && (int)slidenumr > Rass_GalEnd) - Rass_GalEnd = slidenumr; - if (!slidedel && (Rass_GalStart == 0 || (int)slidenumr < Rass_GalStart)) - Rass_GalStart = slidenumr; - // counter - Rass_GalCount = 0; - for (int i = Rass_GalStart; i <= Rass_GalEnd; i++) { - if (Rass_Gallery[i]) - Rass_GalCount++; - } - Rass_Flags[10][0] = (Rass_GalCount > 0); - } - } - } - else - printf("ERROR vdr-radio: writing image/data-file failed '%s'", filepath); - if(filepath) - free(filepath); - } - } - start = false; - splfd = spmax = 0; - } - else { - start = false; - splfd = spmax = 0; - } - } - else { - start = false; - splfd = spmax = 0; - if (S_Verbose >= 1) - printf("RDS-Error: [Rass] Length not correct !\n"); - } -} -#endif - -#if 0 -void cRadioAudio::EnableRadioTextProcessing(const char *Titel, bool replay) -{ - asprintf(&RT_Titel, "%s", Titel); - RT_Replay = replay; - ARec_Receive = ARec_Record = false; - - first_packets = 0; - enabled = true; - imagedelay = 0; - - // Radiotext init - if (S_RtFunc >= 1) { - RT_MsgShow = RT_PlusShow = false; - RT_ReOpen = true; - RT_OsdTO = false; - RT_Index = RT_PTY = RTP_TToggle = 0; - RTP_ItemToggle = 1; - for (int i = 0; i < 5; i++) - memset(RT_Text[i], 0x20, RT_MEL-1); - sprintf(RTP_Title, "---"); - sprintf(RTP_Artist, "---"); - RTP_Starttime = time(NULL); - // - RDS_PSShow = false; - RDS_PSIndex = 0; - for (int i = 0; i < 12; i++) - memset(RDS_PSText[i], 0x20, 8); - } - - // ...Memory - rtp_content.start = time(NULL); - rtp_content.item_New = false; - rtp_content.rt_Index = -1; - rtp_content.item_Index = -1; - rtp_content.info_StockIndex = -1; - rtp_content.info_SportIndex = -1; - rtp_content.info_LotteryIndex = -1; - rtp_content.info_WeatherIndex = -1; - rtp_content.info_OtherIndex = -1; - - for (int i = 0; i < MAX_RTPC; i++) { - rtp_content.radiotext[i] = NULL; - rtp_content.radiotext[MAX_RTPC+i] = NULL; - rtp_content.item_Title[i] = NULL; - rtp_content.item_Artist[i] = NULL; - rtp_content.info_Stock[i] = NULL; - rtp_content.info_Sport[i] = NULL; - rtp_content.info_Lottery[i] = NULL; - rtp_content.info_Weather[i] = NULL; - rtp_content.info_Other[i] = NULL; - } - - rtp_content.info_News = NULL; - rtp_content.info_NewsLocal = NULL; - rtp_content.info_DateTime = NULL; - rtp_content.info_Traffic = NULL; - rtp_content.info_Alarm = NULL; - rtp_content.info_Advert = NULL; - rtp_content.info_Url = NULL; - rtp_content.prog_Station = NULL; - rtp_content.prog_Now = NULL; - rtp_content.prog_Next = NULL; - rtp_content.prog_Part = NULL; - rtp_content.prog_Host = NULL; - rtp_content.prog_EditStaff = NULL; - rtp_content.prog_Homepage = NULL; - rtp_content.phone_Hotline = NULL; - rtp_content.phone_Studio = NULL; - rtp_content.email_Hotline = NULL; - rtp_content.email_Studio = NULL; - - // Rass init - Rass_Show = Rass_Archiv = -1; - for (int i = 0; i <= 10; i++) { - for (int ii = 0; ii < 4; ii++) - Rass_Flags[i][ii] = false; - } - Rass_GalStart = Rass_GalEnd = Rass_GalCount = 0; - for (int i = 0; i < RASS_GALMAX; i++) - Rass_Gallery[i] = false; - Rass_SlideFoto = 99; - - if (S_RtFunc < 1) return; - - // RDS-Receiver for seperate Data-PIDs, only Livemode, hardcoded Astra_19E + Hotbird 13E - int pid = 0; - if (!replay) { - switch (chan->Tid()) { - case 1113: - switch (pid = chan->Apid(0)) { // Astra_19.2E - 12633 GHz - /* case 0x161: pid = 0x229; // radio top40 - break; */ - case 0x400: // Hitradio FFH - case 0x406: // planet radio - case 0x40c: pid += 1; // harmony.ffm - break; - default: return; - } - break; - case 1115: - switch (pid = chan->Apid(0)) { // Astra_19.2E - 12663 GHz - case 0x1bA: pid = 0x21e; // TruckRadio, only NaviData(0xbf) seen - break; - default: return; - } - break; - case 5300: - switch (pid = chan->Apid(0)) { // Hotbird_13E - 11747 GHz, no Radiotext @ moment, only TMC + MECs 25/26 - case 0xdc3: // Radio 1 - case 0xdd3: // Radio 3 - case 0xddb: // Radio 5 - case 0xde3: // Radio Exterior - case 0xdeb: pid += 1; // Radio 4 - break; - default: return; - } - break; - default: return; - } - RDSReceiver = new cRDSReceiver(pid); - rdsdevice = cDevice::ActualDevice(); - rdsdevice->AttachReceiver(RDSReceiver); - } -} - -void cRadioAudio::DisableRadioTextProcessing() -{ - RT_Replay = enabled = false; - - // Radiotext & Rass - RT_Info = -1; - RT_ReOpen = false; - Rass_Show = Rass_Archiv = -1; - Rass_GalStart = Rass_GalEnd = Rass_GalCount = 0; - - if (RadioTextOsd != NULL) - RadioTextOsd->Hide(); - - if (RDSReceiver != NULL) { - rdsdevice->Detach(RDSReceiver); - delete RDSReceiver; - RDSReceiver = NULL; - rdsdevice = NULL; - } -} - - -// --- cRadioTextOsd ------------------------------------------------------ - -cBitmap cRadioTextOsd::rds(rds_xpm); -cBitmap cRadioTextOsd::arec(arec_xpm); -cBitmap cRadioTextOsd::rass(rass_xpm); -cBitmap cRadioTextOsd::index(index_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() -{ - RadioTextOsd = this; - osd = NULL; - qosd = NULL; - rtclosed = rassclosed = false; - RT_ReOpen = false; -} - -cRadioTextOsd::~cRadioTextOsd() -{ - if (Rass_Archiv >= 0) { - if (!RT_Replay) - Rass_Archiv = RassImage(-1, -1, false); - else { - Rass_Archiv = -1; - RadioAudio->SetBackgroundImage(ReplayFile); - } - } - - if (osd != NULL) - delete osd; - if (qosd != NULL) - delete qosd; - RadioTextOsd = NULL; - RT_ReOpen = !RT_OsdTO; - - cRemote::Put(LastKey); -} - -void cRadioTextOsd::Show(void) -{ - LastKey = kNone; - RT_OsdTO = false; -#ifndef VDRP_CLOSEMENU - osdtimer.Set(); -#endif - - ftitel = cFont::GetFont(fontOsd); - ftext = cFont::GetFont(fontSml); - fheight = ftext->Height() + 4; - int rowoffset = (S_RtOsdTitle == 1) ? 1 : 0; - bheight = (S_RtOsdTags >=1 ) ? fheight * (S_RtOsdRows+rowoffset+2) : fheight * (S_RtOsdRows+rowoffset); - (S_RtOsdTitle == 1) ? bheight += 20 : bheight += 12; - - asprintf(&RTp_Titel, "%s - %s", tr("RTplus"), RT_Titel); - - if (S_RtDispl >= 1 && (Rass_Show == -1 || S_RassText >= 2)) { - RT_MsgShow = (RT_Info >= 1); - ShowText(); - } -} - -void cRadioTextOsd::Hide(void) -{ - RTOsdClose(); - RassOsdClose(); -} - -void cRadioTextOsd::RTOsdClose(void) -{ - if (osd != NULL) { - delete osd; - osd = NULL; - } -} -#endif - -#if ENABLE_RASS -int CRadioText::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) - if ((QArchiv % (i==3 ? 1000 : i==2 ? 100 : i==1 ? 10 : 1)) == 0) - break; - } - - if (i > 0) { - --i; - QArchiv += QKey * (int) (i==3 ? 1000 : i==2 ? 100 : i==1 ? 10 : 1); - } - else - 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); -// Houdini: SetBackgroundImage() does not accept mpg stills -// frameBuffer->useBackground(frameBuffer->loadBackground(image));// set useBackground true or false -// frameBuffer->paintBackground(); -// RadioAudio->SetBackgroundImage(image); - free(image); - - return QArchiv; -} -#endif - -#if 0 -void cRadioTextOsd::RassOsd(void) -{ - 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->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); - - // 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-2, 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) -{ - 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->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->DrawText(5, 29+4, tr("Records"), fcolor, clrTransparent, ftext, 97, fh); - qosd->DrawText(5, 29+fh+4, tr("with <0>"), fcolor, clrTransparent, ftext, 97, fh); - qosd->Flush(); - } -} - -void cRadioTextOsd::RassOsdClose(void) -{ - if (qosd != NULL) { - delete qosd; - qosd = NULL; - } -} - -void cRadioTextOsd::RassImgSave(char *size, int pos) -{ - char *infile, *outfile, *cmd; - int filenr = 0, error = 0; - struct tm *ts, tm_store; - 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>>> RTplus-Memoryclasses @ %s", 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_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.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 >= 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; - RadioAudio->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 ... -#ifndef VDRP_CLOSEMENU - else if (S_RtOsdTO > 0 && osdtimer.Elapsed()/1000/60 >= (uint)S_RtOsdTO) { - RT_OsdTO = true; - Hide(); - return osEnd; - } -#endif - else if (Rass_Archiv >= 0) - RassOsd(); - else if (RT_MsgShow && !rtclosed && (Rass_Show == -1 || S_RassText >= 2 || rassclosed)) { - 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) -{ - 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", 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_Station != NULL) { - snprintf(text, sizeof(text), "\t%s:\t%s", tr("Station"), 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"), 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"), 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"), 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"), 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"), 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"), 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"), 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"), rtp_content.phone_Studio); - Add(new cOsdItem(hk(text))); - } - if (rtp_content.email_Hotline != NULL) { - snprintf(text, sizeof(text), "\t%s:\t%s", tr("Email-Hotline"), 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"), 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"), 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"), 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"), 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"), 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"), 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"), 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"), 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; - - time_t t = time(NULL); - ts = localtime_r(&t, &tm_store); - asprintf(&fname, "RTplus_%s_%04d-%02d-%02d.%02d.%02d", 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, ">>> RTplus-Memoryclasses @ %s", 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_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.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", tr("RTplus-File saved"), fname); - Skins.Message(mtInfo, infotext, Setup.OSDMessageTime); - free(infotext); - } - else - printfesyslog("ERROR vdr-radio: 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) -{ - 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; - - 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, 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, 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(text, sizeof(text), "%02d:%02d\t%s\t\t%s", ts->tm_hour, ts->tm_min, rtp_content.item_Title[i], 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(text, sizeof(text), "%02d:%02d\t%s\t\t%s", ts->tm_hour, ts->tm_min, rtp_content.item_Title[i], 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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 ----------------------------------------------------------------- -#endif - CRadioText::CRadioText(void) { pid = 0; @@ -2337,11 +702,6 @@ void CRadioText::init() RT_Text[i][0] = 0; RDS_PTYN[0] = 0; -#if ENABLE_RASS - // Rass ... - Rass_Show = -1; // -1=No, 0=Yes, 1=display - Rass_Archiv = -1; // -1=Off, 0=Index, 1000-9990=Slidenr. -#endif RT_MsgShow = false; // clear entries from old channel have_radiotext = false; } diff --git a/src/driver/radiotext.h b/src/driver/radiotext.h index d5758e48d..60aeaf266 100644 --- a/src/driver/radiotext.h +++ b/src/driver/radiotext.h @@ -46,21 +46,10 @@ #ifndef __RADIO_AUDIO_H #define __RADIO_AUDIO_H -#if 0 -#include -#include -#include -#include -#include -#include -#endif - #include #include #include -//#define ENABLE_RASS - typedef unsigned char uchar; typedef unsigned int uint; @@ -68,22 +57,6 @@ extern const char *ConfigDir; extern const char *DataDir; extern char *ReplayFile; - -#if 0 -// RDS-Receiver for seperate Data-Pids -class cRDSReceiver : public cReceiver { -private: - int pid; - bool rt_start; - bool rt_bstuff; -protected: - virtual void Receive(uchar *Data, int Length); -public: - cRDSReceiver(int Pid); - virtual ~cRDSReceiver(void); -}; -#endif - #define RT_MEL 65 #define tr(a) a @@ -101,18 +74,10 @@ private: int first_packets; //Radiotext -#if 0 -// cDevice *rdsdevice; - void RadiotextCheckPES(const uchar *Data, int Length); - void AudioRecorderService(void); -#endif void RadioStatusMsg(void); - void RassDecode(uchar *Data, int Length); bool DividePes(unsigned char *data, int length, int *substart, int *subend); uint pid; - //pthread_t threadRT; - //int dmxfd; OpenThreads::Mutex mutex; OpenThreads::Mutex pidmutex; @@ -125,7 +90,6 @@ public: CRadioText(void); ~CRadioText(void); int PES_Receive(unsigned char *data, int len); - int RassImage(int QArchiv, int QKey, bool DirUp); void EnableRadioTextProcessing(const char *Titel, bool replay = false); void DisableRadioTextProcessing(); void RadiotextDecode(uchar *Data, int Length); @@ -156,9 +120,7 @@ public: int S_RtBgTra; int S_RtFgCol; int S_RtDispl; - int S_RassText; int S_RtMsgItems; -// uint32_t rt_color[9]; int S_Verbose; // Radiotext @@ -173,80 +135,8 @@ public: int RT_OsdTOTemp; char RDS_PTYN[9]; char *RT_Titel, *RTp_Titel; - -#if ENABLE_RASS - // Rass ... - int Rass_Show; // -1=No, 0=Yes, 1=display - int Rass_Archiv; // -1=Off, 0=Index, 1000-9990=Slidenr. - bool Rass_Flags[11][4]; // Slides+Gallery existent -#endif - }; -#if 0 -class cRadioTextOsd : public cOsdObject { -private: - cOsd *osd; - cOsd *qosd; - cOsd *qiosd; - const cFont *ftitel; - const cFont *ftext; - int fheight; - int bheight; - eKeys LastKey; - cTimeMs osdtimer; - void rtp_print(void); - bool rtclosed; - bool rassclosed; - static cBitmap rds, arec, rass; - static cBitmap index, marker, page1, pages2, pages3, pages4, pageE; - static cBitmap no0, no1, no2, no3, no4, no5, no6, no7, no8, no9, bok; -public: - cRadioTextOsd(); - ~cRadioTextOsd(); - virtual void Hide(void); - virtual void Show(void); - virtual void ShowText(void); - virtual 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(char *size, int pos); - virtual eOSState ProcessKey(eKeys Key); - virtual bool IsInteractive(void) { return false; } -}; - -class cRTplusOsd : public cOsdMenu { -private: - int bcount; - int helpmode; - const char *listtyp[7]; - char *btext[7]; - int rtptyp(char *btext); - void rtp_fileprint(void); -public: - cRTplusOsd(void); - virtual ~cRTplusOsd(); - virtual void Load(void); - virtual void Update(void); - virtual eOSState ProcessKey(eKeys Key); -}; - -class cRTplusList : public cOsdMenu { -private: - int typ; - bool refresh; -public: - cRTplusList(int Typ = 0); - ~cRTplusList(); - virtual void Load(void); - virtual void Update(void); - virtual eOSState ProcessKey(eKeys Key); -}; - -#endif - // Radiotext-Memory #define MAX_RTPC 50 struct rtp_classes { diff --git a/src/driver/radiotools.cpp b/src/driver/radiotools.cpp index 64449b238..f0be42bc9 100644 --- a/src/driver/radiotools.cpp +++ b/src/driver/radiotools.cpp @@ -26,19 +26,8 @@ #include #include -/* for timetest */ -//#include -//#include unsigned short crc16_ccitt(unsigned char *daten, int len, bool skipfirst) { -/* timetest */ -//struct timeval t; -//unsigned long long tstart = 0; -//if (gettimeofday(&t, NULL) == 0) -// tstart = t.tv_sec*1000000 + t.tv_usec; - - // CRC16-CCITT: x^16 + x^12 + x^5 + 1 - // with start 0xffff and result invers register unsigned short crc = 0xffff; if (skipfirst) daten++; @@ -50,10 +39,6 @@ unsigned short crc16_ccitt(unsigned char *daten, int len, bool skipfirst) crc ^= ((crc & 0xff) << 4) << 1; } -/* timetest */ -//if (tstart > 0 && gettimeofday(&t, NULL) == 0) -// printf("vdr-radio: crc-calctime = %d usec\n", (int)((t.tv_sec*1000000 + t.tv_usec) - tstart)); - return ~(crc); } @@ -72,30 +57,3 @@ cTimeMs::cTimeMs(void) { Set(); } - -#if 0 -uint64_t cTimeMs::Now(void) -{ - struct timeval t; - if (gettimeofday(&t, NULL) == 0) - return (uint64_t(t.tv_sec)) * 1000 + t.tv_usec / 1000; - return 0; -} - -void cTimeMs::Set(int Ms) -{ - begin = Now() + Ms; -} - -bool cTimeMs::TimedOut(void) -{ - return Now() >= begin; -} - -uint64_t cTimeMs::Elapsed(void) -{ - return Now() - begin; -} - -#endif -//--------------- End ----------------------------------------------------------------- diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 3efe87157..ab21bdc5d 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1479,26 +1479,6 @@ void CInfoViewer::showRadiotext() } // yoff = 17; ii = 1; -#if 0 - // 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 { - 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); - } -#endif } // Body if (lines) { @@ -1523,48 +1503,7 @@ void CInfoViewer::showRadiotext() g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rts_x, rts_y + (ii++)*rt_dy, rts_dx, g_Radiotext->RT_Text[i], COL_INFOBAR_TEXT, 0, RTisIsUTF); } } -#if 0 - // + 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 %s", tr("Title :"), RTP_Title); - sprintf(stext[2], "> %s %s", tr("Artist :"), RTP_Artist); - osd->DrawText(4, 6+yoff+fheight*(ii++), stext[1], fcolor, clrTransparent, ftext, Setup.OSDWidth-4, ftext->Height()); - osd->DrawText(4, 3+yoff+fheight*(ii++), stext[2], fcolor, clrTransparent, ftext, Setup.OSDWidth-4, ftext->Height()); - } - else { - char *temp = ""; - 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); - } - } -#endif } -#if 0 -// framebuffer can only display raw images - // show mpeg-still - char *image; - if (g_Radiotext->Rass_Archiv >= 0) - asprintf(&image, "%s/Rass_%d.mpg", DataDir, g_Radiotext->Rass_Archiv); - else - asprintf(&image, "%s/Rass_show.mpg", DataDir); - frameBuffer->useBackground(frameBuffer->loadBackground(image));// set useBackground true or false - frameBuffer->paintBackground(); -// RadioAudio->SetBackgroundImage(image); - free(image); -#endif } g_Radiotext->RT_MsgShow = false;