From 9415909c8ec4dddf2eb5246cd67f183da813ffbc Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Tue, 29 Jan 2013 21:01:35 +0100 Subject: [PATCH 01/86] getservices: add FindChannelFuzzy() function Add a function that returns a channel if tsid, onid, sid and satellite position matches and the frequency matches +-2MHz. (This frequency tolerance allows ubouquets to be used after updates to satellites.xml) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/536484f698ea94e4049abd31945ff8854fa5cb84 Author: Stefan Seyfried Date: 2013-01-29 (Tue, 29 Jan 2013) ------------------ This commit was generated by Migit --- src/zapit/include/zapit/getservices.h | 2 ++ src/zapit/src/getservices.cpp | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/zapit/include/zapit/getservices.h b/src/zapit/include/zapit/getservices.h index 7783bcfbb..0233b9016 100644 --- a/src/zapit/include/zapit/getservices.h +++ b/src/zapit/include/zapit/getservices.h @@ -128,6 +128,8 @@ class CServiceManager CZapitChannel* FindChannelByName(std::string name); CZapitChannel* FindCurrentChannel(const t_channel_id channel_id); CZapitChannel* FindChannel48(const t_channel_id channel_id); + CZapitChannel* FindChannelFuzzy(const t_channel_id channel_id, + const t_satellite_position pos, const freq_id_t freq); std::string GetServiceName(t_channel_id channel_id); diff --git a/src/zapit/src/getservices.cpp b/src/zapit/src/getservices.cpp index 0aa479238..693da3522 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -3,6 +3,8 @@ * * (C) 2002, 2003 by Andreas Oberritter * + * (C) 2007-2009, 2013 Stefan Seyfried + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -220,6 +222,18 @@ CZapitChannel * CServiceManager::FindChannel48(const t_channel_id channel_id) return NULL; } +CZapitChannel* CServiceManager::FindChannelFuzzy(const t_channel_id channel_id, + const t_satellite_position pos, const freq_id_t freq) +{ + CZapitChannel *ret; + ret = FindChannel48(channel_id); + if (!ret || !(pos == ret->getSatellitePosition())) + return NULL; + if (abs((int)ret->getFreqId() - (int)freq) < 3) + return ret; + return NULL; +} + bool CServiceManager::GetAllRadioChannels(ZapitChannelList &list, int flags) { list.clear(); From 091694a83a09f052c8b79618d30a4a6f864c7ded Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Tue, 29 Jan 2013 21:05:53 +0100 Subject: [PATCH 02/86] bouquets: fix ubouquet generation for broken services Services with duplicate tsid/onid/sid like found e.g. on "8W Atlantic Bird 2", "12.5W Atlantic Bird 1", "4.8E Sirius", "7E Eutelsat" caused wrong bouquet entries because the satellite position and transponder frequency was not used to distinguish the channels. Use the new FindChannelFuzzy() function to fix this. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/70b3ef04f92d7f6f2d65ed7eab934beefcbe0af0 Author: Stefan Seyfried Date: 2013-01-29 (Tue, 29 Jan 2013) Origin message was: ------------------ bouquets: fix ubouquet generation for broken services Services with duplicate tsid/onid/sid like found e.g. on "8W Atlantic Bird 2", "12.5W Atlantic Bird 1", "4.8E Sirius", "7E Eutelsat" caused wrong bouquet entries because the satellite position and transponder frequency was not used to distinguish the channels. Use the new FindChannelFuzzy() function to fix this. ------------------ This commit was generated by Migit --- src/zapit/src/bouquets.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/zapit/src/bouquets.cpp b/src/zapit/src/bouquets.cpp index 8a74c0a8f..f6f40259d 100644 --- a/src/zapit/src/bouquets.cpp +++ b/src/zapit/src/bouquets.cpp @@ -7,6 +7,8 @@ * rasc , * thegoodguy * + * (C) 2009, 2011, 2013 Stefan Seyfried + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -363,10 +365,11 @@ void CBouquetManager::parseBouquetsXml(const char *fname, bool bUser) freq = freq/1000; CZapitChannel* chan; + t_channel_id chid = CREATE_CHANNEL_ID64; if(bUser) - chan = CServiceManager::getInstance()->FindChannel48(CREATE_CHANNEL_ID64); + chan = CServiceManager::getInstance()->FindChannelFuzzy(chid, satellitePosition, freq); else - chan = CServiceManager::getInstance()->FindChannel(CREATE_CHANNEL_ID64); + chan = CServiceManager::getInstance()->FindChannel(chid); if (chan != NULL) { DBG("%04x %04x %04x %s\n", transport_stream_id, original_network_id, service_id, xmlGetAttribute(channel_node, "n")); #if 0 From 263340cd22bf529d63d043ed2d8a939bf2c4a729 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Wed, 30 Jan 2013 02:14:50 +0100 Subject: [PATCH 03/86] add optional mini-tv to channellist Signed-off-by: satbaby Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1a425308ed89af5e65a425583a6c568c003e23ee Author: TangoCash Date: 2013-01-30 (Wed, 30 Jan 2013) ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 160 +- src/gui/channellist.cpp.rej | 27 + src/gui/channellist.cpp~ | 2160 +++++++++++++++++++ src/gui/channellist.h | 9 + src/gui/osd_setup.cpp | 5 + src/neutrino.cpp | 2 + src/neutrino.cpp.rej | 9 + src/neutrino.cpp~ | 3881 +++++++++++++++++++++++++++++++++++ src/system/locals.h | 2 + src/system/locals_intern.h | 2 + src/system/settings.h | 1 + 11 files changed, 6240 insertions(+), 18 deletions(-) create mode 100644 src/gui/channellist.cpp.rej create mode 100644 src/gui/channellist.cpp~ create mode 100644 src/neutrino.cpp.rej create mode 100644 src/neutrino.cpp~ diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index eaf0a8bfb..703247ef4 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -73,6 +73,8 @@ #include +#include + extern CBouquetList * bouquetList; /* neutrino.cpp */ extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ extern CPictureViewer * g_PicViewer; @@ -90,6 +92,8 @@ extern bool autoshift; extern CBouquetManager *g_bouquetManager; extern int old_b_id; +extern cVideo * videoDecoder; + CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vlist, bool ) { frameBuffer = CFrameBuffer::getInstance(); @@ -460,7 +464,12 @@ void CChannelList::calcSize() const int pic_h = 39; int fw = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth(); width = w_max (((g_settings.channellist_extended)?(frameBuffer->getScreenWidth() / 20 * (fw+6)):(frameBuffer->getScreenWidth() / 20 * (fw+5))), 100); + widthDetails = width; + if (g_settings.channellist_minitv) + widthDetails = frameBuffer->getScreenWidth() - frameBuffer->getScreenX(); height = h_max ((frameBuffer->getScreenHeight() / 20 * 16), (frameBuffer->getScreenHeight() / 20 * 2)); + if (g_settings.channellist_minitv) + height = h_max ((frameBuffer->getScreenHeight() / 20 * 18), 0); CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, name.c_str()); @@ -492,8 +501,22 @@ void CChannelList::calcSize() height = theight + footerHeight + listmaxshow * fheight; info_height = 2*fheight + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getHeight() + 10; + if (g_settings.channellist_minitv) + { + width = frameBuffer->getScreenWidth() / 3 * 2; + x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - widthDetails) / 2; + y = frameBuffer->getScreenY(); + pig_width = widthDetails / 3 - 16; + pig_height = pig_width / 16 * 9; + + infozone_width = pig_width - 8; + infozone_height = height - theight - pig_height; + } + else + { x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2; y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - (height+ info_height)) / 2; + } } bool CChannelList::updateSelection(int newpos) @@ -545,6 +568,11 @@ int CChannelList::show() COSDFader fader(g_settings.menu_Content_alpha); fader.StartFadeIn(); + if (g_settings.channellist_minitv) + { + frameBuffer->paintBoxRel(x,y,widthDetails,height + info_height,COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_ALL); + } + paintHead(); paint(); @@ -876,7 +904,12 @@ int CChannelList::show() void CChannelList::hide() { - frameBuffer->paintBackgroundBoxRel(x, y, width, height+ info_height+ 5); + if (g_settings.channellist_minitv) + { + widthDetails = frameBuffer->getScreenWidth() - frameBuffer->getScreenX(); + videoDecoder->Pig(-1, -1, -1, -1); + } + frameBuffer->paintBackgroundBoxRel(x, y, widthDetails, height+ info_height+ 5); clearItem2DetailsLine(); } @@ -1465,7 +1498,7 @@ void CChannelList::paintDetails(int index) p_event = &chanlist[index]->currentEvent; } - frameBuffer->paintBoxRel(x+2, y + height + 2, width-4, info_height - 4, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE);//round + frameBuffer->paintBoxRel(x+2, y + height + 2, widthDetails-4, info_height - 4, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE);//round if (!p_event->description.empty()) { char cNoch[50] = {0}; // UTF-8 @@ -1489,7 +1522,7 @@ void CChannelList::paintDetails(int index) std::string text2= p_event->text; int xstart = 10; - if (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1, true) > (width - 30 - seit_len) ) + if (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1, true) > (widthDetails - 30 - seit_len) ) { // zu breit, Umbruch versuchen... int pos; @@ -1497,7 +1530,7 @@ void CChannelList::paintDetails(int index) pos = text1.find_last_of("[ -.]+"); if ( pos!=-1 ) text1 = text1.substr( 0, pos ); - } while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1, true) > (width - 30 - seit_len) ) ); + } while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1, true) > (widthDetails - 30 - seit_len) ) ); std::string text3 = ""; /* not perfect, but better than crashing... */ if (p_event->description.length() > text1.length()) @@ -1507,7 +1540,7 @@ void CChannelList::paintDetails(int index) text3= text3+ " - "; xstart += g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text3, true); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2* fheight, width - 30- noch_len, text3, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2* fheight, widthDetails - 30- noch_len, text3, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); } if (!(text2.empty())) { @@ -1516,7 +1549,7 @@ void CChannelList::paintDetails(int index) text2 = text2.substr( 0, text2.find('\n') ); #if 0 //FIXME: to discuss, eat too much cpu time if string long enough int pos = 0; - while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text2, true) > (width - 30 - noch_len) ) ) { + while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text2, true) > (widthDetails - 30 - noch_len) ) ) { pos = text2.find_last_of(" "); if ( pos!=-1 ) { @@ -1524,12 +1557,12 @@ void CChannelList::paintDetails(int index) } } #endif - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ xstart, y+ height+ 5+ 2* fheight, width- xstart- 30- noch_len, text2, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ xstart, y+ height+ 5+ 2* fheight, widthDetails- xstart- 30- noch_len, text2, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); } - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ fheight, width - 30 - seit_len, text1, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ width- 10- seit_len, y+ height+ 5+ fheight, seit_len, cSeit, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8 - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ width- 10- noch_len, y+ height+ 5+ 2* fheight, noch_len, cNoch, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ fheight, widthDetails - 30 - seit_len, text1, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ widthDetails- 10- seit_len, y+ height+ 5+ fheight, seit_len, cSeit, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ widthDetails- 10- noch_len, y+ height+ 5+ 2* fheight, noch_len, cNoch, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8 } if(g_settings.channellist_foot == 0) { transponder t; @@ -1541,7 +1574,7 @@ void CChannelList::paintDetails(int index) else desc = desc + " (" + CServiceManager::getInstance()->GetSatelliteName(chanlist[index]->getSatellitePosition()) + ")"; - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 3*fheight, width - 30, desc.c_str(), COL_MENUCONTENTDARK, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 3*fheight, widthDetails - 30, desc.c_str(), COL_MENUCONTENTDARK, 0, true); } else if( !displayNext && g_settings.channellist_foot == 1) { // next Event char buf[128] = {0}; @@ -1554,10 +1587,12 @@ void CChannelList::paintDetails(int index) snprintf(buf, sizeof(buf), "%s", CurrentNext.next_name.c_str()); int from_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(cFrom, true); // UTF-8 - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 3*fheight, width - 30 - from_len, buf, colored_event_N ? COL_COLORED_EVENTS_CHANNELLIST :COL_MENUCONTENTDARK, 0, true); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ width- 10- from_len, y+ height+ 5+ 3*fheight, from_len, cFrom, colored_event_N ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 3*fheight, widthDetails - 30 - from_len, buf, colored_event_N ? COL_COLORED_EVENTS_CHANNELLIST :COL_MENUCONTENTDARK, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ widthDetails- 10- from_len, y+ height+ 5+ 3*fheight, from_len, cFrom, colored_event_N ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8 } } + if ((g_settings.channellist_minitv) && (p_event != NULL)) + paint_events(index); } void CChannelList::clearItem2DetailsLine() @@ -1575,7 +1610,6 @@ void CChannelList::paintItem2DetailsLine (int pos, int /*ch_index*/) int ypos1a = ypos1 + (fheight/2)-2; int ypos2a = ypos2 + (info_height/2)-2; fb_pixel_t col1 = COL_MENUCONTENT_PLUS_6; - // Clear frameBuffer->paintBackgroundBoxRel(xpos,y, ConnectLineBox_Width, height+info_height + 1); @@ -1588,13 +1622,15 @@ void CChannelList::paintItem2DetailsLine (int pos, int /*ch_index*/) details_line.paint(); //info box frame - frameBuffer->paintBoxFrame(x, ypos2, width, info_height, 2, col1, RADIUS_LARGE); + frameBuffer->paintBoxFrame(x, ypos2, widthDetails, info_height, 2, col1, RADIUS_LARGE); } } } void CChannelList::showChannelLogo() { + if (g_settings.channellist_minitv) + return; if(g_settings.infobar_show_channellogo){ static int logo_w = 0; static int logo_h = 0; @@ -1921,7 +1957,6 @@ void CChannelList::paintHead() char timestr[10] = {0}; time_t now = time(NULL); struct tm *tm = localtime(&now); - bool gotTime = g_Sectionsd->getIsTimeSet(); if(gotTime) { @@ -1936,7 +1971,7 @@ void CChannelList::paintHead() frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE, &iw3, &ih); // head - frameBuffer->paintBoxRel(x,y, width,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round + frameBuffer->paintBoxRel(x,y, widthDetails,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_INFO, x + width - iw1 - 4, y, theight); //y+ 5 ); frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MENU, x + width - iw1 - iw2 - 8, y, theight);//y + 5); // icon for bouquet list button @@ -1947,6 +1982,10 @@ void CChannelList::paintHead() if (gotTime) { int iw3x = (g_settings.channellist_new_zap_mode) ? iw3 : -4; + if (g_settings.channellist_minitv) + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + widthDetails - 16 -timestr_len, + y+theight, timestr_len, timestr, COL_MENUHEAD, 0, true); // UTF-8 + else g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + width - iw1 - iw2 - iw3x - 16 -timestr_len, y+theight, timestr_len, timestr, COL_MENUHEAD, 0, true); // UTF-8 timestr_len += 4; @@ -1956,11 +1995,16 @@ void CChannelList::paintHead() if (g_settings.channellist_new_zap_mode) timestr_len += iw3 + 4; logo_off = timestr_len + 4; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, width - timestr_len, name, COL_MENUHEAD, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, widthDetails - timestr_len, name, COL_MENUHEAD, 0, true); // UTF-8 } void CChannelList::paint() { + if (g_settings.channellist_minitv) + { + paint_pig(x+width, y+theight+1, pig_width, pig_height); + } + numwidth = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(MaxChanNr().c_str()); liststart = (selected/listmaxshow)*listmaxshow; @@ -2044,3 +2088,83 @@ std::string CChannelList::MaxChanNr() ss >> maxchansize; return maxchansize; } + +void CChannelList::paint_pig (int x, int y, int w, int h) +{ + frameBuffer->paintBackgroundBoxRel (x, y, w, h); + printf("CChannelList::paint_pig x %d y %d w %d h %d osd_w %d osd_w %d\n", x, y, w, h, frameBuffer->getScreenWidth(true), frameBuffer->getScreenHeight(true)); + videoDecoder->Pig(x, y, w, h, frameBuffer->getScreenWidth(true), frameBuffer->getScreenHeight(true)); +} + +void CChannelList::paint_events(int index) +{ + readEvents(chanlist[index]->channel_id); + frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUHEAD_PLUS_0); + char text1[10]; + CChannelEventList::iterator e; + time_t azeit; + time(&azeit); + int ffheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getHeight(); + + if ( evtlist.size() == 0 ) + { + CChannelEvent evt; + + evt.description = g_Locale->getText(LOCALE_EPGLIST_NOEVENTS); + evt.eventID = 0; + evtlist.push_back(evt); + + } + + int i=1; + for (e=evtlist.begin(); e!=evtlist.end(); ++e ) + { + //Remove events in the past + time_t dif = azeit - e->startTime; + if ( (dif > 0) && (!(e->eventID == 0))) + { + do + { + //printf("%d seconds in the past - deleted %s\n", dif, e->description.c_str()); + e = evtlist.erase(e); + dif = azeit - e->startTime; + } + while ( dif > 0 ); + } + //Display the remaining events + struct tm *tmStartZeit = localtime(&e->startTime); + strftime(text1, sizeof(text1), "%H:%M", tmStartZeit ); + //printf("%s %s\n", text1, e->description.c_str()); + int timewidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getRenderWidth(text1, true); + if ((y+ theight+ pig_height + i*ffheight) < (y+ height)) + { + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, timewidth, text1, COL_MENUCONTENTDARK, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5+timewidth+5, y+ theight+ pig_height + i*ffheight, infozone_width - timewidth - 20, e->description, COL_MENUCONTENTDARK, 0, true); + } + else break; + i++; + } + evtlist.clear(); +} + +static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& b) +{ + return a.startTime < b.startTime; +} + +void CChannelList::readEvents(const t_channel_id channel_id) +{ + CEitManager::getInstance()->getEventsServiceKey(channel_id , evtlist); + + if ( evtlist.empty() ) + { + CChannelEvent evt; + evt.description = g_Locale->getText(LOCALE_EPGLIST_NOEVENTS); + evt.eventID = 0; + evtlist.push_back(evt); + } + else + sort(evtlist.begin(),evtlist.end(),sortByDateTime); + + return; +} diff --git a/src/gui/channellist.cpp.rej b/src/gui/channellist.cpp.rej new file mode 100644 index 000000000..244e147aa --- /dev/null +++ b/src/gui/channellist.cpp.rej @@ -0,0 +1,27 @@ +diff a/src/gui/channellist.cpp b/src/gui/channellist.cpp (rejected hunks) +@@ -553,6 +576,11 @@ int CChannelList::show() + COSDFader fader(g_settings.menu_Content_alpha); + fader.StartFadeIn(); + ++ if (g_settings.channellist_minitv) ++ { ++ frameBuffer->paintBoxRel(x,y,widthDetails,height + info_height,COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_ALL); ++ } ++ + paintHead(); + paint(); + frameBuffer->blit(); +@@ -886,7 +914,12 @@ int CChannelList::show() + + void CChannelList::hide() + { +- frameBuffer->paintBackgroundBoxRel(x, y, width, height+ info_height+ 5); ++ if (g_settings.channellist_minitv) ++ { ++ widthDetails = frameBuffer->getScreenWidth() - frameBuffer->getScreenX(); ++ videoDecoder->Pig(-1, -1, -1, -1); ++ } ++ frameBuffer->paintBackgroundBoxRel(x, y, widthDetails, height+ info_height+ 5); + clearItem2DetailsLine(); + frameBuffer->blit(); + } diff --git a/src/gui/channellist.cpp~ b/src/gui/channellist.cpp~ new file mode 100644 index 000000000..7270ae3d8 --- /dev/null +++ b/src/gui/channellist.cpp~ @@ -0,0 +1,2160 @@ +/* + Neutrino-GUI - DBoxII-Project + + Copyright (C) 2001 Steffen Hehn 'McClean' + Homepage: http://dbox.cyberphoria.org/ + + Kommentar: + + Diese GUI wurde von Grund auf neu programmiert und sollte nun vom + Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert + auf der Client-Server Idee, diese GUI ist also von der direkten DBox- + Steuerung getrennt. Diese wird dann von Daemons uebernommen. + + + License: GPL + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif +#include + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include + +extern CBouquetList * bouquetList; /* neutrino.cpp */ +extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ +extern CPictureViewer * g_PicViewer; +extern CBouquetList * TVbouquetList; +extern CBouquetList * TVsatList; +extern CBouquetList * TVfavList; +extern CBouquetList * TVallList; +extern CBouquetList * RADIObouquetList; +extern CBouquetList * RADIOsatList; +extern CBouquetList * RADIOfavList; +extern CBouquetList * RADIOallList; + +extern bool autoshift; + +extern CBouquetManager *g_bouquetManager; +extern int old_b_id; + +extern cVideo * videoDecoder; + +CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vlist, bool ) +{ + frameBuffer = CFrameBuffer::getInstance(); + name = pName; + selected = 0; + selected_in_new_mode = 0; + liststart = 0; + tuned = 0xfffffff; + zapProtection = NULL; + this->historyMode = phistoryMode; + vlist = _vlist; + selected_chid = 0; + this->new_mode_active = false; + footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+6; //initial height value for buttonbar +//printf("************ NEW LIST %s : %x\n", name.c_str(), (int) this);fflush(stdout); +} + +CChannelList::~CChannelList() +{ +//printf("************ DELETE LIST %s : %x\n", name.c_str(), this);fflush(stdout); + chanlist.clear(); +} + +void CChannelList::ClearList(void) +{ +//printf("************ CLEAR LIST %s : %x\n", name.c_str(), this);fflush(stdout); + chanlist.clear(); + chanlist.resize(1); +} + +void CChannelList::setSize(int newsize) +{ + //chanlist.reserve(newsize); + chanlist.resize(newsize); +} + +void CChannelList::SetChannelList(ZapitChannelList* channels) +{ + chanlist = *channels; +} + +void CChannelList::addChannel(CZapitChannel* channel, int num) +{ +//printf("************ %s : addChannel: %s %x\n", name.c_str(), channel->getName().c_str(), channel);fflush(stdout); + if(num) + channel->number = num; + chanlist.push_back(channel); +} + +void CChannelList::putChannel(CZapitChannel* channel) +{ + int num = channel->number - 1; + if(num < 0) { + printf("%s error inserting at %d\n", __FUNCTION__, num); + return; + } + if(num >= (int) chanlist.size()) { + chanlist.resize((unsigned) num + 1); + } + chanlist[num] = channel; +//printf("************ %s : me %x putChannel: %d: %s %x -> %x [0] %x\n", name.c_str(), this, num, channel->getName().c_str(), channel, chanlist[num], chanlist[0]);fflush(stdout); +} + +/* uodate the events for the visible channel list entries + from = start entry, to = end entry. If both = zero, update all */ +void CChannelList::updateEvents(unsigned int from, unsigned int to) +{ + CChannelEventList events; + + if (to == 0 || to > chanlist.size()) + to = chanlist.size(); + + size_t chanlist_size = to - from; + if (chanlist_size <= 0) // WTF??? + return; + + if (displayNext) { + time_t atime = time(NULL); + unsigned int count; + for (count = from; count < to; count++) { + events.clear(); + CEitManager::getInstance()->getEventsServiceKey(chanlist[count]->channel_id, events); + chanlist[count]->nextEvent.startTime = (long)0x7fffffff; + for ( CChannelEventList::iterator e= events.begin(); e != events.end(); ++e ) { + if ((long)e->startTime > atime && + (e->startTime < (long)chanlist[count]->nextEvent.startTime)) + { + chanlist[count]->nextEvent = *e; + break; + } + } + } + } else { + t_channel_id *p_requested_channels; + p_requested_channels = new t_channel_id[chanlist_size]; + if (! p_requested_channels) { + fprintf(stderr,"%s:%d allocation failed!\n", __FUNCTION__, __LINE__); + return; + } + for (uint32_t count = 0; count < chanlist_size; count++) + p_requested_channels[count] = chanlist[count + from]->channel_id; + + CChannelEventList levents; + CEitManager::getInstance()->getChannelEvents(levents, p_requested_channels, chanlist_size); + for (uint32_t count=0; count < chanlist_size; count++) { + chanlist[count]->currentEvent = CChannelEvent(); + for (CChannelEventList::iterator e = levents.begin(); e != levents.end(); ++e) { + if ((chanlist[count + from]->channel_id&0xFFFFFFFFFFFFULL) == e->get_channel_id()) { + chanlist[count + from]->currentEvent = *e; + break; + } + } + } + delete[] p_requested_channels; + } + events.clear(); +} + +void CChannelList::SortAlpha(void) +{ + sort(chanlist.begin(), chanlist.end(), CmpChannelByChName()); +} + +void CChannelList::SortSat(void) +{ + sort(chanlist.begin(), chanlist.end(), CmpChannelBySat()); +} + +void CChannelList::SortTP(void) +{ + sort(chanlist.begin(), chanlist.end(), CmpChannelByFreq()); +} + +void CChannelList::SortChNumber(void) +{ + sort(chanlist.begin(), chanlist.end(), CmpChannelByChNum()); +} + +CZapitChannel* CChannelList::getChannel(int number) +{ + for (uint32_t i=0; i< chanlist.size(); i++) { + if (chanlist[i]->number == number) + return chanlist[i]; + } + return(NULL); +} + +CZapitChannel* CChannelList::getChannel(t_channel_id channel_id) +{ + for (uint32_t i=0; i< chanlist.size(); i++) { + if (chanlist[i]->channel_id == channel_id) + return chanlist[i]; + } + return(NULL); +} + +int CChannelList::getKey(int id) +{ + return chanlist[id]->number; +} + +static const std::string empty_string; + +const std::string CChannelList::getActiveChannelName(void) const +{ + if (selected < chanlist.size()) + return chanlist[selected]->getName(); + else + return empty_string; +} + +t_satellite_position CChannelList::getActiveSatellitePosition(void) const +{ + if (selected < chanlist.size()) + return chanlist[selected]->getSatellitePosition(); + else + return 0; +} + +t_channel_id CChannelList::getActiveChannel_ChannelID(void) const +{ + if (selected < chanlist.size()) { +//printf("CChannelList::getActiveChannel_ChannelID me %x selected = %d %llx\n", (int) this, selected, chanlist[selected]->channel_id); + return chanlist[selected]->channel_id; + } else + return 0; +} + +int CChannelList::getActiveChannelNumber(void) const +{ + //return (selected + 1); + if (selected < chanlist.size()) + return chanlist[selected]->number; + return 0; +} + +CZapitChannel * CChannelList::getActiveChannel(void) const +{ + static CZapitChannel channel("Channel not found", 0, 0, 0, 0); + if (selected < chanlist.size()) + return chanlist[selected]; + return &channel; +} + +int CChannelList::doChannelMenu(void) +{ + int i = 0; + int select = -1; + static int old_selected = 0; + char cnt[5]; + bool enabled = true; + + if(g_settings.minimode) + return 0; + + if(vlist) + { + enabled = false; + if(old_selected < 2)//FIXME take care if some items added before 0, 1 + old_selected = 2; + } + + CMenuWidget* menu = new CMenuWidget(LOCALE_CHANNELLIST_EDIT, NEUTRINO_ICON_SETTINGS); + menu->enableFade(false); + menu->enableSaveScreen(true); + CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select); + + snprintf(cnt, sizeof(cnt), "%d", i); + menu->addItem(new CMenuForwarder(LOCALE_BOUQUETEDITOR_DELETE, enabled, NULL, selector, cnt, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED), old_selected == i++); + snprintf(cnt, sizeof(cnt), "%d", i); + menu->addItem(new CMenuForwarder(LOCALE_BOUQUETEDITOR_MOVE, enabled, NULL, selector, cnt, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN), old_selected == i++); + snprintf(cnt, sizeof(cnt), "%d", i); + menu->addItem(new CMenuForwarder(LOCALE_EXTRA_ADD_TO_BOUQUET, true, NULL, selector, cnt, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW), old_selected == i++); + snprintf(cnt, sizeof(cnt), "%d", i); + menu->addItem(new CMenuForwarder(LOCALE_FAVORITES_MENUEADD, true, NULL, selector, cnt, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE), old_selected == i++); + snprintf(cnt, sizeof(cnt), "%d", i); + bool reset_enabled = chanlist[selected]->flags & CZapitChannel::NEW; + menu->addItem(new CMenuForwarder(LOCALE_CHANNELLIST_RESET_FLAGS, reset_enabled, NULL, selector, cnt, CRCInput::convertDigitToKey(0)), old_selected == i++); + snprintf(cnt, sizeof(cnt), "%d", i); + menu->addItem(new CMenuForwarder(LOCALE_MAINMENU_SETTINGS, true, NULL, selector, cnt, CRCInput::convertDigitToKey(0)), old_selected == i++); + menu->exec(NULL, ""); + delete menu; + delete selector; + + if(select >= 0) { + signed int bouquet_id = 0, old_bouquet_id = 0, new_bouquet_id = 0; + old_selected = select; + t_channel_id channel_id = chanlist[selected]->channel_id; + switch(select) { + case 0: { + hide(); + int result = ShowMsgUTF ( LOCALE_BOUQUETEDITOR_DELETE, g_Locale->getText(LOCALE_BOUQUETEDITOR_DELETE_QUESTION), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo ); + + if(result == CMessageBox::mbrYes) { + bouquet_id = bouquetList->getActiveBouquetNumber(); + /* FIXME if bouquet name not unique, this is bad, + * existsBouquet can find wrong bouquet */ + if(!strcmp(bouquetList->Bouquets[bouquet_id]->channelList->getName(), g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME))) + bouquet_id = g_bouquetManager->existsUBouquet(g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME), true); + else + bouquet_id = g_bouquetManager->existsBouquet(bouquetList->Bouquets[bouquet_id]->channelList->getName()); + + if (bouquet_id == -1) + return 0; + if(g_bouquetManager->existsChannelInBouquet(bouquet_id, channel_id)) { + g_bouquetManager->Bouquets[bouquet_id]->removeService(channel_id); + return 1; + } + } + break; + } + case 1: // move + old_bouquet_id = bouquetList->getActiveBouquetNumber(); + old_bouquet_id = g_bouquetManager->existsBouquet(bouquetList->Bouquets[old_bouquet_id]->channelList->getName()); + do { + new_bouquet_id = bouquetList->exec(false); + } while(new_bouquet_id == -3); + + hide(); + if(new_bouquet_id < 0) + return 0; + new_bouquet_id = g_bouquetManager->existsBouquet(bouquetList->Bouquets[new_bouquet_id]->channelList->getName()); + if ((new_bouquet_id == -1) || (new_bouquet_id == old_bouquet_id)) + return 0; + + if(!g_bouquetManager->existsChannelInBouquet(new_bouquet_id, channel_id)) { + CZapit::getInstance()->addChannelToBouquet(new_bouquet_id, channel_id); + } + if(g_bouquetManager->existsChannelInBouquet(old_bouquet_id, channel_id)) { + g_bouquetManager->Bouquets[old_bouquet_id]->removeService(channel_id); + } + return 1; + + break; + case 2: // add to + do { + bouquet_id = bouquetList->exec(false); + } while(bouquet_id == -3); + hide(); + if(bouquet_id < 0) + return 0; + + if(!strcmp(bouquetList->Bouquets[bouquet_id]->channelList->getName(), g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME))) + bouquet_id = g_bouquetManager->existsUBouquet(g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME), true); + else + bouquet_id = g_bouquetManager->existsBouquet(bouquetList->Bouquets[bouquet_id]->channelList->getName()); + + if (bouquet_id == -1) + return 0; + if(!g_bouquetManager->existsChannelInBouquet(bouquet_id, channel_id)) { + CZapit::getInstance()->addChannelToBouquet(bouquet_id, channel_id); + return 1; + } + break; + case 3: // add to my favorites + bouquet_id = g_bouquetManager->existsUBouquet(g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME), true); + if(bouquet_id == -1) { + g_bouquetManager->addBouquet(g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME), true); + bouquet_id = g_bouquetManager->existsUBouquet(g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME), true); + } + if(!g_bouquetManager->existsChannelInBouquet(bouquet_id, channel_id)) { + CZapit::getInstance()->addChannelToBouquet(bouquet_id, channel_id); + return 1; + } + + break; + case 4: // reset new + chanlist[selected]->flags &= ~CZapitChannel::NEW; + CServiceManager::getInstance()->SetServicesChanged(true); + /* if make_new_list == ON, signal to re-init services */ + if(g_settings.make_new_list) + return 1; + break; + case 5: // settings + { + COsdSetup osd_setup; + osd_setup.showContextChanlistMenu(); + //FIXME check font/options changed ? + hide(); + calcSize(); + } + break; + default: + break; + } + } + return 0; +} + +int CChannelList::exec() +{ + displayNext = 0; // always start with current events + int nNewChannel = show(); + if ( nNewChannel > -1 && nNewChannel < (int) chanlist.size()) { + if(this->historyMode && chanlist[nNewChannel]) { + int new_mode = CNeutrinoApp::getInstance()->channelList->getLastChannels().get_mode(chanlist[nNewChannel]->channel_id); + if(new_mode >= 0) + CNeutrinoApp::getInstance()->SetChannelMode(new_mode); + } + CNeutrinoApp::getInstance()->channelList->zapToChannel(chanlist[nNewChannel]); + } + + return nNewChannel; +} + +void CChannelList::calcSize() +{ + const int pic_h = 39; + int fw = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth(); + width = w_max (((g_settings.channellist_extended)?(frameBuffer->getScreenWidth() / 20 * (fw+6)):(frameBuffer->getScreenWidth() / 20 * (fw+5))), 100); + widthDetails = width; + if (g_settings.channellist_minitv) + widthDetails = frameBuffer->getScreenWidth() - frameBuffer->getScreenX(); + height = h_max ((frameBuffer->getScreenHeight() / 20 * 16), (frameBuffer->getScreenHeight() / 20 * 2)); + if (g_settings.channellist_minitv) + height = h_max ((frameBuffer->getScreenHeight() / 20 * 18), 0); + + CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, name.c_str()); + + /* assuming all color icons must have same size */ + int icol_w, icol_h; + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); + + theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + + theight = std::max(theight, pic_h); + + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_HELP, &icol_w, &icol_h); + theight = std::max(theight, icol_h); + + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MENU, &icol_w, &icol_h); + theight = std::max(theight, icol_h); + + if(g_settings.channellist_new_zap_mode) + { + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE, &icol_w, &icol_h); + theight = std::max(theight, icol_h); + } + + fheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight(); + if (fheight == 0) + fheight = 1; /* avoid crash on invalid font */ + + listmaxshow = (height - theight - footerHeight -0)/fheight; + height = theight + footerHeight + listmaxshow * fheight; + info_height = 2*fheight + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getHeight() + 10; + + if (g_settings.channellist_minitv) + { + width = frameBuffer->getScreenWidth() / 3 * 2; + x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - widthDetails) / 2; + y = frameBuffer->getScreenY(); + pig_width = widthDetails / 3 - 16; + pig_height = pig_width / 16 * 9; + + infozone_width = pig_width - 8; + infozone_height = height - theight - pig_height; + } + else + { + x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2; + y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - (height+ info_height)) / 2; + } +} + +bool CChannelList::updateSelection(int newpos) +{ + bool actzap = false; + if((int) selected != newpos) { + int prev_selected = selected; + unsigned int oldliststart = liststart; + + selected = newpos; + liststart = (selected/listmaxshow)*listmaxshow; + if (oldliststart != liststart) + paint(); + else { + paintItem(prev_selected - liststart); + paintItem(selected - liststart); + showChannelLogo(); + } + + if(this->new_mode_active && SameTP()) { + actzap = true; + zapTo(selected); + } + } + return actzap; +} + +#define CHANNEL_SMSKEY_TIMEOUT 800 +/* return: >= 0 to zap, -1 on cancel, -3 on list mode change, -4 list edited, -2 zap but no restore old list/chan ?? */ +int CChannelList::show() +{ + /* temporary debugging stuff */ + struct timeval t1, t2; + gettimeofday(&t1, NULL); + + neutrino_msg_t msg; + neutrino_msg_data_t data; + bool actzap = 0; + int res = -1; + if (chanlist.empty()) { + return res; + } + + this->new_mode_active = 0; + + calcSize(); + displayNext = false; + + COSDFader fader(g_settings.menu_Content_alpha); + fader.StartFadeIn(); + + paintHead(); + paint(); + + gettimeofday(&t2, NULL); + fprintf(stderr, "CChannelList::show(): %llu ms to paint channellist\n", + ((t2.tv_sec * 1000000ULL + t2.tv_usec) - (t1.tv_sec * 1000000ULL + t1.tv_usec)) / 1000ULL); + + int oldselected = selected; + int zapOnExit = false; + bool bShowBouquetList = false; + + uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); + + bool loop=true; + while (loop) { + g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd, true); + if ( msg <= CRCInput::RC_MaxRC ) + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); + + if((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetTimer())) { + if(fader.Fade()) { + loop = false; + } + } + else if ( ( msg == CRCInput::RC_timeout ) || ( msg == (neutrino_msg_t)g_settings.key_channelList_cancel) ) { + res = -1; + if(!actzap) { + selected = oldselected; + } + else { + res = -4; + selected = selected_in_new_mode; + } + if(fader.StartFadeOut()) { + timeoutEnd = CRCInput::calcTimeoutEnd( 1 ); + msg = 0; + } else + loop=false; + } + else if( msg == CRCInput::RC_record) { //start direct recording from channellist +#if 0 + if(!CRecordManager::getInstance()->RecordingStatus(chanlist[selected]->channel_id)) + { + printf("[neutrino channellist] start direct recording...\n"); + hide(); + if (CRecordManager::getInstance()->Record(chanlist[selected]->channel_id)) + { + if(SameTP()) + { + zapOnExit = true; + loop=false; + } + else + DisplayInfoMessage(g_Locale->getText(LOCALE_CHANNELLIST_RECORDING_NOT_POSSIBLE)); // UTF-8 + } + + } +#endif + if(SameTP()) { + printf("[neutrino channellist] start direct recording...\n"); + hide(); + if (!CRecordManager::getInstance()->Record(chanlist[selected]->channel_id)) { + paintHead(); + paint(); + } else + loop=false; + + } + } + else if( msg == CRCInput::RC_stop ) { //stopp recording + if(CRecordManager::getInstance()->RecordingStatus(chanlist[selected]->channel_id)) + { + if (CRecordManager::getInstance()->AskToStop(chanlist[selected]->channel_id)) + { + CRecordManager::getInstance()->Stop(chanlist[selected]->channel_id); + paint(); + } + } + } + else if ((msg == CRCInput::RC_red) || (msg == CRCInput::RC_epg)) { + hide(); + + /* RETURN_EXIT_ALL on FAV/SAT buttons or messages_return::cancel_all from CNeutrinoApp::getInstance()->handleMsg() */ + if ( g_EventList->exec(chanlist[selected]->channel_id, chanlist[selected]->getName()) == menu_return::RETURN_EXIT_ALL) { + res = -2; + loop = false; + } else { + paintHead(); + paint(); + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); + } + } + else if (msg == CRCInput::RC_yellow) { + bShowBouquetList = true; + loop=false; + } + else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) { + g_RCInput->postMsg (msg, 0); + loop = false; + res = -1; + } + else if ( msg == CRCInput::RC_setup) { + old_b_id = bouquetList->getActiveBouquetNumber(); + fader.Stop(); + CNeutrinoApp::getInstance()->g_channel_list_changed = doChannelMenu(); + if(CNeutrinoApp::getInstance()->g_channel_list_changed) { + res = -4; + loop = false; + } else { + old_b_id = -1; + paintHead(); + paint(); + } + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); + } + else if (msg == (neutrino_msg_t) g_settings.key_list_start) { + actzap = updateSelection(0); + } + else if (msg == (neutrino_msg_t) g_settings.key_list_end) { + actzap = updateSelection(chanlist.size()-1); + } + else if (msg == CRCInput::RC_up || (int) msg == g_settings.key_channelList_pageup) + { + int step = ((int) msg == g_settings.key_channelList_pageup) ? listmaxshow : 1; // browse or step 1 + int new_selected = selected - step; + if (new_selected < 0) { + if (selected != 0 && step != 1) + new_selected = 0; + else + new_selected = chanlist.size() - 1; + } + actzap = updateSelection(new_selected); + } + else if (msg == CRCInput::RC_down || (int) msg == g_settings.key_channelList_pagedown) + { + int step = ((int) msg == g_settings.key_channelList_pagedown) ? listmaxshow : 1; // browse or step 1 + int new_selected = selected + step; + if (new_selected >= (int) chanlist.size()) { + if ((chanlist.size() - listmaxshow -1 < selected) && (selected != (chanlist.size() - 1)) && (step != 1)) + new_selected = chanlist.size() - 1; + else if (((chanlist.size() / listmaxshow) + 1) * listmaxshow == chanlist.size() + listmaxshow) // last page has full entries + new_selected = 0; + else + new_selected = ((step == (int) listmaxshow) && (new_selected < (int) (((chanlist.size() / listmaxshow)+1) * listmaxshow))) ? (chanlist.size() - 1) : 0; + } + actzap = updateSelection(new_selected); + } + else if (msg == (neutrino_msg_t)g_settings.key_bouquet_up) { + if (!bouquetList->Bouquets.empty()) { + bool found = true; + uint32_t nNext = (bouquetList->getActiveBouquetNumber()+1) % bouquetList->Bouquets.size(); + if(bouquetList->Bouquets[nNext]->channelList->isEmpty() ) { + found = false; + nNext = nNext < bouquetList->Bouquets.size()-1 ? nNext+1 : 0; + for(uint32_t i = nNext; i < bouquetList->Bouquets.size(); i++) { + if( !bouquetList->Bouquets[i]->channelList->isEmpty() ) { + found = true; + nNext = i; + break; + } + } + } + if(found) { + bouquetList->activateBouquet(nNext, false); + res = bouquetList->showChannelList(); + loop = false; + } + } + } + else if (msg == (neutrino_msg_t)g_settings.key_bouquet_down) { + if (!bouquetList->Bouquets.empty()) { + bool found = true; + int nNext = (bouquetList->getActiveBouquetNumber()+bouquetList->Bouquets.size()-1) % bouquetList->Bouquets.size(); + if(bouquetList->Bouquets[nNext]->channelList->isEmpty() ) { + found = false; + nNext = nNext > 0 ? nNext-1 : bouquetList->Bouquets.size()-1; + for(int i = nNext; i > 0; i--) { + if(!bouquetList->Bouquets[i]->channelList->isEmpty()) { + found = true; + nNext = i; + break; + } + } + } + if(found) { + bouquetList->activateBouquet(nNext, false); + res = bouquetList->showChannelList(); + loop = false; + } + } + } + else if ( msg == CRCInput::RC_ok ) { + if(SameTP()) { + zapOnExit = true; + loop=false; + } + } + else if (( msg == CRCInput::RC_spkr ) && g_settings.channellist_new_zap_mode ) { + if(CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_ts) { + this->new_mode_active = (this->new_mode_active ? 0 : 1); + paintHead(); + showChannelLogo(); + } + } + else if (CRCInput::isNumeric(msg) && (this->historyMode || g_settings.sms_channel)) { + if (this->historyMode) { //numeric zap + selected = CRCInput::getNumericValue(msg); + zapOnExit = true; + loop = false; + } + else if(g_settings.sms_channel) { + unsigned char smsKey = 0; + SMSKeyInput smsInput; + smsInput.setTimeout(CHANNEL_SMSKEY_TIMEOUT); + + do { + smsKey = smsInput.handleMsg(msg); + //printf("SMS new key: %c\n", smsKey); + g_RCInput->getMsg_ms(&msg, &data, CHANNEL_SMSKEY_TIMEOUT-100); + } while ((msg >= CRCInput::RC_1) && (msg <= CRCInput::RC_9)); + + if (msg == CRCInput::RC_timeout || msg == CRCInput::RC_nokey) { + uint32_t i; + for(i = selected+1; i < chanlist.size(); i++) { + char firstCharOfTitle = chanlist[i]->getName().c_str()[0]; + if(tolower(firstCharOfTitle) == smsKey) { + //printf("SMS chan found was= %d selected= %d i= %d %s\n", was_sms, selected, i, chanlist[i]->channel->getName().c_str()); + break; + } + } + if(i >= chanlist.size()) { + for(i = 0; i < chanlist.size(); i++) { + char firstCharOfTitle = chanlist[i]->getName().c_str()[0]; + if(tolower(firstCharOfTitle) == smsKey) { + //printf("SMS chan found was= %d selected= %d i= %d %s\n", was_sms, selected, i, chanlist[i]->channel->getName().c_str()); + break; + } + } + } + if(i < chanlist.size()) { + int prevselected=selected; + selected=i; + + paintItem(prevselected - liststart); + unsigned int oldliststart = liststart; + liststart = (selected/listmaxshow)*listmaxshow; + if(oldliststart!=liststart) { + paint(); + } else { + paintItem(selected - liststart); + showChannelLogo(); + } + } + smsInput.resetOldKey(); + } + } + } + else if(CRCInput::isNumeric(msg)) { + //pushback key if... + selected = oldselected; + g_RCInput->postMsg( msg, data ); + loop=false; + } + else if ( msg == CRCInput::RC_blue ) + { + displayNext = !displayNext; + paintHead(); // update button bar + paint(); + } + else if ( msg == CRCInput::RC_green ) + { + int mode = CNeutrinoApp::getInstance()->GetChannelMode(); + if(mode != LIST_MODE_FAV) { + g_settings.channellist_sort_mode++; + if(g_settings.channellist_sort_mode > SORT_MAX-1) + g_settings.channellist_sort_mode = SORT_ALPHA; + CNeutrinoApp::getInstance()->SetChannelMode(mode); + paintHead(); // update button bar + paint(); + } + } + + else if ((msg == CRCInput::RC_info) || (msg == CRCInput::RC_help)) { + hide(); + CChannelEvent *p_event=NULL; + if (displayNext) + { + p_event = &(chanlist[selected]->nextEvent); + } + + if(p_event && p_event->eventID) + { + g_EpgData->show(chanlist[selected]->channel_id,p_event->eventID,&(p_event->startTime)); + } + else + { + g_EpgData->show(chanlist[selected]->channel_id); + } + paintHead(); + paint(); + } else { + if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { + loop = false; + res = - 2; + } + } + } + hide(); + + fader.Stop(); + + if (bShowBouquetList) { + res = bouquetList->exec(true); + printf("CChannelList:: bouquetList->exec res %d\n", res); + } + this->new_mode_active = 0; + + if(NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode()) + return -1; + + if(zapOnExit) { + res = selected; + //selected_chid = chanlist[selected]->channel_id; + } + + printf("CChannelList::show *********** res %d\n", res); + return(res); +} + +void CChannelList::hide() +{ + frameBuffer->paintBackgroundBoxRel(x, y, width, height+ info_height+ 5); + clearItem2DetailsLine(); +} + +bool CChannelList::showInfo(int number, int epgpos) +{ + CZapitChannel* channel = getChannel(number); + if(channel == NULL) + return false; + + g_InfoViewer->showTitle(channel, true, epgpos); // UTF-8 + return true; +} + +int CChannelList::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data) +{ + bool startvideo = true; + + if (msg != NeutrinoMessages::EVT_PROGRAMLOCKSTATUS) // right now the only message handled here. + return messages_return::unhandled; + + //printf("===> program-lock-status: %d zp: %d\n", data, zapProtection != NULL); + + if (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_NEVER) + goto out; + + // 0x100 als FSK-Status zeigt an, dass (noch) kein EPG zu einem Kanal der NICHT angezeigt + // werden sollte (vorgesperrt) da ist + // oder das bouquet des Kanals ist vorgesperrt + + if (zapProtection != NULL) { + zapProtection->fsk = data; + startvideo = false; + goto out; + } + + // require password if either + // CHANGETOLOCK mode and channel/bouquet is pre locked (0x100) + // ONSIGNAL mode and fsk(data) is beyond configured value + // if program has already been unlocked, dont require pin + if (data < (neutrino_msg_data_t)g_settings.parentallock_lockage) + goto out; + + /* already unlocked */ + if (chanlist[selected]->last_unlocked_EPGid == g_RemoteControl->current_EPGid && g_RemoteControl->current_EPGid != 0) + goto out; + + /* PARENTALLOCK_PROMPT_CHANGETOLOCKED: only pre-locked channels, don't care for fsk sent in SI */ + if (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED && data < 0x100) + goto out; + + /* if a pre-locked channel is inside the zap time, open it. Hardcoded to one hour for now. */ + if (data >= 0x100 && chanlist[selected]->last_unlocked_time + 3600 > time_monotonic()) + goto out; + + /* OK, let's ask for a PIN */ + g_RemoteControl->stopvideo(); + //printf("stopped video\n"); + zapProtection = new CZapProtection(g_settings.parentallock_pincode, data); + + if (zapProtection->check()) + { + // remember it for the next time + /* data < 0x100: lock age -> remember EPG ID */ + if (data < 0x100) + chanlist[selected]->last_unlocked_EPGid = g_RemoteControl->current_EPGid; + else + { + /* data >= 0x100: pre locked bouquet -> remember unlock time */ + chanlist[selected]->last_unlocked_time = time_monotonic(); + int bnum = bouquetList->getActiveBouquetNumber(); + if (bnum >= 0) + { + /* unlock the whole bouquet */ + int i; + for (i = 0; i < bouquetList->Bouquets[bnum]->channelList->getSize(); i++) + bouquetList->Bouquets[bnum]->channelList->getChannelFromIndex(i)->last_unlocked_time = chanlist[selected]->last_unlocked_time; + } + } + } + else + { + /* last_unlocked_time == 0 is the magic to tell zapTo() to not record the time. + Without that, zapping to a locked channel twice would open it without the PIN */ + chanlist[selected]->last_unlocked_time = 0; + startvideo = false; + } + delete zapProtection; + zapProtection = NULL; + +out: + if (startvideo) + g_RemoteControl->startvideo(); + + return messages_return::handled; +} + +/* bToo default to true */ +/* TODO make this member of CNeutrinoApp, because this only called from "whole" list ? */ +bool CChannelList::adjustToChannelID(const t_channel_id channel_id, bool bToo) +{ + unsigned int i; + + selected_chid = channel_id; + printf("CChannelList::adjustToChannelID me %p [%s] list size %d channel_id %llx\n", this, getName(), chanlist.size(), channel_id); + fflush(stdout); + for (i = 0; i < chanlist.size(); i++) { + if(chanlist[i] == NULL) { + printf("CChannelList::adjustToChannelID REPORT BUG !! ******************************** %d is NULL !!\n", i); + continue; + } + if (chanlist[i]->channel_id == channel_id) { + selected = i; + tuned = i; + + lastChList.store (selected, channel_id, false); + + if (bToo) { + int old_mode = CNeutrinoApp::getInstance()->GetChannelMode(); + int new_mode = old_mode; + bool has_channel; + if(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_tv) { + has_channel = TVfavList->adjustToChannelID(channel_id); + if(!has_channel && old_mode == LIST_MODE_FAV) + new_mode = LIST_MODE_PROV; + has_channel = TVbouquetList->adjustToChannelID(channel_id); + if(!has_channel && old_mode == LIST_MODE_PROV) { + new_mode = LIST_MODE_SAT; + } + has_channel = TVsatList->adjustToChannelID(channel_id); + if(!has_channel && old_mode == LIST_MODE_SAT) + new_mode = LIST_MODE_ALL; + has_channel = TVallList->adjustToChannelID(channel_id); + } + else if(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_radio) { + has_channel = RADIOfavList->adjustToChannelID(channel_id); + if(!has_channel && old_mode == LIST_MODE_FAV) + new_mode = LIST_MODE_PROV; + has_channel = RADIObouquetList->adjustToChannelID(channel_id); + if(!has_channel && old_mode == LIST_MODE_PROV) + new_mode = LIST_MODE_SAT; + has_channel = RADIOsatList->adjustToChannelID(channel_id); + if(!has_channel && old_mode == LIST_MODE_SAT) + new_mode = LIST_MODE_ALL; + has_channel = RADIOallList->adjustToChannelID(channel_id); + } + if(old_mode != new_mode) + CNeutrinoApp::getInstance()->SetChannelMode(new_mode); + } +//printf("CChannelList::adjustToChannelID me %x to %llx bToo %s OK: %d\n", (int) this, channel_id, bToo ? "yes" : "no", i);fflush(stdout); + return true; + } + } +//printf("CChannelList::adjustToChannelID me %x to %llx bToo %s FAILED\n", (int) this, channel_id, bToo ? "yes" : "no");fflush(stdout); + + return false; +} + +#if 0 +int CChannelList::hasChannel(int nChannelNr) +{ + for (uint32_t i=0; ichannel_id == channel_id) + return i; + } + return -1; +} + +// for adjusting bouquet's channel list after numzap or quickzap +void CChannelList::setSelected( int nChannelNr) +{ +//printf("CChannelList::setSelected me %s %d -> %s\n", name.c_str(), nChannelNr, (nChannelNr < chanlist.size() && chanlist[nChannelNr] != NULL) ? chanlist[nChannelNr]->getName().c_str() : "********* NONE *********"); + //FIXME real difference between tuned and selected ?! + selected_chid = 0; + tuned = nChannelNr; + if (nChannelNr < (int) chanlist.size()) { + selected = nChannelNr; + selected_chid = chanlist[tuned]->getChannelID(); + } +} + +// -- Zap to channel with channel_id +bool CChannelList::zapTo_ChannelID(const t_channel_id channel_id) +{ + printf("**************************** CChannelList::zapTo_ChannelID %llx\n", channel_id); + for (unsigned int i = 0; i < chanlist.size(); i++) { + if (chanlist[i]->channel_id == channel_id) { + zapTo(i); + return true; + } + } + return false; +} + +bool CChannelList::showEmptyError() +{ + if (chanlist.empty()) { + DisplayErrorMessage(g_Locale->getText(LOCALE_CHANNELLIST_NONEFOUND)); // UTF-8 + return true; + } + return false; +} + +/* forceStoreToLastChannels defaults to false */ +/* TODO make this private to call only from "current" list, where selected/pos not means channel number */ +void CChannelList::zapTo(int pos, bool /* forceStoreToLastChannels */) +{ + if(showEmptyError()) + return; + + if ( (pos >= (signed int) chanlist.size()) || (pos < 0) ) { + pos = 0; + } + CZapitChannel* chan = chanlist[pos]; + + zapToChannel(chan); + tuned = pos; + if(this->new_mode_active) + selected_in_new_mode = pos; + else + selected = pos; +} + +/* to replace zapTo_ChannelID and zapTo from "whole" list ? */ +void CChannelList::zapToChannel(CZapitChannel *channel) +{ + if(showEmptyError()) + return; + + if(channel == NULL) + return; + + /* we record when we switched away from a channel, so that the parental-PIN code can + check for timeout. last_unlocked_time == 0 means: the PIN was not entered + "tuned" is the *old* channel, before zap */ + if (tuned < chanlist.size() && chanlist[tuned]->last_unlocked_time != 0) + chanlist[tuned]->last_unlocked_time = time_monotonic(); + + printf("**************************** CChannelList::zapToChannel me %p %s tuned %d new %s -> %llx\n", this, name.c_str(), tuned, channel->getName().c_str(), channel->channel_id); + if(tuned < chanlist.size()) + selected_chid = chanlist[tuned]->getChannelID(); + + if(selected_chid != channel->getChannelID()) { + if ((g_settings.radiotext_enable) && ((CNeutrinoApp::getInstance()->getMode()) == NeutrinoMessages::mode_radio) && (g_Radiotext)) + { + // stop radiotext PES decoding before zapping + g_Radiotext->radiotext_stop(); + } + + selected_chid = channel->getChannelID(); + g_RemoteControl->zapTo_ChannelID(channel->getChannelID(), channel->getName(), !channel->bAlwaysLocked); + CNeutrinoApp::getInstance()->channelList->adjustToChannelID(channel->getChannelID()); + } + if(!this->new_mode_active) { + /* remove recordModeActive from infobar */ + if(g_settings.auto_timeshift && !CNeutrinoApp::getInstance()->recordingstatus) { + g_InfoViewer->handleMsg(NeutrinoMessages::EVT_RECORDMODE, 0); + } + g_RCInput->postMsg( NeutrinoMessages::SHOW_INFOBAR, 0 ); + CNeutrinoApp::getInstance()->channelList->getLastChannels().set_mode(channel->channel_id); + } +} + +/* Called only from "all" channel list */ +int CChannelList::numericZap(int key) +{ + neutrino_msg_t msg; + neutrino_msg_data_t data; + + int res = -1; + + if(showEmptyError()) + return res; + + // -- quickzap "0" to last seen channel... + if (key == g_settings.key_lastchannel) { + t_channel_id channel_id = lastChList.getlast(1); + if(channel_id && SameTP(channel_id)) { + lastChList.clear_storedelay(); // ignore store delay + int new_mode = lastChList.get_mode(channel_id); + if(new_mode >= 0) + CNeutrinoApp::getInstance()->SetChannelMode(new_mode); + zapTo_ChannelID(channel_id); + res = 0; + } + return res; + } + if ((key == g_settings.key_zaphistory) || (key == CRCInput::RC_games)) { + if((!autoshift && CNeutrinoApp::getInstance()->recordingstatus) || (key == CRCInput::RC_games)) { + CChannelList * orgList = CNeutrinoApp::getInstance()->channelList; + CChannelList * channelList = new CChannelList(g_Locale->getText(LOCALE_CHANNELLIST_CURRENT_TP), false, true); + + if(key == CRCInput::RC_games) { + t_channel_id recid = chanlist[selected]->channel_id >> 16; + for ( unsigned int i = 0 ; i < orgList->chanlist.size(); i++) { + if((orgList->chanlist[i]->channel_id >> 16) == recid) + channelList->addChannel(orgList->chanlist[i]); + } + } else { + for ( unsigned int i = 0 ; i < orgList->chanlist.size(); i++) { + if(SameTP(orgList->chanlist[i])) + channelList->addChannel(orgList->chanlist[i]); + } + } + if ( !channelList->isEmpty()) { + channelList->adjustToChannelID(orgList->getActiveChannel_ChannelID(), false); + this->frameBuffer->paintBackground(); + res = channelList->exec(); + CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); + } + delete channelList; + return res; + } + // -- zap history bouquet, similar to "0" quickzap, but shows a menue of last channels + if (this->lastChList.size() > 1) { + CChannelList * channelList = new CChannelList(g_Locale->getText(LOCALE_CHANNELLIST_HISTORY), true, true); + + for(unsigned int i = 1; i < this->lastChList.size() ; ++i) { + t_channel_id channel_id = this->lastChList.getlast(i); + if(channel_id) { + CZapitChannel* channel = getChannel(channel_id); + if(channel) channelList->addChannel(channel); + } + } + if ( !channelList->isEmpty() ) { + this->frameBuffer->paintBackground(); + res = channelList->exec(); + CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); + } + delete channelList; + } + return res; + } + size_t maxchansize = MaxChanNr().size(); + int fw = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getRenderWidth(widest_number); + int sx = maxchansize * fw + (fw/2); + int sy = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getHeight() + 6; + + int ox = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - sx)/2; + int oy = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - sy)/2; + char valstr[10]; + int chn = CRCInput::getNumericValue(key); + int pos = 1; + int lastchan= -1; + bool doZap = false; + bool showEPG = false; + + while(1) { + if (lastchan != chn) { + snprintf((char*) &valstr, sizeof(valstr), "%d", chn); + + while(strlen(valstr) < maxchansize) + strcat(valstr,"-"); //"_" + frameBuffer->paintBoxRel(ox, oy, sx, sy, COL_INFOBAR_PLUS_0); + + for (int i = maxchansize-1; i >= 0; i--) { + valstr[i+ 1] = 0; + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->RenderString(ox+fw/3+ i*fw, oy+sy-3, sx, &valstr[i], COL_INFOBAR); + } + + showInfo(chn); + lastchan = chn; + } + + g_RCInput->getMsg( &msg, &data, g_settings.timing[SNeutrinoSettings::TIMING_NUMERICZAP] * 10 ); + + if (msg == CRCInput::RC_timeout || msg == CRCInput::RC_ok) { + doZap = true; + break; + } + else if (msg == CRCInput::RC_favorites || msg == CRCInput::RC_sat || msg == CRCInput::RC_right) { + } + else if (CRCInput::isNumeric(msg)) { + if (pos == 4) { + chn = 0; + pos = 1; + } else { + chn *= 10; + pos++; + } + chn += CRCInput::getNumericValue(msg); + } + else if (msg == (neutrino_msg_t)g_settings.key_quickzap_down) { + if(chn > 1) + chn--; + } + else if (msg == (neutrino_msg_t)g_settings.key_quickzap_up) { + chn++; + } + else if (msg == CRCInput::RC_left) { + /* "backspace" */ + if(pos > 0) { + pos--; + if(chn > 10) + chn /= 10; + } + } + else if (msg == CRCInput::RC_home) + { + break; + } + else if (msg == CRCInput::RC_red) { + showEPG = true; + break; + } + else if (CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all) { + break; + } + } + + frameBuffer->paintBackgroundBoxRel(ox, oy, sx, sy); + + CZapitChannel* chan = getChannel(chn); + if (doZap) { + if(g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR] == 0) + g_InfoViewer->killTitle(); + + if(chan && SameTP(chan)) { + zapToChannel(chan); + res = 0; + } else + g_InfoViewer->killTitle(); + + } else { + g_InfoViewer->showTitle(getActiveChannel(), true); + g_InfoViewer->killTitle(); + if (chan && showEPG) + g_EventList->exec(chan->channel_id, chan->getName()); + } + return res; +} + +CZapitChannel* CChannelList::getPrevNextChannel(int key, unsigned int &sl) +{ + CZapitChannel* channel = chanlist[sl]; + int bsize = bouquetList->Bouquets.size(); + int bactive = bouquetList->getActiveBouquetNumber(); + + if(!g_settings.zap_cycle && bsize > 1) { + size_t cactive = sl; + + printf("CChannelList::getPrevNextChannel: selected %d total %d active bouquet %d total %d\n", cactive, chanlist.size(), bactive, bsize); + if ((key == g_settings.key_quickzap_down) || (key == CRCInput::RC_left)) { + if(cactive == 0) { + if(bactive == 0) + bactive = bsize - 1; + else + bactive--; + bouquetList->activateBouquet(bactive, false); + cactive = bouquetList->Bouquets[bactive]->channelList->getSize() - 1; + } else + --cactive; + } + else if ((key == g_settings.key_quickzap_up) || (key == CRCInput::RC_right)) { + cactive++; + if(cactive >= chanlist.size()) { + bactive = (bactive + 1) % bsize; + bouquetList->activateBouquet(bactive, false); + cactive = 0; + } + } + sl = cactive; + channel = bouquetList->Bouquets[bactive]->channelList->getChannelFromIndex(cactive); + printf("CChannelList::getPrevNextChannel: selected %d total %d active bouquet %d total %d channel %x (%s)\n", + cactive, chanlist.size(), bactive, bsize, (int) channel, channel ? channel->getName().c_str(): ""); + } else { + if ((key == g_settings.key_quickzap_down) || (key == CRCInput::RC_left)) { + if(sl == 0) + sl = chanlist.size()-1; + else + sl--; + } + else if ((key==g_settings.key_quickzap_up) || (key == CRCInput::RC_right)) { + sl = (sl+1)%chanlist.size(); + } + channel = chanlist[sl]; + } + return channel; +} + +void CChannelList::virtual_zap_mode(bool up) +{ + neutrino_msg_t msg; + neutrino_msg_data_t data; + + if(showEmptyError()) + return; + + unsigned int sl = selected; + int old_bactive = bouquetList->getActiveBouquetNumber(); + int bactive = old_bactive; + + CZapitChannel* channel = getPrevNextChannel(up ? CRCInput::RC_right : CRCInput::RC_left, sl); + + bool doZap = false; + bool showEPG = false; + int epgpos = 0; + + while(1) { + if (channel) + g_InfoViewer->showTitle(channel, true, epgpos); + + epgpos = 0; + g_RCInput->getMsg(&msg, &data, 15*10); // 15 seconds, not user changable + + if ((msg == CRCInput::RC_left) || (msg == CRCInput::RC_right)) { + channel = bouquetList->Bouquets[bactive]->channelList->getPrevNextChannel(msg, sl); + bactive = bouquetList->getActiveBouquetNumber(); + } + else if (msg == CRCInput::RC_up || msg == CRCInput::RC_down) { + epgpos = (msg == CRCInput::RC_up) ? -1 : 1; + } + else if ((msg == CRCInput::RC_ok) || (msg == CRCInput::RC_home) || (msg == CRCInput::RC_timeout)) { + if(msg == CRCInput::RC_ok) + doZap = true; + break; + } + else if (msg == CRCInput::RC_red) { + showEPG = true; + break; + } + else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) { + break; + } + } + g_InfoViewer->clearVirtualZapMode(); + + if (doZap) { + if(g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR] == 0) + g_InfoViewer->killTitle(); + if(channel && SameTP(channel)) + zapToChannel(channel); + else + g_InfoViewer->killTitle(); + } else { + g_InfoViewer->showTitle(getActiveChannel(), true); + g_InfoViewer->killTitle(); + bouquetList->activateBouquet(old_bactive, false); + + if (showEPG && channel) + g_EventList->exec(channel->channel_id, channel->getName()); + } +} + +void CChannelList::quickZap(int key, bool /* cycle */) +{ + if(chanlist.empty()) + return; + + unsigned int sl = selected; + /* here selected value doesnt matter, zap will do adjust */ + CZapitChannel* channel = getPrevNextChannel(key, sl); + if(channel) + CNeutrinoApp::getInstance()->channelList->zapToChannel(channel); + g_RCInput->clearRCMsg(); //FIXME test for n.103 +} + +void CChannelList::paintDetails(int index) +{ + CChannelEvent *p_event = NULL; + + //colored_events init + bool colored_event_C = false; + bool colored_event_N = false; + if (g_settings.colored_events_channellist == 1) + colored_event_C = true; + if (g_settings.colored_events_channellist == 2) + colored_event_N = true; + + if (displayNext) { + p_event = &chanlist[index]->nextEvent; + } else { + p_event = &chanlist[index]->currentEvent; + } + + frameBuffer->paintBoxRel(x+2, y + height + 2, widthDetails-4, info_height - 4, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE);//round + + if (!p_event->description.empty()) { + char cNoch[50] = {0}; // UTF-8 + char cSeit[50] = {0}; // UTF-8 + + struct tm *pStartZeit = localtime(&p_event->startTime); + unsigned seit = ( time(NULL) - p_event->startTime ) / 60; + snprintf(cSeit, sizeof(cSeit), "%s %02d:%02d",(displayNext) ? g_Locale->getText(LOCALE_CHANNELLIST_START):g_Locale->getText(LOCALE_CHANNELLIST_SINCE), pStartZeit->tm_hour, pStartZeit->tm_min); + if (displayNext) { + snprintf(cNoch, sizeof(cNoch), "(%d min)", p_event->duration / 60); + } else { + int noch = (p_event->startTime + p_event->duration - time(NULL)) / 60; + if ((noch< 0) || (noch>=10000)) + noch= 0; + snprintf(cNoch, sizeof(cNoch), "(%d / %d min)", seit, noch); + } + int seit_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(cSeit, true); // UTF-8 + int noch_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(cNoch, true); // UTF-8 + + std::string text1= p_event->description; + std::string text2= p_event->text; + + int xstart = 10; + if (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1, true) > (widthDetails - 30 - seit_len) ) + { + // zu breit, Umbruch versuchen... + int pos; + do { + pos = text1.find_last_of("[ -.]+"); + if ( pos!=-1 ) + text1 = text1.substr( 0, pos ); + } while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1, true) > (widthDetails - 30 - seit_len) ) ); + + std::string text3 = ""; /* not perfect, but better than crashing... */ + if (p_event->description.length() > text1.length()) + text3 = p_event->description.substr(text1.length()+ 1); + + if (!text2.empty() && !text3.empty()) + text3= text3+ " - "; + + xstart += g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text3, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2* fheight, widthDetails - 30- noch_len, text3, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); + } + + if (!(text2.empty())) { + while ( text2.find_first_of("[ -.+*#?=!$%&/]+") == 0 ) + text2 = text2.substr( 1 ); + text2 = text2.substr( 0, text2.find('\n') ); +#if 0 //FIXME: to discuss, eat too much cpu time if string long enough + int pos = 0; + while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text2, true) > (widthDetails - 30 - noch_len) ) ) { + pos = text2.find_last_of(" "); + + if ( pos!=-1 ) { + text2 = text2.substr( 0, pos ); + } + } +#endif + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ xstart, y+ height+ 5+ 2* fheight, widthDetails- xstart- 30- noch_len, text2, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); + } + + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ fheight, widthDetails - 30 - seit_len, text1, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ widthDetails- 10- seit_len, y+ height+ 5+ fheight, seit_len, cSeit, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ widthDetails- 10- noch_len, y+ height+ 5+ 2* fheight, noch_len, cNoch, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8 + } + if(g_settings.channellist_foot == 0) { + transponder t; + CServiceManager::getInstance()->GetTransponder(chanlist[index]->getTransponderId(), t); + + std::string desc = t.description(); + if(chanlist[index]->pname) + desc = desc + " (" + std::string(chanlist[index]->pname) + ")"; + else + desc = desc + " (" + CServiceManager::getInstance()->GetSatelliteName(chanlist[index]->getSatellitePosition()) + ")"; + + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 3*fheight, widthDetails - 30, desc.c_str(), COL_MENUCONTENTDARK, 0, true); + } + else if( !displayNext && g_settings.channellist_foot == 1) { // next Event + char buf[128] = {0}; + char cFrom[50] = {0}; // UTF-8 + CSectionsdClient::CurrentNextInfo CurrentNext; + CEitManager::getInstance()->getCurrentNextServiceKey(chanlist[index]->channel_id, CurrentNext); + if (!CurrentNext.next_name.empty()) { + struct tm *pStartZeit = localtime (& CurrentNext.next_zeit.startzeit); + snprintf(cFrom, sizeof(cFrom), "%s %02d:%02d",g_Locale->getText(LOCALE_WORD_FROM),pStartZeit->tm_hour, pStartZeit->tm_min ); + snprintf(buf, sizeof(buf), "%s", CurrentNext.next_name.c_str()); + int from_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(cFrom, true); // UTF-8 + + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 3*fheight, widthDetails - 30 - from_len, buf, colored_event_N ? COL_COLORED_EVENTS_CHANNELLIST :COL_MENUCONTENTDARK, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ widthDetails- 10- from_len, y+ height+ 5+ 3*fheight, from_len, cFrom, colored_event_N ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8 + } + } + if ((g_settings.channellist_minitv) && (p_event != NULL)) + paint_events(index); +} + +void CChannelList::clearItem2DetailsLine() +{ + paintItem2DetailsLine (-1, 0); +} + +void CChannelList::paintItem2DetailsLine (int pos, int /*ch_index*/) +{ +#define ConnectLineBox_Width 16 + + int xpos = x - ConnectLineBox_Width; + int ypos1 = y + theight+0 + pos*fheight; + int ypos2 = y + height; + int ypos1a = ypos1 + (fheight/2)-2; + int ypos2a = ypos2 + (info_height/2)-2; + fb_pixel_t col1 = COL_MENUCONTENT_PLUS_6; + // Clear + frameBuffer->paintBackgroundBoxRel(xpos,y, ConnectLineBox_Width, height+info_height + 1); + + // paint Line if detail info (and not valid list pos) + if (pos >= 0) { //pos >= 0 && chanlist[ch_index]->currentEvent.description != "") { + if(1) // FIXME why -> ? (!g_settings.channellist_extended) + { + //details line + CComponentsDetailLine details_line(xpos, ypos1a, ypos2a, fheight/2+1, info_height-RADIUS_LARGE*2); + details_line.paint(); + + //info box frame + frameBuffer->paintBoxFrame(x, ypos2, widthDetails, info_height, 2, col1, RADIUS_LARGE); + } + } +} + +void CChannelList::showChannelLogo() +{ + if (g_settings.channellist_minitv) + return; + if(g_settings.infobar_show_channellogo){ + static int logo_w = 0; + static int logo_h = 0; + int logo_w_max = width / 4; + frameBuffer->paintBoxRel(x + width - logo_off - logo_w, y+(theight-logo_h)/2, logo_w, logo_h, COL_MENUHEAD_PLUS_0); + + std::string lname; + if(g_PicViewer->GetLogoName(chanlist[selected]->channel_id, chanlist[selected]->getName(), lname, &logo_w, &logo_h)) { + if((logo_h > theight) || (logo_w > logo_w_max)) + g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, logo_w_max, theight); + g_PicViewer->DisplayImage(lname, x + width - logo_off - logo_w, y+(theight-logo_h)/2, logo_w, logo_h); + } + } +} + +#define NUM_LIST_BUTTONS 4 +struct button_label SChannelListButtons[NUM_LIST_BUTTONS] = +{ + { NEUTRINO_ICON_BUTTON_RED, LOCALE_INFOVIEWER_EVENTLIST}, + { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_BOUQUETLIST_HEAD}, + { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_INFOVIEWER_NEXT}, + { NEUTRINO_ICON_BUTTON_RECORD_INACTIVE, NONEXISTANT_LOCALE} +}; +#define NUM_LIST_BUTTONS_SORT 5 +struct button_label SChannelListButtons_SMode[NUM_LIST_BUTTONS_SORT] = +{ + { NEUTRINO_ICON_BUTTON_RED, LOCALE_INFOVIEWER_EVENTLIST}, + { NEUTRINO_ICON_BUTTON_GREEN, LOCALE_CHANNELLIST_FOOT_SORT_ALPHA}, + { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_BOUQUETLIST_HEAD}, + { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_INFOVIEWER_NEXT}, + { NEUTRINO_ICON_BUTTON_RECORD_INACTIVE, NONEXISTANT_LOCALE} +}; + +void CChannelList::paintButtonBar(bool is_current) +{ + //printf("[neutrino channellist] %s...%d, selected %d\n", __FUNCTION__, __LINE__, selected); + unsigned int smode = CNeutrinoApp::getInstance()->GetChannelMode(); + int num_buttons = smode != LIST_MODE_FAV ? NUM_LIST_BUTTONS_SORT : NUM_LIST_BUTTONS; + + struct button_label Button[num_buttons]; + const neutrino_locale_t button_ids[] = {LOCALE_INFOVIEWER_NOW,LOCALE_INFOVIEWER_NEXT,LOCALE_MAINMENU_RECORDING,LOCALE_MAINMENU_RECORDING_STOP,NONEXISTANT_LOCALE, + LOCALE_CHANNELLIST_FOOT_SORT_ALPHA,LOCALE_CHANNELLIST_FOOT_SORT_FREQ,LOCALE_CHANNELLIST_FOOT_SORT_SAT,LOCALE_CHANNELLIST_FOOT_SORT_CHNUM}; + const std::vector buttonID_rest (button_ids, button_ids + sizeof(button_ids) / sizeof(neutrino_locale_t) ); + + for (int i = 0;iRecordingStatus(getActiveChannel_ChannelID()); + + if (g_settings.recording_type != RECORDING_OFF && !displayNext){ + if (is_current && !do_record){ + Button[Bindex].locale = LOCALE_MAINMENU_RECORDING; + Button[Bindex].button = NEUTRINO_ICON_BUTTON_RECORD_ACTIVE; + }else if (do_record){ + Button[Bindex].locale = LOCALE_MAINMENU_RECORDING_STOP; + Button[Bindex].button = NEUTRINO_ICON_BUTTON_STOP; + }else{ + Button[Bindex].locale = NONEXISTANT_LOCALE; + Button[Bindex].button = NEUTRINO_ICON_BUTTON_RECORD_INACTIVE; + } + } + if(smode) + { + switch (g_settings.channellist_sort_mode) + { + case SORT_ALPHA: + Button[1].locale = LOCALE_CHANNELLIST_FOOT_SORT_ALPHA; + break; + case SORT_TP: + Button[1].locale = LOCALE_CHANNELLIST_FOOT_SORT_FREQ; + break; + case SORT_SAT: + Button[1].locale = LOCALE_CHANNELLIST_FOOT_SORT_SAT; + break; + case SORT_CH_NUMBER: + Button[1].locale = LOCALE_CHANNELLIST_FOOT_SORT_CHNUM; + break; + default: + break; + } + } + + //paint buttons + int y_foot = y + (height - footerHeight); + ::paintButtons(x, y_foot, width,num_buttons, Button, footerHeight,0,false,COL_INFOBAR_SHADOW,NULL,0,true, buttonID_rest); +} + +void CChannelList::paintItem(int pos) +{ + int ypos = y+ theight+0 + pos*fheight; + uint8_t color; + fb_pixel_t bgcolor; + bool iscurrent = true; + bool paintbuttons = false; + unsigned int curr = liststart + pos; + int rec_mode; + +#if 0 + if(CNeutrinoApp::getInstance()->recordingstatus && !autoshift && curr < chanlist.size()) { + iscurrent = (chanlist[curr]->channel_id >> 16) == (rec_channel_id >> 16); + //printf("recording %llx current %llx current = %s\n", rec_channel_id, chanlist[liststart + pos]->channel_id, iscurrent? "yes" : "no"); + } +#endif + if(curr < chanlist.size()) + iscurrent = SameTP(chanlist[curr]); + + if (curr == selected) { + color = COL_MENUCONTENTSELECTED; + bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; + paintItem2DetailsLine (pos, curr); + paintDetails(curr); + frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, RADIUS_LARGE); + paintbuttons = true; + } else { + color = iscurrent ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE; + bgcolor = iscurrent ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENTINACTIVE_PLUS_0; + frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, 0); + } + + if(curr < chanlist.size()) { + char nameAndDescription[255]; + char tmp[10]; + CZapitChannel* chan = chanlist[curr]; + int prg_offset=0; + int title_offset=0; + uint8_t tcolor=(liststart + pos == selected) ? color : COL_MENUCONTENTINACTIVE; + int xtheight=fheight-2; + + if(g_settings.channellist_extended) + { + prg_offset = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth("00:00"); + title_offset=6; + } + + snprintf((char*) tmp, sizeof(tmp), "%d", this->historyMode ? pos : chan->number); + + CChannelEvent *p_event=NULL; + if (displayNext) { + p_event = &chan->nextEvent; + } else { + p_event = &chan->currentEvent; + } + + if (pos == 0) + { + /* FIXME move to calcSize() ? */ + int w_max, w_min, h; + ChannelList_Rec = 0; + int recmode_icon_max = CRecordManager::RECMODE_REC, recmode_icon_min = CRecordManager::RECMODE_TSHIFT; + frameBuffer->getIconSize(NEUTRINO_ICON_REC, &w_max, &h); + frameBuffer->getIconSize(NEUTRINO_ICON_AUTO_SHIFT, &w_min, &h); + if (w_max < w_min) + { + recmode_icon_max = CRecordManager::RECMODE_TSHIFT; + recmode_icon_min = CRecordManager::RECMODE_REC; + h = w_max; + w_max = w_min; + w_min = h; + } + for (uint32_t i = 0; i < chanlist.size(); i++) + { + rec_mode = CRecordManager::getInstance()->GetRecordMode(chanlist[i]->channel_id); + if (rec_mode & recmode_icon_max) + { + ChannelList_Rec = w_max; + break; + } else if (rec_mode & recmode_icon_min) + ChannelList_Rec = w_min; + } + if (ChannelList_Rec > 0) + ChannelList_Rec += 8; + } + + //record check + rec_mode = CRecordManager::getInstance()->GetRecordMode(chanlist[curr]->channel_id); + + //set recording icon + const char * rec_icon = ""; + if (rec_mode & CRecordManager::RECMODE_REC) + rec_icon = NEUTRINO_ICON_REC; + else if (rec_mode & CRecordManager::RECMODE_TSHIFT) + rec_icon = NEUTRINO_ICON_AUTO_SHIFT; + + //calculating icons + int icon_x = (x+width-15-2) - RADIUS_LARGE/2; + int r_icon_w=0; int s_icon_h=0; int s_icon_w=0; + frameBuffer->getIconSize(NEUTRINO_ICON_SCRAMBLED, &s_icon_w, &s_icon_h); + r_icon_w = ChannelList_Rec; + int r_icon_x = icon_x; + + //paint scramble icon + if(chan->scrambled) + if (frameBuffer->paintIcon(NEUTRINO_ICON_SCRAMBLED, icon_x - s_icon_w, ypos, fheight))//ypos + (fheight - 16)/2); + r_icon_x = r_icon_x - s_icon_w; + + //paint recording icon + if (rec_mode != CRecordManager::RECMODE_OFF) + frameBuffer->paintIcon(rec_icon, r_icon_x - r_icon_w, ypos, fheight);//ypos + (fheight - 16)/2); + + //paint buttons + if (paintbuttons) + paintButtonBar(iscurrent); + + int icon_space = r_icon_w+s_icon_w; + + //number + int numpos = x+5+numwidth- g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(tmp); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(numpos,ypos+fheight, numwidth+5, tmp, color, fheight); + + int l=0; + if (this->historyMode) + l = snprintf(nameAndDescription, sizeof(nameAndDescription), ": %d %s", chan->number, chan->getName().c_str()); + else + l = snprintf(nameAndDescription, sizeof(nameAndDescription), "%s", chan->getName().c_str()); + + CProgressBar pb(false); /* never colored */ + int pb_space = prg_offset - title_offset; + int pb_max = pb_space - 4; + if (!(p_event->description.empty())) { + snprintf(nameAndDescription+l, sizeof(nameAndDescription)-l,g_settings.channellist_epgtext_align_right ? " ":" - "); + unsigned int ch_name_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(nameAndDescription, true); + unsigned int ch_desc_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(p_event->description, true); + + int max_desc_len = width - numwidth - prg_offset - ch_name_len - 15 - 20; // 15 = scrollbar, 20 = spaces + if (chan->scrambled || (g_settings.channellist_extended ||g_settings.channellist_epgtext_align_right)) + max_desc_len -= icon_space; /* do we need space for the lock/rec icon? */ + + if (max_desc_len < 0) + max_desc_len = 0; + if ((int) ch_desc_len > max_desc_len) + ch_desc_len = max_desc_len; + + if(g_settings.channellist_extended) { + if(displayNext) + { + struct tm *pStartZeit = localtime(&p_event->startTime); + + snprintf((char*) tmp, sizeof(tmp), "%02d:%02d", pStartZeit->tm_hour, pStartZeit->tm_min); +// g_Font[SNeutrinoSettings::FONT_TYPE_IMAGEINFO_SMALL]->RenderString(x+ 5+ numwidth+ 6, ypos+ xtheight, width- numwidth- 20- 15 -poffs, tmp, COL_MENUCONTENT, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(x+ 5+ numwidth+ 6, ypos+ xtheight, width- numwidth- 20- 15 -prg_offset, tmp, tcolor, 0, true); + } + else + { + time_t jetzt=time(NULL); + int runningPercent = 0; + + if (((jetzt - p_event->startTime + 30) / 60) < 0 ) + { + runningPercent= 0; + } + else + { + runningPercent=(jetzt-p_event->startTime) * pb_max / p_event->duration; + if (runningPercent > pb_max) // this would lead to negative value in paintBoxRel + runningPercent = pb_max; // later on which can be fatal... + } + + int pb_activeCol , pb_passiveCol; + if (liststart + pos != selected) { + pb_activeCol = COL_MENUCONTENT_PLUS_3; + pb_passiveCol = COL_MENUCONTENT_PLUS_1; + } else { + pb_activeCol = COL_MENUCONTENTSELECTED_PLUS_2; + pb_passiveCol = COL_MENUCONTENTSELECTED_PLUS_0; + } + pb.paintProgressBar(x+5+numwidth + title_offset, ypos + fheight/4, pb_space + 2, fheight/2, runningPercent, pb_max, pb_activeCol, pb_passiveCol, pb_activeCol); + } + } + + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10+prg_offset, ypos+ fheight, width- numwidth- 40- 15-prg_offset, nameAndDescription, color, 0, true); + if (g_settings.channellist_epgtext_align_right) { + // align right + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + width - 20 - ch_desc_len - icon_space - 4, ypos + fheight, ch_desc_len, p_event->description, (curr == selected)?COL_MENUCONTENTSELECTED:(!displayNext ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE) , 0, true); + } + else { + // align left + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ 5+ numwidth+ 10+ ch_name_len+ 5+prg_offset, ypos+ fheight, ch_desc_len, p_event->description, (curr == selected)?COL_MENUCONTENTSELECTED:(!displayNext ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE) , 0, true); + } + } + else { + if(g_settings.channellist_extended) { + int pbz_activeCol, pbz_passiveCol; + if (liststart + pos != selected) { + pbz_activeCol = COL_MENUCONTENT_PLUS_1; + pbz_passiveCol = COL_MENUCONTENT_PLUS_0; + } else { + pbz_activeCol = COL_MENUCONTENTSELECTED_PLUS_2; + pbz_passiveCol = COL_MENUCONTENTSELECTED_PLUS_0; + } + pb.paintProgressBar(x+5+numwidth + title_offset, ypos + fheight/4, pb_space + 2, fheight/2, 0, pb_max, pbz_activeCol, pbz_passiveCol, pbz_activeCol, 0, NULL, 0, NULL, true); + } + //name + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10+prg_offset, ypos+ fheight, width- numwidth- 40- 15-prg_offset, nameAndDescription, color, 0, true); // UTF-8 + } + if (curr == selected) { + if (!(chan->currentEvent.description.empty())) { + snprintf(nameAndDescription, sizeof(nameAndDescription), "%s - %s", + chan->getName().c_str(), p_event->description.c_str()); + CVFD::getInstance()->showMenuText(0, nameAndDescription, -1, true); // UTF-8 + } else + CVFD::getInstance()->showMenuText(0, chan->getName().c_str(), -1, true); // UTF-8 + } + } +} + +void CChannelList::paintHead() +{ + int timestr_len = 0; + char timestr[10] = {0}; + time_t now = time(NULL); + struct tm *tm = localtime(&now); + bool gotTime = g_Sectionsd->getIsTimeSet(); + + if(gotTime) { + strftime(timestr, 10, "%H:%M", tm); + timestr_len = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(timestr, true); // UTF-8 + } + + int iw1, iw2, iw3, ih = 0; + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_INFO, &iw1, &ih); + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MENU, &iw2, &ih); + if (g_settings.channellist_new_zap_mode) + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE, &iw3, &ih); + + // head + frameBuffer->paintBoxRel(x,y, widthDetails,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round + + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_INFO, x + width - iw1 - 4, y, theight); //y+ 5 ); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MENU, x + width - iw1 - iw2 - 8, y, theight);//y + 5); // icon for bouquet list button + if (g_settings.channellist_new_zap_mode) + frameBuffer->paintIcon(this->new_mode_active ? + NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE : NEUTRINO_ICON_BUTTON_MUTE_ZAP_INACTIVE, + x + width - iw1 - iw2 - iw3 - 12, y, theight); + + if (gotTime) { + int iw3x = (g_settings.channellist_new_zap_mode) ? iw3 : -4; + if (g_settings.channellist_minitv) + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + widthDetails - 16 -timestr_len, + y+theight, timestr_len, timestr, COL_MENUHEAD, 0, true); // UTF-8 + else + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + width - iw1 - iw2 - iw3x - 16 -timestr_len, + y+theight, timestr_len, timestr, COL_MENUHEAD, 0, true); // UTF-8 + timestr_len += 4; + } + + timestr_len += iw1 + iw2 + 12; + if (g_settings.channellist_new_zap_mode) + timestr_len += iw3 + 4; + logo_off = timestr_len + 4; + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, widthDetails - timestr_len, name, COL_MENUHEAD, 0, true); // UTF-8 +} + +void CChannelList::paint() +{ + if (g_settings.channellist_minitv) + { + paint_pig(x+width, y+theight+1, pig_width, pig_height); + } + + numwidth = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(MaxChanNr().c_str()); + + liststart = (selected/listmaxshow)*listmaxshow; + updateEvents(this->historyMode ? 0:liststart, this->historyMode ? 0:(liststart + listmaxshow)); + + frameBuffer->paintBoxRel(x, y+theight, width, height-footerHeight-theight, COL_MENUCONTENT_PLUS_0, 0, CORNER_BOTTOM); + for(unsigned int count = 0; count < listmaxshow; count++) { + paintItem(count); + } + const int ypos = y+ theight; + const int sb = fheight* listmaxshow; + frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); + + const int sbc= ((chanlist.size()- 1)/ listmaxshow)+ 1; + const int sbs= (selected/listmaxshow); + + frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs*(sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); + showChannelLogo(); +} + +bool CChannelList::isEmpty() const +{ + return this->chanlist.empty(); +} + +int CChannelList::getSize() const +{ + return this->chanlist.size(); +} + +int CChannelList::getSelectedChannelIndex() const +{ + return this->selected; +} + +bool CChannelList::SameTP(t_channel_id channel_id) +{ + bool iscurrent = true; + +#if 0 + if(CNeutrinoApp::getInstance()->recordingstatus && !autoshift) + iscurrent = (channel_id >> 16) == (rec_channel_id >> 16); +#endif + if(CNeutrinoApp::getInstance()->recordingstatus) { +#if 0 + if(channel_id == 0) + channel_id = chanlist[selected]->channel_id; + iscurrent = CRecordManager::getInstance()->SameTransponder(channel_id); +#endif + CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(channel_id); + if(channel) + iscurrent = SameTP(channel); + else + iscurrent = false; + } + return iscurrent; +} + +bool CChannelList::SameTP(CZapitChannel * channel) +{ + bool iscurrent = true; + + if(CNeutrinoApp::getInstance()->recordingstatus) { + if(channel == NULL) + channel = chanlist[selected]; + iscurrent = CFEManager::getInstance()->canTune(channel); + } + return iscurrent; +} +std::string CChannelList::MaxChanNr() +{ + zapit_list_it_t chan_it; + std::stringstream ss; + std::string maxchansize; + int chan_nr_max = 1; + unsigned int nr = 0; + for (chan_it=chanlist.begin(); chan_it!=chanlist.end(); ++chan_it) { + chan_nr_max = std::max(chan_nr_max, chanlist[nr++]->number); + } + ss << chan_nr_max; + ss >> maxchansize; + return maxchansize; +} + +void CChannelList::paint_pig (int x, int y, int w, int h) +{ + frameBuffer->paintBackgroundBoxRel (x, y, w, h); + printf("CChannelList::paint_pig x %d y %d w %d h %d osd_w %d osd_w %d\n", x, y, w, h, frameBuffer->getScreenWidth(true), frameBuffer->getScreenHeight(true)); + videoDecoder->Pig(x, y, w, h, frameBuffer->getScreenWidth(true), frameBuffer->getScreenHeight(true)); +} + +void CChannelList::paint_events(int index) +{ + readEvents(chanlist[index]->channel_id); + frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUHEAD_PLUS_0); + char text1[10]; + CChannelEventList::iterator e; + time_t azeit; + time(&azeit); + int ffheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getHeight(); + + if ( evtlist.size() == 0 ) + { + CChannelEvent evt; + + evt.description = g_Locale->getText(LOCALE_EPGLIST_NOEVENTS); + evt.eventID = 0; + evtlist.push_back(evt); + + } + + int i=1; + for (e=evtlist.begin(); e!=evtlist.end(); ++e ) + { + //Remove events in the past + time_t dif = azeit - e->startTime; + if ( (dif > 0) && (!(e->eventID == 0))) + { + do + { + //printf("%d seconds in the past - deleted %s\n", dif, e->description.c_str()); + e = evtlist.erase(e); + dif = azeit - e->startTime; + } + while ( dif > 0 ); + } + //Display the remaining events + struct tm *tmStartZeit = localtime(&e->startTime); + strftime(text1, sizeof(text1), "%H:%M", tmStartZeit ); + //printf("%s %s\n", text1, e->description.c_str()); + int timewidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getRenderWidth(text1, true); + if ((y+ theight+ pig_height + i*ffheight) < (y+ height)) + { + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, timewidth, text1, COL_MENUCONTENTDARK, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5+timewidth+5, y+ theight+ pig_height + i*ffheight, infozone_width - timewidth - 20, e->description, COL_MENUCONTENTDARK, 0, true); + } + else break; + i++; + } + evtlist.clear(); +} + +static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& b) +{ + return a.startTime < b.startTime; +} + +void CChannelList::readEvents(const t_channel_id channel_id) +{ + CEitManager::getInstance()->getEventsServiceKey(channel_id , evtlist); + + if ( evtlist.empty() ) + { + CChannelEvent evt; + evt.description = g_Locale->getText(LOCALE_EPGLIST_NOEVENTS); + evt.eventID = 0; + evtlist.push_back(evt); + } + else + sort(evtlist.begin(),evtlist.end(),sortByDateTime); + + return; +} diff --git a/src/gui/channellist.h b/src/gui/channellist.h index d96e22a3a..4cc43c068 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -73,10 +73,15 @@ private: CZapProtection* zapProtection; int width; + int widthDetails; int height; int x; int y; int logo_off; + int pig_width; + int pig_height; + int infozone_width; + int infozone_height; bool historyMode; bool vlist; // "virtual" list, not bouquet @@ -98,6 +103,10 @@ private: void showChannelLogo(); void calcSize(); std::string MaxChanNr(); + void paint_pig(int x, int y, int w, int h); + void paint_events(int index); + CChannelEventList evtlist; + void readEvents(const t_channel_id channel_id); public: CChannelList(const char * const Name, bool historyMode = false, bool _vlist = false, bool new_mode_active = false ); diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 5df9e9a6b..3fd4e292d 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -796,6 +796,11 @@ void COsdSetup::showOsdChanlistSetup(CMenuWidget *menu_chanlist) CMenuOptionChooser * mc; menu_chanlist->addIntroItems(LOCALE_MISCSETTINGS_CHANNELLIST); + // channel list with minitv + mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_MINITV, &g_settings.channellist_minitv, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_MINITV); + menu_chanlist->addItem(mc); + // epg align mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_CHANNELLIST_EPGTEXT_ALIGN, &g_settings.channellist_epgtext_align_right, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_EPG_ALIGN); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index beec61763..3974c1178 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -610,6 +610,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.channellist_foot = configfile.getInt32("channellist_foot" , 1);//default next Event g_settings.channellist_new_zap_mode = configfile.getInt32("channellist_new_zap_mode", 1); g_settings.channellist_sort_mode = configfile.getInt32("channellist_sort_mode", 0);//sort mode: alpha, freq, sat + g_settings.channellist_minitv = configfile.getInt32("channellist_minitv", 0); //default off //screen configuration g_settings.screen_xres = configfile.getInt32("screen_xres", 100); @@ -1030,6 +1031,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setBool("channellist_extended" , g_settings.channellist_extended); configfile.setInt32("channellist_foot" , g_settings.channellist_foot); configfile.setInt32("channellist_new_zap_mode", g_settings.channellist_new_zap_mode); + configfile.setInt32("channellist_minitv", g_settings.channellist_minitv); configfile.setInt32("remote_control_hardware", g_settings.remote_control_hardware); configfile.setBool ( "audiochannel_up_down_enable", g_settings.audiochannel_up_down_enable ); configfile.setInt32("channellist_sort_mode", g_settings.channellist_sort_mode); diff --git a/src/neutrino.cpp.rej b/src/neutrino.cpp.rej new file mode 100644 index 000000000..80d3ad113 --- /dev/null +++ b/src/neutrino.cpp.rej @@ -0,0 +1,9 @@ +diff a/src/neutrino.cpp b/src/neutrino.cpp (rejected hunks) +@@ -690,6 +690,7 @@ int CNeutrinoApp::loadSetup(const char * fname) + g_settings.channellist_foot = configfile.getInt32("channellist_foot" , 1);//default next Event + g_settings.channellist_new_zap_mode = configfile.getInt32("channellist_new_zap_mode", 1); + g_settings.channellist_sort_mode = configfile.getInt32("channellist_sort_mode", 0);//sort mode: alpha, freq, sat ++ g_settings.channellist_minitv = configfile.getInt32("channellist_minitv", 0); //default off + + //screen configuration + g_settings.screen_xres = configfile.getInt32("screen_xres", 100); diff --git a/src/neutrino.cpp~ b/src/neutrino.cpp~ new file mode 100644 index 000000000..7dc872044 --- /dev/null +++ b/src/neutrino.cpp~ @@ -0,0 +1,3881 @@ +/* + Neutrino-GUI - DBoxII-Project + + Copyright (C) 2001 Steffen Hehn 'McClean' + and some other guys + Homepage: http://dbox.cyberphoria.org/ + + Copyright (C) 2011 CoolStream International Ltd + + License: GPL + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#define NEUTRINO_CPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "global.h" +#include "neutrino.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "gui/audioplayer.h" +#include "gui/bouquetlist.h" +#include "gui/cam_menu.h" +#include "gui/cec_setup.h" +#include "gui/channellist.h" +#include "gui/epgview.h" +#include "gui/eventlist.h" +#include "gui/favorites.h" +#include "gui/filebrowser.h" +#include "gui/hdd_menu.h" +#include "gui/infoviewer.h" +#include "gui/mediaplayer.h" +#include "gui/movieplayer.h" +#include "gui/osd_setup.h" +#include "gui/osdlang_setup.h" +#include "gui/pictureviewer.h" +#include "gui/plugins.h" +#include "gui/rc_lock.h" +#include "gui/scan_setup.h" +#include "gui/start_wizard.h" +#include "gui/videosettings.h" + +#include "gui/widget/hintbox.h" +#include "gui/widget/icons.h" +#include "gui/widget/menue.h" +#include "gui/widget/messagebox.h" +#include "gui/infoclock.h" + +#if HAVE_COOL_HARDWARE +#include "gui/widget/progressbar.h" +#endif + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +int old_b_id = -1; +CHintBox * reloadhintBox = 0; +bool has_hdd; + +CInfoClock *InfoClock; +int allow_flash = 1; +Zapit_config zapitCfg; +char zapit_lat[20]; +char zapit_long[20]; +bool autoshift = false; +uint32_t scrambled_timer; +t_channel_id standby_channel_id; + +//NEW +static pthread_t timer_thread; +void * timerd_main_thread(void *data); + +void * nhttpd_main_thread(void *data); +static pthread_t nhttpd_thread ; + +//#define DISABLE_SECTIONSD + +extern cVideo * videoDecoder; +extern cDemux *videoDemux; +extern cAudio * audioDecoder; +cPowerManager *powerManager; +cCpuFreqManager * cpuFreq; + +void stop_daemons(bool stopall = true); +void stop_video(void); +// uncomment if you want to have a "test" menue entry (rasc) + +//#define __EXPERIMENTAL_CODE__ +#ifdef __EXPERIMENTAL_CODE__ +#include "gui/ch_mosaic.h" +#endif + +CAudioSetupNotifier * audioSetupNotifier; +CBouquetList * bouquetList; // current list + +CBouquetList * TVbouquetList; +CBouquetList * TVsatList; +CBouquetList * TVfavList; +CBouquetList * TVallList; + +CBouquetList * RADIObouquetList; +CBouquetList * RADIOsatList; +CBouquetList * RADIOfavList; +CBouquetList * RADIOallList; + +CPlugins * g_PluginList; +CRemoteControl * g_RemoteControl; +CPictureViewer * g_PicViewer; +CCAMMenuHandler * g_CamHandler; +CVolume * g_volume; + +// Globale Variablen - to use import global.h + +// I don't like globals, I would have hidden them in classes, +// but if you wanna do it so... ;) +bool parentallocked = false; +static char **global_argv; + +extern const char * locale_real_names[]; /* #include */ + +// USERMENU +const char* usermenu_button_def[SNeutrinoSettings::BUTTON_MAX]={"red","green","yellow","blue"}; + +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++ CNeutrinoApp - Constructor, initialize g_fontRenderer + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ +CNeutrinoApp::CNeutrinoApp() +: configfile('\t') +{ + standby_pressed_at.tv_sec = 0; + + frameBuffer = CFrameBuffer::getInstance(); + frameBuffer->setIconBasePath(DATADIR "/neutrino/icons/"); + + SetupFrameBuffer(); + + mode = mode_unknown; + channelList = NULL; + TVchannelList = NULL; + RADIOchannelList = NULL; + skipShutdownTimer = false; + skipSleepTimer = false; + lockStandbyCall = false; + current_muted = 0; + recordingstatus = 0; + g_channel_list_changed = 0; + memset(&font, 0, sizeof(neutrino_font_descr_struct)); +} + +/*------------------------------------------------------------------------------------- +- CNeutrinoApp - Destructor - +-------------------------------------------------------------------------------------*/ +CNeutrinoApp::~CNeutrinoApp() +{ + if (channelList) + delete channelList; +} + +CNeutrinoApp* CNeutrinoApp::getInstance() +{ + static CNeutrinoApp* neutrinoApp = NULL; + + if(!neutrinoApp) { + neutrinoApp = new CNeutrinoApp(); + dprintf(DEBUG_DEBUG, "NeutrinoApp Instance created\n"); + } + return neutrinoApp; +} + + +#define FONT_STYLE_REGULAR 0 +#define FONT_STYLE_BOLD 1 +#define FONT_STYLE_ITALIC 2 + +extern font_sizes_groups_struct font_sizes_groups[]; +extern font_sizes_struct neutrino_font[]; + +const font_sizes_struct signal_font = {LOCALE_FONTSIZE_INFOBAR_SMALL , 14, FONT_STYLE_REGULAR, 1}; + +typedef struct lcd_setting_t +{ + const char * const name; + const unsigned int default_value; +} lcd_setting_struct_t; + +const lcd_setting_struct_t lcd_setting[SNeutrinoSettings::LCD_SETTING_COUNT] = +{ + {"lcd_brightness" , DEFAULT_VFD_BRIGHTNESS }, + {"lcd_standbybrightness", DEFAULT_VFD_STANDBYBRIGHTNESS}, + {"lcd_contrast" , DEFAULT_LCD_CONTRAST }, + {"lcd_power" , DEFAULT_LCD_POWER }, + {"lcd_inverse" , DEFAULT_LCD_INVERSE }, + {"lcd_show_volume" , DEFAULT_LCD_SHOW_VOLUME }, + {"lcd_autodimm" , DEFAULT_LCD_AUTODIMM }, + {"lcd_deepbrightness" , DEFAULT_VFD_STANDBYBRIGHTNESS } +#if HAVE_TRIPLEDRAGON + ,{ "lcd_epgmode" , 0 /*DEFAULT_LCD_EPGMODE*/ } +#endif +}; + +/************************************************************************************** +* CNeutrinoApp - loadSetup, load the application-settings * +**************************************************************************************/ +#define DEFAULT_X_START_SD 60 +#define DEFAULT_Y_START_SD 20 +#define DEFAULT_X_END_SD 1220 +#define DEFAULT_Y_END_SD 560 + +#define DEFAULT_X_START_HD 40 //5 +#define DEFAULT_Y_START_HD 25 //5 +#define DEFAULT_X_END_HD 1235 //1275 +#define DEFAULT_Y_END_HD 690 //715 + +std::string ttx_font_file = ""; + +int CNeutrinoApp::loadSetup(const char * fname) +{ + char cfg_key[81]; + int erg = 0; + + configfile.clear(); + //settings laden - und dabei Defaults setzen! + if(!configfile.loadConfig(fname)) { + //file existiert nicht + erg = 1; + } else { + /* try to detect bad / broken config file */ + if (!configfile.getInt32("screen_EndX_crt", 0) || + !configfile.getInt32("screen_EndY_crt", 0) || + !configfile.getInt32("screen_EndX_lcd", 0) || + !configfile.getInt32("screen_EndY_lcd", 0)) { + printf("[neutrino] config file %s is broken, using defaults\n", fname); + configfile.clear(); + } + } + std::ifstream checkParentallocked(NEUTRINO_PARENTALLOCKED_FILE); + if(checkParentallocked) { + parentallocked = true; + checkParentallocked.close(); + } + // video + g_settings.video_Mode = configfile.getInt32("video_Mode", VIDEO_STD_1080I50); // VIDEO_STD_720P50 + g_settings.analog_mode1 = configfile.getInt32("analog_mode1", (int)ANALOG_SD_RGB_SCART); // default RGB + g_settings.analog_mode2 = configfile.getInt32("analog_mode2", (int)ANALOG_SD_YPRPB_CINCH); // default YPBPR + g_settings.hdmi_cec_mode = configfile.getInt32("hdmi_cec_mode", 0); // default off + g_settings.hdmi_cec_view_on = configfile.getInt32("hdmi_cec_view_on", 0); // default off + g_settings.hdmi_cec_standby = configfile.getInt32("hdmi_cec_standby", 0); // default off + + g_settings.video_Format = configfile.getInt32("video_Format", DISPLAY_AR_16_9); + g_settings.video_43mode = configfile.getInt32("video_43mode", DISPLAY_AR_MODE_LETTERBOX); + g_settings.current_volume = configfile.getInt32("current_volume", 50); + g_settings.current_volume_step = configfile.getInt32("current_volume_step", 2); + g_settings.channel_mode = configfile.getInt32("channel_mode", LIST_MODE_PROV); + g_settings.channel_mode_radio = configfile.getInt32("channel_mode_radio", LIST_MODE_PROV); + + g_settings.fan_speed = configfile.getInt32( "fan_speed", 1); + if(g_settings.fan_speed < 1) g_settings.fan_speed = 1; + + g_settings.srs_enable = configfile.getInt32( "srs_enable", 0); + g_settings.srs_algo = configfile.getInt32( "srs_algo", 1); + g_settings.srs_ref_volume = configfile.getInt32( "srs_ref_volume", 40); + g_settings.srs_nmgr_enable = configfile.getInt32( "srs_nmgr_enable", 0); + g_settings.hdmi_dd = configfile.getInt32( "hdmi_dd", 0); + g_settings.spdif_dd = configfile.getInt32( "spdif_dd", 1); + g_settings.analog_out = configfile.getInt32( "analog_out", 1); + g_settings.avsync = configfile.getInt32( "avsync", 1); + g_settings.clockrec = configfile.getInt32( "clockrec", 1); + g_settings.video_dbdr = configfile.getInt32("video_dbdr", 0); + + for(int i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT; i++) { + sprintf(cfg_key, "enabled_video_mode_%d", i); + g_settings.enabled_video_modes[i] = configfile.getInt32(cfg_key, 0); + } + g_settings.enabled_video_modes[3] = 1; // 720p 50Hz + g_settings.enabled_video_modes[4] = 1; // 1080i 50Hz + + g_settings.cpufreq = configfile.getInt32("cpufreq", 0); + g_settings.standby_cpufreq = configfile.getInt32("standby_cpufreq", 100); + g_settings.rounded_corners = configfile.getInt32("rounded_corners", 1); + g_settings.ci_standby_reset = configfile.getInt32("ci_standby_reset", 0); + g_settings.ci_clock = configfile.getInt32("ci_clock", 7); + +#ifndef CPU_FREQ + g_settings.cpufreq = 0; + g_settings.standby_cpufreq = 50; +#endif + + g_settings.make_hd_list = configfile.getInt32("make_hd_list", 1); + g_settings.make_new_list = configfile.getInt32("make_new_list", 1); + g_settings.make_removed_list = configfile.getInt32("make_removed_list", 1); + g_settings.keep_channel_numbers = configfile.getInt32("keep_channel_numbers", 0); + + //misc + g_settings.power_standby = configfile.getInt32( "power_standby", 0); + g_settings.rotor_swap = configfile.getInt32( "rotor_swap", 0); + + //led + g_settings.led_tv_mode = configfile.getInt32( "led_tv_mode", 1); + g_settings.led_standby_mode = configfile.getInt32( "led_standby_mode", 1); + g_settings.led_deep_mode = configfile.getInt32( "led_deep_mode", 1); + g_settings.led_rec_mode = configfile.getInt32( "led_rec_mode", 1); + g_settings.led_blink = configfile.getInt32( "led_blink", 1); + + g_settings.hdd_fs = configfile.getInt32( "hdd_fs", 0); + g_settings.hdd_sleep = configfile.getInt32( "hdd_sleep", 120); + g_settings.hdd_noise = configfile.getInt32( "hdd_noise", 254); + + g_settings.shutdown_real = configfile.getBool("shutdown_real" , false ); + g_settings.shutdown_real_rcdelay = configfile.getBool("shutdown_real_rcdelay", false ); + strcpy(g_settings.shutdown_count, configfile.getString("shutdown_count","0").c_str()); + + strcpy(g_settings.shutdown_min, "000"); + if(cs_get_revision() > 7) + strcpy(g_settings.shutdown_min, configfile.getString("shutdown_min","180").c_str()); + + g_settings.infobar_sat_display = configfile.getBool("infobar_sat_display" , true ); + g_settings.infobar_show_channeldesc = configfile.getBool("infobar_show_channeldesc" , false ); + g_settings.infobar_subchan_disp_pos = configfile.getInt32("infobar_subchan_disp_pos" , 0 ); + g_settings.progressbar_color = configfile.getBool("progressbar_color", true ); + g_settings.infobar_show = configfile.getInt32("infobar_show", 1); + g_settings.infobar_show_channellogo = configfile.getInt32("infobar_show_channellogo" , 3 ); + g_settings.casystem_display = configfile.getInt32("casystem_display", 2 );//mini ca mode default + g_settings.scrambled_message = configfile.getBool("scrambled_message", true ); + g_settings.volume_pos = configfile.getInt32("volume_pos", 0 ); + g_settings.volume_digits = configfile.getBool("volume_digits", true); + g_settings.menu_pos = configfile.getInt32("menu_pos", CMenuWidget::MENU_POS_CENTER); + g_settings.show_menu_hints = configfile.getBool("show_menu_hints", true); + g_settings.infobar_show_sysfs_hdd = configfile.getBool("infobar_show_sysfs_hdd" , true ); + g_settings.show_mute_icon = configfile.getInt32("show_mute_icon" ,0); + g_settings.infobar_show_res = configfile.getInt32("infobar_show_res", 0 ); + g_settings.infobar_show_dd_available = configfile.getInt32("infobar_show_dd_available", 1 ); + g_settings.infobar_show_tuner = configfile.getInt32("infobar_show_tuner", 1 ); + g_settings.radiotext_enable = configfile.getBool("radiotext_enable" , false); + //audio + g_settings.audio_AnalogMode = configfile.getInt32( "audio_AnalogMode", 0 ); + g_settings.audio_DolbyDigital = configfile.getBool("audio_DolbyDigital" , false); + + g_settings.auto_lang = configfile.getInt32( "auto_lang", 0 ); + g_settings.auto_subs = configfile.getInt32( "auto_subs", 0 ); + + for(int i = 0; i < 3; i++) { + sprintf(cfg_key, "pref_lang_%d", i); + strncpy(g_settings.pref_lang[i], configfile.getString(cfg_key, "none").c_str(), 30); + sprintf(cfg_key, "pref_subs_%d", i); + strncpy(g_settings.pref_subs[i], configfile.getString(cfg_key, "none").c_str(), 30); + } + g_settings.zap_cycle = configfile.getInt32( "zap_cycle", 0 ); + strcpy( g_settings.audio_PCMOffset, configfile.getString( "audio_PCMOffset", "0" ).c_str() ); + + //vcr + g_settings.vcr_AutoSwitch = configfile.getBool("vcr_AutoSwitch" , true ); + + //language + strcpy(g_settings.language, configfile.getString("language", "").c_str()); + strcpy(g_settings.timezone, configfile.getString("timezone", "(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Vienna").c_str()); + //epg dir + g_settings.epg_cache = configfile.getString("epg_cache_time", "14"); + g_settings.epg_extendedcache = configfile.getString("epg_extendedcache_time", "360"); + g_settings.epg_old_events = configfile.getString("epg_old_events", "1"); + g_settings.epg_max_events = configfile.getString("epg_max_events", "30000"); + g_settings.epg_dir = configfile.getString("epg_dir", "/media/sda1/epg"); + // NTP-Server for sectionsd + g_settings.network_ntpserver = configfile.getString("network_ntpserver", "time.fu-berlin.de"); + g_settings.network_ntprefresh = configfile.getString("network_ntprefresh", "30" ); + g_settings.network_ntpenable = configfile.getBool("network_ntpenable", false); + + snprintf(g_settings.ifname, sizeof(g_settings.ifname), "%s", configfile.getString("ifname", "eth0").c_str());; + + g_settings.epg_save = configfile.getBool("epg_save", false); + g_settings.epg_save_standby = configfile.getBool("epg_save_standby", true); + //widget settings + g_settings.widget_fade = false; + g_settings.widget_fade = configfile.getBool("widget_fade" , false ); + + //colors (neutrino defaultcolors) + g_settings.menu_Head_alpha = configfile.getInt32( "menu_Head_alpha", 0x00 ); + g_settings.menu_Head_red = configfile.getInt32( "menu_Head_red", 0x00 ); + g_settings.menu_Head_green = configfile.getInt32( "menu_Head_green", 0x0A ); + g_settings.menu_Head_blue = configfile.getInt32( "menu_Head_blue", 0x19 ); + + g_settings.menu_Head_Text_alpha = configfile.getInt32( "menu_Head_Text_alpha", 0x00 ); + g_settings.menu_Head_Text_red = configfile.getInt32( "menu_Head_Text_red", 0x5f ); + g_settings.menu_Head_Text_green = configfile.getInt32( "menu_Head_Text_green", 0x46 ); + g_settings.menu_Head_Text_blue = configfile.getInt32( "menu_Head_Text_blue", 0x00 ); + + g_settings.menu_Content_alpha = configfile.getInt32( "menu_Content_alpha", 0x14 ); + g_settings.menu_Content_red = configfile.getInt32( "menu_Content_red", 0x00 ); + g_settings.menu_Content_green = configfile.getInt32( "menu_Content_green", 0x0f ); + g_settings.menu_Content_blue = configfile.getInt32( "menu_Content_blue", 0x23 ); + g_settings.menu_Content_Text_alpha = configfile.getInt32( "menu_Content_Text_alpha", 0x00 ); + g_settings.menu_Content_Text_red = configfile.getInt32( "menu_Content_Text_red", 0x64 ); + g_settings.menu_Content_Text_green = configfile.getInt32( "menu_Content_Text_green", 0x64 ); + g_settings.menu_Content_Text_blue = configfile.getInt32( "menu_Content_Text_blue", 0x64 ); + + g_settings.menu_Content_Selected_alpha = configfile.getInt32( "menu_Content_Selected_alpha", 0x14 ); + g_settings.menu_Content_Selected_red = configfile.getInt32( "menu_Content_Selected_red", 0x19 ); + g_settings.menu_Content_Selected_green = configfile.getInt32( "menu_Content_Selected_green", 0x37 ); + g_settings.menu_Content_Selected_blue = configfile.getInt32( "menu_Content_Selected_blue", 0x64 ); + + g_settings.menu_Content_Selected_Text_alpha = configfile.getInt32( "menu_Content_Selected_Text_alpha", 0x00 ); + g_settings.menu_Content_Selected_Text_red = configfile.getInt32( "menu_Content_Selected_Text_red", 0x00 ); + g_settings.menu_Content_Selected_Text_green = configfile.getInt32( "menu_Content_Selected_Text_green", 0x00 ); + g_settings.menu_Content_Selected_Text_blue = configfile.getInt32( "menu_Content_Selected_Text_blue", 0x00 ); + + g_settings.menu_Content_inactive_alpha = configfile.getInt32( "menu_Content_inactive_alpha", 0x14 ); + g_settings.menu_Content_inactive_red = configfile.getInt32( "menu_Content_inactive_red", 0x00 ); + g_settings.menu_Content_inactive_green = configfile.getInt32( "menu_Content_inactive_green", 0x0f ); + g_settings.menu_Content_inactive_blue = configfile.getInt32( "menu_Content_inactive_blue", 0x23 ); + + g_settings.menu_Content_inactive_Text_alpha = configfile.getInt32( "menu_Content_inactive_Text_alpha", 0x00 ); + g_settings.menu_Content_inactive_Text_red = configfile.getInt32( "menu_Content_inactive_Text_red", 55 ); + g_settings.menu_Content_inactive_Text_green = configfile.getInt32( "menu_Content_inactive_Text_green", 70 ); + g_settings.menu_Content_inactive_Text_blue = configfile.getInt32( "menu_Content_inactive_Text_blue", 85 ); + + g_settings.infobar_alpha = configfile.getInt32( "infobar_alpha", 0x14 ); + g_settings.infobar_red = configfile.getInt32( "infobar_red", 0x00 ); + g_settings.infobar_green = configfile.getInt32( "infobar_green", 0x0e ); + g_settings.infobar_blue = configfile.getInt32( "infobar_blue", 0x23 ); + + g_settings.infobar_Text_alpha = configfile.getInt32( "infobar_Text_alpha", 0x00 ); + g_settings.infobar_Text_red = configfile.getInt32( "infobar_Text_red", 0x64 ); + g_settings.infobar_Text_green = configfile.getInt32( "infobar_Text_green", 0x64 ); + g_settings.infobar_Text_blue = configfile.getInt32( "infobar_Text_blue", 0x64 ); + + //personalize + strcpy( g_settings.personalize_pincode, configfile.getString( "personalize_pincode", "0000" ).c_str() ); + for (int i = 0; i < SNeutrinoSettings::P_SETTINGS_MAX; i++)//settings.h, settings.cpp + g_settings.personalize[i] = configfile.getInt32( personalize_settings[i].personalize_settings_name, personalize_settings[i].personalize_default_val ); + + g_settings.colored_events_channellist = configfile.getInt32( "colored_events_channellist" , 0 ); + g_settings.colored_events_infobar = configfile.getInt32( "colored_events_infobar" , 0 ); + g_settings.colored_events_alpha = configfile.getInt32( "colored_events_alpha", 0x00 ); + g_settings.colored_events_red = configfile.getInt32( "colored_events_red", 95 ); + g_settings.colored_events_green = configfile.getInt32( "colored_events_green", 70 ); + g_settings.colored_events_blue = configfile.getInt32( "colored_events_blue", 0 ); + + g_settings.contrast_fonts = configfile.getInt32("contrast_fonts", 0); + + //network + for(int i=0 ; i < NETWORK_NFS_NR_OF_ENTRIES ; i++) { + sprintf(cfg_key, "network_nfs_ip_%d", i); + g_settings.network_nfs_ip[i] = configfile.getString(cfg_key, ""); + sprintf(cfg_key, "network_nfs_dir_%d", i); + strcpy( g_settings.network_nfs_dir[i], configfile.getString( cfg_key, "" ).c_str() ); + sprintf(cfg_key, "network_nfs_local_dir_%d", i); + strcpy( g_settings.network_nfs_local_dir[i], configfile.getString( cfg_key, "" ).c_str() ); + sprintf(cfg_key, "network_nfs_automount_%d", i); + g_settings.network_nfs_automount[i] = configfile.getInt32( cfg_key, 0); + sprintf(cfg_key, "network_nfs_type_%d", i); + g_settings.network_nfs_type[i] = configfile.getInt32( cfg_key, 0); + sprintf(cfg_key,"network_nfs_username_%d", i); + strcpy( g_settings.network_nfs_username[i], configfile.getString( cfg_key, "" ).c_str() ); + sprintf(cfg_key, "network_nfs_password_%d", i); + strcpy( g_settings.network_nfs_password[i], configfile.getString( cfg_key, "" ).c_str() ); + sprintf(cfg_key, "network_nfs_mount_options1_%d", i); + strcpy( g_settings.network_nfs_mount_options1[i], configfile.getString( cfg_key, "ro,soft,udp" ).c_str() ); + sprintf(cfg_key, "network_nfs_mount_options2_%d", i); + strcpy( g_settings.network_nfs_mount_options2[i], configfile.getString( cfg_key, "nolock,rsize=8192,wsize=8192" ).c_str() ); + sprintf(cfg_key, "network_nfs_mac_%d", i); + strcpy( g_settings.network_nfs_mac[i], configfile.getString( cfg_key, "11:22:33:44:55:66").c_str() ); + } + strcpy( g_settings.network_nfs_audioplayerdir, configfile.getString( "network_nfs_audioplayerdir", "/media/sda1/music" ).c_str() ); + strcpy( g_settings.network_nfs_picturedir, configfile.getString( "network_nfs_picturedir", "/media/sda1/pictures" ).c_str() ); + strcpy( g_settings.network_nfs_moviedir, configfile.getString( "network_nfs_moviedir", "/media/sda1/movies" ).c_str() ); + strcpy( g_settings.network_nfs_recordingdir, configfile.getString( "network_nfs_recordingdir", "/media/sda1/movies" ).c_str() ); + strcpy( g_settings.timeshiftdir, configfile.getString( "timeshiftdir", "" ).c_str() ); + + g_settings.temp_timeshift = configfile.getInt32( "temp_timeshift", 0 ); + g_settings.auto_timeshift = configfile.getInt32( "auto_timeshift", 0 ); + g_settings.auto_delete = configfile.getInt32( "auto_delete", 1 ); + + char timeshiftDir[255]; + if(strlen(g_settings.timeshiftdir) == 0) { + sprintf(timeshiftDir, "%s/.timeshift", g_settings.network_nfs_recordingdir); + safe_mkdir(timeshiftDir); + } else { + if(strcmp(g_settings.timeshiftdir, g_settings.network_nfs_recordingdir)) + strncpy(timeshiftDir, g_settings.timeshiftdir, sizeof(timeshiftDir)); + else + sprintf(timeshiftDir, "%s/.timeshift", g_settings.network_nfs_recordingdir); + } + printf("***************************** rec dir %s timeshift dir %s\n", g_settings.network_nfs_recordingdir, timeshiftDir); + CRecordManager::getInstance()->SetTimeshiftDirectory(timeshiftDir); + + if(g_settings.auto_delete) { + if(strcmp(g_settings.timeshiftdir, g_settings.network_nfs_recordingdir)) { + DIR *d = opendir(timeshiftDir); + if(d){ + while (struct dirent *e = readdir(d)) + { + std::string filename = e->d_name; + if ((filename.find("_temp.ts") == filename.size() - 8) || (filename.find("_temp.xml") == filename.size() - 9)) + { + std::string timeshiftDir_filename= timeshiftDir; + timeshiftDir_filename+= "/" + filename; + remove(timeshiftDir_filename.c_str()); + } + } + closedir(d); + } + } + } + g_settings.record_hours = configfile.getInt32( "record_hours", 4 ); + g_settings.filesystem_is_utf8 = configfile.getBool("filesystem_is_utf8" , true ); + + //recording (server + vcr) + g_settings.recording_type = configfile.getInt32("recording_type", RECORDING_FILE); + g_settings.recording_stopsectionsd = configfile.getBool("recording_stopsectionsd" , false ); + g_settings.recording_audio_pids_default = configfile.getInt32("recording_audio_pids_default", TIMERD_APIDS_STD | TIMERD_APIDS_AC3); + g_settings.recording_zap_on_announce = configfile.getBool("recording_zap_on_announce" , false); + g_settings.shutdown_timer_record_type = configfile.getBool("shutdown_timer_record_type" , false); + + g_settings.recording_stream_vtxt_pid = configfile.getBool("recordingmenu.stream_vtxt_pid" , false); + g_settings.recording_stream_pmt_pid = configfile.getBool("recordingmenu.stream_pmt_pid" , false); + g_settings.recording_choose_direct_rec_dir = configfile.getInt32( "recording_choose_direct_rec_dir", 0 ); + g_settings.recording_epg_for_filename = configfile.getBool("recording_epg_for_filename" , true); + g_settings.recording_epg_for_end = configfile.getBool("recording_epg_for_end" , false); + g_settings.recording_save_in_channeldir = configfile.getBool("recording_save_in_channeldir" , false); + g_settings.recording_slow_warning = configfile.getBool("recording_slow_warning" , true); + + // default plugin for movieplayer + g_settings.movieplayer_plugin = configfile.getString( "movieplayer_plugin", "Teletext" ); + g_settings.onekey_plugin = configfile.getString( "onekey_plugin", "noplugin" ); + g_settings.plugin_hdd_dir = configfile.getString( "plugin_hdd_dir", "/hdd/tuxbox/plugins" ); + g_settings.logo_hdd_dir = configfile.getString( "logo_hdd_dir", "/var/share/icons/logo" ); + + loadKeys(); + + g_settings.timeshift_pause = configfile.getInt32( "timeshift_pause", 1 ); + + g_settings.screenshot_count = configfile.getInt32( "screenshot_count", 1); + g_settings.screenshot_format = configfile.getInt32( "screenshot_format", 1); + g_settings.screenshot_cover = configfile.getInt32( "screenshot_cover", 0); + g_settings.screenshot_mode = configfile.getInt32( "screenshot_mode", 0); + g_settings.screenshot_video = configfile.getInt32( "screenshot_video", 1); + g_settings.screenshot_scale = configfile.getInt32( "screenshot_scale", 0); + + g_settings.screenshot_dir = configfile.getString( "screenshot_dir", "/media/sda1/movies" ); + g_settings.cacheTXT = configfile.getInt32( "cacheTXT", 0); + g_settings.minimode = configfile.getInt32( "minimode", 0); + g_settings.mode_clock = configfile.getInt32( "mode_clock", 0); + g_settings.zapto_pre_time = configfile.getInt32( "zapto_pre_time", 0); + g_settings.spectrum = configfile.getBool("spectrum" , false); + g_settings.channellist_epgtext_align_right = configfile.getBool("channellist_epgtext_align_right" , false); + g_settings.channellist_extended = configfile.getBool("channellist_extended" , true); + g_settings.channellist_foot = configfile.getInt32("channellist_foot" , 1);//default next Event + g_settings.channellist_new_zap_mode = configfile.getInt32("channellist_new_zap_mode", 1); + g_settings.channellist_sort_mode = configfile.getInt32("channellist_sort_mode", 0);//sort mode: alpha, freq, sat + + //screen configuration + g_settings.screen_xres = configfile.getInt32("screen_xres", 100); + g_settings.screen_yres = configfile.getInt32("screen_yres", 100); + g_settings.screen_StartX_crt = configfile.getInt32( "screen_StartX_crt", DEFAULT_X_START_SD); + g_settings.screen_StartY_crt = configfile.getInt32( "screen_StartY_crt", DEFAULT_Y_START_SD ); + g_settings.screen_EndX_crt = configfile.getInt32( "screen_EndX_crt", DEFAULT_X_END_SD); + g_settings.screen_EndY_crt = configfile.getInt32( "screen_EndY_crt", DEFAULT_Y_END_SD); + g_settings.screen_StartX_lcd = configfile.getInt32( "screen_StartX_lcd", DEFAULT_X_START_HD); + g_settings.screen_StartY_lcd = configfile.getInt32( "screen_StartY_lcd", DEFAULT_Y_START_HD ); + g_settings.screen_EndX_lcd = configfile.getInt32( "screen_EndX_lcd", DEFAULT_X_END_HD); + g_settings.screen_EndY_lcd = configfile.getInt32( "screen_EndY_lcd", DEFAULT_Y_END_HD); + g_settings.screen_preset = configfile.getInt32( "screen_preset", 1); + + g_settings.screen_StartX = g_settings.screen_preset ? g_settings.screen_StartX_lcd : g_settings.screen_StartX_crt; + g_settings.screen_StartY = g_settings.screen_preset ? g_settings.screen_StartY_lcd : g_settings.screen_StartY_crt; + g_settings.screen_EndX = g_settings.screen_preset ? g_settings.screen_EndX_lcd : g_settings.screen_EndX_crt; + g_settings.screen_EndY = g_settings.screen_preset ? g_settings.screen_EndY_lcd : g_settings.screen_EndY_crt; + + g_settings.screen_width = configfile.getInt32("screen_width", 0); + g_settings.screen_height = configfile.getInt32("screen_height", 0); + + g_settings.bigFonts = configfile.getInt32("bigFonts", 0); + g_settings.big_windows = configfile.getInt32("big_windows", 0); + + g_settings.remote_control_hardware = configfile.getInt32( "remote_control_hardware", CRCInput::RC_HW_COOLSTREAM); + g_settings.audiochannel_up_down_enable = configfile.getBool("audiochannel_up_down_enable", false); + + //Software-update + g_settings.softupdate_mode = configfile.getInt32( "softupdate_mode", 1 ); + + strcpy(g_settings.softupdate_url_file, configfile.getString("softupdate_url_file", "/var/etc/update.urls").c_str()); + strcpy(g_settings.softupdate_proxyserver, configfile.getString("softupdate_proxyserver", "" ).c_str()); + strcpy(g_settings.softupdate_proxyusername, configfile.getString("softupdate_proxyusername", "" ).c_str()); + strcpy(g_settings.softupdate_proxypassword, configfile.getString("softupdate_proxypassword", "" ).c_str()); + // + strcpy( g_settings.font_file, configfile.getString( "font_file", FONTDIR"/neutrino.ttf" ).c_str() ); + strcpy( g_settings.ttx_font_file, configfile.getString( "ttx_font_file", FONTDIR"/DejaVuLGCSansMono-Bold.ttf" ).c_str() ); + ttx_font_file = g_settings.ttx_font_file; + strcpy( g_settings.update_dir, configfile.getString( "update_dir", "/tmp" ).c_str() ); + + // parentallock + if (!parentallocked) { + g_settings.parentallock_prompt = configfile.getInt32( "parentallock_prompt", 0 ); + g_settings.parentallock_lockage = configfile.getInt32( "parentallock_lockage", 12 ); + } else { + g_settings.parentallock_prompt = 3; + g_settings.parentallock_lockage = 18; + } + strcpy( g_settings.parentallock_pincode, configfile.getString( "parentallock_pincode", "0000" ).c_str() ); + + for (int i = 0; i < SNeutrinoSettings::TIMING_SETTING_COUNT; i++) + g_settings.timing[i] = configfile.getInt32(locale_real_names[timing_setting[i].name], timing_setting[i].default_timing); + + for (int i = 0; i < SNeutrinoSettings::LCD_SETTING_COUNT; i++) + g_settings.lcd_setting[i] = configfile.getInt32(lcd_setting[i].name, lcd_setting[i].default_value); + strcpy(g_settings.lcd_setting_dim_time, configfile.getString("lcd_dim_time","0").c_str()); + g_settings.lcd_setting_dim_brightness = configfile.getInt32("lcd_dim_brightness", 0); + g_settings.lcd_info_line = configfile.getInt32("lcd_info_line", 0);//channel name or clock + + //Picture-Viewer + strcpy( g_settings.picviewer_slide_time, configfile.getString( "picviewer_slide_time", "10" ).c_str() ); + g_settings.picviewer_scaling = configfile.getInt32("picviewer_scaling", 1 /*(int)CPictureViewer::SIMPLE*/); + g_settings.picviewer_decode_server_ip = configfile.getString("picviewer_decode_server_ip", ""); + + //Audio-Player + g_settings.audioplayer_display = configfile.getInt32("audioplayer_display",(int)CAudioPlayerGui::ARTIST_TITLE); + g_settings.audioplayer_follow = configfile.getInt32("audioplayer_follow",0); + strcpy( g_settings.audioplayer_screensaver, configfile.getString( "audioplayer_screensaver", "1" ).c_str() ); + g_settings.audioplayer_highprio = configfile.getInt32("audioplayer_highprio",0); + g_settings.audioplayer_select_title_by_name = configfile.getInt32("audioplayer_select_title_by_name",0); + g_settings.audioplayer_repeat_on = configfile.getInt32("audioplayer_repeat_on",0); + g_settings.audioplayer_show_playlist = configfile.getInt32("audioplayer_show_playlist",1); + g_settings.audioplayer_enable_sc_metadata = configfile.getInt32("audioplayer_enable_sc_metadata",1); + g_settings.shoutcast_dev_id = configfile.getString("shoutcast_dev_id","XXXXXXXXXXXXXXXX"); + + //Filebrowser + g_settings.filebrowser_showrights = configfile.getInt32("filebrowser_showrights", 1); + g_settings.filebrowser_sortmethod = configfile.getInt32("filebrowser_sortmethod", 0); + if ((g_settings.filebrowser_sortmethod < 0) || (g_settings.filebrowser_sortmethod >= FILEBROWSER_NUMBER_OF_SORT_VARIANTS)) + g_settings.filebrowser_sortmethod = 0; + g_settings.filebrowser_denydirectoryleave = configfile.getBool("filebrowser_denydirectoryleave", false); + //zapit setup + g_settings.StartChannelTV = configfile.getString("startchanneltv",""); + g_settings.StartChannelRadio = configfile.getString("startchannelradio",""); + g_settings.startchanneltv_id = configfile.getInt64("startchanneltv_id", 0); + g_settings.startchannelradio_id = configfile.getInt64("startchannelradio_id", 0); + g_settings.uselastchannel = configfile.getInt32("uselastchannel" , 1); + + + // USERMENU -> in system/settings.h + //------------------------------------------- + // this is as the current neutrino usermen + const char* usermenu_default[SNeutrinoSettings::BUTTON_MAX]={ + "2,3,4,13", // RED + "6", // GREEN + "7", // YELLOW + "12,11,20,21,19,14,15" // BLUE + }; + char txt1[81]; + std::string txt2; + const char* txt2ptr; + for(int button = 0; button < SNeutrinoSettings::BUTTON_MAX; button++) + { + snprintf(txt1,80,"usermenu_tv_%s_text",usermenu_button_def[button]); + txt1[80] = 0; // terminate for sure + g_settings.usermenu_text[button] = configfile.getString(txt1, ""); + + snprintf(txt1,80,"usermenu_tv_%s",usermenu_button_def[button]); + txt2 = configfile.getString(txt1,usermenu_default[button]); + txt2ptr = txt2.c_str(); + for( int pos = 0; pos < SNeutrinoSettings::ITEM_MAX; pos++) + { + // find next comma or end of string - if it's not the first round + if(pos != 0) + { + while(*txt2ptr != 0 && *txt2ptr != ',') + txt2ptr++; + if(*txt2ptr != 0) + txt2ptr++; + } + if(*txt2ptr != 0) + { + g_settings.usermenu[button][pos] = atoi(txt2ptr); // there is still a string + if(g_settings.usermenu[button][pos] >= SNeutrinoSettings::ITEM_MAX) + g_settings.usermenu[button][pos] = 0; + } + else + g_settings.usermenu[button][pos] = 0; // string empty, fill up with 0 + + } + } + + if(configfile.getUnknownKeyQueryedFlag() && (erg==0)) { + erg = 2; + } + + /* in case FB resolution changed */ + if((g_settings.screen_width && g_settings.screen_width != (int) frameBuffer->getScreenWidth(true)) + || (g_settings.screen_height && g_settings.screen_height != (int) frameBuffer->getScreenHeight(true))) { + g_settings.screen_StartX = g_settings.screen_preset ? DEFAULT_X_START_HD : DEFAULT_X_START_SD; + g_settings.screen_StartY = g_settings.screen_preset ? DEFAULT_Y_START_HD : DEFAULT_Y_START_SD; + g_settings.screen_EndX = g_settings.screen_preset ? DEFAULT_X_END_HD : DEFAULT_X_END_SD; + g_settings.screen_EndY = g_settings.screen_preset ? DEFAULT_Y_END_HD : DEFAULT_Y_END_SD; + + g_settings.screen_width = frameBuffer->getScreenWidth(true); + g_settings.screen_height = frameBuffer->getScreenHeight(true); + } + if(erg) + configfile.setModifiedFlag(true); + return erg; +} + +/************************************************************************************** +* CNeutrinoApp - saveSetup, save the application-settings * +**************************************************************************************/ +void CNeutrinoApp::saveSetup(const char * fname) +{ + char cfg_key[81]; + //scansettings + if(!scansettings.saveSettings(NEUTRINO_SCAN_SETTINGS_FILE)) { + dprintf(DEBUG_NORMAL, "error while saving scan-settings!\n"); + } + + //video + configfile.setInt32( "video_Mode", g_settings.video_Mode ); + configfile.setInt32( "analog_mode1", g_settings.analog_mode1 ); + configfile.setInt32( "analog_mode2", g_settings.analog_mode2 ); + configfile.setInt32( "video_Format", g_settings.video_Format ); + configfile.setInt32( "video_43mode", g_settings.video_43mode ); + configfile.setInt32( "hdmi_cec_mode", g_settings.hdmi_cec_mode ); + configfile.setInt32( "hdmi_cec_view_on", g_settings.hdmi_cec_view_on ); + configfile.setInt32( "hdmi_cec_standby", g_settings.hdmi_cec_standby ); + + configfile.setInt32( "current_volume", g_settings.current_volume ); + configfile.setInt32( "current_volume_step", g_settings.current_volume_step ); + configfile.setInt32( "channel_mode", g_settings.channel_mode ); + configfile.setInt32( "channel_mode_radio", g_settings.channel_mode_radio ); + + configfile.setInt32( "fan_speed", g_settings.fan_speed); + + configfile.setInt32( "srs_enable", g_settings.srs_enable); + configfile.setInt32( "srs_algo", g_settings.srs_algo); + configfile.setInt32( "srs_ref_volume", g_settings.srs_ref_volume); + configfile.setInt32( "srs_nmgr_enable", g_settings.srs_nmgr_enable); + configfile.setInt32( "hdmi_dd", g_settings.hdmi_dd); + configfile.setInt32( "analog_out", g_settings.analog_out); + configfile.setInt32( "spdif_dd", g_settings.spdif_dd); + configfile.setInt32( "avsync", g_settings.avsync); + configfile.setInt32( "clockrec", g_settings.clockrec); + configfile.setInt32( "video_dbdr", g_settings.video_dbdr); + for(int i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT; i++) { + sprintf(cfg_key, "enabled_video_mode_%d", i); + configfile.setInt32(cfg_key, g_settings.enabled_video_modes[i]); + } + configfile.setInt32( "cpufreq", g_settings.cpufreq); + configfile.setInt32( "standby_cpufreq", g_settings.standby_cpufreq); + configfile.setInt32("rounded_corners", g_settings.rounded_corners); + configfile.setInt32("ci_standby_reset", g_settings.ci_standby_reset); + configfile.setInt32("ci_clock", g_settings.ci_clock); + + configfile.setInt32( "make_hd_list", g_settings.make_hd_list); + configfile.setInt32( "make_new_list", g_settings.make_new_list); + configfile.setInt32( "make_removed_list", g_settings.make_removed_list); + configfile.setInt32( "keep_channel_numbers", g_settings.keep_channel_numbers); + //led + configfile.setInt32( "led_tv_mode", g_settings.led_tv_mode); + configfile.setInt32( "led_standby_mode", g_settings.led_standby_mode); + configfile.setInt32( "led_deep_mode", g_settings.led_deep_mode); + configfile.setInt32( "led_rec_mode", g_settings.led_rec_mode); + configfile.setInt32( "led_blink", g_settings.led_blink); + + //misc + configfile.setInt32( "power_standby", g_settings.power_standby); + configfile.setInt32( "rotor_swap", g_settings.rotor_swap); + configfile.setInt32( "zap_cycle", g_settings.zap_cycle ); + configfile.setInt32( "hdd_fs", g_settings.hdd_fs); + configfile.setInt32( "hdd_sleep", g_settings.hdd_sleep); + configfile.setInt32( "hdd_noise", g_settings.hdd_noise); + configfile.setBool("shutdown_real" , g_settings.shutdown_real ); + configfile.setBool("shutdown_real_rcdelay", g_settings.shutdown_real_rcdelay); + configfile.setString("shutdown_count" , g_settings.shutdown_count); + configfile.setString("shutdown_min" , g_settings.shutdown_min ); + configfile.setBool("infobar_sat_display" , g_settings.infobar_sat_display ); + configfile.setBool("infobar_show_channeldesc" , g_settings.infobar_show_channeldesc ); + configfile.setInt32("infobar_subchan_disp_pos" , g_settings.infobar_subchan_disp_pos ); + configfile.setBool("progressbar_color" , g_settings.progressbar_color ); + configfile.setInt32("infobar_show", g_settings.infobar_show); + configfile.setInt32("infobar_show_channellogo" , g_settings.infobar_show_channellogo ); + configfile.setInt32("casystem_display" , g_settings.casystem_display ); + configfile.setBool("scrambled_message" , g_settings.scrambled_message ); + configfile.setInt32("volume_pos" , g_settings.volume_pos ); + configfile.setBool("volume_digits", g_settings.volume_digits); + configfile.setInt32("menu_pos" , g_settings.menu_pos); + configfile.setBool("show_menu_hints" , g_settings.show_menu_hints); + configfile.setInt32("infobar_show_sysfs_hdd" , g_settings.infobar_show_sysfs_hdd ); + configfile.setInt32("show_mute_icon" , g_settings.show_mute_icon); + configfile.setInt32("infobar_show_res" , g_settings.infobar_show_res ); + configfile.setInt32("infobar_show_dd_available" , g_settings.infobar_show_dd_available ); + configfile.setInt32("infobar_show_tuner" , g_settings.infobar_show_tuner ); + configfile.setBool("radiotext_enable" , g_settings.radiotext_enable); + //audio + configfile.setInt32( "audio_AnalogMode", g_settings.audio_AnalogMode ); + configfile.setBool("audio_DolbyDigital" , g_settings.audio_DolbyDigital ); + configfile.setInt32( "auto_lang", g_settings.auto_lang ); + configfile.setInt32( "auto_subs", g_settings.auto_subs ); + for(int i = 0; i < 3; i++) { + sprintf(cfg_key, "pref_lang_%d", i); + configfile.setString(cfg_key, g_settings.pref_lang[i]); + sprintf(cfg_key, "pref_subs_%d", i); + configfile.setString(cfg_key, g_settings.pref_subs[i]); + } + configfile.setString( "audio_PCMOffset", g_settings.audio_PCMOffset ); + + //vcr + configfile.setBool("vcr_AutoSwitch" , g_settings.vcr_AutoSwitch ); + + //language + configfile.setString("language", g_settings.language); + configfile.setString("timezone", g_settings.timezone); + // epg + configfile.setBool("epg_save", g_settings.epg_save); + configfile.setBool("epg_save_standby", g_settings.epg_save_standby); + configfile.setString("epg_cache_time" ,g_settings.epg_cache ); + configfile.setString("epg_extendedcache_time" ,g_settings.epg_extendedcache); + configfile.setString("epg_old_events" ,g_settings.epg_old_events ); + configfile.setString("epg_max_events" ,g_settings.epg_max_events ); + configfile.setString("epg_dir" ,g_settings.epg_dir); + + // NTP-Server for sectionsd + configfile.setString( "network_ntpserver", g_settings.network_ntpserver); + configfile.setString( "network_ntprefresh", g_settings.network_ntprefresh); + configfile.setBool( "network_ntpenable", g_settings.network_ntpenable); + + configfile.setString("ifname", g_settings.ifname); + + //widget settings + configfile.setBool("widget_fade" , g_settings.widget_fade ); + + //colors + configfile.setInt32( "menu_Head_alpha", g_settings.menu_Head_alpha ); + configfile.setInt32( "menu_Head_red", g_settings.menu_Head_red ); + configfile.setInt32( "menu_Head_green", g_settings.menu_Head_green ); + configfile.setInt32( "menu_Head_blue", g_settings.menu_Head_blue ); + + configfile.setInt32( "menu_Head_Text_alpha", g_settings.menu_Head_Text_alpha ); + configfile.setInt32( "menu_Head_Text_red", g_settings.menu_Head_Text_red ); + configfile.setInt32( "menu_Head_Text_green", g_settings.menu_Head_Text_green ); + configfile.setInt32( "menu_Head_Text_blue", g_settings.menu_Head_Text_blue ); + + configfile.setInt32( "menu_Content_alpha", g_settings.menu_Content_alpha ); + configfile.setInt32( "menu_Content_red", g_settings.menu_Content_red ); + configfile.setInt32( "menu_Content_green", g_settings.menu_Content_green ); + configfile.setInt32( "menu_Content_blue", g_settings.menu_Content_blue ); + + configfile.setInt32( "menu_Content_Text_alpha", g_settings.menu_Content_Text_alpha ); + configfile.setInt32( "menu_Content_Text_red", g_settings.menu_Content_Text_red ); + configfile.setInt32( "menu_Content_Text_green", g_settings.menu_Content_Text_green ); + configfile.setInt32( "menu_Content_Text_blue", g_settings.menu_Content_Text_blue ); + + configfile.setInt32( "menu_Content_Selected_alpha", g_settings.menu_Content_Selected_alpha ); + configfile.setInt32( "menu_Content_Selected_red", g_settings.menu_Content_Selected_red ); + configfile.setInt32( "menu_Content_Selected_green", g_settings.menu_Content_Selected_green ); + configfile.setInt32( "menu_Content_Selected_blue", g_settings.menu_Content_Selected_blue ); + + configfile.setInt32( "menu_Content_Selected_Text_alpha", g_settings.menu_Content_Selected_Text_alpha ); + configfile.setInt32( "menu_Content_Selected_Text_red", g_settings.menu_Content_Selected_Text_red ); + configfile.setInt32( "menu_Content_Selected_Text_green", g_settings.menu_Content_Selected_Text_green ); + configfile.setInt32( "menu_Content_Selected_Text_blue", g_settings.menu_Content_Selected_Text_blue ); + + configfile.setInt32( "menu_Content_inactive_alpha", g_settings.menu_Content_inactive_alpha ); + configfile.setInt32( "menu_Content_inactive_red", g_settings.menu_Content_inactive_red ); + configfile.setInt32( "menu_Content_inactive_green", g_settings.menu_Content_inactive_green ); + configfile.setInt32( "menu_Content_inactive_blue", g_settings.menu_Content_inactive_blue ); + + configfile.setInt32( "menu_Content_inactive_Text_alpha", g_settings.menu_Content_inactive_Text_alpha ); + configfile.setInt32( "menu_Content_inactive_Text_red", g_settings.menu_Content_inactive_Text_red ); + configfile.setInt32( "menu_Content_inactive_Text_green", g_settings.menu_Content_inactive_Text_green ); + configfile.setInt32( "menu_Content_inactive_Text_blue", g_settings.menu_Content_inactive_Text_blue ); + + configfile.setInt32( "infobar_alpha", g_settings.infobar_alpha ); + configfile.setInt32( "infobar_red", g_settings.infobar_red ); + configfile.setInt32( "infobar_green", g_settings.infobar_green ); + configfile.setInt32( "infobar_blue", g_settings.infobar_blue ); + + configfile.setInt32( "infobar_Text_alpha", g_settings.infobar_Text_alpha ); + configfile.setInt32( "infobar_Text_red", g_settings.infobar_Text_red ); + configfile.setInt32( "infobar_Text_green", g_settings.infobar_Text_green ); + configfile.setInt32( "infobar_Text_blue", g_settings.infobar_Text_blue ); + + //personalize + configfile.setString("personalize_pincode", g_settings.personalize_pincode); + for (int i = 0; i < SNeutrinoSettings::P_SETTINGS_MAX; i++) //settings.h, settings.cpp + configfile.setInt32(personalize_settings[i].personalize_settings_name, g_settings.personalize[i]); + + configfile.setInt32( "colored_events_channellist", g_settings.colored_events_channellist ); + configfile.setInt32( "colored_events_infobar", g_settings.colored_events_infobar ); + configfile.setInt32( "colored_events_alpha", g_settings.colored_events_alpha ); + configfile.setInt32( "colored_events_red", g_settings.colored_events_red ); + configfile.setInt32( "colored_events_green", g_settings.colored_events_green ); + configfile.setInt32( "colored_events_blue", g_settings.colored_events_blue ); + + configfile.setInt32( "contrast_fonts", g_settings.contrast_fonts ); + //network + for(int i=0 ; i < NETWORK_NFS_NR_OF_ENTRIES ; i++) { + sprintf(cfg_key, "network_nfs_ip_%d", i); + configfile.setString( cfg_key, g_settings.network_nfs_ip[i] ); + sprintf(cfg_key, "network_nfs_dir_%d", i); + configfile.setString( cfg_key, g_settings.network_nfs_dir[i] ); + sprintf(cfg_key, "network_nfs_local_dir_%d", i); + configfile.setString( cfg_key, g_settings.network_nfs_local_dir[i] ); + sprintf(cfg_key, "network_nfs_automount_%d", i); + configfile.setInt32( cfg_key, g_settings.network_nfs_automount[i]); + sprintf(cfg_key, "network_nfs_type_%d", i); + configfile.setInt32( cfg_key, g_settings.network_nfs_type[i]); + sprintf(cfg_key,"network_nfs_username_%d", i); + configfile.setString( cfg_key, g_settings.network_nfs_username[i] ); + sprintf(cfg_key, "network_nfs_password_%d", i); + configfile.setString( cfg_key, g_settings.network_nfs_password[i] ); + sprintf(cfg_key, "network_nfs_mount_options1_%d", i); + configfile.setString( cfg_key, g_settings.network_nfs_mount_options1[i]); + sprintf(cfg_key, "network_nfs_mount_options2_%d", i); + configfile.setString( cfg_key, g_settings.network_nfs_mount_options2[i]); + sprintf(cfg_key, "network_nfs_mac_%d", i); + configfile.setString( cfg_key, g_settings.network_nfs_mac[i]); + } + configfile.setString( "network_nfs_audioplayerdir", g_settings.network_nfs_audioplayerdir); + configfile.setString( "network_nfs_picturedir", g_settings.network_nfs_picturedir); + configfile.setString( "network_nfs_moviedir", g_settings.network_nfs_moviedir); + configfile.setString( "network_nfs_recordingdir", g_settings.network_nfs_recordingdir); + configfile.setString( "timeshiftdir", g_settings.timeshiftdir); + configfile.setBool ("filesystem_is_utf8" , g_settings.filesystem_is_utf8 ); + + //recording (server + vcr) + configfile.setInt32 ("recording_type", g_settings.recording_type); + configfile.setBool ("recording_stopsectionsd" , g_settings.recording_stopsectionsd ); + + configfile.setInt32 ("recording_audio_pids_default" , g_settings.recording_audio_pids_default); + configfile.setBool ("recording_zap_on_announce" , g_settings.recording_zap_on_announce ); + configfile.setBool ("shutdown_timer_record_type" , g_settings.shutdown_timer_record_type ); + + configfile.setBool ("recordingmenu.stream_vtxt_pid" , g_settings.recording_stream_vtxt_pid ); + configfile.setBool ("recordingmenu.stream_pmt_pid" , g_settings.recording_stream_pmt_pid ); + configfile.setInt32 ("recording_choose_direct_rec_dir" , g_settings.recording_choose_direct_rec_dir); + configfile.setBool ("recording_epg_for_filename" , g_settings.recording_epg_for_filename ); + configfile.setBool ("recording_epg_for_end" , g_settings.recording_epg_for_end ); + configfile.setBool ("recording_save_in_channeldir" , g_settings.recording_save_in_channeldir ); + configfile.setBool ("recording_slow_warning" , g_settings.recording_slow_warning ); + + // default plugin for movieplayer + configfile.setString ( "movieplayer_plugin", g_settings.movieplayer_plugin ); + configfile.setString ( "onekey_plugin", g_settings.onekey_plugin ); + configfile.setString ( "plugin_hdd_dir", g_settings.plugin_hdd_dir ); + configfile.setString ( "logo_hdd_dir", g_settings.logo_hdd_dir ); + + saveKeys(); + + configfile.setInt32( "timeshift_pause", g_settings.timeshift_pause ); + configfile.setInt32( "temp_timeshift", g_settings.temp_timeshift ); + configfile.setInt32( "auto_timeshift", g_settings.auto_timeshift ); + configfile.setInt32( "auto_delete", g_settings.auto_delete ); + configfile.setInt32( "record_hours", g_settings.record_hours ); + //printf("set: key_unlock =============== %d\n", g_settings.key_unlock); + configfile.setInt32( "screenshot_count", g_settings.screenshot_count ); + configfile.setInt32( "screenshot_format", g_settings.screenshot_format ); + configfile.setInt32( "screenshot_cover", g_settings.screenshot_cover ); + configfile.setInt32( "screenshot_mode", g_settings.screenshot_mode ); + configfile.setInt32( "screenshot_video", g_settings.screenshot_video ); + configfile.setInt32( "screenshot_scale", g_settings.screenshot_scale ); + + configfile.setString( "screenshot_dir", g_settings.screenshot_dir); + configfile.setInt32( "cacheTXT", g_settings.cacheTXT ); + configfile.setInt32( "minimode", g_settings.minimode ); + configfile.setInt32( "mode_clock", g_settings.mode_clock ); + configfile.setInt32( "zapto_pre_time", g_settings.zapto_pre_time ); + configfile.setBool("spectrum", g_settings.spectrum); + configfile.setBool("channellist_epgtext_align_right", g_settings.channellist_epgtext_align_right); + configfile.setBool("channellist_extended" , g_settings.channellist_extended); + configfile.setInt32("channellist_foot" , g_settings.channellist_foot); + configfile.setInt32("channellist_new_zap_mode", g_settings.channellist_new_zap_mode); + configfile.setInt32("channellist_minitv", g_settings.channellist_minitv); + configfile.setInt32("remote_control_hardware", g_settings.remote_control_hardware); + configfile.setBool ( "audiochannel_up_down_enable", g_settings.audiochannel_up_down_enable ); + configfile.setInt32("channellist_sort_mode", g_settings.channellist_sort_mode); + + //screen configuration + configfile.setInt32( "screen_xres", g_settings.screen_xres); + configfile.setInt32( "screen_yres", g_settings.screen_yres); + configfile.setInt32( "screen_StartX_lcd", g_settings.screen_StartX_lcd ); + configfile.setInt32( "screen_StartY_lcd", g_settings.screen_StartY_lcd ); + configfile.setInt32( "screen_EndX_lcd", g_settings.screen_EndX_lcd ); + configfile.setInt32( "screen_EndY_lcd", g_settings.screen_EndY_lcd ); + configfile.setInt32( "screen_StartX_crt", g_settings.screen_StartX_crt ); + configfile.setInt32( "screen_StartY_crt", g_settings.screen_StartY_crt ); + configfile.setInt32( "screen_EndX_crt", g_settings.screen_EndX_crt ); + configfile.setInt32( "screen_EndY_crt", g_settings.screen_EndY_crt ); + configfile.setInt32( "screen_preset", g_settings.screen_preset ); + configfile.setInt32( "screen_width", g_settings.screen_width); + configfile.setInt32( "screen_height", g_settings.screen_height); + + //Software-update + configfile.setInt32 ("softupdate_mode" , g_settings.softupdate_mode ); + configfile.setString("softupdate_url_file" , g_settings.softupdate_url_file ); + + configfile.setString("softupdate_proxyserver" , g_settings.softupdate_proxyserver ); + configfile.setString("softupdate_proxyusername" , g_settings.softupdate_proxyusername ); + configfile.setString("softupdate_proxypassword" , g_settings.softupdate_proxypassword ); + + configfile.setString("update_dir", g_settings.update_dir); + configfile.setString("font_file", g_settings.font_file); + configfile.setString("ttx_font_file", g_settings.ttx_font_file); + + //parentallock + configfile.setInt32( "parentallock_prompt", g_settings.parentallock_prompt ); + configfile.setInt32( "parentallock_lockage", g_settings.parentallock_lockage ); + configfile.setString( "parentallock_pincode", g_settings.parentallock_pincode ); + + //timing + for (int i = 0; i < SNeutrinoSettings::TIMING_SETTING_COUNT; i++) + configfile.setInt32(locale_real_names[timing_setting[i].name], g_settings.timing[i]); + + for (int i = 0; i < SNeutrinoSettings::LCD_SETTING_COUNT; i++) + configfile.setInt32(lcd_setting[i].name, g_settings.lcd_setting[i]); + configfile.setString("lcd_dim_time", g_settings.lcd_setting_dim_time); + configfile.setInt32("lcd_dim_brightness", g_settings.lcd_setting_dim_brightness); + configfile.setInt32("lcd_info_line", g_settings.lcd_info_line);//channel name or clock + + //Picture-Viewer + configfile.setString( "picviewer_slide_time", g_settings.picviewer_slide_time ); + configfile.setInt32( "picviewer_scaling", g_settings.picviewer_scaling ); + configfile.setString( "picviewer_decode_server_ip", g_settings.picviewer_decode_server_ip ); + configfile.setString( "picviewer_decode_server_port", g_settings.picviewer_decode_server_port); + + //Audio-Player + configfile.setInt32( "audioplayer_display", g_settings.audioplayer_display ); + configfile.setInt32( "audioplayer_follow", g_settings.audioplayer_follow ); + configfile.setString( "audioplayer_screensaver", g_settings.audioplayer_screensaver ); + configfile.setInt32( "audioplayer_highprio", g_settings.audioplayer_highprio ); + configfile.setInt32( "audioplayer_select_title_by_name", g_settings.audioplayer_select_title_by_name ); + configfile.setInt32( "audioplayer_repeat_on", g_settings.audioplayer_repeat_on ); + configfile.setInt32( "audioplayer_show_playlist", g_settings.audioplayer_show_playlist ); + configfile.setInt32( "audioplayer_enable_sc_metadata", g_settings.audioplayer_enable_sc_metadata ); + configfile.setString( "shoutcast_dev_id", g_settings.shoutcast_dev_id ); + + //Filebrowser + configfile.setInt32("filebrowser_showrights", g_settings.filebrowser_showrights); + configfile.setInt32("filebrowser_sortmethod", g_settings.filebrowser_sortmethod); + configfile.setBool("filebrowser_denydirectoryleave", g_settings.filebrowser_denydirectoryleave); + + //zapit setup + configfile.setString( "startchanneltv", g_settings.StartChannelTV ); + configfile.setString( "startchannelradio", g_settings.StartChannelRadio ); + configfile.setInt64("startchanneltv_id", g_settings.startchanneltv_id); + configfile.setInt64("startchannelradio_id", g_settings.startchannelradio_id); + configfile.setInt32("uselastchannel", g_settings.uselastchannel); + + // USERMENU + //--------------------------------------- + char txt1[81]; + char txt2[81]; + for(int button = 0; button < SNeutrinoSettings::BUTTON_MAX; button++) { + snprintf(txt1,80,"usermenu_tv_%s_text",usermenu_button_def[button]); + txt1[80] = 0; // terminate for sure + configfile.setString(txt1,g_settings.usermenu_text[button]); + + char* txt2ptr = txt2; + snprintf(txt1,80,"usermenu_tv_%s",usermenu_button_def[button]); + for(int pos = 0; pos < SNeutrinoSettings::ITEM_MAX; pos++) { + if( g_settings.usermenu[button][pos] != 0) { + if(pos != 0) + *txt2ptr++ = ','; + txt2ptr += snprintf(txt2ptr,80,"%d",g_settings.usermenu[button][pos]); + } + } + configfile.setString(txt1,txt2); + } + + configfile.setInt32("bigFonts", g_settings.bigFonts); + configfile.setInt32("big_windows", g_settings.big_windows); +#if 0 + configfile.setInt32("pip_x", g_settings.pip_x); + configfile.setInt32("pip_y", g_settings.pip_y); + configfile.setInt32("pip_width", g_settings.pip_width); + configfile.setInt32("pip_height", g_settings.pip_height); +#endif + if(strcmp(fname, NEUTRINO_SETTINGS_FILE)) + configfile.saveConfig(fname); + + else if (configfile.getModifiedFlag()) + { + configfile.saveConfig(fname); + configfile.setModifiedFlag(false); + } +} + +/************************************************************************************** +* CNeutrinoApp - channelsInit, get the Channellist from daemon * +**************************************************************************************/ +extern CBouquetManager *g_bouquetManager; + +void CNeutrinoApp::channelsInit(bool bOnly) +{ + int bnum; + CBouquet* tmp; + + printf("[neutrino] Creating channels lists...\n"); + TIMER_START(); + + if(!reloadhintBox) + reloadhintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SERVICEMENU_RELOAD_HINT)); + reloadhintBox->paint(); + + memset(tvsort, -1, sizeof(tvsort)); + memset(radiosort, -1, sizeof(tvsort)); + + const char * fav_bouquetname = g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME); + if(g_bouquetManager->existsUBouquet(fav_bouquetname, true) == -1) + g_bouquetManager->addBouquet(fav_bouquetname, true, true); + + + if(TVbouquetList) delete TVbouquetList; + if(RADIObouquetList) delete RADIObouquetList; + + if(TVfavList) delete TVfavList; + if(RADIOfavList) delete RADIOfavList; + + if(TVchannelList) delete TVchannelList; + if(RADIOchannelList) delete RADIOchannelList; + + TVchannelList = new CChannelList(g_Locale->getText(LOCALE_CHANNELLIST_HEAD), false, true); + RADIOchannelList = new CChannelList(g_Locale->getText(LOCALE_CHANNELLIST_HEAD), false, true); + + TVbouquetList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_PROVS)); + TVfavList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_FAVS)); + + RADIObouquetList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_PROVS)); + RADIOfavList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_FAVS)); + + uint32_t i; + i = 1; + + int tvi = 0, ri = 0; + + ZapitChannelList zapitList; + + /* all TV channels */ + CServiceManager::getInstance()->GetAllTvChannels(zapitList); + tvi = zapitList.size(); + TVchannelList->SetChannelList(&zapitList); + + /* all RADIO channels */ + CServiceManager::getInstance()->GetAllRadioChannels(zapitList); + ri = zapitList.size(); + + RADIOchannelList->SetChannelList(&zapitList); + + printf("[neutrino] got %d TV and %d RADIO channels\n", tvi, ri); fflush(stdout); + TIMER_STOP("[neutrino] all channels took"); + + /* unless we will do real channel delete from allchans, needed once ? */ + if(!bOnly) { + if(TVallList) delete TVallList; + if(RADIOallList) delete RADIOallList; + + TVallList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_HEAD)); + tmp = TVallList->addBouquet(g_Locale->getText(LOCALE_CHANNELLIST_HEAD)); + delete tmp->channelList; + tmp->channelList = new CChannelList(*TVchannelList); + //tmp->channelList->SortAlpha(); + + RADIOallList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_HEAD)); + tmp = RADIOallList->addBouquet(g_Locale->getText(LOCALE_CHANNELLIST_HEAD)); + delete tmp->channelList; + tmp->channelList = new CChannelList(*RADIOchannelList); + //tmp->channelList->SortAlpha(); + + TIMER_STOP("[neutrino] sort took"); + + if(TVsatList) delete TVsatList; + TVsatList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_SATS)); + if(RADIOsatList) delete RADIOsatList; + RADIOsatList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_SATS)); + + /* all TV / RADIO channels per satellite */ + sat_iterator_t sit; + satellite_map_t satlist = CServiceManager::getInstance()->SatelliteList(); + for(sit = satlist.begin(); sit != satlist.end(); sit++) { + CServiceManager::getInstance()->GetAllSatelliteChannels(zapitList, sit->first); + if( zapitList.empty() ) + continue; + + tvi = 0, ri = 0; + CBouquet* tmp1 = TVsatList->addBouquet(sit->second.name.c_str()); + CBouquet* tmp2 = RADIOsatList->addBouquet(sit->second.name.c_str()); + + for(zapit_list_it_t it = zapitList.begin(); it != zapitList.end(); it++) { + if ((*it)->getServiceType() == ST_DIGITAL_TELEVISION_SERVICE) { + tmp1->channelList->addChannel(*it); + tvi++; + } + else if ((*it)->getServiceType() == ST_DIGITAL_RADIO_SOUND_SERVICE) { + tmp2->channelList->addChannel(*it); + ri++; + } + } + printf("[neutrino] created %s bouquet with %d TV and %d RADIO channels\n", sit->second.name.c_str(), tvi, ri); + if(!tvi) + TVsatList->deleteBouquet(tmp1); + if(!ri) + RADIOsatList->deleteBouquet(tmp2); + + TIMER_STOP("[neutrino] sat took"); + } + /* new channels */ + if (g_settings.make_new_list) { + CServiceManager::getInstance()->GetAllTvChannels(zapitList, CZapitChannel::NEW); + if (!zapitList.empty()) { + CBouquet* newBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_NEW), false, true); + newBouquet->channelList->SetChannelList(&zapitList); + TVallList->Bouquets.push_back(newBouquet); + printf("[neutrino] got %d new TV channels\n", zapitList.size()); fflush(stdout); + } + CServiceManager::getInstance()->GetAllRadioChannels(zapitList, CZapitChannel::NEW); + if (!zapitList.empty()) { + CBouquet* newBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_NEW), false, true); + newBouquet->channelList->SetChannelList(&zapitList); + RADIOallList->Bouquets.push_back(newBouquet); + printf("[neutrino] got %d new RADIO channels\n", zapitList.size()); fflush(stdout); + } + } + if (g_settings.make_removed_list) { + CServiceManager::getInstance()->GetAllTvChannels(zapitList, CZapitChannel::REMOVED); + if (!zapitList.empty()) { + CBouquet* newBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_REMOVED), false, true); + newBouquet->channelList->SetChannelList(&zapitList); + TVallList->Bouquets.push_back(newBouquet); + printf("[neutrino] got %d removed TV channels\n", zapitList.size()); fflush(stdout); + } + CServiceManager::getInstance()->GetAllRadioChannels(zapitList, CZapitChannel::REMOVED); + if (!zapitList.empty()) { + CBouquet* newBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_REMOVED), false, true); + newBouquet->channelList->SetChannelList(&zapitList); + RADIOallList->Bouquets.push_back(newBouquet); + printf("[neutrino] got %d removed RADIO channels\n", zapitList.size()); fflush(stdout); + } + } + TIMER_STOP("[neutrino] sats took"); + } + + /* Favorites and providers TV bouquets */ + bnum = 0; + for (i = 0; i < g_bouquetManager->Bouquets.size(); i++) { + if (!g_bouquetManager->Bouquets[i]->bHidden && !g_bouquetManager->Bouquets[i]->tvChannels.empty()) + { + if(g_bouquetManager->Bouquets[i]->bUser) + tmp = TVfavList->addBouquet(g_bouquetManager->Bouquets[i]); + else + tmp = TVbouquetList->addBouquet(g_bouquetManager->Bouquets[i]); + + ZapitChannelList* channels = &(g_bouquetManager->Bouquets[i]->tvChannels); + tmp->channelList->SetChannelList(channels); + bnum++; + } + } + printf("[neutrino] got %d TV bouquets\n", bnum); fflush(stdout); + + /* all HD channels */ + if (g_settings.make_hd_list) { + CServiceManager::getInstance()->GetAllHDChannels(zapitList); + if (!zapitList.empty()) { + CBouquet* hdBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_HDTV), false, true); + hdBouquet->channelList->SetChannelList(&zapitList); + hdBouquet->channelList->SortSat(); + TVfavList->Bouquets.push_back(hdBouquet); + printf("[neutrino] got %d HD channels\n", zapitList.size()); fflush(stdout); + } + } + TIMER_STOP("[neutrino] tv took"); + + /* Favorites and provides RADIO bouquets */ + bnum = 0; + for (i = 0; i < g_bouquetManager->Bouquets.size(); i++) { + if (!g_bouquetManager->Bouquets[i]->bHidden && !g_bouquetManager->Bouquets[i]->radioChannels.empty() ) + { + if(g_bouquetManager->Bouquets[i]->bUser) + tmp = RADIOfavList->addBouquet(g_bouquetManager->Bouquets[i]); + else + tmp = RADIObouquetList->addBouquet(g_bouquetManager->Bouquets[i]); + + ZapitChannelList* channels = &(g_bouquetManager->Bouquets[i]->radioChannels); + tmp->channelList->SetChannelList(channels); + bnum++; + } + } + printf("[neutrino] got %d RADIO bouquets\n", bnum); fflush(stdout); + TIMER_STOP("[neutrino] took"); + + SetChannelMode(lastChannelMode); + + dprintf(DEBUG_DEBUG, "\nAll bouquets-channels received\n"); +#ifdef DEBUG + struct mallinfo myinfo = mallinfo(); + printf("[neutrino] total memory allocated by malloc, in bytes: %d (%dkb), chunks %d\n", + myinfo.arena, myinfo.arena / 1024, myinfo.uordblks); +#endif + + reloadhintBox->hide(); +} + +void CNeutrinoApp::SetChannelMode(int newmode) +{ + printf("CNeutrinoApp::SetChannelMode %d [%s]\n", newmode, mode == mode_radio ? "radio" : "tv"); + int *sortmode; + + if(mode == mode_radio) { + channelList = RADIOchannelList; + g_settings.channel_mode_radio = newmode; + sortmode = radiosort; + } else { + channelList = TVchannelList; + g_settings.channel_mode = newmode; + sortmode = tvsort; + } + + switch(newmode) { + case LIST_MODE_FAV: + if(mode == mode_radio) { + bouquetList = RADIOfavList; + } else { + bouquetList = TVfavList; + } + break; + case LIST_MODE_SAT: + if(mode == mode_radio) { + bouquetList = RADIOsatList; + } else { + bouquetList = TVsatList; + } + break; + case LIST_MODE_ALL: + if(mode == mode_radio) { + bouquetList = RADIOallList; + } else { + bouquetList = TVallList; + } + break; + default: + newmode = LIST_MODE_PROV; + case LIST_MODE_PROV: + if(mode == mode_radio) { + bouquetList = RADIObouquetList; + } else { + bouquetList = TVbouquetList; + } + break; + } + INFO("newmode %d sort old %d new %d", newmode, sortmode[newmode], g_settings.channellist_sort_mode); + if(newmode != LIST_MODE_FAV && sortmode[newmode] != g_settings.channellist_sort_mode && g_settings.channellist_sort_mode < CChannelList::SORT_MAX) { + sortmode[newmode] = g_settings.channellist_sort_mode; + INFO("sorting, mode %d, %d bouquets\n", g_settings.channellist_sort_mode, bouquetList->Bouquets.size()); + for (uint32_t i = 0; i < bouquetList->Bouquets.size(); i++) { + if(g_settings.channellist_sort_mode == CChannelList::SORT_ALPHA) + bouquetList->Bouquets[i]->channelList->SortAlpha(); + if(g_settings.channellist_sort_mode == CChannelList::SORT_TP) + bouquetList->Bouquets[i]->channelList->SortTP(); + if(g_settings.channellist_sort_mode == CChannelList::SORT_SAT) + bouquetList->Bouquets[i]->channelList->SortSat(); + if(g_settings.channellist_sort_mode == CChannelList::SORT_CH_NUMBER) + bouquetList->Bouquets[i]->channelList->SortChNumber(); + } + channelList->adjustToChannelID(channelList->getActiveChannel_ChannelID()); + } + lastChannelMode = newmode; +} + +/************************************************************************************** +* CNeutrinoApp - run, the main runloop * +**************************************************************************************/ +extern int cnxt_debug; +extern bool sections_debug; +extern int zapit_debug; + +void CNeutrinoApp::CmdParser(int argc, char **argv) +{ + global_argv = new char *[argc+1]; + for (int i = 0; i < argc; i++) + global_argv[i] = argv[i]; + global_argv[argc] = NULL; + + sections_debug = false; + softupdate = false; + //fromflash = false; + + font.name = NULL; + + for(int x=1; xinit(); + if(frameBuffer->setMode(720, 576, 8 * sizeof(fb_pixel_t))) { + dprintf(DEBUG_NORMAL, "Error while setting framebuffer mode\n"); + exit(-1); + } + frameBuffer->Clear(); +} + +/************************************************************************************** +* CNeutrinoApp - setup fonts * +**************************************************************************************/ + +void CNeutrinoApp::SetupFonts() +{ + const char * style[3]; + + if (g_fontRenderer != NULL) + delete g_fontRenderer; + + g_fontRenderer = new FBFontRenderClass(72 * g_settings.screen_xres / 100, 72 * g_settings.screen_yres / 100); + + if(font.filename != NULL) + free((void *)font.filename); + + printf("[neutrino] settings font file %s\n", g_settings.font_file); + + if(access(g_settings.font_file, F_OK)) { + if(!access(FONTDIR"/neutrino.ttf", F_OK)){ + font.filename = strdup(FONTDIR"/neutrino.ttf"); + strcpy(g_settings.font_file, font.filename); + } + else{ + fprintf( stderr,"[neutrino] font file [%s] not found\n neutrino exit\n",FONTDIR"/neutrino.ttf"); + _exit(0); + } + + } + else{ + font.filename = strdup(g_settings.font_file); + } + style[0] = g_fontRenderer->AddFont(font.filename); + + if(font.name != NULL) + free((void *)font.name); + + font.name = strdup(g_fontRenderer->getFamily(font.filename).c_str()); + + printf("[neutrino] font family %s\n", font.name); + + style[1] = "Bold Regular"; + + g_fontRenderer->AddFont(font.filename, true); // make italics + style[2] = "Italic"; + + for (int i = 0; i < FONT_TYPE_COUNT; i++) + { + if(g_Font[i]) delete g_Font[i]; + g_Font[i] = g_fontRenderer->getFont(font.name, style[neutrino_font[i].style], configfile.getInt32(locale_real_names[neutrino_font[i].name], neutrino_font[i].defaultsize) + neutrino_font[i].size_offset * font.size_offset); + } + g_SignalFont = g_fontRenderer->getFont(font.name, style[signal_font.style], signal_font.defaultsize + signal_font.size_offset * font.size_offset); + /* recalculate infobar position */ + if (g_InfoViewer) + g_InfoViewer->start(); +} + +/************************************************************************************** +* CNeutrinoApp - setup the menu timouts * +**************************************************************************************/ +void CNeutrinoApp::SetupTiming() +{ + for (int i = 0; i < SNeutrinoSettings::TIMING_SETTING_COUNT; i++) + sprintf(g_settings.timing_string[i], "%d", g_settings.timing[i]); +} + + +#define LCD_UPDATE_TIME_RADIO_MODE (6 * 1000 * 1000) +#define LCD_UPDATE_TIME_TV_MODE (60 * 1000 * 1000) + +void CNeutrinoApp::MakeSectionsdConfig(CSectionsdClient::epg_config& config) +{ + config.epg_cache = atoi(g_settings.epg_cache.c_str()); + config.epg_old_events = atoi(g_settings.epg_old_events.c_str()); + config.epg_max_events = atoi(g_settings.epg_max_events.c_str()); + config.epg_extendedcache = atoi(g_settings.epg_extendedcache.c_str()); + config.epg_dir = g_settings.epg_dir; + config.network_ntpserver = g_settings.network_ntpserver; + config.network_ntprefresh = atoi(g_settings.network_ntprefresh.c_str()); + config.network_ntpenable = g_settings.network_ntpenable; +} + +void CNeutrinoApp::SendSectionsdConfig(void) +{ + CSectionsdClient::epg_config config; + MakeSectionsdConfig(config); + g_Sectionsd->setConfig(config); +} + +void CNeutrinoApp::InitZapper() +{ + struct stat my_stat; + + g_InfoViewer->start(); + if (g_settings.epg_save){ + if(stat(g_settings.epg_dir.c_str(), &my_stat) == 0) + g_Sectionsd->readSIfromXML(g_settings.epg_dir.c_str()); + } + int tvmode = CZapit::getInstance()->getMode() & CZapitClient::MODE_TV; + lastChannelMode = tvmode ? g_settings.channel_mode : g_settings.channel_mode_radio; + mode = tvmode ? mode_tv : mode_radio; + + SDTreloadChannels = false; + channelsInit(); + + if(tvmode) + tvMode(true); + else + radioMode(true); + + if(g_settings.cacheTXT) + tuxtxt_init(); + + t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); + if(channelList->getSize() && live_channel_id) + g_Sectionsd->setServiceChanged(live_channel_id, true ); +} + +void CNeutrinoApp::setupRecordingDevice(void) +{ + CRecordManager::getInstance()->SetDirectory(g_settings.network_nfs_recordingdir); + CRecordManager::getInstance()->Config(g_settings.recording_stopsectionsd, g_settings.recording_stream_vtxt_pid, g_settings.recording_stream_pmt_pid); +} + +static void CSSendMessage(uint32_t msg, uint32_t data) +{ + if (g_RCInput) + g_RCInput->postMsg(msg, data); +} + +void CNeutrinoApp::InitTimerdClient() +{ + g_Timerd = new CTimerdClient; + g_Timerd->registerEvent(CTimerdClient::EVT_ANNOUNCE_SHUTDOWN, 222, NEUTRINO_UDS_NAME); + g_Timerd->registerEvent(CTimerdClient::EVT_SHUTDOWN, 222, NEUTRINO_UDS_NAME); + g_Timerd->registerEvent(CTimerdClient::EVT_ANNOUNCE_NEXTPROGRAM, 222, NEUTRINO_UDS_NAME); + g_Timerd->registerEvent(CTimerdClient::EVT_NEXTPROGRAM, 222, NEUTRINO_UDS_NAME); + g_Timerd->registerEvent(CTimerdClient::EVT_STANDBY_ON, 222, NEUTRINO_UDS_NAME); + g_Timerd->registerEvent(CTimerdClient::EVT_STANDBY_OFF, 222, NEUTRINO_UDS_NAME); + g_Timerd->registerEvent(CTimerdClient::EVT_ANNOUNCE_RECORD, 222, NEUTRINO_UDS_NAME); + g_Timerd->registerEvent(CTimerdClient::EVT_RECORD_START, 222, NEUTRINO_UDS_NAME); + g_Timerd->registerEvent(CTimerdClient::EVT_RECORD_STOP, 222, NEUTRINO_UDS_NAME); + g_Timerd->registerEvent(CTimerdClient::EVT_ANNOUNCE_ZAPTO, 222, NEUTRINO_UDS_NAME); + g_Timerd->registerEvent(CTimerdClient::EVT_ZAPTO, 222, NEUTRINO_UDS_NAME); + g_Timerd->registerEvent(CTimerdClient::EVT_SLEEPTIMER, 222, NEUTRINO_UDS_NAME); + g_Timerd->registerEvent(CTimerdClient::EVT_ANNOUNCE_SLEEPTIMER, 222, NEUTRINO_UDS_NAME); + g_Timerd->registerEvent(CTimerdClient::EVT_REMIND, 222, NEUTRINO_UDS_NAME); + g_Timerd->registerEvent(CTimerdClient::EVT_EXEC_PLUGIN, 222, NEUTRINO_UDS_NAME); +} + +void CNeutrinoApp::InitZapitClient() +{ + g_Zapit = new CZapitClient; +#define ZAPIT_EVENT_COUNT 27 + const CZapitClient::events zapit_event[ZAPIT_EVENT_COUNT] = + { + CZapitClient::EVT_ZAP_COMPLETE, + CZapitClient::EVT_ZAP_COMPLETE_IS_NVOD, + CZapitClient::EVT_ZAP_FAILED, + CZapitClient::EVT_ZAP_SUB_COMPLETE, + CZapitClient::EVT_ZAP_SUB_FAILED, + CZapitClient::EVT_ZAP_MOTOR, + CZapitClient::EVT_ZAP_CA_ID, + CZapitClient::EVT_RECORDMODE_ACTIVATED, + CZapitClient::EVT_RECORDMODE_DEACTIVATED, + CZapitClient::EVT_SCAN_COMPLETE, + CZapitClient::EVT_SCAN_FAILED, + CZapitClient::EVT_SCAN_NUM_TRANSPONDERS, + CZapitClient::EVT_SCAN_REPORT_NUM_SCANNED_TRANSPONDERS, + CZapitClient::EVT_SCAN_REPORT_FREQUENCY, + CZapitClient::EVT_SCAN_REPORT_FREQUENCYP, + CZapitClient::EVT_SCAN_SATELLITE, + CZapitClient::EVT_SCAN_NUM_CHANNELS, + CZapitClient::EVT_SCAN_PROVIDER, + CZapitClient::EVT_BOUQUETS_CHANGED, + CZapitClient::EVT_SERVICES_CHANGED, + CZapitClient::EVT_SCAN_SERVICENAME, + CZapitClient::EVT_SCAN_FOUND_TV_CHAN, + CZapitClient::EVT_SCAN_FOUND_RADIO_CHAN, + CZapitClient::EVT_SCAN_FOUND_DATA_CHAN, + CZapitClient::EVT_SDT_CHANGED, + CZapitClient::EVT_PMT_CHANGED, + CZapitClient::EVT_TUNE_COMPLETE, + }; + + for (int i = 0; i < ZAPIT_EVENT_COUNT; i++) + g_Zapit->registerEvent(zapit_event[i], 222, NEUTRINO_UDS_NAME); +} + +void CNeutrinoApp::InitSectiondClient() +{ + g_Sectionsd = new CSectionsdClient; + g_Sectionsd->registerEvent(CSectionsdClient::EVT_TIMESET, 222, NEUTRINO_UDS_NAME); + g_Sectionsd->registerEvent(CSectionsdClient::EVT_GOT_CN_EPG, 222, NEUTRINO_UDS_NAME); + g_Sectionsd->registerEvent(CSectionsdClient::EVT_WRITE_SI_FINISHED, 222, NEUTRINO_UDS_NAME); +} + +#if HAVE_COOL_HARDWARE +#include +#endif + +void wake_up( bool &wakeup) +{ +#if HAVE_COOL_HARDWARE +#ifndef FP_IOCTL_CLEAR_WAKEUP_TIMER +#define FP_IOCTL_CLEAR_WAKEUP_TIMER 10 +#endif + +#define FP_IOCTL_SET_RTC 0x101 +#define FP_IOCTL_GET_RTC 0x102 + + int fd = open("/dev/display", O_RDONLY); + if (fd < 0) { + perror("/dev/display"); + } else { + wakeup_data_t wk; + memset(&wk, 0, sizeof(wk)); + int ret = ioctl(fd, IOC_VFD_GET_WAKEUP, &wk); + if(ret >= 0) + wakeup = ((wk.source == WAKEUP_SOURCE_TIMER) /* || (wk.source == WAKEUP_SOURCE_PWLOST)*/); + close(fd); + } + printf("[timerd] wakeup from standby: %s\n", wakeup ? "yes" : "no"); + if(!wakeup){ + puts("[neutrino.cpp] executing " NEUTRINO_LEAVE_DEEPSTANDBY_SCRIPT "."); + if (my_system(NEUTRINO_LEAVE_DEEPSTANDBY_SCRIPT) != 0) + perror(NEUTRINO_LEAVE_DEEPSTANDBY_SCRIPT " failed"); + } +#endif + +} + +int CNeutrinoApp::run(int argc, char **argv) +{ + CmdParser(argc, argv); + +TIMER_START(); + cs_api_init(); + cs_register_messenger(CSSendMessage); + + g_Locale = new CLocaleManager; + + int loadSettingsErg = loadSetup(NEUTRINO_SETTINGS_FILE); + + initialize_iso639_map(); + + bool show_startwizard = false; + CLocaleManager::loadLocale_ret_t loadLocale_ret = g_Locale->loadLocale(g_settings.language); + if (loadLocale_ret == CLocaleManager::NO_SUCH_LOCALE) + { + strcpy(g_settings.language, "english"); + loadLocale_ret = g_Locale->loadLocale(g_settings.language); + show_startwizard = true; + } + /* setup GUI */ + SetupFonts(); + SetupTiming(); + g_PicViewer = new CPictureViewer(); + CColorSetupNotifier::setPalette(); + + CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_NEUTRINO_STARTING)); + hintBox->paint(); + + CVFD::getInstance()->init(font.filename, font.name); + CVFD::getInstance()->Clear(); + CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_NEUTRINO_STARTING)); + + /* set service manager options before starting zapit */ + CServiceManager::getInstance()->KeepNumbers(g_settings.keep_channel_numbers); + //zapit start parameters + Z_start_arg ZapStart_arg; + ZapStart_arg.startchanneltv_id = g_settings.startchanneltv_id; + ZapStart_arg.startchannelradio_id = g_settings.startchannelradio_id; + ZapStart_arg.uselastchannel = g_settings.uselastchannel; + ZapStart_arg.video_mode = g_settings.video_Mode; + ZapStart_arg.ci_clock = g_settings.ci_clock; + ZapStart_arg.volume = g_settings.current_volume; + + /* create decoders, read channels */ + bool zapit_init = CZapit::getInstance()->Start(&ZapStart_arg); + // init audio settings + audioDecoder->SetSRS(g_settings.srs_enable, g_settings.srs_nmgr_enable, g_settings.srs_algo, g_settings.srs_ref_volume); + //audioDecoder->setVolume(g_settings.current_volume, g_settings.current_volume); + audioDecoder->SetHdmiDD((HDMI_ENCODED_MODE)g_settings.hdmi_dd); + audioDecoder->SetSpdifDD(g_settings.spdif_dd ? true : false); + audioDecoder->EnableAnalogOut(g_settings.analog_out ? true : false); + audioSetupNotifier = new CAudioSetupNotifier; + // trigger a change + if(g_settings.avsync != (AVSYNC_TYPE) AVSYNC_ENABLED) + audioSetupNotifier->changeNotify(LOCALE_AUDIOMENU_AVSYNC, NULL); + + //init video settings + g_videoSettings = new CVideoSettings; + g_videoSettings->setVideoSettings(); + + g_RCInput = new CRCInput(); + + /* later on, we'll crash anyway, so tell about it. */ + if (! zapit_init) + ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, + "Zapit initialization failed.\nThis is a fatal error, sorry.", + CMessageBox::mbrBack, CMessageBox::mbBack); + + InitZapitClient(); + g_Zapit->setStandby(false); + + //timer start + bool timer_wakeup = false; + wake_up( timer_wakeup ); + pthread_create (&timer_thread, NULL, timerd_main_thread, (void *) timer_wakeup); + + init_cec_setting = true; + if(!(g_settings.shutdown_timer_record_type && timer_wakeup && g_settings.hdmi_cec_mode)){ + //init cec settings + CCECSetup cecsetup; + cecsetup.setCECSettings(); + init_cec_setting = false; + } + g_settings.shutdown_timer_record_type = false; + timer_wakeup = false; + + powerManager = new cPowerManager; + powerManager->Open(); + + cpuFreq = new cCpuFreqManager(); + cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000); + + g_info.delivery_system = CFEManager::getInstance()->getLiveFE()->getInfo()->type == FE_QPSK ? DVB_S : DVB_C; + + g_info.delivery_system = CFEManager::getInstance()->getLiveFE()->getInfo()->type == FE_QPSK ? DVB_S : DVB_C; +#if HAVE_TRIPLEDRAGON + /* only SAT-hd1 before rev 8 has fan, rev 1 is TD (compat hack) */ + g_info.has_fan = (cs_get_revision() > 1 && cs_get_revision() < 8 && g_info.delivery_system == DVB_S); +#else + g_info.has_fan = (cs_get_revision() < 8 && g_info.delivery_system == DVB_S); +#endif + dprintf(DEBUG_NORMAL, "g_info.has_fan: %d\n", g_info.has_fan); + //fan speed + if (g_info.has_fan) + CFanControlNotifier::setSpeed(g_settings.fan_speed); + + dvbsub_init(); + + pthread_create (&nhttpd_thread, NULL, nhttpd_main_thread, (void *) NULL); + + CStreamManager::getInstance()->Start(); + +#ifndef DISABLE_SECTIONSD + CSectionsdClient::epg_config config; + MakeSectionsdConfig(config); + CEitManager::getInstance()->SetConfig(config); + CEitManager::getInstance()->Start(); +#endif + + if (!scanSettings.loadSettings(NEUTRINO_SCAN_SETTINGS_FILE, g_info.delivery_system)) { + dprintf(DEBUG_NORMAL, "Loading of scan settings failed. Using defaults.\n"); + } + + CVFD::getInstance()->showVolume(g_settings.current_volume); + CVFD::getInstance()->setMuted(current_muted); + + g_RemoteControl = new CRemoteControl; + g_EpgData = new CEpgData; + g_InfoViewer = new CInfoViewer; + g_EventList = new CNeutrinoEventList; + + g_CamHandler = new CCAMMenuHandler(); + g_CamHandler->init(); + +#ifndef ASSUME_MDEV + mkdir("/media/sda1", 0755); + mkdir("/media/sdb1", 0755); + my_system("mount", "/dev/sda1", "/media/sda1"); + my_system("mount", "/dev/sdb1", "/media/sdb1"); +#endif + + CFSMounter::automount(); + g_PluginList = new CPlugins; + g_PluginList->setPluginDir(PLUGINDIR); + //load Pluginlist before main menu (only show script menu if at least one script is available + g_PluginList->loadPlugins(); + + MoviePluginChanger = new CMoviePluginChangeExec; + + // setup recording device + setupRecordingDevice(); + + dprintf( DEBUG_NORMAL, "menue setup\n"); + //init Menues + InitMenu(); + + dprintf( DEBUG_NORMAL, "registering as event client\n"); + +#ifndef DISABLE_SECTIONSD + InitSectiondClient(); +#endif + + InitTimerdClient(); + + g_volume = CVolume::getInstance(); + + if (show_startwizard) { + hintBox->hide(); + CStartUpWizard startwizard; + startwizard.exec(NULL, ""); + } + + if(loadSettingsErg) { + hintBox->hide(); + dprintf(DEBUG_INFO, "config file or options missing\n"); + ShowHintUTF(LOCALE_MESSAGEBOX_INFO, loadSettingsErg == 1 ? g_Locale->getText(LOCALE_SETTINGS_NOCONFFILE) + : g_Locale->getText(LOCALE_SETTINGS_MISSINGOPTIONSCONFFILE)); + configfile.setModifiedFlag(true); + saveSetup(NEUTRINO_SETTINGS_FILE); + } + + CHDDDestExec * hdd = new CHDDDestExec(); + hdd->exec(NULL, ""); + delete hdd; + + cCA::GetInstance()->Ready(true); + InitZapper(); + + g_volume->AudioMute(current_muted, true); + SHTDCNT::getInstance()->init(); + + hintBox->hide(); + delete hintBox; + +TIMER_STOP("################################## after all ##################################"); + RealRun(personalize.getWidget(0)/**main**/); + + ExitRun(true, (cs_get_revision() > 7)); + + return 0; +} + +void CNeutrinoApp::quickZap(int msg) +{ + int res; + + StopSubtitles(); + printf("CNeutrinoApp::quickZap haveFreeFrontend %d\n", CFEManager::getInstance()->haveFreeFrontend()); + if(!CFEManager::getInstance()->haveFreeFrontend()) + { + res = channelList->numericZap(g_settings.key_zaphistory); + StartSubtitles(res < 0); + return; + } + if(!bouquetList->Bouquets.empty()) + bouquetList->Bouquets[bouquetList->getActiveBouquetNumber()]->channelList->quickZap(msg, g_settings.zap_cycle); + else + channelList->quickZap(msg); +} + +void CNeutrinoApp::numericZap(int msg) +{ + StopSubtitles(); + int res = channelList->numericZap( msg ); + StartSubtitles(res < 0); +} + +void CNeutrinoApp::showInfo() +{ + StopSubtitles(); + + char *pname = NULL; + if(g_settings.infobar_show_channeldesc){ + CZapitChannel* channel = channelList->getActiveChannel(); + if(channel->pname){ + pname = channel->pname; + } + } + + g_InfoViewer->showTitle(channelList->getActiveChannelNumber(), channelList->getActiveChannelName(), channelList->getActiveSatellitePosition(), channelList->getActiveChannel_ChannelID(), false, 0, pname); + StartSubtitles(); +} + +void CNeutrinoApp::RealRun(CMenuWidget &mainMenu) +{ + neutrino_msg_t msg; + neutrino_msg_data_t data; + + dprintf(DEBUG_NORMAL, "initialized everything\n"); + + g_PluginList->startPlugin("startup.cfg"); + if (!g_PluginList->getScriptOutput().empty()) { + ShowMsgUTF(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMessageBox::mbrBack,CMessageBox::mbBack,NEUTRINO_ICON_SHELL); + } + g_RCInput->clearRCMsg(); + if(g_settings.power_standby || init_cec_setting) + standbyMode(true, true); + + InfoClock = CInfoClock::getInstance(); + if(g_settings.mode_clock) + InfoClock->StartClock(); + + //cCA::GetInstance()->Ready(true); + + while( true ) { + g_RCInput->getMsg(&msg, &data, 100, ((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VOLUME) && (g_RemoteControl->subChannels.size() < 1)) ? true : false); // 10 secs.. + + if( ( mode == mode_tv ) || ( ( mode == mode_radio ) ) ) { + if( (msg == NeutrinoMessages::SHOW_EPG) /* || (msg == CRCInput::RC_info) */ ) { + StopSubtitles(); + t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); + g_EpgData->show(live_channel_id); + StartSubtitles(); + } + else if( msg == CRCInput::RC_epg ) { + StopSubtitles(); + t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); + g_EventList->exec(live_channel_id, channelList->getActiveChannelName()); + StartSubtitles(); + } + else if( ( msg == (neutrino_msg_t) g_settings.key_quickzap_up ) || ( msg == (neutrino_msg_t) g_settings.key_quickzap_down ) ) + { + //quickzap + quickZap(msg); + } + + else if( msg == CRCInput::RC_text) { + g_RCInput->clearRCMsg(); + if(g_settings.mode_clock) + InfoClock->StopClock(); + StopSubtitles(); + tuxtx_stop_subtitle(); + + tuxtx_main(g_RCInput->getFileHandle(), g_RemoteControl->current_PIDs.PIDs.vtxtpid); + + frameBuffer->paintBackground(); + //if(!g_settings.cacheTXT) + // tuxtxt_stop(); + g_RCInput->clearRCMsg(); + // restore mute symbol + if (current_muted) + g_volume->AudioMute(current_muted, true); + if(g_settings.mode_clock) + InfoClock->StartClock(); + StartSubtitles(); + } + else if( msg == CRCInput::RC_setup ) { + if(!g_settings.minimode) { + StopSubtitles(); + if(g_settings.mode_clock) + InfoClock->StopClock(); + mainMenu.exec(NULL, ""); + // restore mute symbol + if (current_muted) + g_volume->AudioMute(current_muted, true); + if(g_settings.mode_clock) + InfoClock->StartClock(); + StartSubtitles(); + saveSetup(NEUTRINO_SETTINGS_FILE); + } + } + else if( ((msg == CRCInput::RC_tv) || (msg == CRCInput::RC_radio)) && ((neutrino_msg_t)g_settings.key_tvradio_mode == CRCInput::RC_nokey)) { + switchTvRadioMode();//used with defined default tv/radio rc key + } + else if( msg == (neutrino_msg_t) g_settings.key_tvradio_mode ) { + switchTvRadioMode(); //used with defined rc key TODO: do we really need this, because we already have a specified key on the remote control + } + else if( msg == (neutrino_msg_t) g_settings.key_subchannel_up || msg == (neutrino_msg_t) g_settings.key_subchannel_down) { + if( !g_RemoteControl->subChannels.empty() ) { + StopSubtitles(); + if( msg == (neutrino_msg_t) g_settings.key_subchannel_up ) + g_RemoteControl->subChannelUp(); + else if( msg == (neutrino_msg_t) g_settings.key_subchannel_down ) + g_RemoteControl->subChannelDown(); + g_InfoViewer->showSubchan(); + } + else if ( msg == CRCInput::RC_left || msg == CRCInput::RC_right) { + if (g_settings.mode_left_right_key_tv == SNeutrinoSettings::VOLUME) { + g_volume->setVolume(msg, true); + } + else if((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) + || (g_settings.mode_left_right_key_tv == SNeutrinoSettings::INFOBAR)) { + if(channelList->getSize()) { + showInfo(); + } + } + } + else + quickZap( msg ); + } + /* in case key_subchannel_up/down redefined */ + else if( msg == CRCInput::RC_left || msg == CRCInput::RC_right) { + if(g_settings.mode_left_right_key_tv == SNeutrinoSettings::VOLUME) { + g_volume->setVolume(msg, true); + } else if(channelList->getSize()) { + showInfo(); + } + } + else if( msg == (neutrino_msg_t) g_settings.key_zaphistory ) { + // Zap-History "Bouquet" + if(g_settings.mode_clock && g_settings.key_zaphistory == CRCInput::RC_home) { + g_settings.mode_clock=false; + InfoClock->StopClock(); + } else { + numericZap( msg ); + } + } + else if (msg == (neutrino_msg_t) g_settings.key_screenshot) { + for(int i = 0; i < g_settings.screenshot_count; i++) { + CScreenShot * sc = new CScreenShot("", (CScreenShot::screenshot_format_t)g_settings.screenshot_format); + sc->MakeFileName(CZapit::getInstance()->GetCurrentChannelID()); + sc->Start(); + } + } + else if( msg == (neutrino_msg_t) g_settings.key_lastchannel ) { + // Quick Zap + numericZap( msg ); + } + else if( msg == (neutrino_msg_t) g_settings.key_plugin ) { + g_PluginList->start_plugin_by_name(g_settings.onekey_plugin.c_str(), 0); + } + else if(msg == (neutrino_msg_t) g_settings.key_timeshift) { + CRecordManager::getInstance()->StartTimeshift(); + } + else if (msg == (neutrino_msg_t) g_settings.key_current_transponder){ + numericZap( msg ); + } + else if (CRCInput::isNumeric(msg)) { + numericZap( msg ); + } + else if(msg == CRCInput::RC_rewind) { + if(g_RemoteControl->is_video_started) { + t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); + if(CRecordManager::getInstance()->RecordingStatus(live_channel_id)) + CMoviePlayerGui::getInstance().exec(NULL, "rtimeshift"); + } + } + else if( msg == CRCInput::RC_record) { + CRecordManager::getInstance()->exec(NULL, "Record"); + } + else if( msg == CRCInput::RC_stop ) { + CRecordManager::getInstance()->exec(NULL, "Stop_record"); + } + else if( msg == CRCInput::RC_red ) { + // eventlist + if (g_settings.personalize[SNeutrinoSettings::P_MAIN_RED_BUTTON] == CPersonalizeGui::PERSONALIZE_ACTIVE_MODE_ENABLED)// EventList Menu - Personalization Check + { + StopSubtitles(); + usermenu.showUserMenu(SNeutrinoSettings::BUTTON_RED); + StartSubtitles(); + } + else + ShowHintUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_PERSONALIZE_MENUDISABLEDHINT),450, 10); + } + else if ((msg == CRCInput::RC_audio) && !g_settings.audio_run_player) + { + StopSubtitles(); + usermenu.showUserMenu(SNeutrinoSettings::BUTTON_GREEN); + StartSubtitles(); + } + else if( msg == CRCInput::RC_green) + { + if (g_settings.personalize[SNeutrinoSettings::P_MAIN_GREEN_BUTTON] == CPersonalizeGui::PERSONALIZE_ACTIVE_MODE_ENABLED) + { + StopSubtitles(); + usermenu.showUserMenu(SNeutrinoSettings::BUTTON_GREEN); + StartSubtitles(); + } + else + ShowHintUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_PERSONALIZE_MENUDISABLEDHINT),450, 10); + } + else if( msg == CRCInput::RC_yellow ) { // NVODs + if (g_settings.personalize[SNeutrinoSettings::P_MAIN_YELLOW_BUTTON] == CPersonalizeGui::PERSONALIZE_ACTIVE_MODE_ENABLED) + { + StopSubtitles(); + usermenu.showUserMenu(SNeutrinoSettings::BUTTON_YELLOW); + StartSubtitles(); + } + else + ShowHintUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_PERSONALIZE_MENUDISABLEDHINT),450, 10); + } + else if( (msg == CRCInput::RC_green) || ((msg == CRCInput::RC_audio) && !g_settings.audio_run_player) ) + { + StopSubtitles(); + usermenu.showUserMenu(SNeutrinoSettings::BUTTON_GREEN); + StartSubtitles(); + } + else if( msg == CRCInput::RC_yellow ) { // NVODs + StopSubtitles(); + usermenu.showUserMenu(SNeutrinoSettings::BUTTON_YELLOW); + StartSubtitles(); + } + else if( msg == CRCInput::RC_blue ) { + if (g_settings.personalize[SNeutrinoSettings::P_MAIN_BLUE_BUTTON] == CPersonalizeGui::PERSONALIZE_ACTIVE_MODE_ENABLED)// Features Menu - Personalization Check + { + StopSubtitles(); + usermenu.showUserMenu(SNeutrinoSettings::BUTTON_BLUE); + StartSubtitles(); + } + else + ShowHintUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_PERSONALIZE_MENUDISABLEDHINT), 450, 10); + } + else if( (msg == CRCInput::RC_audio) && g_settings.audio_run_player) { + //open mediaplayer menu in audio mode, user can select between audioplayer and internetradio + CMediaPlayerMenu * media = CMediaPlayerMenu::getInstance(); + media->setMenuTitel(LOCALE_MAINMENU_AUDIOPLAYER); + media->setUsageMode(CMediaPlayerMenu::MODE_AUDIO); + media->exec(NULL, ""); + } + else if( msg == CRCInput::RC_video || msg == CRCInput::RC_play ) { + //open moviebrowser via media player menu object + CMediaPlayerMenu::getInstance()->exec(NULL,"movieplayer"); + } + else if (CRCInput::isNumeric(msg) && g_RemoteControl->director_mode ) { + g_RemoteControl->setSubChannel(CRCInput::getNumericValue(msg)); + g_InfoViewer->showSubchan(); + } + else if( ( msg == CRCInput::RC_help ) || ( msg == CRCInput::RC_info) || + ( msg == NeutrinoMessages::SHOW_INFOBAR ) ) + { + bool show_info = ((msg != NeutrinoMessages::SHOW_INFOBAR) || (g_InfoViewer->is_visible || g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR] != 0)); + // turn on LCD display + CVFD::getInstance()->wake_up(); + + // show Infoviewer + if(show_info && channelList->getSize()) { + showInfo(); + } + } + else if (msg == CRCInput::RC_timer) + { + CTimerList Timerlist; + Timerlist.exec(NULL, ""); + } + else { + if (msg == CRCInput::RC_home) { + if(g_settings.mode_clock && g_settings.key_zaphistory == CRCInput::RC_home) { + g_settings.mode_clock=false; + InfoClock->StopClock(); + } + CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); + } + handleMsg(msg, data); + } + } + else { + // mode == mode_scart + if( msg == CRCInput::RC_home ) { + if( mode == mode_scart ) { + // Scart-Mode verlassen + scartMode( false ); + } + } + else { + handleMsg(msg, data); + } + } + } +} + +int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) +{ + int res = 0; + neutrino_msg_t msg = _msg; + + if(msg == NeutrinoMessages::EVT_ZAP_COMPLETE) { + CZapit::getInstance()->GetAudioMode(g_settings.audio_AnalogMode); + if(g_settings.audio_AnalogMode < 0 || g_settings.audio_AnalogMode > 2) + g_settings.audio_AnalogMode = 0; + + g_RCInput->killTimer(scrambled_timer); + + scrambled_timer = g_RCInput->addTimer(10*1000*1000, true); + SelectSubtitles(); + StartSubtitles(!g_InfoViewer->is_visible); + + /* update scan settings for manual scan to current channel */ + CScanSetup::getInstance()->updateManualSettings(); + } + if ((msg == NeutrinoMessages::EVT_TIMER)) { + if(data == scrambled_timer) { + scrambled_timer = 0; + if(g_settings.scrambled_message && videoDecoder->getBlank() && videoDecoder->getPlayState()) { + const char * text = g_Locale->getText(LOCALE_SCRAMBLED_CHANNEL); + ShowHintUTF (LOCALE_MESSAGEBOX_INFO, text, g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth (text, true) + 10, 5); + } + return messages_return::handled; + } + } + + res = res | g_RemoteControl->handleMsg(msg, data); + res = res | g_InfoViewer->handleMsg(msg, data); + res = res | channelList->handleMsg(msg, data); + res = res | CRecordManager::getInstance()->handleMsg(msg, data); + + if( res != messages_return::unhandled ) { + if( ( msg>= CRCInput::RC_WithData ) && ( msg< CRCInput::RC_WithData+ 0x10000000 ) ) + delete[] (unsigned char*) data; + return( res & ( 0xFFFFFFFF - messages_return::unhandled ) ); + } + + /* we assume g_CamHandler free/delete data if needed */ + res = g_CamHandler->handleMsg(msg, data); + if( res != messages_return::unhandled ) { + return(res & (0xFFFFFFFF - messages_return::unhandled)); + } + + /* ================================== KEYS ================================================ */ + if( msg == CRCInput::RC_ok || (!g_InfoViewer->virtual_zap_mode && (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites))) { + if( (mode == mode_tv) || (mode == mode_radio) || (mode == mode_ts)) { + if(g_settings.mode_clock) + InfoClock->StopClock(); + + StopSubtitles(); + +_show: + int nNewChannel = -1; + int old_num = 0; + int old_b = bouquetList->getActiveBouquetNumber(); + //int old_mode = g_settings.channel_mode; + int old_mode = GetChannelMode(); + printf("************************* ZAP START: bouquetList %p size %d old_b %d\n", bouquetList, bouquetList->Bouquets.size(), old_b);fflush(stdout); + + if(!bouquetList->Bouquets.empty()) { + old_num = bouquetList->Bouquets[old_b]->channelList->getSelected(); + } +//_show: + if(msg == CRCInput::RC_ok) + { + if( !bouquetList->Bouquets.empty() && bouquetList->Bouquets[old_b]->channelList->getSize() > 0) + nNewChannel = bouquetList->Bouquets[old_b]->channelList->exec();//with ZAP! + else + nNewChannel = bouquetList->exec(true); + // restore mute symbol + if (current_muted) + g_volume->AudioMute(current_muted, true); + } else if(msg == CRCInput::RC_sat) { + SetChannelMode(LIST_MODE_SAT); + nNewChannel = bouquetList->exec(true); + } else if(msg == CRCInput::RC_favorites) { + SetChannelMode(LIST_MODE_FAV); + nNewChannel = bouquetList->exec(true); + } +_repeat: + CVFD::getInstance ()->showServicename(channelList->getActiveChannelName()); + CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); + printf("************************* ZAP RES: nNewChannel %d\n", nNewChannel);fflush(stdout); + if(nNewChannel == -1) { // restore orig. bouquet and selected channel on cancel + /* FIXME if mode was changed while browsing, + * other modes selected bouquet not restored */ + SetChannelMode(old_mode); + bouquetList->activateBouquet(old_b, false); + if(!bouquetList->Bouquets.empty()) + bouquetList->Bouquets[bouquetList->getActiveBouquetNumber()]->channelList->setSelected(old_num); + StartSubtitles(mode == mode_tv); + } + else if(nNewChannel == -3) { // list mode changed + printf("************************* ZAP NEW MODE: bouquetList %p size %d\n", bouquetList, bouquetList->Bouquets.size());fflush(stdout); + nNewChannel = bouquetList->exec(true); + goto _repeat; + } + //else if(nNewChannel == -4) + if(g_channel_list_changed) + { + SetChannelMode(old_mode); + g_channel_list_changed = 0; + if(old_b_id < 0) old_b_id = old_b; + //g_Zapit->saveBouquets(); + /* lets do it in sync */ + reloadhintBox->paint(); + g_bouquetManager->saveBouquets(); + g_bouquetManager->saveUBouquets(); + g_bouquetManager->renumServices(); + channelsInit(/*true*/); + t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); + channelList->adjustToChannelID(live_channel_id);//FIXME what if deleted ? + bouquetList->activateBouquet(old_b_id, false); + msg = CRCInput::RC_ok; + goto _show; + } + + if(g_settings.mode_clock) + InfoClock->StartClock(); + + return messages_return::handled; + } + } + else if (msg == CRCInput::RC_standby_on) { + if (data == 0) + g_RCInput->postMsg(NeutrinoMessages::STANDBY_ON, 0); + return messages_return::cancel_all | messages_return::handled; + } + else if ((msg == CRCInput::RC_standby_off) || (msg == CRCInput::RC_power_on)) { + if (data == 0) + g_RCInput->postMsg(NeutrinoMessages::STANDBY_OFF, 0); + return messages_return::handled; + } + else if (msg == CRCInput::RC_power_off) { + g_RCInput->postMsg(NeutrinoMessages::SHUTDOWN, 0); + return messages_return::cancel_all | messages_return::handled; + } + else if (msg == (neutrino_msg_t) g_settings.key_power_off /*CRCInput::RC_standby*/) { + if (data == 0) { + neutrino_msg_t new_msg; + + /* Note: pressing the power button on the dbox (not the remote control) over 1 second */ + /* shuts down the system even if !g_settings.shutdown_real_rcdelay (see below) */ + gettimeofday(&standby_pressed_at, NULL); + + if ((mode != mode_standby) && (g_settings.shutdown_real) && !recordingstatus) { + new_msg = NeutrinoMessages::SHUTDOWN; + } + else { + new_msg = (mode == mode_standby) ? NeutrinoMessages::STANDBY_OFF : NeutrinoMessages::STANDBY_ON; + //printf("standby: new msg %X\n", new_msg); + if ((g_settings.shutdown_real_rcdelay)) { + neutrino_msg_t _msg_; + neutrino_msg_data_t mdata; + struct timeval endtime; + time_t seconds; + + int timeout = 0; + int timeout1 = 0; + + sscanf(g_settings.repeat_blocker, "%d", &timeout); + sscanf(g_settings.repeat_genericblocker, "%d", &timeout1); + + if (timeout1 > timeout) + timeout = timeout1; + + timeout += 500; + //printf("standby: timeout %d\n", timeout); + + while(true) { + g_RCInput->getMsg_ms(&_msg_, &mdata, timeout); + + //printf("standby: input msg %X\n", msg); + if (_msg_ == CRCInput::RC_timeout) + break; + + gettimeofday(&endtime, NULL); + seconds = endtime.tv_sec - standby_pressed_at.tv_sec; + if (endtime.tv_usec < standby_pressed_at.tv_usec) + seconds--; + //printf("standby: input seconds %d\n", seconds); + if (seconds >= 1) { + if (_msg_ == CRCInput::RC_standby) + new_msg = NeutrinoMessages::SHUTDOWN; + break; + } + } + } + } + g_RCInput->postMsg(new_msg, 0); + return messages_return::cancel_all | messages_return::handled; + } + return messages_return::handled; +#if 0 + else /* data == 1: KEY_POWER released */ + if (standby_pressed_at.tv_sec != 0) /* check if we received a KEY_POWER pressed event before */ + { /* required for correct handling of KEY_POWER events of */ + /* the power button on the dbox (not the remote control) */ + struct timeval endtime; + gettimeofday(&endtime, NULL); + time_t seconds = endtime.tv_sec - standby_pressed_at.tv_sec; + if (endtime.tv_usec < standby_pressed_at.tv_usec) + seconds--; + if (seconds >= 1) { + g_RCInput->postMsg(NeutrinoMessages::SHUTDOWN, 0); + return messages_return::cancel_all | messages_return::handled; + } + } +#endif + } + else if ((msg == CRCInput::RC_plus) || (msg == CRCInput::RC_minus)) + { + g_volume->setVolume(msg, (mode != mode_scart)); + return messages_return::handled; + } + else if( msg == CRCInput::RC_spkr ) { + if( mode == mode_standby ) { + //switch lcd off/on + CVFD::getInstance()->togglePower(); + } + else { + //mute + g_volume->AudioMute(!current_muted, true); + } + return messages_return::handled; + } + else if( msg == CRCInput::RC_mute_on ) { + g_volume->AudioMute(true, true); + return messages_return::handled; + } + else if( msg == CRCInput::RC_mute_off ) { + g_volume->AudioMute(false, true); + return messages_return::handled; + } + else if( msg == CRCInput::RC_analog_on ) { + g_settings.analog_out = 1; + audioDecoder->EnableAnalogOut(true); + return messages_return::handled; + } + else if( msg == CRCInput::RC_analog_off ) { + g_settings.analog_out = 0; + audioDecoder->EnableAnalogOut(false); + return messages_return::handled; + } + else if( msg == CRCInput::RC_mode ) { + g_videoSettings->nextMode(); + return messages_return::handled; + } + else if( msg == CRCInput::RC_next ) { + g_videoSettings->next43Mode(); + return messages_return::handled; + } + else if( msg == CRCInput::RC_prev ) { + g_videoSettings->SwitchFormat(); + return messages_return::handled; + } + else if (msg == (neutrino_msg_t) g_settings.key_screenshot) { + //video+osd scaled to osd size + CScreenShot * sc = new CScreenShot("", (CScreenShot::screenshot_format_t)g_settings.screenshot_format); + sc->EnableOSD(true); + sc->MakeFileName(CZapit::getInstance()->GetCurrentChannelID()); + sc->Start(); + } + + /* ================================== MESSAGES ================================================ */ + else if (msg == NeutrinoMessages::EVT_VOLCHANGED) { + //setVolume(msg, false, true); + return messages_return::handled; + } +#ifdef HAVE_CONTROLD + else if( msg == NeutrinoMessages::EVT_VCRCHANGED ) { + if (g_settings.vcr_AutoSwitch) { + if( data != VCR_STATUS_OFF ) + g_RCInput->postMsg( NeutrinoMessages::VCR_ON, 0 ); + else + g_RCInput->postMsg( NeutrinoMessages::VCR_OFF, 0 ); + } + return messages_return::handled | messages_return::cancel_info; + } +#endif + else if( msg == NeutrinoMessages::EVT_MUTECHANGED ) { + //FIXME unused ? + return messages_return::handled; + } + else if( msg == NeutrinoMessages::EVT_SERVICESCHANGED ) { + printf("NeutrinoMessages::EVT_SERVICESCHANGED\n");fflush(stdout); + channelsInit(); + t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); + channelList->adjustToChannelID(live_channel_id);//FIXME what if deleted ? + if(old_b_id >= 0) { + bouquetList->activateBouquet(old_b_id, false); + old_b_id = -1; + g_RCInput->postMsg(CRCInput::RC_ok, 0); + } + } + else if( msg == NeutrinoMessages::EVT_BOUQUETSCHANGED ) { + printf("NeutrinoMessages::EVT_BOUQUETSCHANGED\n");fflush(stdout); + channelsInit(); + t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); + channelList->adjustToChannelID(live_channel_id);//FIXME what if deleted ? + return messages_return::handled; + } + else if( msg == NeutrinoMessages::EVT_RECORDMODE ) { + /* sent by rcinput, when got msg from zapit about record activated/deactivated */ + /* should be sent when no record running */ + printf("NeutrinoMessages::EVT_RECORDMODE: %s\n", ( data ) ? "on" : "off"); + //if(!CRecordManager::getInstance()->RecordingStatus() && was_record && (!data)) + + /* no records left and record mode off FIXME check !*/ + if(!CRecordManager::getInstance()->RecordingStatus() && (!data)) + { + if(mode == mode_standby) { + g_Zapit->setStandby(true); + cpuFreq->SetCpuFreq(g_settings.standby_cpufreq * 1000 * 1000); + } + } + recordingstatus = data; + autoshift = CRecordManager::getInstance()->TimeshiftOnly(); + CVFD::getInstance()->ShowIcon(VFD_ICON_CAM1, recordingstatus != 0); + + if( ( !g_InfoViewer->is_visible ) && data && !autoshift) + g_RCInput->postMsg( NeutrinoMessages::SHOW_INFOBAR, 0 ); + + return messages_return::handled; + } + else if (msg == NeutrinoMessages::RECORD_START) { + //FIXME better at announce ? + if( mode == mode_standby ) { + cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000); + if(!recordingstatus && g_settings.ci_standby_reset) { + g_CamHandler->exec(NULL, "ca_ci_reset0"); + g_CamHandler->exec(NULL, "ca_ci_reset1"); + } + } + CRecordManager::getInstance()->Record((CTimerd::RecordingInfo *) data); + autoshift = CRecordManager::getInstance()->TimeshiftOnly(); + + delete[] (unsigned char*) data; + return messages_return::handled | messages_return::cancel_all; + } + else if( msg == NeutrinoMessages::RECORD_STOP) { + CTimerd::RecordingStopInfo* recinfo = (CTimerd::RecordingStopInfo*)data; + printf("NeutrinoMessages::RECORD_STOP: eventID %d channel_id %llx\n", recinfo->eventID, recinfo->channel_id); + CRecordManager::getInstance()->Stop(recinfo); + autoshift = CRecordManager::getInstance()->TimeshiftOnly(); + + delete[] (unsigned char*) data; + return messages_return::handled; + } + else if( msg == NeutrinoMessages::EVT_PMT_CHANGED) { + res = messages_return::handled; + t_channel_id channel_id = *(t_channel_id*) data; + CRecordManager::getInstance()->Update(channel_id); + return res; + } + + else if( msg == NeutrinoMessages::ZAPTO) { + CTimerd::EventInfo * eventinfo = (CTimerd::EventInfo *) data; + if (eventinfo->channel_id != CZapit::getInstance()->GetCurrentChannelID()){ + if( (recordingstatus == 0) || (recordingstatus && CRecordManager::getInstance()->TimeshiftOnly()) || (recordingstatus && CFEManager::getInstance()->haveFreeFrontend()) || + (recordingstatus && channelList->SameTP(eventinfo->channel_id)) ) { + bool isTVMode = CServiceManager::getInstance()->IsChannelTVChannel(eventinfo->channel_id); + + dvbsub_stop(); + + if ((!isTVMode) && (mode != mode_radio)) { + radioMode(false); + } + else if (isTVMode && (mode != mode_tv)) { + tvMode(false); + } + channelList->zapTo_ChannelID(eventinfo->channel_id); + } + } + delete[] (unsigned char*) data; + return messages_return::handled; + } + else if( msg == NeutrinoMessages::ANNOUNCE_ZAPTO) { + if( mode == mode_standby ) { + standbyMode( false ); + } + if( mode != mode_scart ) { + CTimerd::RecordingInfo * eventinfo = (CTimerd::RecordingInfo *) data; + std::string name = g_Locale->getText(LOCALE_ZAPTOTIMER_ANNOUNCE); + getAnnounceEpgName( eventinfo, name); + ShowHintUTF( LOCALE_MESSAGEBOX_INFO, name.c_str() ); + } + delete [] (unsigned char*) data; + return messages_return::handled; + } + else if( msg == NeutrinoMessages::ANNOUNCE_RECORD) { + my_system(NEUTRINO_RECORDING_TIMER_SCRIPT); + CTimerd::RecordingInfo * eventinfo = (CTimerd::RecordingInfo *) data; + if (g_settings.recording_type == RECORDING_FILE) { + char * recordingDir = eventinfo->recordingDir; + for(int i=0 ; i < NETWORK_NFS_NR_OF_ENTRIES ; i++) { + if (strcmp(g_settings.network_nfs_local_dir[i],recordingDir) == 0) { + printf("[neutrino] waking up %s (%s)\n",g_settings.network_nfs_ip[i].c_str(),recordingDir); + if(my_system("ether-wake",g_settings.network_nfs_mac[i]) != 0) + perror("ether-wake failed"); + break; + } + } + if(has_hdd) { + wakeup_hdd(g_settings.network_nfs_recordingdir); + } + } + + if( g_settings.recording_zap_on_announce && (mode != mode_standby) && (eventinfo->channel_id != CZapit::getInstance()->GetCurrentChannelID())) { + CRecordManager::getInstance()->StopAutoRecord(); + bool recordingStatus = CRecordManager::getInstance()->RecordingStatus(); + if ( !recordingStatus || (recordingStatus && CRecordManager::getInstance()->TimeshiftOnly()) || (recordingStatus && CFEManager::getInstance()->haveFreeFrontend()) || + (recordingStatus && channelList->SameTP(eventinfo->channel_id)) ){ + dvbsub_stop(); + t_channel_id channel_id=eventinfo->channel_id; + g_Zapit->zapTo_serviceID_NOWAIT(channel_id); + } + } + if(( mode != mode_scart ) && ( mode != mode_standby )){ + std::string name = g_Locale->getText(LOCALE_RECORDTIMER_ANNOUNCE); + getAnnounceEpgName(eventinfo, name); + ShowHintUTF(LOCALE_MESSAGEBOX_INFO, name.c_str()); + } + delete[] (unsigned char*) data; + return messages_return::handled; + } + else if( msg == NeutrinoMessages::ANNOUNCE_SLEEPTIMER) { + if( mode != mode_scart && mode != mode_standby) + skipSleepTimer = (ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, g_settings.shutdown_real ? LOCALE_SHUTDOWNTIMER_ANNOUNCE:LOCALE_SLEEPTIMERBOX_ANNOUNCE,CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, true) == CMessageBox::mbrYes); + return messages_return::handled; + } + else if( msg == NeutrinoMessages::SLEEPTIMER) { + if(data) {//INACTIVITY SLEEPTIMER + skipShutdownTimer = + (ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, g_settings.shutdown_real ? LOCALE_SHUTDOWNTIMER_ANNOUNCE:LOCALE_SLEEPTIMERBOX_ANNOUNCE, + CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, true) == CMessageBox::mbrYes);//FIXME + if(skipShutdownTimer) { + printf("NeutrinoMessages::INACTIVITY SLEEPTIMER: skiping\n"); + skipShutdownTimer = false; + return messages_return::handled; + } + }else{ //MAIN-MENU SLEEPTIMER + if(skipSleepTimer) { + printf("NeutrinoMessages::SLEEPTIMER: skiping\n"); + skipSleepTimer = false; + return messages_return::handled; + } + } + if(g_settings.shutdown_real) + ExitRun(true, (cs_get_revision() > 7)); + else if(mode != mode_standby) + standbyMode( true ); + return messages_return::handled; + } + else if( msg == NeutrinoMessages::RELOAD_SETUP ) { + bool tmp = g_settings.make_hd_list; + loadSetup(NEUTRINO_SETTINGS_FILE); + if(tmp != g_settings.make_hd_list) + g_Zapit->reinitChannels(); + + return messages_return::handled; + } + else if( msg == NeutrinoMessages::STANDBY_TOGGLE ) { + standbyMode( !(mode & mode_standby) ); + g_RCInput->clearRCMsg(); + return messages_return::handled; + } + else if( msg == NeutrinoMessages::STANDBY_ON ) { + if( mode != mode_standby ) { + standbyMode( true ); + } + g_RCInput->clearRCMsg(); + return messages_return::handled; + } + else if( msg == NeutrinoMessages::STANDBY_OFF ) { + if( mode == mode_standby ) { + standbyMode( false ); + } + g_RCInput->clearRCMsg(); + return messages_return::handled; + } + else if( msg == NeutrinoMessages::ANNOUNCE_SHUTDOWN) { + if( mode != mode_scart ) + skipShutdownTimer = (ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, LOCALE_SHUTDOWNTIMER_ANNOUNCE, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 5) == CMessageBox::mbrYes); + } + else if( msg == NeutrinoMessages::SHUTDOWN ) { + if(!skipShutdownTimer) { + ExitRun(true, (cs_get_revision() > 7)); + } + else { + skipShutdownTimer=false; + } + return messages_return::handled; + } + else if( msg == NeutrinoMessages::REBOOT ) { + FILE *f = fopen("/tmp/.reboot", "w"); + fclose(f); + ExitRun(true); + } + else if (msg == NeutrinoMessages::EVT_POPUP || msg == NeutrinoMessages::EVT_EXTMSG) { + if (mode != mode_scart) { + std::string timeout="-1"; + std::string text = (char*)data; + std::string::size_type pos; + + pos = text.find("&timeout=", 0); + if (pos != std::string::npos) { + timeout = text.substr( pos+9, text.length()+1 ); + text[pos] = '\0'; + } + + if (msg == NeutrinoMessages::EVT_POPUP) + ShowHintUTF(LOCALE_MESSAGEBOX_INFO, text.c_str(), 0, atoi(timeout.c_str())); + else if (msg == NeutrinoMessages::EVT_EXTMSG) + ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, text, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO, 0, atoi(timeout.c_str())); + + } + delete[] (unsigned char*) data; + return messages_return::handled; + } + else if (msg == NeutrinoMessages::EVT_RECORDING_ENDED) { + /* FIXME TODO, when/if needed, monitor record status somewhere + * and report possible error to user if any with this message ? + * not used/not supported for now */ + //delete[] (unsigned char*) data; + + return messages_return::handled; + } + else if( msg == NeutrinoMessages::REMIND) { + std::string text = (char*)data; + std::string::size_type pos; + while((pos=text.find('/'))!= std::string::npos) + { + text[pos] = '\n'; + } + if( mode != mode_scart ) + ShowMsgUTF(LOCALE_TIMERLIST_TYPE_REMIND, text, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8 + delete[] (unsigned char*) data; + return messages_return::handled; + } + else if (msg == NeutrinoMessages::LOCK_RC) + { + CRCLock rcLock; + rcLock.exec(NULL,CRCLock::NO_USER_INPUT); + return messages_return::handled; + } + else if( msg == NeutrinoMessages::CHANGEMODE ) { + + if((data & mode_mask)== mode_radio) { + if( mode != mode_radio ) { + radioMode((data & norezap) != norezap); + } + } + if((data & mode_mask)== mode_tv) { + if( mode != mode_tv ) { + tvMode((data & norezap) != norezap); + } + } + if((data & mode_mask)== mode_standby) { + if(mode != mode_standby) + standbyMode( true ); + } + if((data & mode_mask)== mode_audio) { + lastMode=mode; + mode=mode_audio; + } + if((data & mode_mask)== mode_pic) { + lastMode=mode; + mode=mode_pic; + } + if((data & mode_mask)== mode_ts && CMoviePlayerGui::getInstance().Playing()) { + if(mode == mode_radio) + videoDecoder->StopPicture(); + lastMode=mode; + mode=mode_ts; + } + } + else if( msg == NeutrinoMessages::VCR_ON ) { + if( mode != mode_scart ) { + scartMode( true ); + } + else + CVFD::getInstance()->setMode(CVFD::MODE_SCART); + } + + else if( msg == NeutrinoMessages::VCR_OFF ) { + if( mode == mode_scart ) { + scartMode( false ); + } + } + else if (msg == NeutrinoMessages::EVT_START_PLUGIN) { + g_PluginList->startPlugin((const char *)data); + if (!g_PluginList->getScriptOutput().empty()) { + ShowMsgUTF(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMessageBox::mbrBack,CMessageBox::mbBack,NEUTRINO_ICON_SHELL); + } + + delete[] (unsigned char*) data; + return messages_return::handled; + } + else if (msg == NeutrinoMessages::EVT_SERVICES_UPD) { + SDTreloadChannels = true; + g_InfoViewer->SDT_freq_update = true; + if( !g_InfoViewer->is_visible && !autoshift){ + g_RCInput->postMsg(NeutrinoMessages::SHOW_INFOBAR , 0); + } + return messages_return::handled; +// ShowHintUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_EXTRA_ZAPIT_SDT_CHANGED), +// CMessageBox::mbrBack,CMessageBox::mbBack, NEUTRINO_ICON_INFO); + } + if ((msg >= CRCInput::RC_WithData) && (msg < CRCInput::RC_WithData + 0x10000000)) + delete [] (unsigned char*) data; + + return messages_return::unhandled; +} + +extern time_t timer_minutes;//timermanager.cpp +extern bool timer_is_rec;//timermanager.cpp + +void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) +{ + bool do_shutdown = true; + + CRecordManager::getInstance()->StopAutoRecord(); + if(CRecordManager::getInstance()->RecordingStatus()) { + do_shutdown = + (ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, LOCALE_SHUTDOWN_RECODING_QUERY, CMessageBox::mbrNo, + CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, true) == CMessageBox::mbrYes); + } + + if(do_shutdown) { + if(SDTreloadChannels){ + SDT_ReloadChannels(); + //SDTreloadChannels = false; + } + + + delete CRecordManager::getInstance(); + + dprintf(DEBUG_INFO, "exit\n"); + StopSubtitles(); + g_Zapit->stopPlayBack(); + + frameBuffer->paintBackground(); + videoDecoder->ShowPicture(DATADIR "/neutrino/icons/shutdown.jpg"); + + if(g_settings.epg_save /* && timeset && g_Sectionsd->getIsTimeSet ()*/) { + saveEpg(true);// true CVFD::MODE_SHUTDOWN + } + CVFD::getInstance()->setMode(CVFD::MODE_SHUTDOWN); + + stop_daemons(true /*retcode*/);//need here for timer_is_rec before saveSetup + g_settings.shutdown_timer_record_type = timer_is_rec; + saveSetup(NEUTRINO_SETTINGS_FILE); + + if(retcode) { + puts("[neutrino.cpp] executing " NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT "."); + if (my_system(NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT) != 0) + perror(NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT " failed"); + + printf("entering off state\n"); + mode = mode_off; + //CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_SHUTDOWN)); + + my_system("/etc/init.d/rcK"); + sync(); + my_system("/bin/umount", "-a"); + sleep(1); + { + standby_data_t standby; + time_t mtime = time(NULL); + struct tm *tmtime = localtime(&mtime); + time_t fp_timer = 0; + + if(timer_minutes) { + fp_timer = timer_minutes - mtime/60; + if(fp_timer < 1) + fp_timer = 1; + } + printf("now: %ld, timer %ld, FP timer %ldmin\n", mtime/60, timer_minutes, fp_timer);fflush(stdout); + int leds = 0x40; + switch(g_settings.led_deep_mode){ + case 0: + leds = 0x0;//off leds + break; + case 1: + leds = 0x60;//on led1 & 2 + break; + case 2: + leds = 0x20;//led1 on , 2 off + break; + case 3: + leds = 0x40;//led2 off, 2 on + break; + default: + break; + } + if(leds && g_settings.led_blink && fp_timer) + leds |= 0x80; + + standby.brightness = cs_get_revision() == 10 ? 0 : g_settings.lcd_setting[SNeutrinoSettings::LCD_DEEPSTANDBY_BRIGHTNESS]; + standby.flags = leds; + standby.current_hour = tmtime->tm_hour; + standby.current_minute = tmtime->tm_min; + standby.timer_minutes_hi = fp_timer >> 8;; + standby.timer_minutes_lo = fp_timer & 0xFF; + + stop_video(); + + int fd = open("/dev/display", O_RDONLY); + if (fd < 0) { + perror("/dev/display"); + reboot(LINUX_REBOOT_CMD_RESTART); + } else { + + if (ioctl(fd, IOC_VFD_STANDBY, (standby_data_t *) &standby)) { + perror("IOC_VFD_STANDBY"); + reboot(LINUX_REBOOT_CMD_RESTART); + } else { + while(true) sleep(1); + } + } + } + } else { + delete g_RCInput; + //fan speed + if (g_info.has_fan) { + CFanControlNotifier::setSpeed(0); + } + //CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_REBOOT)); + stop_video(); + Cleanup(); + //_exit(retcode); + exit(retcode); + } + } +} + +void CNeutrinoApp::saveEpg(bool cvfd_mode) +{ + struct stat my_stat; + if(stat(g_settings.epg_dir.c_str(), &my_stat) == 0){ + if(!cvfd_mode){//skip saveepg in standby mode, if last saveepg time < 15 Min. + std::string index_xml = g_settings.epg_dir.c_str(); + index_xml += "/index.xml"; + time_t t=0; + if(stat(index_xml.c_str(), &my_stat) == 0){ + if(difftime(time(&t), my_stat.st_ctime) < 900){ + return; + } + } + } + printf("[neutrino] Saving EPG to %s...\n", g_settings.epg_dir.c_str()); + + CVFD::getInstance()->Clear(); + CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); + CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_EPG_SAVING)); + + g_Sectionsd->writeSI2XML(g_settings.epg_dir.c_str()); + + neutrino_msg_t msg; + neutrino_msg_data_t data; + while( true ) { + g_RCInput->getMsg(&msg, &data, 1200); // 120 secs.. + if (( msg == CRCInput::RC_timeout ) || (msg == NeutrinoMessages::EVT_SI_FINISHED)) { + //printf("Msg %x timeout %d EVT_SI_FINISHED %x\n", msg, CRCInput::RC_timeout, NeutrinoMessages::EVT_SI_FINISHED); + CVFD::getInstance()->Clear(); + CVFD::getInstance()->setMode(cvfd_mode ? CVFD::MODE_SHUTDOWN : CVFD::MODE_STANDBY);// true CVFD::MODE_SHUTDOWN , false CVFD::MODE_STANDBY + break; + } else if (!cvfd_mode){ + printf("wait for epg saving, Msg %x \n", (int) msg); + handleMsg(msg, data); + } + } + } +} + +void CNeutrinoApp::tvMode( bool rezap ) +{ + INFO("rezap %d current mode %d", rezap, mode); + if (mode == mode_radio) { + if (g_settings.radiotext_enable && g_Radiotext) { + delete g_Radiotext; + g_Radiotext = NULL; + } + + videoDecoder->StopPicture(); + CVFD::getInstance()->ShowIcon(VFD_ICON_RADIO, false); + StartSubtitles(!rezap); + } + g_InfoViewer->setUpdateTimer(LCD_UPDATE_TIME_TV_MODE); + + g_volume->Init(); + + CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); + CVFD::getInstance()->ShowIcon(VFD_ICON_TV, true); + + if( mode == mode_standby ) { + CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); + videoDecoder->Standby(false); + } + + bool stopauto = (mode != mode_ts); + mode = mode_tv; + if(stopauto /*&& autoshift*/) { + //printf("standby on: autoshift ! stopping ...\n"); + CRecordManager::getInstance()->StopAutoRecord(); + //recordingstatus = 0; + } + + frameBuffer->useBackground(false); + frameBuffer->paintBackground(); + + g_RemoteControl->tvMode(); + SetChannelMode(g_settings.channel_mode); + if( rezap ) { + t_channel_id last_chid = CZapit::getInstance()->GetLastTVChannel(); + channelList->setSelected(0xfffffff); /* make sure that zapTo_ChannelID will zap */ + if(CServiceManager::getInstance()->FindChannel(last_chid)) + channelList->zapTo_ChannelID(last_chid); + else + channelList->zapTo(0); + } +#ifdef USEACTIONLOG + g_ActionLog->println("mode: tv"); +#endif +} + +void CNeutrinoApp::scartMode( bool bOnOff ) +{ + //printf( ( bOnOff ) ? "mode: scart on\n" : "mode: scart off\n" ); + + if( bOnOff ) { + // SCART AN + frameBuffer->useBackground(false); + frameBuffer->paintBackground(); + + //g_Controld->setScartMode( 1 ); + CVFD::getInstance()->setMode(CVFD::MODE_SCART); + lastMode = mode; + mode = mode_scart; + } else { + // SCART AUS + //g_Controld->setScartMode( 0 ); + + mode = mode_unknown; + //re-set mode + if( lastMode == mode_radio ) { + radioMode( false ); + } + else if( lastMode == mode_tv ) { + tvMode( false ); + } + else if( lastMode == mode_standby ) { + standbyMode( true ); + } + } +} + +void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) +{ + //static bool wasshift = false; + INFO("%s", bOnOff ? "ON" : "OFF" ); + + if(lockStandbyCall) + return; + + lockStandbyCall = true; + + if( bOnOff ) { + if( mode == mode_scart ) { + //g_Controld->setScartMode( 0 ); + } + g_InfoViewer->setUpdateTimer(0); // delete timer + StopSubtitles(); + if(SDTreloadChannels && !CRecordManager::getInstance()->RecordingStatus()){ + SDT_ReloadChannels(); + //SDTreloadChannels = false; + } + frameBuffer->useBackground(false); + frameBuffer->paintBackground(); + + /* wasshift = */ CRecordManager::getInstance()->StopAutoRecord(); + + if(mode == mode_radio && g_Radiotext) + g_Radiotext->radiotext_stop(); + + + bool stream_status = CStreamManager::getInstance()->StreamStatus(); + if(!fromDeepStandby && !CRecordManager::getInstance()->RecordingStatus() && !stream_status) { + g_Zapit->setStandby(true); + } else { + g_Zapit->stopPlayBack(); + } + + videoDecoder->Standby(true); + + g_Sectionsd->setPauseScanning(!fromDeepStandby); + g_Sectionsd->setServiceChanged(0, false); + + lastMode = mode; + mode = mode_standby; + + if(!CRecordManager::getInstance()->RecordingStatus() ) { + //only save epg when not recording + if(g_settings.epg_save && !fromDeepStandby && g_settings.epg_save_standby) { + saveEpg(false);//false CVFD::MODE_STANDBY + } + } + + if(CVFD::getInstance()->getMode() != CVFD::MODE_STANDBY){ + CVFD::getInstance()->Clear(); + CVFD::getInstance()->setMode(CVFD::MODE_STANDBY); + } + + if(g_settings.mode_clock) { + InfoClock->StopClock(); + } + + //remember tuned channel-id + standby_channel_id = CZapit::getInstance()->GetCurrentChannelID(); + + puts("[neutrino.cpp] executing " NEUTRINO_ENTER_STANDBY_SCRIPT "."); + if (my_system(NEUTRINO_ENTER_STANDBY_SCRIPT) != 0) + perror(NEUTRINO_ENTER_STANDBY_SCRIPT " failed"); + + if(!CRecordManager::getInstance()->RecordingStatus()) + cpuFreq->SetCpuFreq(g_settings.standby_cpufreq * 1000 * 1000); + + //fan speed + if (g_info.has_fan) + CFanControlNotifier::setSpeed(1); + + frameBuffer->setActive(false); + // Active standby on + powerManager->SetStandby(true, false); + } else { + // Active standby off + cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000); + powerManager->SetStandby(false, false); + videoDecoder->Standby(false); + + if(init_cec_setting){ + //init cec settings + CCECSetup cecsetup; + cecsetup.setCECSettings(); + init_cec_setting = false; + } + + if(!recordingstatus && g_settings.ci_standby_reset) { + g_CamHandler->exec(NULL, "ca_ci_reset0"); + g_CamHandler->exec(NULL, "ca_ci_reset1"); + } + frameBuffer->setActive(true); + //fan speed + if (g_info.has_fan) + CFanControlNotifier::setSpeed(g_settings.fan_speed); + + puts("[neutrino.cpp] executing " NEUTRINO_LEAVE_STANDBY_SCRIPT "."); + if (my_system(NEUTRINO_LEAVE_STANDBY_SCRIPT) != 0) + perror(NEUTRINO_LEAVE_STANDBY_SCRIPT " failed"); + + CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); + g_Zapit->setStandby(false); + /* the old code did: + if(was_record) g_Zapit->startPlayBack() + unfortunately this bypasses the parental PIN code check if a record timer + was set on a locked channel, then the box put in standby and after the + recording started, the box was woken up. + The channelList->setSelected(); channelList->zapTo_ChannelID() sequence + does trigger the PIN check + If the channel is the same (as during a recording), then it will only + check PIN and not zap, so we should be fine here + */ + mode = mode_unknown; + if( lastMode == mode_radio ) { + radioMode( false ); + } else { + /* for standby -> tv mode from radio mode in case of record */ + videoDecoder->StopPicture(); + tvMode( false ); + } + t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); + if(!recordingstatus) { //only switch to standby_channel_id when not recording + live_channel_id = standby_channel_id; + } + channelList->setSelected(0xfffffff); /* make sure that zapTo_ChannelID will zap */ + channelList->zapTo_ChannelID(live_channel_id); + + g_Sectionsd->setPauseScanning(false); + //g_Sectionsd->setServiceChanged(live_channel_id, true ); + + if(g_settings.mode_clock) + InfoClock->StartClock(); + + g_volume->AudioMute(current_muted, true); + StartSubtitles(); + } + lockStandbyCall = false; +} + +void CNeutrinoApp::radioMode( bool rezap) +{ + //printf("radioMode: rezap %s\n", rezap ? "yes" : "no"); + INFO("rezap %d current mode %d", rezap, mode); + if (mode == mode_tv) { + CVFD::getInstance()->ShowIcon(VFD_ICON_TV, false); + StopSubtitles(); + } + g_InfoViewer->setUpdateTimer(LCD_UPDATE_TIME_RADIO_MODE); + CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); + CVFD::getInstance()->ShowIcon(VFD_ICON_RADIO, true); + + if( mode == mode_standby ) { + CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); + videoDecoder->Standby(false); + } + mode = mode_radio; + + CRecordManager::getInstance()->StopAutoRecord(); + + g_RemoteControl->radioMode(); + SetChannelMode(g_settings.channel_mode_radio); + + if (g_settings.radiotext_enable && !g_Radiotext) + g_Radiotext = new CRadioText; + + if( rezap ) { + t_channel_id last_chid = CZapit::getInstance()->GetLastRADIOChannel(); + channelList->setSelected(0xfffffff); /* make sure that zapTo_ChannelID will zap */ + if(CServiceManager::getInstance()->FindChannel(last_chid)) + channelList->zapTo_ChannelID(last_chid); + else + channelList->zapTo(0); + } + videoDecoder->ShowPicture(DATADIR "/neutrino/icons/radiomode.jpg"); +} + +//switching from current mode to tv or radio mode or to optional parameter prev_mode +void CNeutrinoApp::switchTvRadioMode(const int prev_mode) +{ + if (prev_mode != mode_unknown){ + if (prev_mode == mode_tv && mode != mode_tv ) + tvMode(); + else if(prev_mode == mode_radio && mode != mode_radio) + radioMode(); + }else { + if (mode == mode_radio ) + tvMode(); + else if(mode == mode_tv) + radioMode(); + } +} + +//switching clock on or off depends of current displayed or not +void CNeutrinoApp::switchClockOnOff() +{ + if(g_settings.mode_clock) { + g_settings.mode_clock=false; + InfoClock->StopClock(); + } else { + g_settings.mode_clock=true; + InfoClock->StartClock(); + } +} + +/************************************************************************************** +* CNeutrinoApp - exec, menuitem callback (shutdown) * +**************************************************************************************/ + +int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) +{ + // printf("ac: %s\n", actionKey.c_str()); + int returnval = menu_return::RETURN_REPAINT; + + if(actionKey == "help_recording") { + ShowLocalizedMessage(LOCALE_SETTINGS_HELP, LOCALE_RECORDINGMENU_HELP, CMessageBox::mbrBack, CMessageBox::mbBack); + } + else if(actionKey=="shutdown") { + ExitRun(true, 1); + } + else if(actionKey=="reboot") + { + FILE *f = fopen("/tmp/.reboot", "w"); + fclose(f); + ExitRun(true); + unlink("/tmp/.reboot"); + returnval = menu_return::RETURN_NONE; + } + else if (actionKey=="clock_switch") + { + switchClockOnOff(); + returnval = menu_return::RETURN_EXIT_ALL; + } + else if (actionKey=="tv_radio_switch")//used in mainmenu + { + switchTvRadioMode(); + returnval = menu_return::RETURN_EXIT_ALL; + } + else if (actionKey=="tv")//used in mainmenu + { + switchTvRadioMode(mode_tv); + returnval = menu_return::RETURN_EXIT_ALL; + } + else if (actionKey=="radio")//used in mainmenu + { + switchTvRadioMode(mode_radio); + returnval = menu_return::RETURN_EXIT_ALL; + } + else if(actionKey=="scart") { + g_RCInput->postMsg( NeutrinoMessages::VCR_ON, 0 ); + returnval = menu_return::RETURN_EXIT_ALL; + } + else if(actionKey=="savesettings") { + CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_MAINSETTINGS_SAVESETTINGSNOW_HINT)); // UTF-8 + hintBox->paint(); + + saveSetup(NEUTRINO_SETTINGS_FILE); + + if(g_settings.cacheTXT) { + tuxtxt_init(); + } else + tuxtxt_close(); + + //g_Sectionsd->setEventsAreOldInMinutes((unsigned short) (g_settings.epg_old_hours*60)); + //g_Sectionsd->setHoursToCache((unsigned short) (g_settings.epg_cache_days*24)); + + hintBox->hide(); + delete hintBox; + } + else if(actionKey=="recording") { + setupRecordingDevice(); + } + else if(actionKey=="reloadplugins") { + CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SERVICEMENU_GETPLUGINS_HINT)); + hintBox->paint(); + + g_PluginList->loadPlugins(); + + hintBox->hide(); + delete hintBox; + } + else if(actionKey=="restart") { + if (recordingstatus) + DisplayErrorMessage(g_Locale->getText(LOCALE_SERVICEMENU_RESTART_REFUSED_RECORDING)); + else { + CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SERVICEMENU_RESTART_HINT)); + hintBox->paint(); + + saveSetup(NEUTRINO_SETTINGS_FILE); + + /* this is an ugly mess :-( */ + delete g_RCInput; + delete g_Sectionsd; + delete g_RemoteControl; + delete g_fontRenderer; + + delete hintBox; + + stop_daemons(true); + stop_video(); + /* g_Timerd, g_Zapit and CVFD are used in stop_daemons */ + delete g_Timerd; + delete g_Zapit; //do we really need this? + delete CVFD::getInstance(); + + for(int i = 3; i < 256; i++) + close(i); + execvp(global_argv[0], global_argv); // no return if successful + exit(1); + } + } + else if(actionKey == "moviedir") { + parent->hide(); + + chooserDir(g_settings.network_nfs_moviedir, false, NULL, sizeof(g_settings.network_nfs_moviedir)-1); + + return menu_return::RETURN_REPAINT; + } + else if(actionKey == "movieplugin") { + parent->hide(); + CMenuWidget MoviePluginSelector(LOCALE_MOVIEPLAYER_DEFPLUGIN, NEUTRINO_ICON_FEATURES); + MoviePluginSelector.addItem(GenericMenuSeparator); + + char id[5]; + int cnt = 0; + int enabled_count = 0; + for(unsigned int count=0;count < (unsigned int) g_PluginList->getNumberOfPlugins();count++) { + if (g_PluginList->getType(count)== CPlugins::P_TYPE_TOOL && !g_PluginList->isHidden(count)) { + // zB vtxt-plugins + sprintf(id, "%d", count); + enabled_count++; + MoviePluginSelector.addItem(new CMenuForwarderNonLocalized(g_PluginList->getName(count), true, NULL, MoviePluginChanger, id, CRCInput::convertDigitToKey(count)), (cnt == 0)); + cnt++; + } + } + + MoviePluginSelector.exec(NULL, ""); + return menu_return::RETURN_REPAINT; + } + else if(actionKey == "clearSectionsd") + { + g_Sectionsd->freeMemory(); + } + + return returnval; +} + +/************************************************************************************** +* changeNotify - features menu recording start / stop * +**************************************************************************************/ +bool CNeutrinoApp::changeNotify(const neutrino_locale_t OptionName, void * /*data*/) +{ + if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LANGUAGESETUP_SELECT)) + { + g_Locale->loadLocale(g_settings.language); + return true; + } + return false; +} + +/************************************************************************************** +* Main programm - no function here * +**************************************************************************************/ +void stop_daemons(bool stopall) +{ + dvbsub_close(); + tuxtxt_stop(); + tuxtxt_close(); + + if (g_Radiotext) { + delete g_Radiotext; + g_Radiotext = NULL; + } + printf("httpd shutdown\n"); + pthread_cancel(nhttpd_thread); + pthread_join(nhttpd_thread, NULL); + printf("httpd shutdown done\n"); + CStreamManager::getInstance()->Stop(); + if(stopall) { + printf("timerd shutdown\n"); + g_Timerd->shutdown(); + pthread_join(timer_thread, NULL); + printf("timerd shutdown done\n"); + } +#ifndef DISABLE_SECTIONSD + printf("sectionsd shutdown\n"); + CEitManager::getInstance()->Stop(); + printf("sectionsd shutdown done\n"); +#endif + tuxtx_stop_subtitle(); + printf("zapit shutdown\n"); + if(!stopall && g_settings.hdmi_cec_mode && g_settings.hdmi_cec_standby){ + videoDecoder->SetCECMode((VIDEO_HDMI_CEC_MODE)0); + } + + delete &CMoviePlayerGui::getInstance(); + CZapit::getInstance()->Stop(); + printf("zapit shutdown done\n"); + CVFD::getInstance()->Clear(); + if(stopall) { + if (cpuFreq) + cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000); + if (powerManager) { + /* if we were in standby, leave it otherwise, the next + start of neutrino will fail in "_write_gxa" in + framebuffer.cpp + => this is needed because the drivers are crap :( */ + powerManager->SetStandby(false, false); + powerManager->Close(); + delete powerManager; + } + cs_deregister_messenger(); + } +} + +void stop_video() +{ + delete videoDecoder; + delete videoDemux; + delete CFrameBuffer::getInstance(); + cs_api_exit(); +} + +void sighandler (int signum) +{ + signal (signum, SIG_IGN); + switch (signum) { + case SIGTERM: + case SIGINT: + delete CRecordManager::getInstance(); + //CNeutrinoApp::getInstance()->saveSetup(NEUTRINO_SETTINGS_FILE); + stop_daemons(); + stop_video(); + //_exit(0); + exit(0); + default: + break; + } +} + +int main(int argc, char **argv) +{ + setDebugLevel(DEBUG_NORMAL); + signal(SIGTERM, sighandler); // TODO: consider the following + signal(SIGINT, sighandler); // NOTES: The effects of signal() in a multithreaded + signal(SIGHUP, SIG_IGN); // process are unspecified (signal(2)) + /* don't die in streamts.cpp from a SIGPIPE if client disconnects */ + signal(SIGPIPE, SIG_IGN); + + tzset(); + + return CNeutrinoApp::getInstance()->run(argc, argv); +} + +void CNeutrinoApp::loadKeys(const char * fname) +{ + bool res; + CConfigFile & tconfig = configfile; + + if(fname) { + CConfigFile newconfig(',', true); + + res = newconfig.loadConfig(fname); + if(!res) return; + tconfig = newconfig; + } + + //rc-key configuration + g_settings.key_tvradio_mode = tconfig.getInt32( "key_tvradio_mode", CRCInput::RC_nokey ); + g_settings.key_power_off = tconfig.getInt32( "key_power_off", CRCInput::RC_standby ); + + g_settings.key_channelList_pageup = tconfig.getInt32( "key_channelList_pageup", CRCInput::RC_page_up ); + g_settings.key_channelList_pagedown = tconfig.getInt32( "key_channelList_pagedown", CRCInput::RC_page_down ); + g_settings.key_channelList_cancel = tconfig.getInt32( "key_channelList_cancel", CRCInput::RC_home ); + g_settings.key_channelList_sort = tconfig.getInt32( "key_channelList_sort", CRCInput::RC_blue ); + g_settings.key_channelList_addrecord = tconfig.getInt32( "key_channelList_addrecord", CRCInput::RC_red ); + g_settings.key_channelList_addremind = tconfig.getInt32( "key_channelList_addremind", CRCInput::RC_yellow ); + + g_settings.key_list_start = tconfig.getInt32( "key_list_start", CRCInput::RC_nokey ); + g_settings.key_list_end = tconfig.getInt32( "key_list_end", CRCInput::RC_nokey ); + g_settings.key_timeshift = tconfig.getInt32( "key_timeshift", CRCInput::RC_pause ); + g_settings.key_plugin = tconfig.getInt32( "key_plugin", CRCInput::RC_nokey ); + g_settings.key_unlock = tconfig.getInt32( "key_unlock", CRCInput::RC_setup ); + g_settings.key_screenshot = tconfig.getInt32( "key_screenshot", CRCInput::RC_nokey ); + g_settings.key_current_transponder = tconfig.getInt32( "key_current_transponder", CRCInput::RC_games ); + + g_settings.key_quickzap_up = tconfig.getInt32( "key_quickzap_up", CRCInput::RC_up ); + g_settings.key_quickzap_down = tconfig.getInt32( "key_quickzap_down", CRCInput::RC_down ); + g_settings.key_subchannel_up = tconfig.getInt32( "key_subchannel_up", CRCInput::RC_right ); + g_settings.key_subchannel_down = tconfig.getInt32( "key_subchannel_down", CRCInput::RC_left ); + g_settings.key_zaphistory = tconfig.getInt32( "key_zaphistory", CRCInput::RC_home ); + g_settings.key_lastchannel = tconfig.getInt32( "key_lastchannel", CRCInput::RC_0 ); + + g_settings.key_bouquet_up = tconfig.getInt32( "key_bouquet_up", CRCInput::RC_right); + g_settings.key_bouquet_down = tconfig.getInt32( "key_bouquet_down", CRCInput::RC_left); + + g_settings.mpkey_rewind = tconfig.getInt32( "mpkey.rewind", CRCInput::RC_rewind ); + g_settings.mpkey_forward = tconfig.getInt32( "mpkey.forward", CRCInput::RC_forward ); + g_settings.mpkey_pause = tconfig.getInt32( "mpkey.pause", CRCInput::RC_pause ); + g_settings.mpkey_stop = tconfig.getInt32( "mpkey.stop", CRCInput::RC_stop ); + g_settings.mpkey_play = tconfig.getInt32( "mpkey.play", CRCInput::RC_play ); + g_settings.mpkey_audio = tconfig.getInt32( "mpkey.audio", CRCInput::RC_green ); + g_settings.mpkey_time = tconfig.getInt32( "mpkey.time", CRCInput::RC_setup ); + g_settings.mpkey_bookmark = tconfig.getInt32( "mpkey.bookmark", CRCInput::RC_blue ); + g_settings.mpkey_plugin = tconfig.getInt32( "mpkey.plugin", CRCInput::RC_red ); + + /* options */ + g_settings.menu_left_exit = tconfig.getInt32( "menu_left_exit", 0 ); + g_settings.audio_run_player = tconfig.getInt32( "audio_run_player", 1 ); + g_settings.key_click = tconfig.getInt32( "key_click", 1 ); + strcpy(g_settings.repeat_blocker, tconfig.getString("repeat_blocker", "150").c_str()); + strcpy(g_settings.repeat_genericblocker, tconfig.getString("repeat_genericblocker", "100").c_str()); + + g_settings.bouquetlist_mode = tconfig.getInt32( "bouquetlist_mode", 0 ); + g_settings.sms_channel = tconfig.getInt32( "sms_channel", 0 ); + g_settings.mode_left_right_key_tv = tconfig.getInt32( "mode_left_right_key_tv", SNeutrinoSettings::ZAP); +} + +void CNeutrinoApp::saveKeys(const char * fname) +{ + CConfigFile & tconfig = configfile; + if(fname) { + CConfigFile newconfig(',', true); + tconfig = newconfig; + } + //rc-key configuration + tconfig.setInt32( "key_tvradio_mode", g_settings.key_tvradio_mode ); + tconfig.setInt32( "key_power_off", g_settings.key_power_off ); + + tconfig.setInt32( "key_channelList_pageup", g_settings.key_channelList_pageup ); + tconfig.setInt32( "key_channelList_pagedown", g_settings.key_channelList_pagedown ); + tconfig.setInt32( "key_channelList_cancel", g_settings.key_channelList_cancel ); + tconfig.setInt32( "key_channelList_sort", g_settings.key_channelList_sort ); + tconfig.setInt32( "key_channelList_addrecord", g_settings.key_channelList_addrecord ); + tconfig.setInt32( "key_channelList_addremind", g_settings.key_channelList_addremind ); + + tconfig.setInt32( "key_list_start", g_settings.key_list_start ); + tconfig.setInt32( "key_list_end", g_settings.key_list_end ); + tconfig.setInt32( "key_timeshift", g_settings.key_timeshift ); + tconfig.setInt32( "key_plugin", g_settings.key_plugin ); + tconfig.setInt32( "key_unlock", g_settings.key_unlock ); + tconfig.setInt32( "key_screenshot", g_settings.key_screenshot ); + tconfig.setInt32( "key_current_transponder", g_settings.key_current_transponder ); + + tconfig.setInt32( "key_quickzap_up", g_settings.key_quickzap_up ); + tconfig.setInt32( "key_quickzap_down", g_settings.key_quickzap_down ); + tconfig.setInt32( "key_subchannel_up", g_settings.key_subchannel_up ); + tconfig.setInt32( "key_subchannel_down", g_settings.key_subchannel_down ); + tconfig.setInt32( "key_zaphistory", g_settings.key_zaphistory ); + tconfig.setInt32( "key_lastchannel", g_settings.key_lastchannel ); + + tconfig.setInt32( "key_bouquet_up", g_settings.key_bouquet_up ); + tconfig.setInt32( "key_bouquet_down", g_settings.key_bouquet_down ); + + tconfig.setInt32( "mpkey.rewind", g_settings.mpkey_rewind ); + tconfig.setInt32( "mpkey.forward", g_settings.mpkey_forward ); + tconfig.setInt32( "mpkey.pause", g_settings.mpkey_pause ); + tconfig.setInt32( "mpkey.stop", g_settings.mpkey_stop ); + tconfig.setInt32( "mpkey.play", g_settings.mpkey_play ); + tconfig.setInt32( "mpkey.audio", g_settings.mpkey_audio ); + tconfig.setInt32( "mpkey.time", g_settings.mpkey_time ); + tconfig.setInt32( "mpkey.bookmark", g_settings.mpkey_bookmark ); + tconfig.setInt32( "mpkey.plugin", g_settings.mpkey_plugin ); + + tconfig.setInt32( "menu_left_exit", g_settings.menu_left_exit ); + tconfig.setInt32( "audio_run_player", g_settings.audio_run_player ); + tconfig.setInt32( "key_click", g_settings.key_click ); + tconfig.setString( "repeat_blocker", g_settings.repeat_blocker ); + tconfig.setString( "repeat_genericblocker", g_settings.repeat_genericblocker ); + + tconfig.setInt32( "bouquetlist_mode", g_settings.bouquetlist_mode ); + tconfig.setInt32( "sms_channel", g_settings.sms_channel ); + tconfig.setInt32( "mode_left_right_key_tv", g_settings.mode_left_right_key_tv ); + + if(fname) + tconfig.saveConfig(fname); +} + +void CNeutrinoApp::StopSubtitles() +{ + printf("[neutrino] %s\n", __FUNCTION__); + int ttx, dvbpid, ttxpid, ttxpage; + + dvbpid = dvbsub_getpid(); + tuxtx_subtitle_running(&ttxpid, &ttxpage, &ttx); + + if(dvbpid) + dvbsub_pause(); + if(ttx) { + tuxtx_pause_subtitle(true); + frameBuffer->paintBackground(); + } +} + +void CNeutrinoApp::StartSubtitles(bool show) +{ + printf("%s: %s\n", __FUNCTION__, show ? "Show" : "Not show"); + if(!show) + return; + dvbsub_start(0); + tuxtx_pause_subtitle(false); +} + +void CNeutrinoApp::SelectSubtitles() +{ + /* called on NeutrinoMessages::EVT_ZAP_COMPLETE, should be safe to use zapit current channel */ + CZapitChannel * cc = CZapit::getInstance()->GetCurrentChannel(); + + if(!g_settings.auto_subs || cc == NULL) + return; + + for(int i = 0; i < 3; i++) { + if(strlen(g_settings.pref_subs[i]) == 0 || !strcmp(g_settings.pref_subs[i], "none")) + continue; + + std::string temp(g_settings.pref_subs[i]); + + for(int j = 0 ; j < (int)cc->getSubtitleCount() ; j++) { + CZapitAbsSub* s = cc->getChannelSub(j); + if (s->thisSubType == CZapitAbsSub::DVB) { + CZapitDVBSub* sd = reinterpret_cast(s); + std::map::const_iterator it; + for(it = iso639.begin(); it != iso639.end(); ++it) { + if(temp == it->second && sd->ISO639_language_code == it->first) { + printf("CNeutrinoApp::SelectSubtitles: found DVB %s, pid %x\n", sd->ISO639_language_code.c_str(), sd->pId); + dvbsub_stop(); + dvbsub_setpid(sd->pId); + return; + } + } + } + } + for(int j = 0 ; j < (int)cc->getSubtitleCount() ; j++) { + CZapitAbsSub* s = cc->getChannelSub(j); + if (s->thisSubType == CZapitAbsSub::TTX) { + CZapitTTXSub* sd = reinterpret_cast(s); + std::map::const_iterator it; + for(it = iso639.begin(); it != iso639.end(); ++it) { + if(temp == it->second && sd->ISO639_language_code == it->first) { + int page = ((sd->teletext_magazine_number & 0xFF) << 8) | sd->teletext_page_number; + printf("CNeutrinoApp::SelectSubtitles: found TTX %s, pid %x page %03X\n", sd->ISO639_language_code.c_str(), sd->pId, page); + tuxtx_stop_subtitle(); + tuxtx_set_pid(sd->pId, page, (char *) sd->ISO639_language_code.c_str()); + return; + } + } + } + } + } +} + +void CNeutrinoApp::SDT_ReloadChannels() +{ + SDTreloadChannels = false; + //g_Zapit->reinitChannels(); + channelsInit(); + t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); + channelList->adjustToChannelID(live_channel_id);//FIXME what if deleted ? + if(old_b_id >= 0) { + bouquetList->activateBouquet(old_b_id, false); + old_b_id = -1; + g_RCInput->postMsg(CRCInput::RC_ok, 0); + } +} + +void CNeutrinoApp::getAnnounceEpgName(CTimerd::RecordingInfo * eventinfo, std::string &name) +{ + + name += "\n"; + + std::string zAddData = CServiceManager::getInstance()->GetServiceName(eventinfo->channel_id); + if( zAddData.empty()) { + zAddData = g_Locale->getText(LOCALE_TIMERLIST_PROGRAM_UNKNOWN); + } + + if(eventinfo->epgID!=0) { + CEPGData epgdata; + zAddData += " :\n"; + if (CEitManager::getInstance()->getEPGid(eventinfo->epgID, eventinfo->epg_starttime, &epgdata)) { + zAddData += epgdata.title; + } + else if(strlen(eventinfo->epgTitle)!=0) { + zAddData += eventinfo->epgTitle; + } + } + else if(strlen(eventinfo->epgTitle)!=0) { + zAddData += " :\n"; + zAddData += eventinfo->epgTitle; + } + + name += zAddData; +} + +void CNeutrinoApp::Cleanup() +{ +#ifdef EXIT_CLEANUP + INFO("cleanup..."); + printf("cleanup 10\n");fflush(stdout); + delete g_Sectionsd; g_Sectionsd = NULL; + delete g_Timerd; g_Timerd = NULL; + delete g_Zapit; g_Zapit = NULL; + delete g_RemoteControl; g_RemoteControl = NULL; + + printf("cleanup 11\n");fflush(stdout); + delete g_fontRenderer; g_fontRenderer = NULL; + printf("cleanup 12\n");fflush(stdout); + delete g_PicViewer; g_PicViewer = NULL; + printf("cleanup 13\n");fflush(stdout); + delete g_PluginList; g_PluginList = NULL; + printf("cleanup 16\n");fflush(stdout); + delete g_CamHandler; g_CamHandler = NULL; + printf("cleanup 17\n");fflush(stdout); + delete g_volume; g_volume = NULL; + printf("cleanup 18\n");fflush(stdout); + delete g_EpgData; g_EpgData = NULL; + printf("cleanup 19\n");fflush(stdout); + delete g_InfoViewer; g_InfoViewer = NULL; + printf("cleanup 11\n");fflush(stdout); + delete g_EventList; g_EventList = NULL; + printf("cleanup 12\n");fflush(stdout); + delete g_Locale; g_Locale = NULL; + delete g_videoSettings; g_videoSettings = NULL; + delete g_Radiotext; g_Radiotext = NULL; + + printf("cleanup 13\n");fflush(stdout); + delete audioSetupNotifier; audioSetupNotifier = NULL; + delete MoviePluginChanger; MoviePluginChanger = NULL; + printf("cleanup 14\n");fflush(stdout); + + delete TVbouquetList; TVbouquetList = NULL; + delete RADIObouquetList; RADIObouquetList = NULL; + + delete TVfavList; TVfavList = NULL; + delete RADIOfavList; RADIOfavList = NULL; + + delete TVchannelList; TVchannelList = NULL; + delete RADIOchannelList; RADIOchannelList = NULL; + delete TVallList; TVallList = NULL; + delete RADIOallList; RADIOallList = NULL; + delete TVsatList; TVsatList = NULL; + delete RADIOsatList; RADIOsatList = NULL; + + printf("cleanup 1\n");fflush(stdout); + for (int i = 0; i < FONT_TYPE_COUNT; i++) { + delete g_Font[i]; + g_Font[i] = NULL; + } + printf("cleanup 2\n");fflush(stdout); + delete g_SignalFont; g_SignalFont = NULL; + printf("cleanup 3\n");fflush(stdout); + configfile.clear(); + + printf("cleanup 4\n");fflush(stdout); + delete CZapit::getInstance(); + printf("cleanup 5\n");fflush(stdout); + delete CEitManager::getInstance(); + printf("cleanup 6\n");fflush(stdout); + delete CVFD::getInstance(); + malloc_stats(); +#endif +} diff --git a/src/system/locals.h b/src/system/locals.h index 0ecf8dd6f..01aa97c15 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -232,6 +232,7 @@ typedef enum LOCALE_CHANNELLIST_EPGTEXT_ALIGN_LEFT, LOCALE_CHANNELLIST_EPGTEXT_ALIGN_RIGHT, LOCALE_CHANNELLIST_EXTENDED, + LOCALE_CHANNELLIST_MINITV, LOCALE_CHANNELLIST_FAVS, LOCALE_CHANNELLIST_FOOT, LOCALE_CHANNELLIST_FOOT_FREQ, @@ -763,6 +764,7 @@ typedef enum LOCALE_MENU_HINT_CHANNELLIST_COLORED, LOCALE_MENU_HINT_CHANNELLIST_EPG_ALIGN, LOCALE_MENU_HINT_CHANNELLIST_EXTENDED, + LOCALE_MENU_HINT_CHANNELLIST_MINITV, LOCALE_MENU_HINT_CHANNELLIST_FONTS, LOCALE_MENU_HINT_CHANNELLIST_FOOT, LOCALE_MENU_HINT_CHANNELLIST_SETUP, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 81125c8cf..1e5fd4c65 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -232,6 +232,7 @@ const char * locale_real_names[] = "channellist.epgtext_align_left", "channellist.epgtext_align_right", "channellist.extended", + "channellist.minitv", "channellist.favs", "channellist.foot", "channellist.foot_freq", @@ -763,6 +764,7 @@ const char * locale_real_names[] = "menu.hint_channellist_colored", "menu.hint_channellist_epg_align", "menu.hint_channellist_extended", + "menu.hint_channellist_minitv", "menu.hint_channellist_fonts", "menu.hint_channellist_foot", "menu.hint_channellist_setup", diff --git a/src/system/settings.h b/src/system/settings.h index 29c9ee2fb..cb6261825 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -421,6 +421,7 @@ struct SNeutrinoSettings int channellist_foot; int channellist_new_zap_mode; int channellist_sort_mode; + int channellist_minitv; char repeat_blocker[4]; char repeat_genericblocker[4]; int remote_control_hardware; From f6f0911121ccf15142be7c2365b416f7d8905d5b Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 30 Jan 2013 19:31:57 +0100 Subject: [PATCH 04/86] compil fix for commit 263340cd22bf529d63d043ed2d8a939bf2c4a729 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/deeed028d4b94fc3e2560535dd94013611247850 Author: Jacek Jendrzej Date: 2013-01-30 (Wed, 30 Jan 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 98 +++++++++++++++++++++-------------------- 1 file changed, 50 insertions(+), 48 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 703247ef4..fb95ad6ec 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2002,7 +2002,7 @@ void CChannelList::paint() { if (g_settings.channellist_minitv) { - paint_pig(x+width, y+theight+1, pig_width, pig_height); + paint_pig(x+width, y+theight+1, pig_width, pig_height); } numwidth = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(MaxChanNr().c_str()); @@ -2089,67 +2089,69 @@ std::string CChannelList::MaxChanNr() return maxchansize; } -void CChannelList::paint_pig (int x, int y, int w, int h) +void CChannelList::paint_pig (int _x, int _y, int w, int h) { - frameBuffer->paintBackgroundBoxRel (x, y, w, h); - printf("CChannelList::paint_pig x %d y %d w %d h %d osd_w %d osd_w %d\n", x, y, w, h, frameBuffer->getScreenWidth(true), frameBuffer->getScreenHeight(true)); - videoDecoder->Pig(x, y, w, h, frameBuffer->getScreenWidth(true), frameBuffer->getScreenHeight(true)); + frameBuffer->paintBackgroundBoxRel (_x, _y, w, h); + printf("CChannelList::paint_pig x %d y %d w %d h %d osd_w %d osd_w %d\n", _x, _y, w, h, frameBuffer->getScreenWidth(true), frameBuffer->getScreenHeight(true)); + videoDecoder->Pig(_x, _y, w, h, frameBuffer->getScreenWidth(true), frameBuffer->getScreenHeight(true)); } void CChannelList::paint_events(int index) { - readEvents(chanlist[index]->channel_id); + readEvents(chanlist[index]->channel_id); frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUHEAD_PLUS_0); - char text1[10]; - CChannelEventList::iterator e; - time_t azeit; - time(&azeit); - int ffheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getHeight(); + char text1[10]; + CChannelEventList::iterator e; + time_t azeit; + time(&azeit); + int ffheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getHeight(); - if ( evtlist.size() == 0 ) - { - CChannelEvent evt; + if ( evtlist.size() == 0 ) + { + CChannelEvent evt; - evt.description = g_Locale->getText(LOCALE_EPGLIST_NOEVENTS); - evt.eventID = 0; - evtlist.push_back(evt); + evt.description = g_Locale->getText(LOCALE_EPGLIST_NOEVENTS); + evt.eventID = 0; + evtlist.push_back(evt); + } - } - - int i=1; - for (e=evtlist.begin(); e!=evtlist.end(); ++e ) - { - //Remove events in the past - time_t dif = azeit - e->startTime; - if ( (dif > 0) && (!(e->eventID == 0))) - { - do - { - //printf("%d seconds in the past - deleted %s\n", dif, e->description.c_str()); - e = evtlist.erase(e); - dif = azeit - e->startTime; - } - while ( dif > 0 ); - } - //Display the remaining events - struct tm *tmStartZeit = localtime(&e->startTime); - strftime(text1, sizeof(text1), "%H:%M", tmStartZeit ); - //printf("%s %s\n", text1, e->description.c_str()); - int timewidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getRenderWidth(text1, true); - if ((y+ theight+ pig_height + i*ffheight) < (y+ height)) - { - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, timewidth, text1, COL_MENUCONTENTDARK, 0, true); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5+timewidth+5, y+ theight+ pig_height + i*ffheight, infozone_width - timewidth - 20, e->description, COL_MENUCONTENTDARK, 0, true); - } - else break; - i++; - } + int i=1; + for (e=evtlist.begin(); e!=evtlist.end(); ++e ) + { + //Remove events in the past + time_t dif = azeit - e->startTime; + if ( (dif > 0) && (!(e->eventID == 0))) + { + do + { + //printf("%d seconds in the past - deleted %s\n", dif, e->description.c_str()); + e = evtlist.erase(e); + dif = azeit - e->startTime; + } + while ( dif > 0 ); + } + //Display the remaining events + struct tm *tmStartZeit = localtime(&e->startTime); + strftime(text1, sizeof(text1), "%H:%M", tmStartZeit ); + //printf("%s %s\n", text1, e->description.c_str()); + int timewidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getRenderWidth(text1, true); + if ((y+ theight+ pig_height + i*ffheight) < (y+ height)) + { + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, timewidth, text1, COL_MENUCONTENTDARK, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5+timewidth+5, y+ theight+ pig_height + i*ffheight, infozone_width - timewidth - 20, e->description, COL_MENUCONTENTDARK, 0, true); + } + else + { + break; + } + i++; + } evtlist.clear(); } static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& b) { - return a.startTime < b.startTime; + return a.startTime < b.startTime; } void CChannelList::readEvents(const t_channel_id channel_id) From 08873a05cc07ebf02ec7230eeff650ed12be032d Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 30 Jan 2013 23:37:11 +0100 Subject: [PATCH 05/86] src/gui/channellist.cpp: fix minitv gui & segfault Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e509f193610e972e2d255a5e9fe2003bccdb14bd Author: Jacek Jendrzej Date: 2013-01-30 (Wed, 30 Jan 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 42 ++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index fb95ad6ec..f58e96ec3 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -465,11 +465,13 @@ void CChannelList::calcSize() int fw = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth(); width = w_max (((g_settings.channellist_extended)?(frameBuffer->getScreenWidth() / 20 * (fw+6)):(frameBuffer->getScreenWidth() / 20 * (fw+5))), 100); widthDetails = width; - if (g_settings.channellist_minitv) + if (g_settings.channellist_minitv){ widthDetails = frameBuffer->getScreenWidth() - frameBuffer->getScreenX(); + infozone_width = widthDetails - width; + } height = h_max ((frameBuffer->getScreenHeight() / 20 * 16), (frameBuffer->getScreenHeight() / 20 * 2)); if (g_settings.channellist_minitv) - height = h_max ((frameBuffer->getScreenHeight() / 20 * 18), 0); + height = h_max ((frameBuffer->getScreenHeight() / 20 * 17), 0); CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, name.c_str()); @@ -503,19 +505,18 @@ void CChannelList::calcSize() if (g_settings.channellist_minitv) { - width = frameBuffer->getScreenWidth() / 3 * 2; - x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - widthDetails) / 2; - y = frameBuffer->getScreenY(); - pig_width = widthDetails / 3 - 16; - pig_height = pig_width / 16 * 9; + width = frameBuffer->getScreenWidth() / 3 * 2; + x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - widthDetails) / 2; + y = frameBuffer->getScreenY(); + pig_width = widthDetails / 3 - 16; + pig_height = pig_width / 16 * 9; - infozone_width = pig_width - 8; - infozone_height = height - theight - pig_height; + infozone_height = height - theight - pig_height; } else { - x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2; - y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - (height+ info_height)) / 2; + x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2; + y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - (height+ info_height)) / 2; } } @@ -906,7 +907,7 @@ void CChannelList::hide() { if (g_settings.channellist_minitv) { - widthDetails = frameBuffer->getScreenWidth() - frameBuffer->getScreenX(); +// widthDetails = frameBuffer->getScreenWidth() - frameBuffer->getScreenX(); videoDecoder->Pig(-1, -1, -1, -1); } frameBuffer->paintBackgroundBoxRel(x, y, widthDetails, height+ info_height+ 5); @@ -1983,10 +1984,10 @@ void CChannelList::paintHead() if (gotTime) { int iw3x = (g_settings.channellist_new_zap_mode) ? iw3 : -4; if (g_settings.channellist_minitv) - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + widthDetails - 16 -timestr_len, + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + widthDetails - 16 -timestr_len, y+theight, timestr_len, timestr, COL_MENUHEAD, 0, true); // UTF-8 else - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + width - iw1 - iw2 - iw3x - 16 -timestr_len, + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + width - iw1 - iw2 - iw3x - 16 -timestr_len, y+theight, timestr_len, timestr, COL_MENUHEAD, 0, true); // UTF-8 timestr_len += 4; } @@ -2100,13 +2101,14 @@ void CChannelList::paint_events(int index) { readEvents(chanlist[index]->channel_id); frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUHEAD_PLUS_0); + char text1[10]; CChannelEventList::iterator e; time_t azeit; time(&azeit); int ffheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getHeight(); - if ( evtlist.size() == 0 ) + if ( evtlist.empty() ) { CChannelEvent evt; @@ -2125,11 +2127,12 @@ void CChannelList::paint_events(int index) do { //printf("%d seconds in the past - deleted %s\n", dif, e->description.c_str()); - e = evtlist.erase(e); + if(!evtlist.empty()) + e = evtlist.erase(e); dif = azeit - e->startTime; } - while ( dif > 0 ); - } + while (!evtlist.empty() && dif > 0 ); + } //Display the remaining events struct tm *tmStartZeit = localtime(&e->startTime); strftime(text1, sizeof(text1), "%H:%M", tmStartZeit ); @@ -2146,7 +2149,8 @@ void CChannelList::paint_events(int index) } i++; } - evtlist.clear(); + if ( !evtlist.empty() ) + evtlist.clear(); } static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& b) From 07ff520ab7677532c5d07823f3162cb50ac8396a Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 30 Jan 2013 23:41:40 +0100 Subject: [PATCH 06/86] add locale minitv Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5803ddf873b9e5abd55c8e17d76ccd78640bfe05 Author: Jacek Jendrzej Date: 2013-01-30 (Wed, 30 Jan 2013) Origin message was: ------------------ -add locale minitv ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + 2 files changed, 2 insertions(+) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 13c0cb219..0e369832e 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -220,6 +220,7 @@ channellist.keep_numbers Dauerhafte Kanalnummern channellist.make_hdlist Erzeuge Bouquet mit HD-Kanälen channellist.make_newlist Erzeuge Bouquet mit neuen Kanälen channellist.make_removedlist Erzeuge Bouquet mit gelöschten Kanälen +channellist.minitv Kanalliste mit MiniTV channellist.new_zap_mode Quickzap in Liste channellist.nonefound Es wurden keine Kanäle gefunden!\nFühren Sie bitte eine Kanalsuche durch\n(MENU-Taste -> Service) channellist.provs Anbieter diff --git a/data/locale/english.locale b/data/locale/english.locale index f49f35c98..235f7cc6d 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -220,6 +220,7 @@ channellist.keep_numbers Persistent channel numbers channellist.make_hdlist Create list of HD channels channellist.make_newlist Create list of new channels channellist.make_removedlist Create list of removed channels +channellist.minitv Channellist with MiniTV channellist.new_zap_mode Quickzap in list channellist.nonefound No channels were found!\nPlease execute a scan\n(MENU-key -> service) channellist.provs Providers From 11273b685fd33526ef6a06a172ad4df819116f15 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 30 Jan 2013 23:47:25 +0100 Subject: [PATCH 07/86] delete src/gui/channellist.cpp~ Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8c0ac9e724b9a30572b2001c22679b1abfd4ab8a Author: Jacek Jendrzej Date: 2013-01-30 (Wed, 30 Jan 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp~ | 2160 -------------------------------------- 1 file changed, 2160 deletions(-) delete mode 100644 src/gui/channellist.cpp~ diff --git a/src/gui/channellist.cpp~ b/src/gui/channellist.cpp~ deleted file mode 100644 index 7270ae3d8..000000000 --- a/src/gui/channellist.cpp~ +++ /dev/null @@ -1,2160 +0,0 @@ -/* - Neutrino-GUI - DBoxII-Project - - Copyright (C) 2001 Steffen Hehn 'McClean' - Homepage: http://dbox.cyberphoria.org/ - - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. - - - License: GPL - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the - Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#include - -extern CBouquetList * bouquetList; /* neutrino.cpp */ -extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ -extern CPictureViewer * g_PicViewer; -extern CBouquetList * TVbouquetList; -extern CBouquetList * TVsatList; -extern CBouquetList * TVfavList; -extern CBouquetList * TVallList; -extern CBouquetList * RADIObouquetList; -extern CBouquetList * RADIOsatList; -extern CBouquetList * RADIOfavList; -extern CBouquetList * RADIOallList; - -extern bool autoshift; - -extern CBouquetManager *g_bouquetManager; -extern int old_b_id; - -extern cVideo * videoDecoder; - -CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vlist, bool ) -{ - frameBuffer = CFrameBuffer::getInstance(); - name = pName; - selected = 0; - selected_in_new_mode = 0; - liststart = 0; - tuned = 0xfffffff; - zapProtection = NULL; - this->historyMode = phistoryMode; - vlist = _vlist; - selected_chid = 0; - this->new_mode_active = false; - footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+6; //initial height value for buttonbar -//printf("************ NEW LIST %s : %x\n", name.c_str(), (int) this);fflush(stdout); -} - -CChannelList::~CChannelList() -{ -//printf("************ DELETE LIST %s : %x\n", name.c_str(), this);fflush(stdout); - chanlist.clear(); -} - -void CChannelList::ClearList(void) -{ -//printf("************ CLEAR LIST %s : %x\n", name.c_str(), this);fflush(stdout); - chanlist.clear(); - chanlist.resize(1); -} - -void CChannelList::setSize(int newsize) -{ - //chanlist.reserve(newsize); - chanlist.resize(newsize); -} - -void CChannelList::SetChannelList(ZapitChannelList* channels) -{ - chanlist = *channels; -} - -void CChannelList::addChannel(CZapitChannel* channel, int num) -{ -//printf("************ %s : addChannel: %s %x\n", name.c_str(), channel->getName().c_str(), channel);fflush(stdout); - if(num) - channel->number = num; - chanlist.push_back(channel); -} - -void CChannelList::putChannel(CZapitChannel* channel) -{ - int num = channel->number - 1; - if(num < 0) { - printf("%s error inserting at %d\n", __FUNCTION__, num); - return; - } - if(num >= (int) chanlist.size()) { - chanlist.resize((unsigned) num + 1); - } - chanlist[num] = channel; -//printf("************ %s : me %x putChannel: %d: %s %x -> %x [0] %x\n", name.c_str(), this, num, channel->getName().c_str(), channel, chanlist[num], chanlist[0]);fflush(stdout); -} - -/* uodate the events for the visible channel list entries - from = start entry, to = end entry. If both = zero, update all */ -void CChannelList::updateEvents(unsigned int from, unsigned int to) -{ - CChannelEventList events; - - if (to == 0 || to > chanlist.size()) - to = chanlist.size(); - - size_t chanlist_size = to - from; - if (chanlist_size <= 0) // WTF??? - return; - - if (displayNext) { - time_t atime = time(NULL); - unsigned int count; - for (count = from; count < to; count++) { - events.clear(); - CEitManager::getInstance()->getEventsServiceKey(chanlist[count]->channel_id, events); - chanlist[count]->nextEvent.startTime = (long)0x7fffffff; - for ( CChannelEventList::iterator e= events.begin(); e != events.end(); ++e ) { - if ((long)e->startTime > atime && - (e->startTime < (long)chanlist[count]->nextEvent.startTime)) - { - chanlist[count]->nextEvent = *e; - break; - } - } - } - } else { - t_channel_id *p_requested_channels; - p_requested_channels = new t_channel_id[chanlist_size]; - if (! p_requested_channels) { - fprintf(stderr,"%s:%d allocation failed!\n", __FUNCTION__, __LINE__); - return; - } - for (uint32_t count = 0; count < chanlist_size; count++) - p_requested_channels[count] = chanlist[count + from]->channel_id; - - CChannelEventList levents; - CEitManager::getInstance()->getChannelEvents(levents, p_requested_channels, chanlist_size); - for (uint32_t count=0; count < chanlist_size; count++) { - chanlist[count]->currentEvent = CChannelEvent(); - for (CChannelEventList::iterator e = levents.begin(); e != levents.end(); ++e) { - if ((chanlist[count + from]->channel_id&0xFFFFFFFFFFFFULL) == e->get_channel_id()) { - chanlist[count + from]->currentEvent = *e; - break; - } - } - } - delete[] p_requested_channels; - } - events.clear(); -} - -void CChannelList::SortAlpha(void) -{ - sort(chanlist.begin(), chanlist.end(), CmpChannelByChName()); -} - -void CChannelList::SortSat(void) -{ - sort(chanlist.begin(), chanlist.end(), CmpChannelBySat()); -} - -void CChannelList::SortTP(void) -{ - sort(chanlist.begin(), chanlist.end(), CmpChannelByFreq()); -} - -void CChannelList::SortChNumber(void) -{ - sort(chanlist.begin(), chanlist.end(), CmpChannelByChNum()); -} - -CZapitChannel* CChannelList::getChannel(int number) -{ - for (uint32_t i=0; i< chanlist.size(); i++) { - if (chanlist[i]->number == number) - return chanlist[i]; - } - return(NULL); -} - -CZapitChannel* CChannelList::getChannel(t_channel_id channel_id) -{ - for (uint32_t i=0; i< chanlist.size(); i++) { - if (chanlist[i]->channel_id == channel_id) - return chanlist[i]; - } - return(NULL); -} - -int CChannelList::getKey(int id) -{ - return chanlist[id]->number; -} - -static const std::string empty_string; - -const std::string CChannelList::getActiveChannelName(void) const -{ - if (selected < chanlist.size()) - return chanlist[selected]->getName(); - else - return empty_string; -} - -t_satellite_position CChannelList::getActiveSatellitePosition(void) const -{ - if (selected < chanlist.size()) - return chanlist[selected]->getSatellitePosition(); - else - return 0; -} - -t_channel_id CChannelList::getActiveChannel_ChannelID(void) const -{ - if (selected < chanlist.size()) { -//printf("CChannelList::getActiveChannel_ChannelID me %x selected = %d %llx\n", (int) this, selected, chanlist[selected]->channel_id); - return chanlist[selected]->channel_id; - } else - return 0; -} - -int CChannelList::getActiveChannelNumber(void) const -{ - //return (selected + 1); - if (selected < chanlist.size()) - return chanlist[selected]->number; - return 0; -} - -CZapitChannel * CChannelList::getActiveChannel(void) const -{ - static CZapitChannel channel("Channel not found", 0, 0, 0, 0); - if (selected < chanlist.size()) - return chanlist[selected]; - return &channel; -} - -int CChannelList::doChannelMenu(void) -{ - int i = 0; - int select = -1; - static int old_selected = 0; - char cnt[5]; - bool enabled = true; - - if(g_settings.minimode) - return 0; - - if(vlist) - { - enabled = false; - if(old_selected < 2)//FIXME take care if some items added before 0, 1 - old_selected = 2; - } - - CMenuWidget* menu = new CMenuWidget(LOCALE_CHANNELLIST_EDIT, NEUTRINO_ICON_SETTINGS); - menu->enableFade(false); - menu->enableSaveScreen(true); - CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select); - - snprintf(cnt, sizeof(cnt), "%d", i); - menu->addItem(new CMenuForwarder(LOCALE_BOUQUETEDITOR_DELETE, enabled, NULL, selector, cnt, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED), old_selected == i++); - snprintf(cnt, sizeof(cnt), "%d", i); - menu->addItem(new CMenuForwarder(LOCALE_BOUQUETEDITOR_MOVE, enabled, NULL, selector, cnt, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN), old_selected == i++); - snprintf(cnt, sizeof(cnt), "%d", i); - menu->addItem(new CMenuForwarder(LOCALE_EXTRA_ADD_TO_BOUQUET, true, NULL, selector, cnt, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW), old_selected == i++); - snprintf(cnt, sizeof(cnt), "%d", i); - menu->addItem(new CMenuForwarder(LOCALE_FAVORITES_MENUEADD, true, NULL, selector, cnt, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE), old_selected == i++); - snprintf(cnt, sizeof(cnt), "%d", i); - bool reset_enabled = chanlist[selected]->flags & CZapitChannel::NEW; - menu->addItem(new CMenuForwarder(LOCALE_CHANNELLIST_RESET_FLAGS, reset_enabled, NULL, selector, cnt, CRCInput::convertDigitToKey(0)), old_selected == i++); - snprintf(cnt, sizeof(cnt), "%d", i); - menu->addItem(new CMenuForwarder(LOCALE_MAINMENU_SETTINGS, true, NULL, selector, cnt, CRCInput::convertDigitToKey(0)), old_selected == i++); - menu->exec(NULL, ""); - delete menu; - delete selector; - - if(select >= 0) { - signed int bouquet_id = 0, old_bouquet_id = 0, new_bouquet_id = 0; - old_selected = select; - t_channel_id channel_id = chanlist[selected]->channel_id; - switch(select) { - case 0: { - hide(); - int result = ShowMsgUTF ( LOCALE_BOUQUETEDITOR_DELETE, g_Locale->getText(LOCALE_BOUQUETEDITOR_DELETE_QUESTION), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo ); - - if(result == CMessageBox::mbrYes) { - bouquet_id = bouquetList->getActiveBouquetNumber(); - /* FIXME if bouquet name not unique, this is bad, - * existsBouquet can find wrong bouquet */ - if(!strcmp(bouquetList->Bouquets[bouquet_id]->channelList->getName(), g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME))) - bouquet_id = g_bouquetManager->existsUBouquet(g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME), true); - else - bouquet_id = g_bouquetManager->existsBouquet(bouquetList->Bouquets[bouquet_id]->channelList->getName()); - - if (bouquet_id == -1) - return 0; - if(g_bouquetManager->existsChannelInBouquet(bouquet_id, channel_id)) { - g_bouquetManager->Bouquets[bouquet_id]->removeService(channel_id); - return 1; - } - } - break; - } - case 1: // move - old_bouquet_id = bouquetList->getActiveBouquetNumber(); - old_bouquet_id = g_bouquetManager->existsBouquet(bouquetList->Bouquets[old_bouquet_id]->channelList->getName()); - do { - new_bouquet_id = bouquetList->exec(false); - } while(new_bouquet_id == -3); - - hide(); - if(new_bouquet_id < 0) - return 0; - new_bouquet_id = g_bouquetManager->existsBouquet(bouquetList->Bouquets[new_bouquet_id]->channelList->getName()); - if ((new_bouquet_id == -1) || (new_bouquet_id == old_bouquet_id)) - return 0; - - if(!g_bouquetManager->existsChannelInBouquet(new_bouquet_id, channel_id)) { - CZapit::getInstance()->addChannelToBouquet(new_bouquet_id, channel_id); - } - if(g_bouquetManager->existsChannelInBouquet(old_bouquet_id, channel_id)) { - g_bouquetManager->Bouquets[old_bouquet_id]->removeService(channel_id); - } - return 1; - - break; - case 2: // add to - do { - bouquet_id = bouquetList->exec(false); - } while(bouquet_id == -3); - hide(); - if(bouquet_id < 0) - return 0; - - if(!strcmp(bouquetList->Bouquets[bouquet_id]->channelList->getName(), g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME))) - bouquet_id = g_bouquetManager->existsUBouquet(g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME), true); - else - bouquet_id = g_bouquetManager->existsBouquet(bouquetList->Bouquets[bouquet_id]->channelList->getName()); - - if (bouquet_id == -1) - return 0; - if(!g_bouquetManager->existsChannelInBouquet(bouquet_id, channel_id)) { - CZapit::getInstance()->addChannelToBouquet(bouquet_id, channel_id); - return 1; - } - break; - case 3: // add to my favorites - bouquet_id = g_bouquetManager->existsUBouquet(g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME), true); - if(bouquet_id == -1) { - g_bouquetManager->addBouquet(g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME), true); - bouquet_id = g_bouquetManager->existsUBouquet(g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME), true); - } - if(!g_bouquetManager->existsChannelInBouquet(bouquet_id, channel_id)) { - CZapit::getInstance()->addChannelToBouquet(bouquet_id, channel_id); - return 1; - } - - break; - case 4: // reset new - chanlist[selected]->flags &= ~CZapitChannel::NEW; - CServiceManager::getInstance()->SetServicesChanged(true); - /* if make_new_list == ON, signal to re-init services */ - if(g_settings.make_new_list) - return 1; - break; - case 5: // settings - { - COsdSetup osd_setup; - osd_setup.showContextChanlistMenu(); - //FIXME check font/options changed ? - hide(); - calcSize(); - } - break; - default: - break; - } - } - return 0; -} - -int CChannelList::exec() -{ - displayNext = 0; // always start with current events - int nNewChannel = show(); - if ( nNewChannel > -1 && nNewChannel < (int) chanlist.size()) { - if(this->historyMode && chanlist[nNewChannel]) { - int new_mode = CNeutrinoApp::getInstance()->channelList->getLastChannels().get_mode(chanlist[nNewChannel]->channel_id); - if(new_mode >= 0) - CNeutrinoApp::getInstance()->SetChannelMode(new_mode); - } - CNeutrinoApp::getInstance()->channelList->zapToChannel(chanlist[nNewChannel]); - } - - return nNewChannel; -} - -void CChannelList::calcSize() -{ - const int pic_h = 39; - int fw = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth(); - width = w_max (((g_settings.channellist_extended)?(frameBuffer->getScreenWidth() / 20 * (fw+6)):(frameBuffer->getScreenWidth() / 20 * (fw+5))), 100); - widthDetails = width; - if (g_settings.channellist_minitv) - widthDetails = frameBuffer->getScreenWidth() - frameBuffer->getScreenX(); - height = h_max ((frameBuffer->getScreenHeight() / 20 * 16), (frameBuffer->getScreenHeight() / 20 * 2)); - if (g_settings.channellist_minitv) - height = h_max ((frameBuffer->getScreenHeight() / 20 * 18), 0); - - CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, name.c_str()); - - /* assuming all color icons must have same size */ - int icol_w, icol_h; - frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); - - theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); - - theight = std::max(theight, pic_h); - - frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_HELP, &icol_w, &icol_h); - theight = std::max(theight, icol_h); - - frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MENU, &icol_w, &icol_h); - theight = std::max(theight, icol_h); - - if(g_settings.channellist_new_zap_mode) - { - frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE, &icol_w, &icol_h); - theight = std::max(theight, icol_h); - } - - fheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight(); - if (fheight == 0) - fheight = 1; /* avoid crash on invalid font */ - - listmaxshow = (height - theight - footerHeight -0)/fheight; - height = theight + footerHeight + listmaxshow * fheight; - info_height = 2*fheight + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getHeight() + 10; - - if (g_settings.channellist_minitv) - { - width = frameBuffer->getScreenWidth() / 3 * 2; - x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - widthDetails) / 2; - y = frameBuffer->getScreenY(); - pig_width = widthDetails / 3 - 16; - pig_height = pig_width / 16 * 9; - - infozone_width = pig_width - 8; - infozone_height = height - theight - pig_height; - } - else - { - x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2; - y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - (height+ info_height)) / 2; - } -} - -bool CChannelList::updateSelection(int newpos) -{ - bool actzap = false; - if((int) selected != newpos) { - int prev_selected = selected; - unsigned int oldliststart = liststart; - - selected = newpos; - liststart = (selected/listmaxshow)*listmaxshow; - if (oldliststart != liststart) - paint(); - else { - paintItem(prev_selected - liststart); - paintItem(selected - liststart); - showChannelLogo(); - } - - if(this->new_mode_active && SameTP()) { - actzap = true; - zapTo(selected); - } - } - return actzap; -} - -#define CHANNEL_SMSKEY_TIMEOUT 800 -/* return: >= 0 to zap, -1 on cancel, -3 on list mode change, -4 list edited, -2 zap but no restore old list/chan ?? */ -int CChannelList::show() -{ - /* temporary debugging stuff */ - struct timeval t1, t2; - gettimeofday(&t1, NULL); - - neutrino_msg_t msg; - neutrino_msg_data_t data; - bool actzap = 0; - int res = -1; - if (chanlist.empty()) { - return res; - } - - this->new_mode_active = 0; - - calcSize(); - displayNext = false; - - COSDFader fader(g_settings.menu_Content_alpha); - fader.StartFadeIn(); - - paintHead(); - paint(); - - gettimeofday(&t2, NULL); - fprintf(stderr, "CChannelList::show(): %llu ms to paint channellist\n", - ((t2.tv_sec * 1000000ULL + t2.tv_usec) - (t1.tv_sec * 1000000ULL + t1.tv_usec)) / 1000ULL); - - int oldselected = selected; - int zapOnExit = false; - bool bShowBouquetList = false; - - uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); - - bool loop=true; - while (loop) { - g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd, true); - if ( msg <= CRCInput::RC_MaxRC ) - timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); - - if((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetTimer())) { - if(fader.Fade()) { - loop = false; - } - } - else if ( ( msg == CRCInput::RC_timeout ) || ( msg == (neutrino_msg_t)g_settings.key_channelList_cancel) ) { - res = -1; - if(!actzap) { - selected = oldselected; - } - else { - res = -4; - selected = selected_in_new_mode; - } - if(fader.StartFadeOut()) { - timeoutEnd = CRCInput::calcTimeoutEnd( 1 ); - msg = 0; - } else - loop=false; - } - else if( msg == CRCInput::RC_record) { //start direct recording from channellist -#if 0 - if(!CRecordManager::getInstance()->RecordingStatus(chanlist[selected]->channel_id)) - { - printf("[neutrino channellist] start direct recording...\n"); - hide(); - if (CRecordManager::getInstance()->Record(chanlist[selected]->channel_id)) - { - if(SameTP()) - { - zapOnExit = true; - loop=false; - } - else - DisplayInfoMessage(g_Locale->getText(LOCALE_CHANNELLIST_RECORDING_NOT_POSSIBLE)); // UTF-8 - } - - } -#endif - if(SameTP()) { - printf("[neutrino channellist] start direct recording...\n"); - hide(); - if (!CRecordManager::getInstance()->Record(chanlist[selected]->channel_id)) { - paintHead(); - paint(); - } else - loop=false; - - } - } - else if( msg == CRCInput::RC_stop ) { //stopp recording - if(CRecordManager::getInstance()->RecordingStatus(chanlist[selected]->channel_id)) - { - if (CRecordManager::getInstance()->AskToStop(chanlist[selected]->channel_id)) - { - CRecordManager::getInstance()->Stop(chanlist[selected]->channel_id); - paint(); - } - } - } - else if ((msg == CRCInput::RC_red) || (msg == CRCInput::RC_epg)) { - hide(); - - /* RETURN_EXIT_ALL on FAV/SAT buttons or messages_return::cancel_all from CNeutrinoApp::getInstance()->handleMsg() */ - if ( g_EventList->exec(chanlist[selected]->channel_id, chanlist[selected]->getName()) == menu_return::RETURN_EXIT_ALL) { - res = -2; - loop = false; - } else { - paintHead(); - paint(); - timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); - } - } - else if (msg == CRCInput::RC_yellow) { - bShowBouquetList = true; - loop=false; - } - else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) { - g_RCInput->postMsg (msg, 0); - loop = false; - res = -1; - } - else if ( msg == CRCInput::RC_setup) { - old_b_id = bouquetList->getActiveBouquetNumber(); - fader.Stop(); - CNeutrinoApp::getInstance()->g_channel_list_changed = doChannelMenu(); - if(CNeutrinoApp::getInstance()->g_channel_list_changed) { - res = -4; - loop = false; - } else { - old_b_id = -1; - paintHead(); - paint(); - } - timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); - } - else if (msg == (neutrino_msg_t) g_settings.key_list_start) { - actzap = updateSelection(0); - } - else if (msg == (neutrino_msg_t) g_settings.key_list_end) { - actzap = updateSelection(chanlist.size()-1); - } - else if (msg == CRCInput::RC_up || (int) msg == g_settings.key_channelList_pageup) - { - int step = ((int) msg == g_settings.key_channelList_pageup) ? listmaxshow : 1; // browse or step 1 - int new_selected = selected - step; - if (new_selected < 0) { - if (selected != 0 && step != 1) - new_selected = 0; - else - new_selected = chanlist.size() - 1; - } - actzap = updateSelection(new_selected); - } - else if (msg == CRCInput::RC_down || (int) msg == g_settings.key_channelList_pagedown) - { - int step = ((int) msg == g_settings.key_channelList_pagedown) ? listmaxshow : 1; // browse or step 1 - int new_selected = selected + step; - if (new_selected >= (int) chanlist.size()) { - if ((chanlist.size() - listmaxshow -1 < selected) && (selected != (chanlist.size() - 1)) && (step != 1)) - new_selected = chanlist.size() - 1; - else if (((chanlist.size() / listmaxshow) + 1) * listmaxshow == chanlist.size() + listmaxshow) // last page has full entries - new_selected = 0; - else - new_selected = ((step == (int) listmaxshow) && (new_selected < (int) (((chanlist.size() / listmaxshow)+1) * listmaxshow))) ? (chanlist.size() - 1) : 0; - } - actzap = updateSelection(new_selected); - } - else if (msg == (neutrino_msg_t)g_settings.key_bouquet_up) { - if (!bouquetList->Bouquets.empty()) { - bool found = true; - uint32_t nNext = (bouquetList->getActiveBouquetNumber()+1) % bouquetList->Bouquets.size(); - if(bouquetList->Bouquets[nNext]->channelList->isEmpty() ) { - found = false; - nNext = nNext < bouquetList->Bouquets.size()-1 ? nNext+1 : 0; - for(uint32_t i = nNext; i < bouquetList->Bouquets.size(); i++) { - if( !bouquetList->Bouquets[i]->channelList->isEmpty() ) { - found = true; - nNext = i; - break; - } - } - } - if(found) { - bouquetList->activateBouquet(nNext, false); - res = bouquetList->showChannelList(); - loop = false; - } - } - } - else if (msg == (neutrino_msg_t)g_settings.key_bouquet_down) { - if (!bouquetList->Bouquets.empty()) { - bool found = true; - int nNext = (bouquetList->getActiveBouquetNumber()+bouquetList->Bouquets.size()-1) % bouquetList->Bouquets.size(); - if(bouquetList->Bouquets[nNext]->channelList->isEmpty() ) { - found = false; - nNext = nNext > 0 ? nNext-1 : bouquetList->Bouquets.size()-1; - for(int i = nNext; i > 0; i--) { - if(!bouquetList->Bouquets[i]->channelList->isEmpty()) { - found = true; - nNext = i; - break; - } - } - } - if(found) { - bouquetList->activateBouquet(nNext, false); - res = bouquetList->showChannelList(); - loop = false; - } - } - } - else if ( msg == CRCInput::RC_ok ) { - if(SameTP()) { - zapOnExit = true; - loop=false; - } - } - else if (( msg == CRCInput::RC_spkr ) && g_settings.channellist_new_zap_mode ) { - if(CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_ts) { - this->new_mode_active = (this->new_mode_active ? 0 : 1); - paintHead(); - showChannelLogo(); - } - } - else if (CRCInput::isNumeric(msg) && (this->historyMode || g_settings.sms_channel)) { - if (this->historyMode) { //numeric zap - selected = CRCInput::getNumericValue(msg); - zapOnExit = true; - loop = false; - } - else if(g_settings.sms_channel) { - unsigned char smsKey = 0; - SMSKeyInput smsInput; - smsInput.setTimeout(CHANNEL_SMSKEY_TIMEOUT); - - do { - smsKey = smsInput.handleMsg(msg); - //printf("SMS new key: %c\n", smsKey); - g_RCInput->getMsg_ms(&msg, &data, CHANNEL_SMSKEY_TIMEOUT-100); - } while ((msg >= CRCInput::RC_1) && (msg <= CRCInput::RC_9)); - - if (msg == CRCInput::RC_timeout || msg == CRCInput::RC_nokey) { - uint32_t i; - for(i = selected+1; i < chanlist.size(); i++) { - char firstCharOfTitle = chanlist[i]->getName().c_str()[0]; - if(tolower(firstCharOfTitle) == smsKey) { - //printf("SMS chan found was= %d selected= %d i= %d %s\n", was_sms, selected, i, chanlist[i]->channel->getName().c_str()); - break; - } - } - if(i >= chanlist.size()) { - for(i = 0; i < chanlist.size(); i++) { - char firstCharOfTitle = chanlist[i]->getName().c_str()[0]; - if(tolower(firstCharOfTitle) == smsKey) { - //printf("SMS chan found was= %d selected= %d i= %d %s\n", was_sms, selected, i, chanlist[i]->channel->getName().c_str()); - break; - } - } - } - if(i < chanlist.size()) { - int prevselected=selected; - selected=i; - - paintItem(prevselected - liststart); - unsigned int oldliststart = liststart; - liststart = (selected/listmaxshow)*listmaxshow; - if(oldliststart!=liststart) { - paint(); - } else { - paintItem(selected - liststart); - showChannelLogo(); - } - } - smsInput.resetOldKey(); - } - } - } - else if(CRCInput::isNumeric(msg)) { - //pushback key if... - selected = oldselected; - g_RCInput->postMsg( msg, data ); - loop=false; - } - else if ( msg == CRCInput::RC_blue ) - { - displayNext = !displayNext; - paintHead(); // update button bar - paint(); - } - else if ( msg == CRCInput::RC_green ) - { - int mode = CNeutrinoApp::getInstance()->GetChannelMode(); - if(mode != LIST_MODE_FAV) { - g_settings.channellist_sort_mode++; - if(g_settings.channellist_sort_mode > SORT_MAX-1) - g_settings.channellist_sort_mode = SORT_ALPHA; - CNeutrinoApp::getInstance()->SetChannelMode(mode); - paintHead(); // update button bar - paint(); - } - } - - else if ((msg == CRCInput::RC_info) || (msg == CRCInput::RC_help)) { - hide(); - CChannelEvent *p_event=NULL; - if (displayNext) - { - p_event = &(chanlist[selected]->nextEvent); - } - - if(p_event && p_event->eventID) - { - g_EpgData->show(chanlist[selected]->channel_id,p_event->eventID,&(p_event->startTime)); - } - else - { - g_EpgData->show(chanlist[selected]->channel_id); - } - paintHead(); - paint(); - } else { - if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { - loop = false; - res = - 2; - } - } - } - hide(); - - fader.Stop(); - - if (bShowBouquetList) { - res = bouquetList->exec(true); - printf("CChannelList:: bouquetList->exec res %d\n", res); - } - this->new_mode_active = 0; - - if(NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode()) - return -1; - - if(zapOnExit) { - res = selected; - //selected_chid = chanlist[selected]->channel_id; - } - - printf("CChannelList::show *********** res %d\n", res); - return(res); -} - -void CChannelList::hide() -{ - frameBuffer->paintBackgroundBoxRel(x, y, width, height+ info_height+ 5); - clearItem2DetailsLine(); -} - -bool CChannelList::showInfo(int number, int epgpos) -{ - CZapitChannel* channel = getChannel(number); - if(channel == NULL) - return false; - - g_InfoViewer->showTitle(channel, true, epgpos); // UTF-8 - return true; -} - -int CChannelList::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data) -{ - bool startvideo = true; - - if (msg != NeutrinoMessages::EVT_PROGRAMLOCKSTATUS) // right now the only message handled here. - return messages_return::unhandled; - - //printf("===> program-lock-status: %d zp: %d\n", data, zapProtection != NULL); - - if (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_NEVER) - goto out; - - // 0x100 als FSK-Status zeigt an, dass (noch) kein EPG zu einem Kanal der NICHT angezeigt - // werden sollte (vorgesperrt) da ist - // oder das bouquet des Kanals ist vorgesperrt - - if (zapProtection != NULL) { - zapProtection->fsk = data; - startvideo = false; - goto out; - } - - // require password if either - // CHANGETOLOCK mode and channel/bouquet is pre locked (0x100) - // ONSIGNAL mode and fsk(data) is beyond configured value - // if program has already been unlocked, dont require pin - if (data < (neutrino_msg_data_t)g_settings.parentallock_lockage) - goto out; - - /* already unlocked */ - if (chanlist[selected]->last_unlocked_EPGid == g_RemoteControl->current_EPGid && g_RemoteControl->current_EPGid != 0) - goto out; - - /* PARENTALLOCK_PROMPT_CHANGETOLOCKED: only pre-locked channels, don't care for fsk sent in SI */ - if (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED && data < 0x100) - goto out; - - /* if a pre-locked channel is inside the zap time, open it. Hardcoded to one hour for now. */ - if (data >= 0x100 && chanlist[selected]->last_unlocked_time + 3600 > time_monotonic()) - goto out; - - /* OK, let's ask for a PIN */ - g_RemoteControl->stopvideo(); - //printf("stopped video\n"); - zapProtection = new CZapProtection(g_settings.parentallock_pincode, data); - - if (zapProtection->check()) - { - // remember it for the next time - /* data < 0x100: lock age -> remember EPG ID */ - if (data < 0x100) - chanlist[selected]->last_unlocked_EPGid = g_RemoteControl->current_EPGid; - else - { - /* data >= 0x100: pre locked bouquet -> remember unlock time */ - chanlist[selected]->last_unlocked_time = time_monotonic(); - int bnum = bouquetList->getActiveBouquetNumber(); - if (bnum >= 0) - { - /* unlock the whole bouquet */ - int i; - for (i = 0; i < bouquetList->Bouquets[bnum]->channelList->getSize(); i++) - bouquetList->Bouquets[bnum]->channelList->getChannelFromIndex(i)->last_unlocked_time = chanlist[selected]->last_unlocked_time; - } - } - } - else - { - /* last_unlocked_time == 0 is the magic to tell zapTo() to not record the time. - Without that, zapping to a locked channel twice would open it without the PIN */ - chanlist[selected]->last_unlocked_time = 0; - startvideo = false; - } - delete zapProtection; - zapProtection = NULL; - -out: - if (startvideo) - g_RemoteControl->startvideo(); - - return messages_return::handled; -} - -/* bToo default to true */ -/* TODO make this member of CNeutrinoApp, because this only called from "whole" list ? */ -bool CChannelList::adjustToChannelID(const t_channel_id channel_id, bool bToo) -{ - unsigned int i; - - selected_chid = channel_id; - printf("CChannelList::adjustToChannelID me %p [%s] list size %d channel_id %llx\n", this, getName(), chanlist.size(), channel_id); - fflush(stdout); - for (i = 0; i < chanlist.size(); i++) { - if(chanlist[i] == NULL) { - printf("CChannelList::adjustToChannelID REPORT BUG !! ******************************** %d is NULL !!\n", i); - continue; - } - if (chanlist[i]->channel_id == channel_id) { - selected = i; - tuned = i; - - lastChList.store (selected, channel_id, false); - - if (bToo) { - int old_mode = CNeutrinoApp::getInstance()->GetChannelMode(); - int new_mode = old_mode; - bool has_channel; - if(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_tv) { - has_channel = TVfavList->adjustToChannelID(channel_id); - if(!has_channel && old_mode == LIST_MODE_FAV) - new_mode = LIST_MODE_PROV; - has_channel = TVbouquetList->adjustToChannelID(channel_id); - if(!has_channel && old_mode == LIST_MODE_PROV) { - new_mode = LIST_MODE_SAT; - } - has_channel = TVsatList->adjustToChannelID(channel_id); - if(!has_channel && old_mode == LIST_MODE_SAT) - new_mode = LIST_MODE_ALL; - has_channel = TVallList->adjustToChannelID(channel_id); - } - else if(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_radio) { - has_channel = RADIOfavList->adjustToChannelID(channel_id); - if(!has_channel && old_mode == LIST_MODE_FAV) - new_mode = LIST_MODE_PROV; - has_channel = RADIObouquetList->adjustToChannelID(channel_id); - if(!has_channel && old_mode == LIST_MODE_PROV) - new_mode = LIST_MODE_SAT; - has_channel = RADIOsatList->adjustToChannelID(channel_id); - if(!has_channel && old_mode == LIST_MODE_SAT) - new_mode = LIST_MODE_ALL; - has_channel = RADIOallList->adjustToChannelID(channel_id); - } - if(old_mode != new_mode) - CNeutrinoApp::getInstance()->SetChannelMode(new_mode); - } -//printf("CChannelList::adjustToChannelID me %x to %llx bToo %s OK: %d\n", (int) this, channel_id, bToo ? "yes" : "no", i);fflush(stdout); - return true; - } - } -//printf("CChannelList::adjustToChannelID me %x to %llx bToo %s FAILED\n", (int) this, channel_id, bToo ? "yes" : "no");fflush(stdout); - - return false; -} - -#if 0 -int CChannelList::hasChannel(int nChannelNr) -{ - for (uint32_t i=0; ichannel_id == channel_id) - return i; - } - return -1; -} - -// for adjusting bouquet's channel list after numzap or quickzap -void CChannelList::setSelected( int nChannelNr) -{ -//printf("CChannelList::setSelected me %s %d -> %s\n", name.c_str(), nChannelNr, (nChannelNr < chanlist.size() && chanlist[nChannelNr] != NULL) ? chanlist[nChannelNr]->getName().c_str() : "********* NONE *********"); - //FIXME real difference between tuned and selected ?! - selected_chid = 0; - tuned = nChannelNr; - if (nChannelNr < (int) chanlist.size()) { - selected = nChannelNr; - selected_chid = chanlist[tuned]->getChannelID(); - } -} - -// -- Zap to channel with channel_id -bool CChannelList::zapTo_ChannelID(const t_channel_id channel_id) -{ - printf("**************************** CChannelList::zapTo_ChannelID %llx\n", channel_id); - for (unsigned int i = 0; i < chanlist.size(); i++) { - if (chanlist[i]->channel_id == channel_id) { - zapTo(i); - return true; - } - } - return false; -} - -bool CChannelList::showEmptyError() -{ - if (chanlist.empty()) { - DisplayErrorMessage(g_Locale->getText(LOCALE_CHANNELLIST_NONEFOUND)); // UTF-8 - return true; - } - return false; -} - -/* forceStoreToLastChannels defaults to false */ -/* TODO make this private to call only from "current" list, where selected/pos not means channel number */ -void CChannelList::zapTo(int pos, bool /* forceStoreToLastChannels */) -{ - if(showEmptyError()) - return; - - if ( (pos >= (signed int) chanlist.size()) || (pos < 0) ) { - pos = 0; - } - CZapitChannel* chan = chanlist[pos]; - - zapToChannel(chan); - tuned = pos; - if(this->new_mode_active) - selected_in_new_mode = pos; - else - selected = pos; -} - -/* to replace zapTo_ChannelID and zapTo from "whole" list ? */ -void CChannelList::zapToChannel(CZapitChannel *channel) -{ - if(showEmptyError()) - return; - - if(channel == NULL) - return; - - /* we record when we switched away from a channel, so that the parental-PIN code can - check for timeout. last_unlocked_time == 0 means: the PIN was not entered - "tuned" is the *old* channel, before zap */ - if (tuned < chanlist.size() && chanlist[tuned]->last_unlocked_time != 0) - chanlist[tuned]->last_unlocked_time = time_monotonic(); - - printf("**************************** CChannelList::zapToChannel me %p %s tuned %d new %s -> %llx\n", this, name.c_str(), tuned, channel->getName().c_str(), channel->channel_id); - if(tuned < chanlist.size()) - selected_chid = chanlist[tuned]->getChannelID(); - - if(selected_chid != channel->getChannelID()) { - if ((g_settings.radiotext_enable) && ((CNeutrinoApp::getInstance()->getMode()) == NeutrinoMessages::mode_radio) && (g_Radiotext)) - { - // stop radiotext PES decoding before zapping - g_Radiotext->radiotext_stop(); - } - - selected_chid = channel->getChannelID(); - g_RemoteControl->zapTo_ChannelID(channel->getChannelID(), channel->getName(), !channel->bAlwaysLocked); - CNeutrinoApp::getInstance()->channelList->adjustToChannelID(channel->getChannelID()); - } - if(!this->new_mode_active) { - /* remove recordModeActive from infobar */ - if(g_settings.auto_timeshift && !CNeutrinoApp::getInstance()->recordingstatus) { - g_InfoViewer->handleMsg(NeutrinoMessages::EVT_RECORDMODE, 0); - } - g_RCInput->postMsg( NeutrinoMessages::SHOW_INFOBAR, 0 ); - CNeutrinoApp::getInstance()->channelList->getLastChannels().set_mode(channel->channel_id); - } -} - -/* Called only from "all" channel list */ -int CChannelList::numericZap(int key) -{ - neutrino_msg_t msg; - neutrino_msg_data_t data; - - int res = -1; - - if(showEmptyError()) - return res; - - // -- quickzap "0" to last seen channel... - if (key == g_settings.key_lastchannel) { - t_channel_id channel_id = lastChList.getlast(1); - if(channel_id && SameTP(channel_id)) { - lastChList.clear_storedelay(); // ignore store delay - int new_mode = lastChList.get_mode(channel_id); - if(new_mode >= 0) - CNeutrinoApp::getInstance()->SetChannelMode(new_mode); - zapTo_ChannelID(channel_id); - res = 0; - } - return res; - } - if ((key == g_settings.key_zaphistory) || (key == CRCInput::RC_games)) { - if((!autoshift && CNeutrinoApp::getInstance()->recordingstatus) || (key == CRCInput::RC_games)) { - CChannelList * orgList = CNeutrinoApp::getInstance()->channelList; - CChannelList * channelList = new CChannelList(g_Locale->getText(LOCALE_CHANNELLIST_CURRENT_TP), false, true); - - if(key == CRCInput::RC_games) { - t_channel_id recid = chanlist[selected]->channel_id >> 16; - for ( unsigned int i = 0 ; i < orgList->chanlist.size(); i++) { - if((orgList->chanlist[i]->channel_id >> 16) == recid) - channelList->addChannel(orgList->chanlist[i]); - } - } else { - for ( unsigned int i = 0 ; i < orgList->chanlist.size(); i++) { - if(SameTP(orgList->chanlist[i])) - channelList->addChannel(orgList->chanlist[i]); - } - } - if ( !channelList->isEmpty()) { - channelList->adjustToChannelID(orgList->getActiveChannel_ChannelID(), false); - this->frameBuffer->paintBackground(); - res = channelList->exec(); - CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); - } - delete channelList; - return res; - } - // -- zap history bouquet, similar to "0" quickzap, but shows a menue of last channels - if (this->lastChList.size() > 1) { - CChannelList * channelList = new CChannelList(g_Locale->getText(LOCALE_CHANNELLIST_HISTORY), true, true); - - for(unsigned int i = 1; i < this->lastChList.size() ; ++i) { - t_channel_id channel_id = this->lastChList.getlast(i); - if(channel_id) { - CZapitChannel* channel = getChannel(channel_id); - if(channel) channelList->addChannel(channel); - } - } - if ( !channelList->isEmpty() ) { - this->frameBuffer->paintBackground(); - res = channelList->exec(); - CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); - } - delete channelList; - } - return res; - } - size_t maxchansize = MaxChanNr().size(); - int fw = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getRenderWidth(widest_number); - int sx = maxchansize * fw + (fw/2); - int sy = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getHeight() + 6; - - int ox = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - sx)/2; - int oy = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - sy)/2; - char valstr[10]; - int chn = CRCInput::getNumericValue(key); - int pos = 1; - int lastchan= -1; - bool doZap = false; - bool showEPG = false; - - while(1) { - if (lastchan != chn) { - snprintf((char*) &valstr, sizeof(valstr), "%d", chn); - - while(strlen(valstr) < maxchansize) - strcat(valstr,"-"); //"_" - frameBuffer->paintBoxRel(ox, oy, sx, sy, COL_INFOBAR_PLUS_0); - - for (int i = maxchansize-1; i >= 0; i--) { - valstr[i+ 1] = 0; - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->RenderString(ox+fw/3+ i*fw, oy+sy-3, sx, &valstr[i], COL_INFOBAR); - } - - showInfo(chn); - lastchan = chn; - } - - g_RCInput->getMsg( &msg, &data, g_settings.timing[SNeutrinoSettings::TIMING_NUMERICZAP] * 10 ); - - if (msg == CRCInput::RC_timeout || msg == CRCInput::RC_ok) { - doZap = true; - break; - } - else if (msg == CRCInput::RC_favorites || msg == CRCInput::RC_sat || msg == CRCInput::RC_right) { - } - else if (CRCInput::isNumeric(msg)) { - if (pos == 4) { - chn = 0; - pos = 1; - } else { - chn *= 10; - pos++; - } - chn += CRCInput::getNumericValue(msg); - } - else if (msg == (neutrino_msg_t)g_settings.key_quickzap_down) { - if(chn > 1) - chn--; - } - else if (msg == (neutrino_msg_t)g_settings.key_quickzap_up) { - chn++; - } - else if (msg == CRCInput::RC_left) { - /* "backspace" */ - if(pos > 0) { - pos--; - if(chn > 10) - chn /= 10; - } - } - else if (msg == CRCInput::RC_home) - { - break; - } - else if (msg == CRCInput::RC_red) { - showEPG = true; - break; - } - else if (CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all) { - break; - } - } - - frameBuffer->paintBackgroundBoxRel(ox, oy, sx, sy); - - CZapitChannel* chan = getChannel(chn); - if (doZap) { - if(g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR] == 0) - g_InfoViewer->killTitle(); - - if(chan && SameTP(chan)) { - zapToChannel(chan); - res = 0; - } else - g_InfoViewer->killTitle(); - - } else { - g_InfoViewer->showTitle(getActiveChannel(), true); - g_InfoViewer->killTitle(); - if (chan && showEPG) - g_EventList->exec(chan->channel_id, chan->getName()); - } - return res; -} - -CZapitChannel* CChannelList::getPrevNextChannel(int key, unsigned int &sl) -{ - CZapitChannel* channel = chanlist[sl]; - int bsize = bouquetList->Bouquets.size(); - int bactive = bouquetList->getActiveBouquetNumber(); - - if(!g_settings.zap_cycle && bsize > 1) { - size_t cactive = sl; - - printf("CChannelList::getPrevNextChannel: selected %d total %d active bouquet %d total %d\n", cactive, chanlist.size(), bactive, bsize); - if ((key == g_settings.key_quickzap_down) || (key == CRCInput::RC_left)) { - if(cactive == 0) { - if(bactive == 0) - bactive = bsize - 1; - else - bactive--; - bouquetList->activateBouquet(bactive, false); - cactive = bouquetList->Bouquets[bactive]->channelList->getSize() - 1; - } else - --cactive; - } - else if ((key == g_settings.key_quickzap_up) || (key == CRCInput::RC_right)) { - cactive++; - if(cactive >= chanlist.size()) { - bactive = (bactive + 1) % bsize; - bouquetList->activateBouquet(bactive, false); - cactive = 0; - } - } - sl = cactive; - channel = bouquetList->Bouquets[bactive]->channelList->getChannelFromIndex(cactive); - printf("CChannelList::getPrevNextChannel: selected %d total %d active bouquet %d total %d channel %x (%s)\n", - cactive, chanlist.size(), bactive, bsize, (int) channel, channel ? channel->getName().c_str(): ""); - } else { - if ((key == g_settings.key_quickzap_down) || (key == CRCInput::RC_left)) { - if(sl == 0) - sl = chanlist.size()-1; - else - sl--; - } - else if ((key==g_settings.key_quickzap_up) || (key == CRCInput::RC_right)) { - sl = (sl+1)%chanlist.size(); - } - channel = chanlist[sl]; - } - return channel; -} - -void CChannelList::virtual_zap_mode(bool up) -{ - neutrino_msg_t msg; - neutrino_msg_data_t data; - - if(showEmptyError()) - return; - - unsigned int sl = selected; - int old_bactive = bouquetList->getActiveBouquetNumber(); - int bactive = old_bactive; - - CZapitChannel* channel = getPrevNextChannel(up ? CRCInput::RC_right : CRCInput::RC_left, sl); - - bool doZap = false; - bool showEPG = false; - int epgpos = 0; - - while(1) { - if (channel) - g_InfoViewer->showTitle(channel, true, epgpos); - - epgpos = 0; - g_RCInput->getMsg(&msg, &data, 15*10); // 15 seconds, not user changable - - if ((msg == CRCInput::RC_left) || (msg == CRCInput::RC_right)) { - channel = bouquetList->Bouquets[bactive]->channelList->getPrevNextChannel(msg, sl); - bactive = bouquetList->getActiveBouquetNumber(); - } - else if (msg == CRCInput::RC_up || msg == CRCInput::RC_down) { - epgpos = (msg == CRCInput::RC_up) ? -1 : 1; - } - else if ((msg == CRCInput::RC_ok) || (msg == CRCInput::RC_home) || (msg == CRCInput::RC_timeout)) { - if(msg == CRCInput::RC_ok) - doZap = true; - break; - } - else if (msg == CRCInput::RC_red) { - showEPG = true; - break; - } - else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) { - break; - } - } - g_InfoViewer->clearVirtualZapMode(); - - if (doZap) { - if(g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR] == 0) - g_InfoViewer->killTitle(); - if(channel && SameTP(channel)) - zapToChannel(channel); - else - g_InfoViewer->killTitle(); - } else { - g_InfoViewer->showTitle(getActiveChannel(), true); - g_InfoViewer->killTitle(); - bouquetList->activateBouquet(old_bactive, false); - - if (showEPG && channel) - g_EventList->exec(channel->channel_id, channel->getName()); - } -} - -void CChannelList::quickZap(int key, bool /* cycle */) -{ - if(chanlist.empty()) - return; - - unsigned int sl = selected; - /* here selected value doesnt matter, zap will do adjust */ - CZapitChannel* channel = getPrevNextChannel(key, sl); - if(channel) - CNeutrinoApp::getInstance()->channelList->zapToChannel(channel); - g_RCInput->clearRCMsg(); //FIXME test for n.103 -} - -void CChannelList::paintDetails(int index) -{ - CChannelEvent *p_event = NULL; - - //colored_events init - bool colored_event_C = false; - bool colored_event_N = false; - if (g_settings.colored_events_channellist == 1) - colored_event_C = true; - if (g_settings.colored_events_channellist == 2) - colored_event_N = true; - - if (displayNext) { - p_event = &chanlist[index]->nextEvent; - } else { - p_event = &chanlist[index]->currentEvent; - } - - frameBuffer->paintBoxRel(x+2, y + height + 2, widthDetails-4, info_height - 4, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE);//round - - if (!p_event->description.empty()) { - char cNoch[50] = {0}; // UTF-8 - char cSeit[50] = {0}; // UTF-8 - - struct tm *pStartZeit = localtime(&p_event->startTime); - unsigned seit = ( time(NULL) - p_event->startTime ) / 60; - snprintf(cSeit, sizeof(cSeit), "%s %02d:%02d",(displayNext) ? g_Locale->getText(LOCALE_CHANNELLIST_START):g_Locale->getText(LOCALE_CHANNELLIST_SINCE), pStartZeit->tm_hour, pStartZeit->tm_min); - if (displayNext) { - snprintf(cNoch, sizeof(cNoch), "(%d min)", p_event->duration / 60); - } else { - int noch = (p_event->startTime + p_event->duration - time(NULL)) / 60; - if ((noch< 0) || (noch>=10000)) - noch= 0; - snprintf(cNoch, sizeof(cNoch), "(%d / %d min)", seit, noch); - } - int seit_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(cSeit, true); // UTF-8 - int noch_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(cNoch, true); // UTF-8 - - std::string text1= p_event->description; - std::string text2= p_event->text; - - int xstart = 10; - if (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1, true) > (widthDetails - 30 - seit_len) ) - { - // zu breit, Umbruch versuchen... - int pos; - do { - pos = text1.find_last_of("[ -.]+"); - if ( pos!=-1 ) - text1 = text1.substr( 0, pos ); - } while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1, true) > (widthDetails - 30 - seit_len) ) ); - - std::string text3 = ""; /* not perfect, but better than crashing... */ - if (p_event->description.length() > text1.length()) - text3 = p_event->description.substr(text1.length()+ 1); - - if (!text2.empty() && !text3.empty()) - text3= text3+ " - "; - - xstart += g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text3, true); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2* fheight, widthDetails - 30- noch_len, text3, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); - } - - if (!(text2.empty())) { - while ( text2.find_first_of("[ -.+*#?=!$%&/]+") == 0 ) - text2 = text2.substr( 1 ); - text2 = text2.substr( 0, text2.find('\n') ); -#if 0 //FIXME: to discuss, eat too much cpu time if string long enough - int pos = 0; - while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text2, true) > (widthDetails - 30 - noch_len) ) ) { - pos = text2.find_last_of(" "); - - if ( pos!=-1 ) { - text2 = text2.substr( 0, pos ); - } - } -#endif - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ xstart, y+ height+ 5+ 2* fheight, widthDetails- xstart- 30- noch_len, text2, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); - } - - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ fheight, widthDetails - 30 - seit_len, text1, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ widthDetails- 10- seit_len, y+ height+ 5+ fheight, seit_len, cSeit, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8 - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ widthDetails- 10- noch_len, y+ height+ 5+ 2* fheight, noch_len, cNoch, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8 - } - if(g_settings.channellist_foot == 0) { - transponder t; - CServiceManager::getInstance()->GetTransponder(chanlist[index]->getTransponderId(), t); - - std::string desc = t.description(); - if(chanlist[index]->pname) - desc = desc + " (" + std::string(chanlist[index]->pname) + ")"; - else - desc = desc + " (" + CServiceManager::getInstance()->GetSatelliteName(chanlist[index]->getSatellitePosition()) + ")"; - - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 3*fheight, widthDetails - 30, desc.c_str(), COL_MENUCONTENTDARK, 0, true); - } - else if( !displayNext && g_settings.channellist_foot == 1) { // next Event - char buf[128] = {0}; - char cFrom[50] = {0}; // UTF-8 - CSectionsdClient::CurrentNextInfo CurrentNext; - CEitManager::getInstance()->getCurrentNextServiceKey(chanlist[index]->channel_id, CurrentNext); - if (!CurrentNext.next_name.empty()) { - struct tm *pStartZeit = localtime (& CurrentNext.next_zeit.startzeit); - snprintf(cFrom, sizeof(cFrom), "%s %02d:%02d",g_Locale->getText(LOCALE_WORD_FROM),pStartZeit->tm_hour, pStartZeit->tm_min ); - snprintf(buf, sizeof(buf), "%s", CurrentNext.next_name.c_str()); - int from_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(cFrom, true); // UTF-8 - - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 3*fheight, widthDetails - 30 - from_len, buf, colored_event_N ? COL_COLORED_EVENTS_CHANNELLIST :COL_MENUCONTENTDARK, 0, true); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ widthDetails- 10- from_len, y+ height+ 5+ 3*fheight, from_len, cFrom, colored_event_N ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8 - } - } - if ((g_settings.channellist_minitv) && (p_event != NULL)) - paint_events(index); -} - -void CChannelList::clearItem2DetailsLine() -{ - paintItem2DetailsLine (-1, 0); -} - -void CChannelList::paintItem2DetailsLine (int pos, int /*ch_index*/) -{ -#define ConnectLineBox_Width 16 - - int xpos = x - ConnectLineBox_Width; - int ypos1 = y + theight+0 + pos*fheight; - int ypos2 = y + height; - int ypos1a = ypos1 + (fheight/2)-2; - int ypos2a = ypos2 + (info_height/2)-2; - fb_pixel_t col1 = COL_MENUCONTENT_PLUS_6; - // Clear - frameBuffer->paintBackgroundBoxRel(xpos,y, ConnectLineBox_Width, height+info_height + 1); - - // paint Line if detail info (and not valid list pos) - if (pos >= 0) { //pos >= 0 && chanlist[ch_index]->currentEvent.description != "") { - if(1) // FIXME why -> ? (!g_settings.channellist_extended) - { - //details line - CComponentsDetailLine details_line(xpos, ypos1a, ypos2a, fheight/2+1, info_height-RADIUS_LARGE*2); - details_line.paint(); - - //info box frame - frameBuffer->paintBoxFrame(x, ypos2, widthDetails, info_height, 2, col1, RADIUS_LARGE); - } - } -} - -void CChannelList::showChannelLogo() -{ - if (g_settings.channellist_minitv) - return; - if(g_settings.infobar_show_channellogo){ - static int logo_w = 0; - static int logo_h = 0; - int logo_w_max = width / 4; - frameBuffer->paintBoxRel(x + width - logo_off - logo_w, y+(theight-logo_h)/2, logo_w, logo_h, COL_MENUHEAD_PLUS_0); - - std::string lname; - if(g_PicViewer->GetLogoName(chanlist[selected]->channel_id, chanlist[selected]->getName(), lname, &logo_w, &logo_h)) { - if((logo_h > theight) || (logo_w > logo_w_max)) - g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, logo_w_max, theight); - g_PicViewer->DisplayImage(lname, x + width - logo_off - logo_w, y+(theight-logo_h)/2, logo_w, logo_h); - } - } -} - -#define NUM_LIST_BUTTONS 4 -struct button_label SChannelListButtons[NUM_LIST_BUTTONS] = -{ - { NEUTRINO_ICON_BUTTON_RED, LOCALE_INFOVIEWER_EVENTLIST}, - { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_BOUQUETLIST_HEAD}, - { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_INFOVIEWER_NEXT}, - { NEUTRINO_ICON_BUTTON_RECORD_INACTIVE, NONEXISTANT_LOCALE} -}; -#define NUM_LIST_BUTTONS_SORT 5 -struct button_label SChannelListButtons_SMode[NUM_LIST_BUTTONS_SORT] = -{ - { NEUTRINO_ICON_BUTTON_RED, LOCALE_INFOVIEWER_EVENTLIST}, - { NEUTRINO_ICON_BUTTON_GREEN, LOCALE_CHANNELLIST_FOOT_SORT_ALPHA}, - { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_BOUQUETLIST_HEAD}, - { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_INFOVIEWER_NEXT}, - { NEUTRINO_ICON_BUTTON_RECORD_INACTIVE, NONEXISTANT_LOCALE} -}; - -void CChannelList::paintButtonBar(bool is_current) -{ - //printf("[neutrino channellist] %s...%d, selected %d\n", __FUNCTION__, __LINE__, selected); - unsigned int smode = CNeutrinoApp::getInstance()->GetChannelMode(); - int num_buttons = smode != LIST_MODE_FAV ? NUM_LIST_BUTTONS_SORT : NUM_LIST_BUTTONS; - - struct button_label Button[num_buttons]; - const neutrino_locale_t button_ids[] = {LOCALE_INFOVIEWER_NOW,LOCALE_INFOVIEWER_NEXT,LOCALE_MAINMENU_RECORDING,LOCALE_MAINMENU_RECORDING_STOP,NONEXISTANT_LOCALE, - LOCALE_CHANNELLIST_FOOT_SORT_ALPHA,LOCALE_CHANNELLIST_FOOT_SORT_FREQ,LOCALE_CHANNELLIST_FOOT_SORT_SAT,LOCALE_CHANNELLIST_FOOT_SORT_CHNUM}; - const std::vector buttonID_rest (button_ids, button_ids + sizeof(button_ids) / sizeof(neutrino_locale_t) ); - - for (int i = 0;iRecordingStatus(getActiveChannel_ChannelID()); - - if (g_settings.recording_type != RECORDING_OFF && !displayNext){ - if (is_current && !do_record){ - Button[Bindex].locale = LOCALE_MAINMENU_RECORDING; - Button[Bindex].button = NEUTRINO_ICON_BUTTON_RECORD_ACTIVE; - }else if (do_record){ - Button[Bindex].locale = LOCALE_MAINMENU_RECORDING_STOP; - Button[Bindex].button = NEUTRINO_ICON_BUTTON_STOP; - }else{ - Button[Bindex].locale = NONEXISTANT_LOCALE; - Button[Bindex].button = NEUTRINO_ICON_BUTTON_RECORD_INACTIVE; - } - } - if(smode) - { - switch (g_settings.channellist_sort_mode) - { - case SORT_ALPHA: - Button[1].locale = LOCALE_CHANNELLIST_FOOT_SORT_ALPHA; - break; - case SORT_TP: - Button[1].locale = LOCALE_CHANNELLIST_FOOT_SORT_FREQ; - break; - case SORT_SAT: - Button[1].locale = LOCALE_CHANNELLIST_FOOT_SORT_SAT; - break; - case SORT_CH_NUMBER: - Button[1].locale = LOCALE_CHANNELLIST_FOOT_SORT_CHNUM; - break; - default: - break; - } - } - - //paint buttons - int y_foot = y + (height - footerHeight); - ::paintButtons(x, y_foot, width,num_buttons, Button, footerHeight,0,false,COL_INFOBAR_SHADOW,NULL,0,true, buttonID_rest); -} - -void CChannelList::paintItem(int pos) -{ - int ypos = y+ theight+0 + pos*fheight; - uint8_t color; - fb_pixel_t bgcolor; - bool iscurrent = true; - bool paintbuttons = false; - unsigned int curr = liststart + pos; - int rec_mode; - -#if 0 - if(CNeutrinoApp::getInstance()->recordingstatus && !autoshift && curr < chanlist.size()) { - iscurrent = (chanlist[curr]->channel_id >> 16) == (rec_channel_id >> 16); - //printf("recording %llx current %llx current = %s\n", rec_channel_id, chanlist[liststart + pos]->channel_id, iscurrent? "yes" : "no"); - } -#endif - if(curr < chanlist.size()) - iscurrent = SameTP(chanlist[curr]); - - if (curr == selected) { - color = COL_MENUCONTENTSELECTED; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - paintItem2DetailsLine (pos, curr); - paintDetails(curr); - frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, RADIUS_LARGE); - paintbuttons = true; - } else { - color = iscurrent ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE; - bgcolor = iscurrent ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENTINACTIVE_PLUS_0; - frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, 0); - } - - if(curr < chanlist.size()) { - char nameAndDescription[255]; - char tmp[10]; - CZapitChannel* chan = chanlist[curr]; - int prg_offset=0; - int title_offset=0; - uint8_t tcolor=(liststart + pos == selected) ? color : COL_MENUCONTENTINACTIVE; - int xtheight=fheight-2; - - if(g_settings.channellist_extended) - { - prg_offset = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth("00:00"); - title_offset=6; - } - - snprintf((char*) tmp, sizeof(tmp), "%d", this->historyMode ? pos : chan->number); - - CChannelEvent *p_event=NULL; - if (displayNext) { - p_event = &chan->nextEvent; - } else { - p_event = &chan->currentEvent; - } - - if (pos == 0) - { - /* FIXME move to calcSize() ? */ - int w_max, w_min, h; - ChannelList_Rec = 0; - int recmode_icon_max = CRecordManager::RECMODE_REC, recmode_icon_min = CRecordManager::RECMODE_TSHIFT; - frameBuffer->getIconSize(NEUTRINO_ICON_REC, &w_max, &h); - frameBuffer->getIconSize(NEUTRINO_ICON_AUTO_SHIFT, &w_min, &h); - if (w_max < w_min) - { - recmode_icon_max = CRecordManager::RECMODE_TSHIFT; - recmode_icon_min = CRecordManager::RECMODE_REC; - h = w_max; - w_max = w_min; - w_min = h; - } - for (uint32_t i = 0; i < chanlist.size(); i++) - { - rec_mode = CRecordManager::getInstance()->GetRecordMode(chanlist[i]->channel_id); - if (rec_mode & recmode_icon_max) - { - ChannelList_Rec = w_max; - break; - } else if (rec_mode & recmode_icon_min) - ChannelList_Rec = w_min; - } - if (ChannelList_Rec > 0) - ChannelList_Rec += 8; - } - - //record check - rec_mode = CRecordManager::getInstance()->GetRecordMode(chanlist[curr]->channel_id); - - //set recording icon - const char * rec_icon = ""; - if (rec_mode & CRecordManager::RECMODE_REC) - rec_icon = NEUTRINO_ICON_REC; - else if (rec_mode & CRecordManager::RECMODE_TSHIFT) - rec_icon = NEUTRINO_ICON_AUTO_SHIFT; - - //calculating icons - int icon_x = (x+width-15-2) - RADIUS_LARGE/2; - int r_icon_w=0; int s_icon_h=0; int s_icon_w=0; - frameBuffer->getIconSize(NEUTRINO_ICON_SCRAMBLED, &s_icon_w, &s_icon_h); - r_icon_w = ChannelList_Rec; - int r_icon_x = icon_x; - - //paint scramble icon - if(chan->scrambled) - if (frameBuffer->paintIcon(NEUTRINO_ICON_SCRAMBLED, icon_x - s_icon_w, ypos, fheight))//ypos + (fheight - 16)/2); - r_icon_x = r_icon_x - s_icon_w; - - //paint recording icon - if (rec_mode != CRecordManager::RECMODE_OFF) - frameBuffer->paintIcon(rec_icon, r_icon_x - r_icon_w, ypos, fheight);//ypos + (fheight - 16)/2); - - //paint buttons - if (paintbuttons) - paintButtonBar(iscurrent); - - int icon_space = r_icon_w+s_icon_w; - - //number - int numpos = x+5+numwidth- g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(tmp); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(numpos,ypos+fheight, numwidth+5, tmp, color, fheight); - - int l=0; - if (this->historyMode) - l = snprintf(nameAndDescription, sizeof(nameAndDescription), ": %d %s", chan->number, chan->getName().c_str()); - else - l = snprintf(nameAndDescription, sizeof(nameAndDescription), "%s", chan->getName().c_str()); - - CProgressBar pb(false); /* never colored */ - int pb_space = prg_offset - title_offset; - int pb_max = pb_space - 4; - if (!(p_event->description.empty())) { - snprintf(nameAndDescription+l, sizeof(nameAndDescription)-l,g_settings.channellist_epgtext_align_right ? " ":" - "); - unsigned int ch_name_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(nameAndDescription, true); - unsigned int ch_desc_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(p_event->description, true); - - int max_desc_len = width - numwidth - prg_offset - ch_name_len - 15 - 20; // 15 = scrollbar, 20 = spaces - if (chan->scrambled || (g_settings.channellist_extended ||g_settings.channellist_epgtext_align_right)) - max_desc_len -= icon_space; /* do we need space for the lock/rec icon? */ - - if (max_desc_len < 0) - max_desc_len = 0; - if ((int) ch_desc_len > max_desc_len) - ch_desc_len = max_desc_len; - - if(g_settings.channellist_extended) { - if(displayNext) - { - struct tm *pStartZeit = localtime(&p_event->startTime); - - snprintf((char*) tmp, sizeof(tmp), "%02d:%02d", pStartZeit->tm_hour, pStartZeit->tm_min); -// g_Font[SNeutrinoSettings::FONT_TYPE_IMAGEINFO_SMALL]->RenderString(x+ 5+ numwidth+ 6, ypos+ xtheight, width- numwidth- 20- 15 -poffs, tmp, COL_MENUCONTENT, 0, true); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(x+ 5+ numwidth+ 6, ypos+ xtheight, width- numwidth- 20- 15 -prg_offset, tmp, tcolor, 0, true); - } - else - { - time_t jetzt=time(NULL); - int runningPercent = 0; - - if (((jetzt - p_event->startTime + 30) / 60) < 0 ) - { - runningPercent= 0; - } - else - { - runningPercent=(jetzt-p_event->startTime) * pb_max / p_event->duration; - if (runningPercent > pb_max) // this would lead to negative value in paintBoxRel - runningPercent = pb_max; // later on which can be fatal... - } - - int pb_activeCol , pb_passiveCol; - if (liststart + pos != selected) { - pb_activeCol = COL_MENUCONTENT_PLUS_3; - pb_passiveCol = COL_MENUCONTENT_PLUS_1; - } else { - pb_activeCol = COL_MENUCONTENTSELECTED_PLUS_2; - pb_passiveCol = COL_MENUCONTENTSELECTED_PLUS_0; - } - pb.paintProgressBar(x+5+numwidth + title_offset, ypos + fheight/4, pb_space + 2, fheight/2, runningPercent, pb_max, pb_activeCol, pb_passiveCol, pb_activeCol); - } - } - - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10+prg_offset, ypos+ fheight, width- numwidth- 40- 15-prg_offset, nameAndDescription, color, 0, true); - if (g_settings.channellist_epgtext_align_right) { - // align right - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + width - 20 - ch_desc_len - icon_space - 4, ypos + fheight, ch_desc_len, p_event->description, (curr == selected)?COL_MENUCONTENTSELECTED:(!displayNext ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE) , 0, true); - } - else { - // align left - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ 5+ numwidth+ 10+ ch_name_len+ 5+prg_offset, ypos+ fheight, ch_desc_len, p_event->description, (curr == selected)?COL_MENUCONTENTSELECTED:(!displayNext ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE) , 0, true); - } - } - else { - if(g_settings.channellist_extended) { - int pbz_activeCol, pbz_passiveCol; - if (liststart + pos != selected) { - pbz_activeCol = COL_MENUCONTENT_PLUS_1; - pbz_passiveCol = COL_MENUCONTENT_PLUS_0; - } else { - pbz_activeCol = COL_MENUCONTENTSELECTED_PLUS_2; - pbz_passiveCol = COL_MENUCONTENTSELECTED_PLUS_0; - } - pb.paintProgressBar(x+5+numwidth + title_offset, ypos + fheight/4, pb_space + 2, fheight/2, 0, pb_max, pbz_activeCol, pbz_passiveCol, pbz_activeCol, 0, NULL, 0, NULL, true); - } - //name - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10+prg_offset, ypos+ fheight, width- numwidth- 40- 15-prg_offset, nameAndDescription, color, 0, true); // UTF-8 - } - if (curr == selected) { - if (!(chan->currentEvent.description.empty())) { - snprintf(nameAndDescription, sizeof(nameAndDescription), "%s - %s", - chan->getName().c_str(), p_event->description.c_str()); - CVFD::getInstance()->showMenuText(0, nameAndDescription, -1, true); // UTF-8 - } else - CVFD::getInstance()->showMenuText(0, chan->getName().c_str(), -1, true); // UTF-8 - } - } -} - -void CChannelList::paintHead() -{ - int timestr_len = 0; - char timestr[10] = {0}; - time_t now = time(NULL); - struct tm *tm = localtime(&now); - bool gotTime = g_Sectionsd->getIsTimeSet(); - - if(gotTime) { - strftime(timestr, 10, "%H:%M", tm); - timestr_len = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(timestr, true); // UTF-8 - } - - int iw1, iw2, iw3, ih = 0; - frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_INFO, &iw1, &ih); - frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MENU, &iw2, &ih); - if (g_settings.channellist_new_zap_mode) - frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE, &iw3, &ih); - - // head - frameBuffer->paintBoxRel(x,y, widthDetails,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round - - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_INFO, x + width - iw1 - 4, y, theight); //y+ 5 ); - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MENU, x + width - iw1 - iw2 - 8, y, theight);//y + 5); // icon for bouquet list button - if (g_settings.channellist_new_zap_mode) - frameBuffer->paintIcon(this->new_mode_active ? - NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE : NEUTRINO_ICON_BUTTON_MUTE_ZAP_INACTIVE, - x + width - iw1 - iw2 - iw3 - 12, y, theight); - - if (gotTime) { - int iw3x = (g_settings.channellist_new_zap_mode) ? iw3 : -4; - if (g_settings.channellist_minitv) - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + widthDetails - 16 -timestr_len, - y+theight, timestr_len, timestr, COL_MENUHEAD, 0, true); // UTF-8 - else - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + width - iw1 - iw2 - iw3x - 16 -timestr_len, - y+theight, timestr_len, timestr, COL_MENUHEAD, 0, true); // UTF-8 - timestr_len += 4; - } - - timestr_len += iw1 + iw2 + 12; - if (g_settings.channellist_new_zap_mode) - timestr_len += iw3 + 4; - logo_off = timestr_len + 4; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, widthDetails - timestr_len, name, COL_MENUHEAD, 0, true); // UTF-8 -} - -void CChannelList::paint() -{ - if (g_settings.channellist_minitv) - { - paint_pig(x+width, y+theight+1, pig_width, pig_height); - } - - numwidth = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(MaxChanNr().c_str()); - - liststart = (selected/listmaxshow)*listmaxshow; - updateEvents(this->historyMode ? 0:liststart, this->historyMode ? 0:(liststart + listmaxshow)); - - frameBuffer->paintBoxRel(x, y+theight, width, height-footerHeight-theight, COL_MENUCONTENT_PLUS_0, 0, CORNER_BOTTOM); - for(unsigned int count = 0; count < listmaxshow; count++) { - paintItem(count); - } - const int ypos = y+ theight; - const int sb = fheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); - - const int sbc= ((chanlist.size()- 1)/ listmaxshow)+ 1; - const int sbs= (selected/listmaxshow); - - frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs*(sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); - showChannelLogo(); -} - -bool CChannelList::isEmpty() const -{ - return this->chanlist.empty(); -} - -int CChannelList::getSize() const -{ - return this->chanlist.size(); -} - -int CChannelList::getSelectedChannelIndex() const -{ - return this->selected; -} - -bool CChannelList::SameTP(t_channel_id channel_id) -{ - bool iscurrent = true; - -#if 0 - if(CNeutrinoApp::getInstance()->recordingstatus && !autoshift) - iscurrent = (channel_id >> 16) == (rec_channel_id >> 16); -#endif - if(CNeutrinoApp::getInstance()->recordingstatus) { -#if 0 - if(channel_id == 0) - channel_id = chanlist[selected]->channel_id; - iscurrent = CRecordManager::getInstance()->SameTransponder(channel_id); -#endif - CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(channel_id); - if(channel) - iscurrent = SameTP(channel); - else - iscurrent = false; - } - return iscurrent; -} - -bool CChannelList::SameTP(CZapitChannel * channel) -{ - bool iscurrent = true; - - if(CNeutrinoApp::getInstance()->recordingstatus) { - if(channel == NULL) - channel = chanlist[selected]; - iscurrent = CFEManager::getInstance()->canTune(channel); - } - return iscurrent; -} -std::string CChannelList::MaxChanNr() -{ - zapit_list_it_t chan_it; - std::stringstream ss; - std::string maxchansize; - int chan_nr_max = 1; - unsigned int nr = 0; - for (chan_it=chanlist.begin(); chan_it!=chanlist.end(); ++chan_it) { - chan_nr_max = std::max(chan_nr_max, chanlist[nr++]->number); - } - ss << chan_nr_max; - ss >> maxchansize; - return maxchansize; -} - -void CChannelList::paint_pig (int x, int y, int w, int h) -{ - frameBuffer->paintBackgroundBoxRel (x, y, w, h); - printf("CChannelList::paint_pig x %d y %d w %d h %d osd_w %d osd_w %d\n", x, y, w, h, frameBuffer->getScreenWidth(true), frameBuffer->getScreenHeight(true)); - videoDecoder->Pig(x, y, w, h, frameBuffer->getScreenWidth(true), frameBuffer->getScreenHeight(true)); -} - -void CChannelList::paint_events(int index) -{ - readEvents(chanlist[index]->channel_id); - frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUHEAD_PLUS_0); - char text1[10]; - CChannelEventList::iterator e; - time_t azeit; - time(&azeit); - int ffheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getHeight(); - - if ( evtlist.size() == 0 ) - { - CChannelEvent evt; - - evt.description = g_Locale->getText(LOCALE_EPGLIST_NOEVENTS); - evt.eventID = 0; - evtlist.push_back(evt); - - } - - int i=1; - for (e=evtlist.begin(); e!=evtlist.end(); ++e ) - { - //Remove events in the past - time_t dif = azeit - e->startTime; - if ( (dif > 0) && (!(e->eventID == 0))) - { - do - { - //printf("%d seconds in the past - deleted %s\n", dif, e->description.c_str()); - e = evtlist.erase(e); - dif = azeit - e->startTime; - } - while ( dif > 0 ); - } - //Display the remaining events - struct tm *tmStartZeit = localtime(&e->startTime); - strftime(text1, sizeof(text1), "%H:%M", tmStartZeit ); - //printf("%s %s\n", text1, e->description.c_str()); - int timewidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getRenderWidth(text1, true); - if ((y+ theight+ pig_height + i*ffheight) < (y+ height)) - { - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, timewidth, text1, COL_MENUCONTENTDARK, 0, true); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5+timewidth+5, y+ theight+ pig_height + i*ffheight, infozone_width - timewidth - 20, e->description, COL_MENUCONTENTDARK, 0, true); - } - else break; - i++; - } - evtlist.clear(); -} - -static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& b) -{ - return a.startTime < b.startTime; -} - -void CChannelList::readEvents(const t_channel_id channel_id) -{ - CEitManager::getInstance()->getEventsServiceKey(channel_id , evtlist); - - if ( evtlist.empty() ) - { - CChannelEvent evt; - evt.description = g_Locale->getText(LOCALE_EPGLIST_NOEVENTS); - evt.eventID = 0; - evtlist.push_back(evt); - } - else - sort(evtlist.begin(),evtlist.end(),sortByDateTime); - - return; -} From 1798a3e20ddc08f29d40683b9680054dd368a2c1 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 30 Jan 2013 23:49:43 +0100 Subject: [PATCH 08/86] delete src/gui/channellist.cpp.rej Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1d1f1e3ae9bcffb29a02cccb8c807e757fe24e18 Author: Jacek Jendrzej Date: 2013-01-30 (Wed, 30 Jan 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp.rej | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 src/gui/channellist.cpp.rej diff --git a/src/gui/channellist.cpp.rej b/src/gui/channellist.cpp.rej deleted file mode 100644 index 244e147aa..000000000 --- a/src/gui/channellist.cpp.rej +++ /dev/null @@ -1,27 +0,0 @@ -diff a/src/gui/channellist.cpp b/src/gui/channellist.cpp (rejected hunks) -@@ -553,6 +576,11 @@ int CChannelList::show() - COSDFader fader(g_settings.menu_Content_alpha); - fader.StartFadeIn(); - -+ if (g_settings.channellist_minitv) -+ { -+ frameBuffer->paintBoxRel(x,y,widthDetails,height + info_height,COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_ALL); -+ } -+ - paintHead(); - paint(); - frameBuffer->blit(); -@@ -886,7 +914,12 @@ int CChannelList::show() - - void CChannelList::hide() - { -- frameBuffer->paintBackgroundBoxRel(x, y, width, height+ info_height+ 5); -+ if (g_settings.channellist_minitv) -+ { -+ widthDetails = frameBuffer->getScreenWidth() - frameBuffer->getScreenX(); -+ videoDecoder->Pig(-1, -1, -1, -1); -+ } -+ frameBuffer->paintBackgroundBoxRel(x, y, widthDetails, height+ info_height+ 5); - clearItem2DetailsLine(); - frameBuffer->blit(); - } From 3ca4aae3940fc5bff22f9cc740c96bff8bc867e8 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 30 Jan 2013 23:52:31 +0100 Subject: [PATCH 09/86] delete src/neutrino.cpp.~ .rej Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/15623981dff046473f4073261424cf9a700575a7 Author: Jacek Jendrzej Date: 2013-01-30 (Wed, 30 Jan 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp.rej | 9 - src/neutrino.cpp~ | 3881 ------------------------------------------ 2 files changed, 3890 deletions(-) delete mode 100644 src/neutrino.cpp.rej delete mode 100644 src/neutrino.cpp~ diff --git a/src/neutrino.cpp.rej b/src/neutrino.cpp.rej deleted file mode 100644 index 80d3ad113..000000000 --- a/src/neutrino.cpp.rej +++ /dev/null @@ -1,9 +0,0 @@ -diff a/src/neutrino.cpp b/src/neutrino.cpp (rejected hunks) -@@ -690,6 +690,7 @@ int CNeutrinoApp::loadSetup(const char * fname) - g_settings.channellist_foot = configfile.getInt32("channellist_foot" , 1);//default next Event - g_settings.channellist_new_zap_mode = configfile.getInt32("channellist_new_zap_mode", 1); - g_settings.channellist_sort_mode = configfile.getInt32("channellist_sort_mode", 0);//sort mode: alpha, freq, sat -+ g_settings.channellist_minitv = configfile.getInt32("channellist_minitv", 0); //default off - - //screen configuration - g_settings.screen_xres = configfile.getInt32("screen_xres", 100); diff --git a/src/neutrino.cpp~ b/src/neutrino.cpp~ deleted file mode 100644 index 7dc872044..000000000 --- a/src/neutrino.cpp~ +++ /dev/null @@ -1,3881 +0,0 @@ -/* - Neutrino-GUI - DBoxII-Project - - Copyright (C) 2001 Steffen Hehn 'McClean' - and some other guys - Homepage: http://dbox.cyberphoria.org/ - - Copyright (C) 2011 CoolStream International Ltd - - License: GPL - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA -*/ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#define NEUTRINO_CPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "global.h" -#include "neutrino.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "gui/audioplayer.h" -#include "gui/bouquetlist.h" -#include "gui/cam_menu.h" -#include "gui/cec_setup.h" -#include "gui/channellist.h" -#include "gui/epgview.h" -#include "gui/eventlist.h" -#include "gui/favorites.h" -#include "gui/filebrowser.h" -#include "gui/hdd_menu.h" -#include "gui/infoviewer.h" -#include "gui/mediaplayer.h" -#include "gui/movieplayer.h" -#include "gui/osd_setup.h" -#include "gui/osdlang_setup.h" -#include "gui/pictureviewer.h" -#include "gui/plugins.h" -#include "gui/rc_lock.h" -#include "gui/scan_setup.h" -#include "gui/start_wizard.h" -#include "gui/videosettings.h" - -#include "gui/widget/hintbox.h" -#include "gui/widget/icons.h" -#include "gui/widget/menue.h" -#include "gui/widget/messagebox.h" -#include "gui/infoclock.h" - -#if HAVE_COOL_HARDWARE -#include "gui/widget/progressbar.h" -#endif - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - -int old_b_id = -1; -CHintBox * reloadhintBox = 0; -bool has_hdd; - -CInfoClock *InfoClock; -int allow_flash = 1; -Zapit_config zapitCfg; -char zapit_lat[20]; -char zapit_long[20]; -bool autoshift = false; -uint32_t scrambled_timer; -t_channel_id standby_channel_id; - -//NEW -static pthread_t timer_thread; -void * timerd_main_thread(void *data); - -void * nhttpd_main_thread(void *data); -static pthread_t nhttpd_thread ; - -//#define DISABLE_SECTIONSD - -extern cVideo * videoDecoder; -extern cDemux *videoDemux; -extern cAudio * audioDecoder; -cPowerManager *powerManager; -cCpuFreqManager * cpuFreq; - -void stop_daemons(bool stopall = true); -void stop_video(void); -// uncomment if you want to have a "test" menue entry (rasc) - -//#define __EXPERIMENTAL_CODE__ -#ifdef __EXPERIMENTAL_CODE__ -#include "gui/ch_mosaic.h" -#endif - -CAudioSetupNotifier * audioSetupNotifier; -CBouquetList * bouquetList; // current list - -CBouquetList * TVbouquetList; -CBouquetList * TVsatList; -CBouquetList * TVfavList; -CBouquetList * TVallList; - -CBouquetList * RADIObouquetList; -CBouquetList * RADIOsatList; -CBouquetList * RADIOfavList; -CBouquetList * RADIOallList; - -CPlugins * g_PluginList; -CRemoteControl * g_RemoteControl; -CPictureViewer * g_PicViewer; -CCAMMenuHandler * g_CamHandler; -CVolume * g_volume; - -// Globale Variablen - to use import global.h - -// I don't like globals, I would have hidden them in classes, -// but if you wanna do it so... ;) -bool parentallocked = false; -static char **global_argv; - -extern const char * locale_real_names[]; /* #include */ - -// USERMENU -const char* usermenu_button_def[SNeutrinoSettings::BUTTON_MAX]={"red","green","yellow","blue"}; - -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -+ CNeutrinoApp - Constructor, initialize g_fontRenderer + -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -CNeutrinoApp::CNeutrinoApp() -: configfile('\t') -{ - standby_pressed_at.tv_sec = 0; - - frameBuffer = CFrameBuffer::getInstance(); - frameBuffer->setIconBasePath(DATADIR "/neutrino/icons/"); - - SetupFrameBuffer(); - - mode = mode_unknown; - channelList = NULL; - TVchannelList = NULL; - RADIOchannelList = NULL; - skipShutdownTimer = false; - skipSleepTimer = false; - lockStandbyCall = false; - current_muted = 0; - recordingstatus = 0; - g_channel_list_changed = 0; - memset(&font, 0, sizeof(neutrino_font_descr_struct)); -} - -/*------------------------------------------------------------------------------------- -- CNeutrinoApp - Destructor - --------------------------------------------------------------------------------------*/ -CNeutrinoApp::~CNeutrinoApp() -{ - if (channelList) - delete channelList; -} - -CNeutrinoApp* CNeutrinoApp::getInstance() -{ - static CNeutrinoApp* neutrinoApp = NULL; - - if(!neutrinoApp) { - neutrinoApp = new CNeutrinoApp(); - dprintf(DEBUG_DEBUG, "NeutrinoApp Instance created\n"); - } - return neutrinoApp; -} - - -#define FONT_STYLE_REGULAR 0 -#define FONT_STYLE_BOLD 1 -#define FONT_STYLE_ITALIC 2 - -extern font_sizes_groups_struct font_sizes_groups[]; -extern font_sizes_struct neutrino_font[]; - -const font_sizes_struct signal_font = {LOCALE_FONTSIZE_INFOBAR_SMALL , 14, FONT_STYLE_REGULAR, 1}; - -typedef struct lcd_setting_t -{ - const char * const name; - const unsigned int default_value; -} lcd_setting_struct_t; - -const lcd_setting_struct_t lcd_setting[SNeutrinoSettings::LCD_SETTING_COUNT] = -{ - {"lcd_brightness" , DEFAULT_VFD_BRIGHTNESS }, - {"lcd_standbybrightness", DEFAULT_VFD_STANDBYBRIGHTNESS}, - {"lcd_contrast" , DEFAULT_LCD_CONTRAST }, - {"lcd_power" , DEFAULT_LCD_POWER }, - {"lcd_inverse" , DEFAULT_LCD_INVERSE }, - {"lcd_show_volume" , DEFAULT_LCD_SHOW_VOLUME }, - {"lcd_autodimm" , DEFAULT_LCD_AUTODIMM }, - {"lcd_deepbrightness" , DEFAULT_VFD_STANDBYBRIGHTNESS } -#if HAVE_TRIPLEDRAGON - ,{ "lcd_epgmode" , 0 /*DEFAULT_LCD_EPGMODE*/ } -#endif -}; - -/************************************************************************************** -* CNeutrinoApp - loadSetup, load the application-settings * -**************************************************************************************/ -#define DEFAULT_X_START_SD 60 -#define DEFAULT_Y_START_SD 20 -#define DEFAULT_X_END_SD 1220 -#define DEFAULT_Y_END_SD 560 - -#define DEFAULT_X_START_HD 40 //5 -#define DEFAULT_Y_START_HD 25 //5 -#define DEFAULT_X_END_HD 1235 //1275 -#define DEFAULT_Y_END_HD 690 //715 - -std::string ttx_font_file = ""; - -int CNeutrinoApp::loadSetup(const char * fname) -{ - char cfg_key[81]; - int erg = 0; - - configfile.clear(); - //settings laden - und dabei Defaults setzen! - if(!configfile.loadConfig(fname)) { - //file existiert nicht - erg = 1; - } else { - /* try to detect bad / broken config file */ - if (!configfile.getInt32("screen_EndX_crt", 0) || - !configfile.getInt32("screen_EndY_crt", 0) || - !configfile.getInt32("screen_EndX_lcd", 0) || - !configfile.getInt32("screen_EndY_lcd", 0)) { - printf("[neutrino] config file %s is broken, using defaults\n", fname); - configfile.clear(); - } - } - std::ifstream checkParentallocked(NEUTRINO_PARENTALLOCKED_FILE); - if(checkParentallocked) { - parentallocked = true; - checkParentallocked.close(); - } - // video - g_settings.video_Mode = configfile.getInt32("video_Mode", VIDEO_STD_1080I50); // VIDEO_STD_720P50 - g_settings.analog_mode1 = configfile.getInt32("analog_mode1", (int)ANALOG_SD_RGB_SCART); // default RGB - g_settings.analog_mode2 = configfile.getInt32("analog_mode2", (int)ANALOG_SD_YPRPB_CINCH); // default YPBPR - g_settings.hdmi_cec_mode = configfile.getInt32("hdmi_cec_mode", 0); // default off - g_settings.hdmi_cec_view_on = configfile.getInt32("hdmi_cec_view_on", 0); // default off - g_settings.hdmi_cec_standby = configfile.getInt32("hdmi_cec_standby", 0); // default off - - g_settings.video_Format = configfile.getInt32("video_Format", DISPLAY_AR_16_9); - g_settings.video_43mode = configfile.getInt32("video_43mode", DISPLAY_AR_MODE_LETTERBOX); - g_settings.current_volume = configfile.getInt32("current_volume", 50); - g_settings.current_volume_step = configfile.getInt32("current_volume_step", 2); - g_settings.channel_mode = configfile.getInt32("channel_mode", LIST_MODE_PROV); - g_settings.channel_mode_radio = configfile.getInt32("channel_mode_radio", LIST_MODE_PROV); - - g_settings.fan_speed = configfile.getInt32( "fan_speed", 1); - if(g_settings.fan_speed < 1) g_settings.fan_speed = 1; - - g_settings.srs_enable = configfile.getInt32( "srs_enable", 0); - g_settings.srs_algo = configfile.getInt32( "srs_algo", 1); - g_settings.srs_ref_volume = configfile.getInt32( "srs_ref_volume", 40); - g_settings.srs_nmgr_enable = configfile.getInt32( "srs_nmgr_enable", 0); - g_settings.hdmi_dd = configfile.getInt32( "hdmi_dd", 0); - g_settings.spdif_dd = configfile.getInt32( "spdif_dd", 1); - g_settings.analog_out = configfile.getInt32( "analog_out", 1); - g_settings.avsync = configfile.getInt32( "avsync", 1); - g_settings.clockrec = configfile.getInt32( "clockrec", 1); - g_settings.video_dbdr = configfile.getInt32("video_dbdr", 0); - - for(int i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT; i++) { - sprintf(cfg_key, "enabled_video_mode_%d", i); - g_settings.enabled_video_modes[i] = configfile.getInt32(cfg_key, 0); - } - g_settings.enabled_video_modes[3] = 1; // 720p 50Hz - g_settings.enabled_video_modes[4] = 1; // 1080i 50Hz - - g_settings.cpufreq = configfile.getInt32("cpufreq", 0); - g_settings.standby_cpufreq = configfile.getInt32("standby_cpufreq", 100); - g_settings.rounded_corners = configfile.getInt32("rounded_corners", 1); - g_settings.ci_standby_reset = configfile.getInt32("ci_standby_reset", 0); - g_settings.ci_clock = configfile.getInt32("ci_clock", 7); - -#ifndef CPU_FREQ - g_settings.cpufreq = 0; - g_settings.standby_cpufreq = 50; -#endif - - g_settings.make_hd_list = configfile.getInt32("make_hd_list", 1); - g_settings.make_new_list = configfile.getInt32("make_new_list", 1); - g_settings.make_removed_list = configfile.getInt32("make_removed_list", 1); - g_settings.keep_channel_numbers = configfile.getInt32("keep_channel_numbers", 0); - - //misc - g_settings.power_standby = configfile.getInt32( "power_standby", 0); - g_settings.rotor_swap = configfile.getInt32( "rotor_swap", 0); - - //led - g_settings.led_tv_mode = configfile.getInt32( "led_tv_mode", 1); - g_settings.led_standby_mode = configfile.getInt32( "led_standby_mode", 1); - g_settings.led_deep_mode = configfile.getInt32( "led_deep_mode", 1); - g_settings.led_rec_mode = configfile.getInt32( "led_rec_mode", 1); - g_settings.led_blink = configfile.getInt32( "led_blink", 1); - - g_settings.hdd_fs = configfile.getInt32( "hdd_fs", 0); - g_settings.hdd_sleep = configfile.getInt32( "hdd_sleep", 120); - g_settings.hdd_noise = configfile.getInt32( "hdd_noise", 254); - - g_settings.shutdown_real = configfile.getBool("shutdown_real" , false ); - g_settings.shutdown_real_rcdelay = configfile.getBool("shutdown_real_rcdelay", false ); - strcpy(g_settings.shutdown_count, configfile.getString("shutdown_count","0").c_str()); - - strcpy(g_settings.shutdown_min, "000"); - if(cs_get_revision() > 7) - strcpy(g_settings.shutdown_min, configfile.getString("shutdown_min","180").c_str()); - - g_settings.infobar_sat_display = configfile.getBool("infobar_sat_display" , true ); - g_settings.infobar_show_channeldesc = configfile.getBool("infobar_show_channeldesc" , false ); - g_settings.infobar_subchan_disp_pos = configfile.getInt32("infobar_subchan_disp_pos" , 0 ); - g_settings.progressbar_color = configfile.getBool("progressbar_color", true ); - g_settings.infobar_show = configfile.getInt32("infobar_show", 1); - g_settings.infobar_show_channellogo = configfile.getInt32("infobar_show_channellogo" , 3 ); - g_settings.casystem_display = configfile.getInt32("casystem_display", 2 );//mini ca mode default - g_settings.scrambled_message = configfile.getBool("scrambled_message", true ); - g_settings.volume_pos = configfile.getInt32("volume_pos", 0 ); - g_settings.volume_digits = configfile.getBool("volume_digits", true); - g_settings.menu_pos = configfile.getInt32("menu_pos", CMenuWidget::MENU_POS_CENTER); - g_settings.show_menu_hints = configfile.getBool("show_menu_hints", true); - g_settings.infobar_show_sysfs_hdd = configfile.getBool("infobar_show_sysfs_hdd" , true ); - g_settings.show_mute_icon = configfile.getInt32("show_mute_icon" ,0); - g_settings.infobar_show_res = configfile.getInt32("infobar_show_res", 0 ); - g_settings.infobar_show_dd_available = configfile.getInt32("infobar_show_dd_available", 1 ); - g_settings.infobar_show_tuner = configfile.getInt32("infobar_show_tuner", 1 ); - g_settings.radiotext_enable = configfile.getBool("radiotext_enable" , false); - //audio - g_settings.audio_AnalogMode = configfile.getInt32( "audio_AnalogMode", 0 ); - g_settings.audio_DolbyDigital = configfile.getBool("audio_DolbyDigital" , false); - - g_settings.auto_lang = configfile.getInt32( "auto_lang", 0 ); - g_settings.auto_subs = configfile.getInt32( "auto_subs", 0 ); - - for(int i = 0; i < 3; i++) { - sprintf(cfg_key, "pref_lang_%d", i); - strncpy(g_settings.pref_lang[i], configfile.getString(cfg_key, "none").c_str(), 30); - sprintf(cfg_key, "pref_subs_%d", i); - strncpy(g_settings.pref_subs[i], configfile.getString(cfg_key, "none").c_str(), 30); - } - g_settings.zap_cycle = configfile.getInt32( "zap_cycle", 0 ); - strcpy( g_settings.audio_PCMOffset, configfile.getString( "audio_PCMOffset", "0" ).c_str() ); - - //vcr - g_settings.vcr_AutoSwitch = configfile.getBool("vcr_AutoSwitch" , true ); - - //language - strcpy(g_settings.language, configfile.getString("language", "").c_str()); - strcpy(g_settings.timezone, configfile.getString("timezone", "(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Vienna").c_str()); - //epg dir - g_settings.epg_cache = configfile.getString("epg_cache_time", "14"); - g_settings.epg_extendedcache = configfile.getString("epg_extendedcache_time", "360"); - g_settings.epg_old_events = configfile.getString("epg_old_events", "1"); - g_settings.epg_max_events = configfile.getString("epg_max_events", "30000"); - g_settings.epg_dir = configfile.getString("epg_dir", "/media/sda1/epg"); - // NTP-Server for sectionsd - g_settings.network_ntpserver = configfile.getString("network_ntpserver", "time.fu-berlin.de"); - g_settings.network_ntprefresh = configfile.getString("network_ntprefresh", "30" ); - g_settings.network_ntpenable = configfile.getBool("network_ntpenable", false); - - snprintf(g_settings.ifname, sizeof(g_settings.ifname), "%s", configfile.getString("ifname", "eth0").c_str());; - - g_settings.epg_save = configfile.getBool("epg_save", false); - g_settings.epg_save_standby = configfile.getBool("epg_save_standby", true); - //widget settings - g_settings.widget_fade = false; - g_settings.widget_fade = configfile.getBool("widget_fade" , false ); - - //colors (neutrino defaultcolors) - g_settings.menu_Head_alpha = configfile.getInt32( "menu_Head_alpha", 0x00 ); - g_settings.menu_Head_red = configfile.getInt32( "menu_Head_red", 0x00 ); - g_settings.menu_Head_green = configfile.getInt32( "menu_Head_green", 0x0A ); - g_settings.menu_Head_blue = configfile.getInt32( "menu_Head_blue", 0x19 ); - - g_settings.menu_Head_Text_alpha = configfile.getInt32( "menu_Head_Text_alpha", 0x00 ); - g_settings.menu_Head_Text_red = configfile.getInt32( "menu_Head_Text_red", 0x5f ); - g_settings.menu_Head_Text_green = configfile.getInt32( "menu_Head_Text_green", 0x46 ); - g_settings.menu_Head_Text_blue = configfile.getInt32( "menu_Head_Text_blue", 0x00 ); - - g_settings.menu_Content_alpha = configfile.getInt32( "menu_Content_alpha", 0x14 ); - g_settings.menu_Content_red = configfile.getInt32( "menu_Content_red", 0x00 ); - g_settings.menu_Content_green = configfile.getInt32( "menu_Content_green", 0x0f ); - g_settings.menu_Content_blue = configfile.getInt32( "menu_Content_blue", 0x23 ); - g_settings.menu_Content_Text_alpha = configfile.getInt32( "menu_Content_Text_alpha", 0x00 ); - g_settings.menu_Content_Text_red = configfile.getInt32( "menu_Content_Text_red", 0x64 ); - g_settings.menu_Content_Text_green = configfile.getInt32( "menu_Content_Text_green", 0x64 ); - g_settings.menu_Content_Text_blue = configfile.getInt32( "menu_Content_Text_blue", 0x64 ); - - g_settings.menu_Content_Selected_alpha = configfile.getInt32( "menu_Content_Selected_alpha", 0x14 ); - g_settings.menu_Content_Selected_red = configfile.getInt32( "menu_Content_Selected_red", 0x19 ); - g_settings.menu_Content_Selected_green = configfile.getInt32( "menu_Content_Selected_green", 0x37 ); - g_settings.menu_Content_Selected_blue = configfile.getInt32( "menu_Content_Selected_blue", 0x64 ); - - g_settings.menu_Content_Selected_Text_alpha = configfile.getInt32( "menu_Content_Selected_Text_alpha", 0x00 ); - g_settings.menu_Content_Selected_Text_red = configfile.getInt32( "menu_Content_Selected_Text_red", 0x00 ); - g_settings.menu_Content_Selected_Text_green = configfile.getInt32( "menu_Content_Selected_Text_green", 0x00 ); - g_settings.menu_Content_Selected_Text_blue = configfile.getInt32( "menu_Content_Selected_Text_blue", 0x00 ); - - g_settings.menu_Content_inactive_alpha = configfile.getInt32( "menu_Content_inactive_alpha", 0x14 ); - g_settings.menu_Content_inactive_red = configfile.getInt32( "menu_Content_inactive_red", 0x00 ); - g_settings.menu_Content_inactive_green = configfile.getInt32( "menu_Content_inactive_green", 0x0f ); - g_settings.menu_Content_inactive_blue = configfile.getInt32( "menu_Content_inactive_blue", 0x23 ); - - g_settings.menu_Content_inactive_Text_alpha = configfile.getInt32( "menu_Content_inactive_Text_alpha", 0x00 ); - g_settings.menu_Content_inactive_Text_red = configfile.getInt32( "menu_Content_inactive_Text_red", 55 ); - g_settings.menu_Content_inactive_Text_green = configfile.getInt32( "menu_Content_inactive_Text_green", 70 ); - g_settings.menu_Content_inactive_Text_blue = configfile.getInt32( "menu_Content_inactive_Text_blue", 85 ); - - g_settings.infobar_alpha = configfile.getInt32( "infobar_alpha", 0x14 ); - g_settings.infobar_red = configfile.getInt32( "infobar_red", 0x00 ); - g_settings.infobar_green = configfile.getInt32( "infobar_green", 0x0e ); - g_settings.infobar_blue = configfile.getInt32( "infobar_blue", 0x23 ); - - g_settings.infobar_Text_alpha = configfile.getInt32( "infobar_Text_alpha", 0x00 ); - g_settings.infobar_Text_red = configfile.getInt32( "infobar_Text_red", 0x64 ); - g_settings.infobar_Text_green = configfile.getInt32( "infobar_Text_green", 0x64 ); - g_settings.infobar_Text_blue = configfile.getInt32( "infobar_Text_blue", 0x64 ); - - //personalize - strcpy( g_settings.personalize_pincode, configfile.getString( "personalize_pincode", "0000" ).c_str() ); - for (int i = 0; i < SNeutrinoSettings::P_SETTINGS_MAX; i++)//settings.h, settings.cpp - g_settings.personalize[i] = configfile.getInt32( personalize_settings[i].personalize_settings_name, personalize_settings[i].personalize_default_val ); - - g_settings.colored_events_channellist = configfile.getInt32( "colored_events_channellist" , 0 ); - g_settings.colored_events_infobar = configfile.getInt32( "colored_events_infobar" , 0 ); - g_settings.colored_events_alpha = configfile.getInt32( "colored_events_alpha", 0x00 ); - g_settings.colored_events_red = configfile.getInt32( "colored_events_red", 95 ); - g_settings.colored_events_green = configfile.getInt32( "colored_events_green", 70 ); - g_settings.colored_events_blue = configfile.getInt32( "colored_events_blue", 0 ); - - g_settings.contrast_fonts = configfile.getInt32("contrast_fonts", 0); - - //network - for(int i=0 ; i < NETWORK_NFS_NR_OF_ENTRIES ; i++) { - sprintf(cfg_key, "network_nfs_ip_%d", i); - g_settings.network_nfs_ip[i] = configfile.getString(cfg_key, ""); - sprintf(cfg_key, "network_nfs_dir_%d", i); - strcpy( g_settings.network_nfs_dir[i], configfile.getString( cfg_key, "" ).c_str() ); - sprintf(cfg_key, "network_nfs_local_dir_%d", i); - strcpy( g_settings.network_nfs_local_dir[i], configfile.getString( cfg_key, "" ).c_str() ); - sprintf(cfg_key, "network_nfs_automount_%d", i); - g_settings.network_nfs_automount[i] = configfile.getInt32( cfg_key, 0); - sprintf(cfg_key, "network_nfs_type_%d", i); - g_settings.network_nfs_type[i] = configfile.getInt32( cfg_key, 0); - sprintf(cfg_key,"network_nfs_username_%d", i); - strcpy( g_settings.network_nfs_username[i], configfile.getString( cfg_key, "" ).c_str() ); - sprintf(cfg_key, "network_nfs_password_%d", i); - strcpy( g_settings.network_nfs_password[i], configfile.getString( cfg_key, "" ).c_str() ); - sprintf(cfg_key, "network_nfs_mount_options1_%d", i); - strcpy( g_settings.network_nfs_mount_options1[i], configfile.getString( cfg_key, "ro,soft,udp" ).c_str() ); - sprintf(cfg_key, "network_nfs_mount_options2_%d", i); - strcpy( g_settings.network_nfs_mount_options2[i], configfile.getString( cfg_key, "nolock,rsize=8192,wsize=8192" ).c_str() ); - sprintf(cfg_key, "network_nfs_mac_%d", i); - strcpy( g_settings.network_nfs_mac[i], configfile.getString( cfg_key, "11:22:33:44:55:66").c_str() ); - } - strcpy( g_settings.network_nfs_audioplayerdir, configfile.getString( "network_nfs_audioplayerdir", "/media/sda1/music" ).c_str() ); - strcpy( g_settings.network_nfs_picturedir, configfile.getString( "network_nfs_picturedir", "/media/sda1/pictures" ).c_str() ); - strcpy( g_settings.network_nfs_moviedir, configfile.getString( "network_nfs_moviedir", "/media/sda1/movies" ).c_str() ); - strcpy( g_settings.network_nfs_recordingdir, configfile.getString( "network_nfs_recordingdir", "/media/sda1/movies" ).c_str() ); - strcpy( g_settings.timeshiftdir, configfile.getString( "timeshiftdir", "" ).c_str() ); - - g_settings.temp_timeshift = configfile.getInt32( "temp_timeshift", 0 ); - g_settings.auto_timeshift = configfile.getInt32( "auto_timeshift", 0 ); - g_settings.auto_delete = configfile.getInt32( "auto_delete", 1 ); - - char timeshiftDir[255]; - if(strlen(g_settings.timeshiftdir) == 0) { - sprintf(timeshiftDir, "%s/.timeshift", g_settings.network_nfs_recordingdir); - safe_mkdir(timeshiftDir); - } else { - if(strcmp(g_settings.timeshiftdir, g_settings.network_nfs_recordingdir)) - strncpy(timeshiftDir, g_settings.timeshiftdir, sizeof(timeshiftDir)); - else - sprintf(timeshiftDir, "%s/.timeshift", g_settings.network_nfs_recordingdir); - } - printf("***************************** rec dir %s timeshift dir %s\n", g_settings.network_nfs_recordingdir, timeshiftDir); - CRecordManager::getInstance()->SetTimeshiftDirectory(timeshiftDir); - - if(g_settings.auto_delete) { - if(strcmp(g_settings.timeshiftdir, g_settings.network_nfs_recordingdir)) { - DIR *d = opendir(timeshiftDir); - if(d){ - while (struct dirent *e = readdir(d)) - { - std::string filename = e->d_name; - if ((filename.find("_temp.ts") == filename.size() - 8) || (filename.find("_temp.xml") == filename.size() - 9)) - { - std::string timeshiftDir_filename= timeshiftDir; - timeshiftDir_filename+= "/" + filename; - remove(timeshiftDir_filename.c_str()); - } - } - closedir(d); - } - } - } - g_settings.record_hours = configfile.getInt32( "record_hours", 4 ); - g_settings.filesystem_is_utf8 = configfile.getBool("filesystem_is_utf8" , true ); - - //recording (server + vcr) - g_settings.recording_type = configfile.getInt32("recording_type", RECORDING_FILE); - g_settings.recording_stopsectionsd = configfile.getBool("recording_stopsectionsd" , false ); - g_settings.recording_audio_pids_default = configfile.getInt32("recording_audio_pids_default", TIMERD_APIDS_STD | TIMERD_APIDS_AC3); - g_settings.recording_zap_on_announce = configfile.getBool("recording_zap_on_announce" , false); - g_settings.shutdown_timer_record_type = configfile.getBool("shutdown_timer_record_type" , false); - - g_settings.recording_stream_vtxt_pid = configfile.getBool("recordingmenu.stream_vtxt_pid" , false); - g_settings.recording_stream_pmt_pid = configfile.getBool("recordingmenu.stream_pmt_pid" , false); - g_settings.recording_choose_direct_rec_dir = configfile.getInt32( "recording_choose_direct_rec_dir", 0 ); - g_settings.recording_epg_for_filename = configfile.getBool("recording_epg_for_filename" , true); - g_settings.recording_epg_for_end = configfile.getBool("recording_epg_for_end" , false); - g_settings.recording_save_in_channeldir = configfile.getBool("recording_save_in_channeldir" , false); - g_settings.recording_slow_warning = configfile.getBool("recording_slow_warning" , true); - - // default plugin for movieplayer - g_settings.movieplayer_plugin = configfile.getString( "movieplayer_plugin", "Teletext" ); - g_settings.onekey_plugin = configfile.getString( "onekey_plugin", "noplugin" ); - g_settings.plugin_hdd_dir = configfile.getString( "plugin_hdd_dir", "/hdd/tuxbox/plugins" ); - g_settings.logo_hdd_dir = configfile.getString( "logo_hdd_dir", "/var/share/icons/logo" ); - - loadKeys(); - - g_settings.timeshift_pause = configfile.getInt32( "timeshift_pause", 1 ); - - g_settings.screenshot_count = configfile.getInt32( "screenshot_count", 1); - g_settings.screenshot_format = configfile.getInt32( "screenshot_format", 1); - g_settings.screenshot_cover = configfile.getInt32( "screenshot_cover", 0); - g_settings.screenshot_mode = configfile.getInt32( "screenshot_mode", 0); - g_settings.screenshot_video = configfile.getInt32( "screenshot_video", 1); - g_settings.screenshot_scale = configfile.getInt32( "screenshot_scale", 0); - - g_settings.screenshot_dir = configfile.getString( "screenshot_dir", "/media/sda1/movies" ); - g_settings.cacheTXT = configfile.getInt32( "cacheTXT", 0); - g_settings.minimode = configfile.getInt32( "minimode", 0); - g_settings.mode_clock = configfile.getInt32( "mode_clock", 0); - g_settings.zapto_pre_time = configfile.getInt32( "zapto_pre_time", 0); - g_settings.spectrum = configfile.getBool("spectrum" , false); - g_settings.channellist_epgtext_align_right = configfile.getBool("channellist_epgtext_align_right" , false); - g_settings.channellist_extended = configfile.getBool("channellist_extended" , true); - g_settings.channellist_foot = configfile.getInt32("channellist_foot" , 1);//default next Event - g_settings.channellist_new_zap_mode = configfile.getInt32("channellist_new_zap_mode", 1); - g_settings.channellist_sort_mode = configfile.getInt32("channellist_sort_mode", 0);//sort mode: alpha, freq, sat - - //screen configuration - g_settings.screen_xres = configfile.getInt32("screen_xres", 100); - g_settings.screen_yres = configfile.getInt32("screen_yres", 100); - g_settings.screen_StartX_crt = configfile.getInt32( "screen_StartX_crt", DEFAULT_X_START_SD); - g_settings.screen_StartY_crt = configfile.getInt32( "screen_StartY_crt", DEFAULT_Y_START_SD ); - g_settings.screen_EndX_crt = configfile.getInt32( "screen_EndX_crt", DEFAULT_X_END_SD); - g_settings.screen_EndY_crt = configfile.getInt32( "screen_EndY_crt", DEFAULT_Y_END_SD); - g_settings.screen_StartX_lcd = configfile.getInt32( "screen_StartX_lcd", DEFAULT_X_START_HD); - g_settings.screen_StartY_lcd = configfile.getInt32( "screen_StartY_lcd", DEFAULT_Y_START_HD ); - g_settings.screen_EndX_lcd = configfile.getInt32( "screen_EndX_lcd", DEFAULT_X_END_HD); - g_settings.screen_EndY_lcd = configfile.getInt32( "screen_EndY_lcd", DEFAULT_Y_END_HD); - g_settings.screen_preset = configfile.getInt32( "screen_preset", 1); - - g_settings.screen_StartX = g_settings.screen_preset ? g_settings.screen_StartX_lcd : g_settings.screen_StartX_crt; - g_settings.screen_StartY = g_settings.screen_preset ? g_settings.screen_StartY_lcd : g_settings.screen_StartY_crt; - g_settings.screen_EndX = g_settings.screen_preset ? g_settings.screen_EndX_lcd : g_settings.screen_EndX_crt; - g_settings.screen_EndY = g_settings.screen_preset ? g_settings.screen_EndY_lcd : g_settings.screen_EndY_crt; - - g_settings.screen_width = configfile.getInt32("screen_width", 0); - g_settings.screen_height = configfile.getInt32("screen_height", 0); - - g_settings.bigFonts = configfile.getInt32("bigFonts", 0); - g_settings.big_windows = configfile.getInt32("big_windows", 0); - - g_settings.remote_control_hardware = configfile.getInt32( "remote_control_hardware", CRCInput::RC_HW_COOLSTREAM); - g_settings.audiochannel_up_down_enable = configfile.getBool("audiochannel_up_down_enable", false); - - //Software-update - g_settings.softupdate_mode = configfile.getInt32( "softupdate_mode", 1 ); - - strcpy(g_settings.softupdate_url_file, configfile.getString("softupdate_url_file", "/var/etc/update.urls").c_str()); - strcpy(g_settings.softupdate_proxyserver, configfile.getString("softupdate_proxyserver", "" ).c_str()); - strcpy(g_settings.softupdate_proxyusername, configfile.getString("softupdate_proxyusername", "" ).c_str()); - strcpy(g_settings.softupdate_proxypassword, configfile.getString("softupdate_proxypassword", "" ).c_str()); - // - strcpy( g_settings.font_file, configfile.getString( "font_file", FONTDIR"/neutrino.ttf" ).c_str() ); - strcpy( g_settings.ttx_font_file, configfile.getString( "ttx_font_file", FONTDIR"/DejaVuLGCSansMono-Bold.ttf" ).c_str() ); - ttx_font_file = g_settings.ttx_font_file; - strcpy( g_settings.update_dir, configfile.getString( "update_dir", "/tmp" ).c_str() ); - - // parentallock - if (!parentallocked) { - g_settings.parentallock_prompt = configfile.getInt32( "parentallock_prompt", 0 ); - g_settings.parentallock_lockage = configfile.getInt32( "parentallock_lockage", 12 ); - } else { - g_settings.parentallock_prompt = 3; - g_settings.parentallock_lockage = 18; - } - strcpy( g_settings.parentallock_pincode, configfile.getString( "parentallock_pincode", "0000" ).c_str() ); - - for (int i = 0; i < SNeutrinoSettings::TIMING_SETTING_COUNT; i++) - g_settings.timing[i] = configfile.getInt32(locale_real_names[timing_setting[i].name], timing_setting[i].default_timing); - - for (int i = 0; i < SNeutrinoSettings::LCD_SETTING_COUNT; i++) - g_settings.lcd_setting[i] = configfile.getInt32(lcd_setting[i].name, lcd_setting[i].default_value); - strcpy(g_settings.lcd_setting_dim_time, configfile.getString("lcd_dim_time","0").c_str()); - g_settings.lcd_setting_dim_brightness = configfile.getInt32("lcd_dim_brightness", 0); - g_settings.lcd_info_line = configfile.getInt32("lcd_info_line", 0);//channel name or clock - - //Picture-Viewer - strcpy( g_settings.picviewer_slide_time, configfile.getString( "picviewer_slide_time", "10" ).c_str() ); - g_settings.picviewer_scaling = configfile.getInt32("picviewer_scaling", 1 /*(int)CPictureViewer::SIMPLE*/); - g_settings.picviewer_decode_server_ip = configfile.getString("picviewer_decode_server_ip", ""); - - //Audio-Player - g_settings.audioplayer_display = configfile.getInt32("audioplayer_display",(int)CAudioPlayerGui::ARTIST_TITLE); - g_settings.audioplayer_follow = configfile.getInt32("audioplayer_follow",0); - strcpy( g_settings.audioplayer_screensaver, configfile.getString( "audioplayer_screensaver", "1" ).c_str() ); - g_settings.audioplayer_highprio = configfile.getInt32("audioplayer_highprio",0); - g_settings.audioplayer_select_title_by_name = configfile.getInt32("audioplayer_select_title_by_name",0); - g_settings.audioplayer_repeat_on = configfile.getInt32("audioplayer_repeat_on",0); - g_settings.audioplayer_show_playlist = configfile.getInt32("audioplayer_show_playlist",1); - g_settings.audioplayer_enable_sc_metadata = configfile.getInt32("audioplayer_enable_sc_metadata",1); - g_settings.shoutcast_dev_id = configfile.getString("shoutcast_dev_id","XXXXXXXXXXXXXXXX"); - - //Filebrowser - g_settings.filebrowser_showrights = configfile.getInt32("filebrowser_showrights", 1); - g_settings.filebrowser_sortmethod = configfile.getInt32("filebrowser_sortmethod", 0); - if ((g_settings.filebrowser_sortmethod < 0) || (g_settings.filebrowser_sortmethod >= FILEBROWSER_NUMBER_OF_SORT_VARIANTS)) - g_settings.filebrowser_sortmethod = 0; - g_settings.filebrowser_denydirectoryleave = configfile.getBool("filebrowser_denydirectoryleave", false); - //zapit setup - g_settings.StartChannelTV = configfile.getString("startchanneltv",""); - g_settings.StartChannelRadio = configfile.getString("startchannelradio",""); - g_settings.startchanneltv_id = configfile.getInt64("startchanneltv_id", 0); - g_settings.startchannelradio_id = configfile.getInt64("startchannelradio_id", 0); - g_settings.uselastchannel = configfile.getInt32("uselastchannel" , 1); - - - // USERMENU -> in system/settings.h - //------------------------------------------- - // this is as the current neutrino usermen - const char* usermenu_default[SNeutrinoSettings::BUTTON_MAX]={ - "2,3,4,13", // RED - "6", // GREEN - "7", // YELLOW - "12,11,20,21,19,14,15" // BLUE - }; - char txt1[81]; - std::string txt2; - const char* txt2ptr; - for(int button = 0; button < SNeutrinoSettings::BUTTON_MAX; button++) - { - snprintf(txt1,80,"usermenu_tv_%s_text",usermenu_button_def[button]); - txt1[80] = 0; // terminate for sure - g_settings.usermenu_text[button] = configfile.getString(txt1, ""); - - snprintf(txt1,80,"usermenu_tv_%s",usermenu_button_def[button]); - txt2 = configfile.getString(txt1,usermenu_default[button]); - txt2ptr = txt2.c_str(); - for( int pos = 0; pos < SNeutrinoSettings::ITEM_MAX; pos++) - { - // find next comma or end of string - if it's not the first round - if(pos != 0) - { - while(*txt2ptr != 0 && *txt2ptr != ',') - txt2ptr++; - if(*txt2ptr != 0) - txt2ptr++; - } - if(*txt2ptr != 0) - { - g_settings.usermenu[button][pos] = atoi(txt2ptr); // there is still a string - if(g_settings.usermenu[button][pos] >= SNeutrinoSettings::ITEM_MAX) - g_settings.usermenu[button][pos] = 0; - } - else - g_settings.usermenu[button][pos] = 0; // string empty, fill up with 0 - - } - } - - if(configfile.getUnknownKeyQueryedFlag() && (erg==0)) { - erg = 2; - } - - /* in case FB resolution changed */ - if((g_settings.screen_width && g_settings.screen_width != (int) frameBuffer->getScreenWidth(true)) - || (g_settings.screen_height && g_settings.screen_height != (int) frameBuffer->getScreenHeight(true))) { - g_settings.screen_StartX = g_settings.screen_preset ? DEFAULT_X_START_HD : DEFAULT_X_START_SD; - g_settings.screen_StartY = g_settings.screen_preset ? DEFAULT_Y_START_HD : DEFAULT_Y_START_SD; - g_settings.screen_EndX = g_settings.screen_preset ? DEFAULT_X_END_HD : DEFAULT_X_END_SD; - g_settings.screen_EndY = g_settings.screen_preset ? DEFAULT_Y_END_HD : DEFAULT_Y_END_SD; - - g_settings.screen_width = frameBuffer->getScreenWidth(true); - g_settings.screen_height = frameBuffer->getScreenHeight(true); - } - if(erg) - configfile.setModifiedFlag(true); - return erg; -} - -/************************************************************************************** -* CNeutrinoApp - saveSetup, save the application-settings * -**************************************************************************************/ -void CNeutrinoApp::saveSetup(const char * fname) -{ - char cfg_key[81]; - //scansettings - if(!scansettings.saveSettings(NEUTRINO_SCAN_SETTINGS_FILE)) { - dprintf(DEBUG_NORMAL, "error while saving scan-settings!\n"); - } - - //video - configfile.setInt32( "video_Mode", g_settings.video_Mode ); - configfile.setInt32( "analog_mode1", g_settings.analog_mode1 ); - configfile.setInt32( "analog_mode2", g_settings.analog_mode2 ); - configfile.setInt32( "video_Format", g_settings.video_Format ); - configfile.setInt32( "video_43mode", g_settings.video_43mode ); - configfile.setInt32( "hdmi_cec_mode", g_settings.hdmi_cec_mode ); - configfile.setInt32( "hdmi_cec_view_on", g_settings.hdmi_cec_view_on ); - configfile.setInt32( "hdmi_cec_standby", g_settings.hdmi_cec_standby ); - - configfile.setInt32( "current_volume", g_settings.current_volume ); - configfile.setInt32( "current_volume_step", g_settings.current_volume_step ); - configfile.setInt32( "channel_mode", g_settings.channel_mode ); - configfile.setInt32( "channel_mode_radio", g_settings.channel_mode_radio ); - - configfile.setInt32( "fan_speed", g_settings.fan_speed); - - configfile.setInt32( "srs_enable", g_settings.srs_enable); - configfile.setInt32( "srs_algo", g_settings.srs_algo); - configfile.setInt32( "srs_ref_volume", g_settings.srs_ref_volume); - configfile.setInt32( "srs_nmgr_enable", g_settings.srs_nmgr_enable); - configfile.setInt32( "hdmi_dd", g_settings.hdmi_dd); - configfile.setInt32( "analog_out", g_settings.analog_out); - configfile.setInt32( "spdif_dd", g_settings.spdif_dd); - configfile.setInt32( "avsync", g_settings.avsync); - configfile.setInt32( "clockrec", g_settings.clockrec); - configfile.setInt32( "video_dbdr", g_settings.video_dbdr); - for(int i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT; i++) { - sprintf(cfg_key, "enabled_video_mode_%d", i); - configfile.setInt32(cfg_key, g_settings.enabled_video_modes[i]); - } - configfile.setInt32( "cpufreq", g_settings.cpufreq); - configfile.setInt32( "standby_cpufreq", g_settings.standby_cpufreq); - configfile.setInt32("rounded_corners", g_settings.rounded_corners); - configfile.setInt32("ci_standby_reset", g_settings.ci_standby_reset); - configfile.setInt32("ci_clock", g_settings.ci_clock); - - configfile.setInt32( "make_hd_list", g_settings.make_hd_list); - configfile.setInt32( "make_new_list", g_settings.make_new_list); - configfile.setInt32( "make_removed_list", g_settings.make_removed_list); - configfile.setInt32( "keep_channel_numbers", g_settings.keep_channel_numbers); - //led - configfile.setInt32( "led_tv_mode", g_settings.led_tv_mode); - configfile.setInt32( "led_standby_mode", g_settings.led_standby_mode); - configfile.setInt32( "led_deep_mode", g_settings.led_deep_mode); - configfile.setInt32( "led_rec_mode", g_settings.led_rec_mode); - configfile.setInt32( "led_blink", g_settings.led_blink); - - //misc - configfile.setInt32( "power_standby", g_settings.power_standby); - configfile.setInt32( "rotor_swap", g_settings.rotor_swap); - configfile.setInt32( "zap_cycle", g_settings.zap_cycle ); - configfile.setInt32( "hdd_fs", g_settings.hdd_fs); - configfile.setInt32( "hdd_sleep", g_settings.hdd_sleep); - configfile.setInt32( "hdd_noise", g_settings.hdd_noise); - configfile.setBool("shutdown_real" , g_settings.shutdown_real ); - configfile.setBool("shutdown_real_rcdelay", g_settings.shutdown_real_rcdelay); - configfile.setString("shutdown_count" , g_settings.shutdown_count); - configfile.setString("shutdown_min" , g_settings.shutdown_min ); - configfile.setBool("infobar_sat_display" , g_settings.infobar_sat_display ); - configfile.setBool("infobar_show_channeldesc" , g_settings.infobar_show_channeldesc ); - configfile.setInt32("infobar_subchan_disp_pos" , g_settings.infobar_subchan_disp_pos ); - configfile.setBool("progressbar_color" , g_settings.progressbar_color ); - configfile.setInt32("infobar_show", g_settings.infobar_show); - configfile.setInt32("infobar_show_channellogo" , g_settings.infobar_show_channellogo ); - configfile.setInt32("casystem_display" , g_settings.casystem_display ); - configfile.setBool("scrambled_message" , g_settings.scrambled_message ); - configfile.setInt32("volume_pos" , g_settings.volume_pos ); - configfile.setBool("volume_digits", g_settings.volume_digits); - configfile.setInt32("menu_pos" , g_settings.menu_pos); - configfile.setBool("show_menu_hints" , g_settings.show_menu_hints); - configfile.setInt32("infobar_show_sysfs_hdd" , g_settings.infobar_show_sysfs_hdd ); - configfile.setInt32("show_mute_icon" , g_settings.show_mute_icon); - configfile.setInt32("infobar_show_res" , g_settings.infobar_show_res ); - configfile.setInt32("infobar_show_dd_available" , g_settings.infobar_show_dd_available ); - configfile.setInt32("infobar_show_tuner" , g_settings.infobar_show_tuner ); - configfile.setBool("radiotext_enable" , g_settings.radiotext_enable); - //audio - configfile.setInt32( "audio_AnalogMode", g_settings.audio_AnalogMode ); - configfile.setBool("audio_DolbyDigital" , g_settings.audio_DolbyDigital ); - configfile.setInt32( "auto_lang", g_settings.auto_lang ); - configfile.setInt32( "auto_subs", g_settings.auto_subs ); - for(int i = 0; i < 3; i++) { - sprintf(cfg_key, "pref_lang_%d", i); - configfile.setString(cfg_key, g_settings.pref_lang[i]); - sprintf(cfg_key, "pref_subs_%d", i); - configfile.setString(cfg_key, g_settings.pref_subs[i]); - } - configfile.setString( "audio_PCMOffset", g_settings.audio_PCMOffset ); - - //vcr - configfile.setBool("vcr_AutoSwitch" , g_settings.vcr_AutoSwitch ); - - //language - configfile.setString("language", g_settings.language); - configfile.setString("timezone", g_settings.timezone); - // epg - configfile.setBool("epg_save", g_settings.epg_save); - configfile.setBool("epg_save_standby", g_settings.epg_save_standby); - configfile.setString("epg_cache_time" ,g_settings.epg_cache ); - configfile.setString("epg_extendedcache_time" ,g_settings.epg_extendedcache); - configfile.setString("epg_old_events" ,g_settings.epg_old_events ); - configfile.setString("epg_max_events" ,g_settings.epg_max_events ); - configfile.setString("epg_dir" ,g_settings.epg_dir); - - // NTP-Server for sectionsd - configfile.setString( "network_ntpserver", g_settings.network_ntpserver); - configfile.setString( "network_ntprefresh", g_settings.network_ntprefresh); - configfile.setBool( "network_ntpenable", g_settings.network_ntpenable); - - configfile.setString("ifname", g_settings.ifname); - - //widget settings - configfile.setBool("widget_fade" , g_settings.widget_fade ); - - //colors - configfile.setInt32( "menu_Head_alpha", g_settings.menu_Head_alpha ); - configfile.setInt32( "menu_Head_red", g_settings.menu_Head_red ); - configfile.setInt32( "menu_Head_green", g_settings.menu_Head_green ); - configfile.setInt32( "menu_Head_blue", g_settings.menu_Head_blue ); - - configfile.setInt32( "menu_Head_Text_alpha", g_settings.menu_Head_Text_alpha ); - configfile.setInt32( "menu_Head_Text_red", g_settings.menu_Head_Text_red ); - configfile.setInt32( "menu_Head_Text_green", g_settings.menu_Head_Text_green ); - configfile.setInt32( "menu_Head_Text_blue", g_settings.menu_Head_Text_blue ); - - configfile.setInt32( "menu_Content_alpha", g_settings.menu_Content_alpha ); - configfile.setInt32( "menu_Content_red", g_settings.menu_Content_red ); - configfile.setInt32( "menu_Content_green", g_settings.menu_Content_green ); - configfile.setInt32( "menu_Content_blue", g_settings.menu_Content_blue ); - - configfile.setInt32( "menu_Content_Text_alpha", g_settings.menu_Content_Text_alpha ); - configfile.setInt32( "menu_Content_Text_red", g_settings.menu_Content_Text_red ); - configfile.setInt32( "menu_Content_Text_green", g_settings.menu_Content_Text_green ); - configfile.setInt32( "menu_Content_Text_blue", g_settings.menu_Content_Text_blue ); - - configfile.setInt32( "menu_Content_Selected_alpha", g_settings.menu_Content_Selected_alpha ); - configfile.setInt32( "menu_Content_Selected_red", g_settings.menu_Content_Selected_red ); - configfile.setInt32( "menu_Content_Selected_green", g_settings.menu_Content_Selected_green ); - configfile.setInt32( "menu_Content_Selected_blue", g_settings.menu_Content_Selected_blue ); - - configfile.setInt32( "menu_Content_Selected_Text_alpha", g_settings.menu_Content_Selected_Text_alpha ); - configfile.setInt32( "menu_Content_Selected_Text_red", g_settings.menu_Content_Selected_Text_red ); - configfile.setInt32( "menu_Content_Selected_Text_green", g_settings.menu_Content_Selected_Text_green ); - configfile.setInt32( "menu_Content_Selected_Text_blue", g_settings.menu_Content_Selected_Text_blue ); - - configfile.setInt32( "menu_Content_inactive_alpha", g_settings.menu_Content_inactive_alpha ); - configfile.setInt32( "menu_Content_inactive_red", g_settings.menu_Content_inactive_red ); - configfile.setInt32( "menu_Content_inactive_green", g_settings.menu_Content_inactive_green ); - configfile.setInt32( "menu_Content_inactive_blue", g_settings.menu_Content_inactive_blue ); - - configfile.setInt32( "menu_Content_inactive_Text_alpha", g_settings.menu_Content_inactive_Text_alpha ); - configfile.setInt32( "menu_Content_inactive_Text_red", g_settings.menu_Content_inactive_Text_red ); - configfile.setInt32( "menu_Content_inactive_Text_green", g_settings.menu_Content_inactive_Text_green ); - configfile.setInt32( "menu_Content_inactive_Text_blue", g_settings.menu_Content_inactive_Text_blue ); - - configfile.setInt32( "infobar_alpha", g_settings.infobar_alpha ); - configfile.setInt32( "infobar_red", g_settings.infobar_red ); - configfile.setInt32( "infobar_green", g_settings.infobar_green ); - configfile.setInt32( "infobar_blue", g_settings.infobar_blue ); - - configfile.setInt32( "infobar_Text_alpha", g_settings.infobar_Text_alpha ); - configfile.setInt32( "infobar_Text_red", g_settings.infobar_Text_red ); - configfile.setInt32( "infobar_Text_green", g_settings.infobar_Text_green ); - configfile.setInt32( "infobar_Text_blue", g_settings.infobar_Text_blue ); - - //personalize - configfile.setString("personalize_pincode", g_settings.personalize_pincode); - for (int i = 0; i < SNeutrinoSettings::P_SETTINGS_MAX; i++) //settings.h, settings.cpp - configfile.setInt32(personalize_settings[i].personalize_settings_name, g_settings.personalize[i]); - - configfile.setInt32( "colored_events_channellist", g_settings.colored_events_channellist ); - configfile.setInt32( "colored_events_infobar", g_settings.colored_events_infobar ); - configfile.setInt32( "colored_events_alpha", g_settings.colored_events_alpha ); - configfile.setInt32( "colored_events_red", g_settings.colored_events_red ); - configfile.setInt32( "colored_events_green", g_settings.colored_events_green ); - configfile.setInt32( "colored_events_blue", g_settings.colored_events_blue ); - - configfile.setInt32( "contrast_fonts", g_settings.contrast_fonts ); - //network - for(int i=0 ; i < NETWORK_NFS_NR_OF_ENTRIES ; i++) { - sprintf(cfg_key, "network_nfs_ip_%d", i); - configfile.setString( cfg_key, g_settings.network_nfs_ip[i] ); - sprintf(cfg_key, "network_nfs_dir_%d", i); - configfile.setString( cfg_key, g_settings.network_nfs_dir[i] ); - sprintf(cfg_key, "network_nfs_local_dir_%d", i); - configfile.setString( cfg_key, g_settings.network_nfs_local_dir[i] ); - sprintf(cfg_key, "network_nfs_automount_%d", i); - configfile.setInt32( cfg_key, g_settings.network_nfs_automount[i]); - sprintf(cfg_key, "network_nfs_type_%d", i); - configfile.setInt32( cfg_key, g_settings.network_nfs_type[i]); - sprintf(cfg_key,"network_nfs_username_%d", i); - configfile.setString( cfg_key, g_settings.network_nfs_username[i] ); - sprintf(cfg_key, "network_nfs_password_%d", i); - configfile.setString( cfg_key, g_settings.network_nfs_password[i] ); - sprintf(cfg_key, "network_nfs_mount_options1_%d", i); - configfile.setString( cfg_key, g_settings.network_nfs_mount_options1[i]); - sprintf(cfg_key, "network_nfs_mount_options2_%d", i); - configfile.setString( cfg_key, g_settings.network_nfs_mount_options2[i]); - sprintf(cfg_key, "network_nfs_mac_%d", i); - configfile.setString( cfg_key, g_settings.network_nfs_mac[i]); - } - configfile.setString( "network_nfs_audioplayerdir", g_settings.network_nfs_audioplayerdir); - configfile.setString( "network_nfs_picturedir", g_settings.network_nfs_picturedir); - configfile.setString( "network_nfs_moviedir", g_settings.network_nfs_moviedir); - configfile.setString( "network_nfs_recordingdir", g_settings.network_nfs_recordingdir); - configfile.setString( "timeshiftdir", g_settings.timeshiftdir); - configfile.setBool ("filesystem_is_utf8" , g_settings.filesystem_is_utf8 ); - - //recording (server + vcr) - configfile.setInt32 ("recording_type", g_settings.recording_type); - configfile.setBool ("recording_stopsectionsd" , g_settings.recording_stopsectionsd ); - - configfile.setInt32 ("recording_audio_pids_default" , g_settings.recording_audio_pids_default); - configfile.setBool ("recording_zap_on_announce" , g_settings.recording_zap_on_announce ); - configfile.setBool ("shutdown_timer_record_type" , g_settings.shutdown_timer_record_type ); - - configfile.setBool ("recordingmenu.stream_vtxt_pid" , g_settings.recording_stream_vtxt_pid ); - configfile.setBool ("recordingmenu.stream_pmt_pid" , g_settings.recording_stream_pmt_pid ); - configfile.setInt32 ("recording_choose_direct_rec_dir" , g_settings.recording_choose_direct_rec_dir); - configfile.setBool ("recording_epg_for_filename" , g_settings.recording_epg_for_filename ); - configfile.setBool ("recording_epg_for_end" , g_settings.recording_epg_for_end ); - configfile.setBool ("recording_save_in_channeldir" , g_settings.recording_save_in_channeldir ); - configfile.setBool ("recording_slow_warning" , g_settings.recording_slow_warning ); - - // default plugin for movieplayer - configfile.setString ( "movieplayer_plugin", g_settings.movieplayer_plugin ); - configfile.setString ( "onekey_plugin", g_settings.onekey_plugin ); - configfile.setString ( "plugin_hdd_dir", g_settings.plugin_hdd_dir ); - configfile.setString ( "logo_hdd_dir", g_settings.logo_hdd_dir ); - - saveKeys(); - - configfile.setInt32( "timeshift_pause", g_settings.timeshift_pause ); - configfile.setInt32( "temp_timeshift", g_settings.temp_timeshift ); - configfile.setInt32( "auto_timeshift", g_settings.auto_timeshift ); - configfile.setInt32( "auto_delete", g_settings.auto_delete ); - configfile.setInt32( "record_hours", g_settings.record_hours ); - //printf("set: key_unlock =============== %d\n", g_settings.key_unlock); - configfile.setInt32( "screenshot_count", g_settings.screenshot_count ); - configfile.setInt32( "screenshot_format", g_settings.screenshot_format ); - configfile.setInt32( "screenshot_cover", g_settings.screenshot_cover ); - configfile.setInt32( "screenshot_mode", g_settings.screenshot_mode ); - configfile.setInt32( "screenshot_video", g_settings.screenshot_video ); - configfile.setInt32( "screenshot_scale", g_settings.screenshot_scale ); - - configfile.setString( "screenshot_dir", g_settings.screenshot_dir); - configfile.setInt32( "cacheTXT", g_settings.cacheTXT ); - configfile.setInt32( "minimode", g_settings.minimode ); - configfile.setInt32( "mode_clock", g_settings.mode_clock ); - configfile.setInt32( "zapto_pre_time", g_settings.zapto_pre_time ); - configfile.setBool("spectrum", g_settings.spectrum); - configfile.setBool("channellist_epgtext_align_right", g_settings.channellist_epgtext_align_right); - configfile.setBool("channellist_extended" , g_settings.channellist_extended); - configfile.setInt32("channellist_foot" , g_settings.channellist_foot); - configfile.setInt32("channellist_new_zap_mode", g_settings.channellist_new_zap_mode); - configfile.setInt32("channellist_minitv", g_settings.channellist_minitv); - configfile.setInt32("remote_control_hardware", g_settings.remote_control_hardware); - configfile.setBool ( "audiochannel_up_down_enable", g_settings.audiochannel_up_down_enable ); - configfile.setInt32("channellist_sort_mode", g_settings.channellist_sort_mode); - - //screen configuration - configfile.setInt32( "screen_xres", g_settings.screen_xres); - configfile.setInt32( "screen_yres", g_settings.screen_yres); - configfile.setInt32( "screen_StartX_lcd", g_settings.screen_StartX_lcd ); - configfile.setInt32( "screen_StartY_lcd", g_settings.screen_StartY_lcd ); - configfile.setInt32( "screen_EndX_lcd", g_settings.screen_EndX_lcd ); - configfile.setInt32( "screen_EndY_lcd", g_settings.screen_EndY_lcd ); - configfile.setInt32( "screen_StartX_crt", g_settings.screen_StartX_crt ); - configfile.setInt32( "screen_StartY_crt", g_settings.screen_StartY_crt ); - configfile.setInt32( "screen_EndX_crt", g_settings.screen_EndX_crt ); - configfile.setInt32( "screen_EndY_crt", g_settings.screen_EndY_crt ); - configfile.setInt32( "screen_preset", g_settings.screen_preset ); - configfile.setInt32( "screen_width", g_settings.screen_width); - configfile.setInt32( "screen_height", g_settings.screen_height); - - //Software-update - configfile.setInt32 ("softupdate_mode" , g_settings.softupdate_mode ); - configfile.setString("softupdate_url_file" , g_settings.softupdate_url_file ); - - configfile.setString("softupdate_proxyserver" , g_settings.softupdate_proxyserver ); - configfile.setString("softupdate_proxyusername" , g_settings.softupdate_proxyusername ); - configfile.setString("softupdate_proxypassword" , g_settings.softupdate_proxypassword ); - - configfile.setString("update_dir", g_settings.update_dir); - configfile.setString("font_file", g_settings.font_file); - configfile.setString("ttx_font_file", g_settings.ttx_font_file); - - //parentallock - configfile.setInt32( "parentallock_prompt", g_settings.parentallock_prompt ); - configfile.setInt32( "parentallock_lockage", g_settings.parentallock_lockage ); - configfile.setString( "parentallock_pincode", g_settings.parentallock_pincode ); - - //timing - for (int i = 0; i < SNeutrinoSettings::TIMING_SETTING_COUNT; i++) - configfile.setInt32(locale_real_names[timing_setting[i].name], g_settings.timing[i]); - - for (int i = 0; i < SNeutrinoSettings::LCD_SETTING_COUNT; i++) - configfile.setInt32(lcd_setting[i].name, g_settings.lcd_setting[i]); - configfile.setString("lcd_dim_time", g_settings.lcd_setting_dim_time); - configfile.setInt32("lcd_dim_brightness", g_settings.lcd_setting_dim_brightness); - configfile.setInt32("lcd_info_line", g_settings.lcd_info_line);//channel name or clock - - //Picture-Viewer - configfile.setString( "picviewer_slide_time", g_settings.picviewer_slide_time ); - configfile.setInt32( "picviewer_scaling", g_settings.picviewer_scaling ); - configfile.setString( "picviewer_decode_server_ip", g_settings.picviewer_decode_server_ip ); - configfile.setString( "picviewer_decode_server_port", g_settings.picviewer_decode_server_port); - - //Audio-Player - configfile.setInt32( "audioplayer_display", g_settings.audioplayer_display ); - configfile.setInt32( "audioplayer_follow", g_settings.audioplayer_follow ); - configfile.setString( "audioplayer_screensaver", g_settings.audioplayer_screensaver ); - configfile.setInt32( "audioplayer_highprio", g_settings.audioplayer_highprio ); - configfile.setInt32( "audioplayer_select_title_by_name", g_settings.audioplayer_select_title_by_name ); - configfile.setInt32( "audioplayer_repeat_on", g_settings.audioplayer_repeat_on ); - configfile.setInt32( "audioplayer_show_playlist", g_settings.audioplayer_show_playlist ); - configfile.setInt32( "audioplayer_enable_sc_metadata", g_settings.audioplayer_enable_sc_metadata ); - configfile.setString( "shoutcast_dev_id", g_settings.shoutcast_dev_id ); - - //Filebrowser - configfile.setInt32("filebrowser_showrights", g_settings.filebrowser_showrights); - configfile.setInt32("filebrowser_sortmethod", g_settings.filebrowser_sortmethod); - configfile.setBool("filebrowser_denydirectoryleave", g_settings.filebrowser_denydirectoryleave); - - //zapit setup - configfile.setString( "startchanneltv", g_settings.StartChannelTV ); - configfile.setString( "startchannelradio", g_settings.StartChannelRadio ); - configfile.setInt64("startchanneltv_id", g_settings.startchanneltv_id); - configfile.setInt64("startchannelradio_id", g_settings.startchannelradio_id); - configfile.setInt32("uselastchannel", g_settings.uselastchannel); - - // USERMENU - //--------------------------------------- - char txt1[81]; - char txt2[81]; - for(int button = 0; button < SNeutrinoSettings::BUTTON_MAX; button++) { - snprintf(txt1,80,"usermenu_tv_%s_text",usermenu_button_def[button]); - txt1[80] = 0; // terminate for sure - configfile.setString(txt1,g_settings.usermenu_text[button]); - - char* txt2ptr = txt2; - snprintf(txt1,80,"usermenu_tv_%s",usermenu_button_def[button]); - for(int pos = 0; pos < SNeutrinoSettings::ITEM_MAX; pos++) { - if( g_settings.usermenu[button][pos] != 0) { - if(pos != 0) - *txt2ptr++ = ','; - txt2ptr += snprintf(txt2ptr,80,"%d",g_settings.usermenu[button][pos]); - } - } - configfile.setString(txt1,txt2); - } - - configfile.setInt32("bigFonts", g_settings.bigFonts); - configfile.setInt32("big_windows", g_settings.big_windows); -#if 0 - configfile.setInt32("pip_x", g_settings.pip_x); - configfile.setInt32("pip_y", g_settings.pip_y); - configfile.setInt32("pip_width", g_settings.pip_width); - configfile.setInt32("pip_height", g_settings.pip_height); -#endif - if(strcmp(fname, NEUTRINO_SETTINGS_FILE)) - configfile.saveConfig(fname); - - else if (configfile.getModifiedFlag()) - { - configfile.saveConfig(fname); - configfile.setModifiedFlag(false); - } -} - -/************************************************************************************** -* CNeutrinoApp - channelsInit, get the Channellist from daemon * -**************************************************************************************/ -extern CBouquetManager *g_bouquetManager; - -void CNeutrinoApp::channelsInit(bool bOnly) -{ - int bnum; - CBouquet* tmp; - - printf("[neutrino] Creating channels lists...\n"); - TIMER_START(); - - if(!reloadhintBox) - reloadhintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SERVICEMENU_RELOAD_HINT)); - reloadhintBox->paint(); - - memset(tvsort, -1, sizeof(tvsort)); - memset(radiosort, -1, sizeof(tvsort)); - - const char * fav_bouquetname = g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME); - if(g_bouquetManager->existsUBouquet(fav_bouquetname, true) == -1) - g_bouquetManager->addBouquet(fav_bouquetname, true, true); - - - if(TVbouquetList) delete TVbouquetList; - if(RADIObouquetList) delete RADIObouquetList; - - if(TVfavList) delete TVfavList; - if(RADIOfavList) delete RADIOfavList; - - if(TVchannelList) delete TVchannelList; - if(RADIOchannelList) delete RADIOchannelList; - - TVchannelList = new CChannelList(g_Locale->getText(LOCALE_CHANNELLIST_HEAD), false, true); - RADIOchannelList = new CChannelList(g_Locale->getText(LOCALE_CHANNELLIST_HEAD), false, true); - - TVbouquetList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_PROVS)); - TVfavList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_FAVS)); - - RADIObouquetList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_PROVS)); - RADIOfavList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_FAVS)); - - uint32_t i; - i = 1; - - int tvi = 0, ri = 0; - - ZapitChannelList zapitList; - - /* all TV channels */ - CServiceManager::getInstance()->GetAllTvChannels(zapitList); - tvi = zapitList.size(); - TVchannelList->SetChannelList(&zapitList); - - /* all RADIO channels */ - CServiceManager::getInstance()->GetAllRadioChannels(zapitList); - ri = zapitList.size(); - - RADIOchannelList->SetChannelList(&zapitList); - - printf("[neutrino] got %d TV and %d RADIO channels\n", tvi, ri); fflush(stdout); - TIMER_STOP("[neutrino] all channels took"); - - /* unless we will do real channel delete from allchans, needed once ? */ - if(!bOnly) { - if(TVallList) delete TVallList; - if(RADIOallList) delete RADIOallList; - - TVallList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_HEAD)); - tmp = TVallList->addBouquet(g_Locale->getText(LOCALE_CHANNELLIST_HEAD)); - delete tmp->channelList; - tmp->channelList = new CChannelList(*TVchannelList); - //tmp->channelList->SortAlpha(); - - RADIOallList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_HEAD)); - tmp = RADIOallList->addBouquet(g_Locale->getText(LOCALE_CHANNELLIST_HEAD)); - delete tmp->channelList; - tmp->channelList = new CChannelList(*RADIOchannelList); - //tmp->channelList->SortAlpha(); - - TIMER_STOP("[neutrino] sort took"); - - if(TVsatList) delete TVsatList; - TVsatList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_SATS)); - if(RADIOsatList) delete RADIOsatList; - RADIOsatList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_SATS)); - - /* all TV / RADIO channels per satellite */ - sat_iterator_t sit; - satellite_map_t satlist = CServiceManager::getInstance()->SatelliteList(); - for(sit = satlist.begin(); sit != satlist.end(); sit++) { - CServiceManager::getInstance()->GetAllSatelliteChannels(zapitList, sit->first); - if( zapitList.empty() ) - continue; - - tvi = 0, ri = 0; - CBouquet* tmp1 = TVsatList->addBouquet(sit->second.name.c_str()); - CBouquet* tmp2 = RADIOsatList->addBouquet(sit->second.name.c_str()); - - for(zapit_list_it_t it = zapitList.begin(); it != zapitList.end(); it++) { - if ((*it)->getServiceType() == ST_DIGITAL_TELEVISION_SERVICE) { - tmp1->channelList->addChannel(*it); - tvi++; - } - else if ((*it)->getServiceType() == ST_DIGITAL_RADIO_SOUND_SERVICE) { - tmp2->channelList->addChannel(*it); - ri++; - } - } - printf("[neutrino] created %s bouquet with %d TV and %d RADIO channels\n", sit->second.name.c_str(), tvi, ri); - if(!tvi) - TVsatList->deleteBouquet(tmp1); - if(!ri) - RADIOsatList->deleteBouquet(tmp2); - - TIMER_STOP("[neutrino] sat took"); - } - /* new channels */ - if (g_settings.make_new_list) { - CServiceManager::getInstance()->GetAllTvChannels(zapitList, CZapitChannel::NEW); - if (!zapitList.empty()) { - CBouquet* newBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_NEW), false, true); - newBouquet->channelList->SetChannelList(&zapitList); - TVallList->Bouquets.push_back(newBouquet); - printf("[neutrino] got %d new TV channels\n", zapitList.size()); fflush(stdout); - } - CServiceManager::getInstance()->GetAllRadioChannels(zapitList, CZapitChannel::NEW); - if (!zapitList.empty()) { - CBouquet* newBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_NEW), false, true); - newBouquet->channelList->SetChannelList(&zapitList); - RADIOallList->Bouquets.push_back(newBouquet); - printf("[neutrino] got %d new RADIO channels\n", zapitList.size()); fflush(stdout); - } - } - if (g_settings.make_removed_list) { - CServiceManager::getInstance()->GetAllTvChannels(zapitList, CZapitChannel::REMOVED); - if (!zapitList.empty()) { - CBouquet* newBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_REMOVED), false, true); - newBouquet->channelList->SetChannelList(&zapitList); - TVallList->Bouquets.push_back(newBouquet); - printf("[neutrino] got %d removed TV channels\n", zapitList.size()); fflush(stdout); - } - CServiceManager::getInstance()->GetAllRadioChannels(zapitList, CZapitChannel::REMOVED); - if (!zapitList.empty()) { - CBouquet* newBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_REMOVED), false, true); - newBouquet->channelList->SetChannelList(&zapitList); - RADIOallList->Bouquets.push_back(newBouquet); - printf("[neutrino] got %d removed RADIO channels\n", zapitList.size()); fflush(stdout); - } - } - TIMER_STOP("[neutrino] sats took"); - } - - /* Favorites and providers TV bouquets */ - bnum = 0; - for (i = 0; i < g_bouquetManager->Bouquets.size(); i++) { - if (!g_bouquetManager->Bouquets[i]->bHidden && !g_bouquetManager->Bouquets[i]->tvChannels.empty()) - { - if(g_bouquetManager->Bouquets[i]->bUser) - tmp = TVfavList->addBouquet(g_bouquetManager->Bouquets[i]); - else - tmp = TVbouquetList->addBouquet(g_bouquetManager->Bouquets[i]); - - ZapitChannelList* channels = &(g_bouquetManager->Bouquets[i]->tvChannels); - tmp->channelList->SetChannelList(channels); - bnum++; - } - } - printf("[neutrino] got %d TV bouquets\n", bnum); fflush(stdout); - - /* all HD channels */ - if (g_settings.make_hd_list) { - CServiceManager::getInstance()->GetAllHDChannels(zapitList); - if (!zapitList.empty()) { - CBouquet* hdBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_HDTV), false, true); - hdBouquet->channelList->SetChannelList(&zapitList); - hdBouquet->channelList->SortSat(); - TVfavList->Bouquets.push_back(hdBouquet); - printf("[neutrino] got %d HD channels\n", zapitList.size()); fflush(stdout); - } - } - TIMER_STOP("[neutrino] tv took"); - - /* Favorites and provides RADIO bouquets */ - bnum = 0; - for (i = 0; i < g_bouquetManager->Bouquets.size(); i++) { - if (!g_bouquetManager->Bouquets[i]->bHidden && !g_bouquetManager->Bouquets[i]->radioChannels.empty() ) - { - if(g_bouquetManager->Bouquets[i]->bUser) - tmp = RADIOfavList->addBouquet(g_bouquetManager->Bouquets[i]); - else - tmp = RADIObouquetList->addBouquet(g_bouquetManager->Bouquets[i]); - - ZapitChannelList* channels = &(g_bouquetManager->Bouquets[i]->radioChannels); - tmp->channelList->SetChannelList(channels); - bnum++; - } - } - printf("[neutrino] got %d RADIO bouquets\n", bnum); fflush(stdout); - TIMER_STOP("[neutrino] took"); - - SetChannelMode(lastChannelMode); - - dprintf(DEBUG_DEBUG, "\nAll bouquets-channels received\n"); -#ifdef DEBUG - struct mallinfo myinfo = mallinfo(); - printf("[neutrino] total memory allocated by malloc, in bytes: %d (%dkb), chunks %d\n", - myinfo.arena, myinfo.arena / 1024, myinfo.uordblks); -#endif - - reloadhintBox->hide(); -} - -void CNeutrinoApp::SetChannelMode(int newmode) -{ - printf("CNeutrinoApp::SetChannelMode %d [%s]\n", newmode, mode == mode_radio ? "radio" : "tv"); - int *sortmode; - - if(mode == mode_radio) { - channelList = RADIOchannelList; - g_settings.channel_mode_radio = newmode; - sortmode = radiosort; - } else { - channelList = TVchannelList; - g_settings.channel_mode = newmode; - sortmode = tvsort; - } - - switch(newmode) { - case LIST_MODE_FAV: - if(mode == mode_radio) { - bouquetList = RADIOfavList; - } else { - bouquetList = TVfavList; - } - break; - case LIST_MODE_SAT: - if(mode == mode_radio) { - bouquetList = RADIOsatList; - } else { - bouquetList = TVsatList; - } - break; - case LIST_MODE_ALL: - if(mode == mode_radio) { - bouquetList = RADIOallList; - } else { - bouquetList = TVallList; - } - break; - default: - newmode = LIST_MODE_PROV; - case LIST_MODE_PROV: - if(mode == mode_radio) { - bouquetList = RADIObouquetList; - } else { - bouquetList = TVbouquetList; - } - break; - } - INFO("newmode %d sort old %d new %d", newmode, sortmode[newmode], g_settings.channellist_sort_mode); - if(newmode != LIST_MODE_FAV && sortmode[newmode] != g_settings.channellist_sort_mode && g_settings.channellist_sort_mode < CChannelList::SORT_MAX) { - sortmode[newmode] = g_settings.channellist_sort_mode; - INFO("sorting, mode %d, %d bouquets\n", g_settings.channellist_sort_mode, bouquetList->Bouquets.size()); - for (uint32_t i = 0; i < bouquetList->Bouquets.size(); i++) { - if(g_settings.channellist_sort_mode == CChannelList::SORT_ALPHA) - bouquetList->Bouquets[i]->channelList->SortAlpha(); - if(g_settings.channellist_sort_mode == CChannelList::SORT_TP) - bouquetList->Bouquets[i]->channelList->SortTP(); - if(g_settings.channellist_sort_mode == CChannelList::SORT_SAT) - bouquetList->Bouquets[i]->channelList->SortSat(); - if(g_settings.channellist_sort_mode == CChannelList::SORT_CH_NUMBER) - bouquetList->Bouquets[i]->channelList->SortChNumber(); - } - channelList->adjustToChannelID(channelList->getActiveChannel_ChannelID()); - } - lastChannelMode = newmode; -} - -/************************************************************************************** -* CNeutrinoApp - run, the main runloop * -**************************************************************************************/ -extern int cnxt_debug; -extern bool sections_debug; -extern int zapit_debug; - -void CNeutrinoApp::CmdParser(int argc, char **argv) -{ - global_argv = new char *[argc+1]; - for (int i = 0; i < argc; i++) - global_argv[i] = argv[i]; - global_argv[argc] = NULL; - - sections_debug = false; - softupdate = false; - //fromflash = false; - - font.name = NULL; - - for(int x=1; xinit(); - if(frameBuffer->setMode(720, 576, 8 * sizeof(fb_pixel_t))) { - dprintf(DEBUG_NORMAL, "Error while setting framebuffer mode\n"); - exit(-1); - } - frameBuffer->Clear(); -} - -/************************************************************************************** -* CNeutrinoApp - setup fonts * -**************************************************************************************/ - -void CNeutrinoApp::SetupFonts() -{ - const char * style[3]; - - if (g_fontRenderer != NULL) - delete g_fontRenderer; - - g_fontRenderer = new FBFontRenderClass(72 * g_settings.screen_xres / 100, 72 * g_settings.screen_yres / 100); - - if(font.filename != NULL) - free((void *)font.filename); - - printf("[neutrino] settings font file %s\n", g_settings.font_file); - - if(access(g_settings.font_file, F_OK)) { - if(!access(FONTDIR"/neutrino.ttf", F_OK)){ - font.filename = strdup(FONTDIR"/neutrino.ttf"); - strcpy(g_settings.font_file, font.filename); - } - else{ - fprintf( stderr,"[neutrino] font file [%s] not found\n neutrino exit\n",FONTDIR"/neutrino.ttf"); - _exit(0); - } - - } - else{ - font.filename = strdup(g_settings.font_file); - } - style[0] = g_fontRenderer->AddFont(font.filename); - - if(font.name != NULL) - free((void *)font.name); - - font.name = strdup(g_fontRenderer->getFamily(font.filename).c_str()); - - printf("[neutrino] font family %s\n", font.name); - - style[1] = "Bold Regular"; - - g_fontRenderer->AddFont(font.filename, true); // make italics - style[2] = "Italic"; - - for (int i = 0; i < FONT_TYPE_COUNT; i++) - { - if(g_Font[i]) delete g_Font[i]; - g_Font[i] = g_fontRenderer->getFont(font.name, style[neutrino_font[i].style], configfile.getInt32(locale_real_names[neutrino_font[i].name], neutrino_font[i].defaultsize) + neutrino_font[i].size_offset * font.size_offset); - } - g_SignalFont = g_fontRenderer->getFont(font.name, style[signal_font.style], signal_font.defaultsize + signal_font.size_offset * font.size_offset); - /* recalculate infobar position */ - if (g_InfoViewer) - g_InfoViewer->start(); -} - -/************************************************************************************** -* CNeutrinoApp - setup the menu timouts * -**************************************************************************************/ -void CNeutrinoApp::SetupTiming() -{ - for (int i = 0; i < SNeutrinoSettings::TIMING_SETTING_COUNT; i++) - sprintf(g_settings.timing_string[i], "%d", g_settings.timing[i]); -} - - -#define LCD_UPDATE_TIME_RADIO_MODE (6 * 1000 * 1000) -#define LCD_UPDATE_TIME_TV_MODE (60 * 1000 * 1000) - -void CNeutrinoApp::MakeSectionsdConfig(CSectionsdClient::epg_config& config) -{ - config.epg_cache = atoi(g_settings.epg_cache.c_str()); - config.epg_old_events = atoi(g_settings.epg_old_events.c_str()); - config.epg_max_events = atoi(g_settings.epg_max_events.c_str()); - config.epg_extendedcache = atoi(g_settings.epg_extendedcache.c_str()); - config.epg_dir = g_settings.epg_dir; - config.network_ntpserver = g_settings.network_ntpserver; - config.network_ntprefresh = atoi(g_settings.network_ntprefresh.c_str()); - config.network_ntpenable = g_settings.network_ntpenable; -} - -void CNeutrinoApp::SendSectionsdConfig(void) -{ - CSectionsdClient::epg_config config; - MakeSectionsdConfig(config); - g_Sectionsd->setConfig(config); -} - -void CNeutrinoApp::InitZapper() -{ - struct stat my_stat; - - g_InfoViewer->start(); - if (g_settings.epg_save){ - if(stat(g_settings.epg_dir.c_str(), &my_stat) == 0) - g_Sectionsd->readSIfromXML(g_settings.epg_dir.c_str()); - } - int tvmode = CZapit::getInstance()->getMode() & CZapitClient::MODE_TV; - lastChannelMode = tvmode ? g_settings.channel_mode : g_settings.channel_mode_radio; - mode = tvmode ? mode_tv : mode_radio; - - SDTreloadChannels = false; - channelsInit(); - - if(tvmode) - tvMode(true); - else - radioMode(true); - - if(g_settings.cacheTXT) - tuxtxt_init(); - - t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); - if(channelList->getSize() && live_channel_id) - g_Sectionsd->setServiceChanged(live_channel_id, true ); -} - -void CNeutrinoApp::setupRecordingDevice(void) -{ - CRecordManager::getInstance()->SetDirectory(g_settings.network_nfs_recordingdir); - CRecordManager::getInstance()->Config(g_settings.recording_stopsectionsd, g_settings.recording_stream_vtxt_pid, g_settings.recording_stream_pmt_pid); -} - -static void CSSendMessage(uint32_t msg, uint32_t data) -{ - if (g_RCInput) - g_RCInput->postMsg(msg, data); -} - -void CNeutrinoApp::InitTimerdClient() -{ - g_Timerd = new CTimerdClient; - g_Timerd->registerEvent(CTimerdClient::EVT_ANNOUNCE_SHUTDOWN, 222, NEUTRINO_UDS_NAME); - g_Timerd->registerEvent(CTimerdClient::EVT_SHUTDOWN, 222, NEUTRINO_UDS_NAME); - g_Timerd->registerEvent(CTimerdClient::EVT_ANNOUNCE_NEXTPROGRAM, 222, NEUTRINO_UDS_NAME); - g_Timerd->registerEvent(CTimerdClient::EVT_NEXTPROGRAM, 222, NEUTRINO_UDS_NAME); - g_Timerd->registerEvent(CTimerdClient::EVT_STANDBY_ON, 222, NEUTRINO_UDS_NAME); - g_Timerd->registerEvent(CTimerdClient::EVT_STANDBY_OFF, 222, NEUTRINO_UDS_NAME); - g_Timerd->registerEvent(CTimerdClient::EVT_ANNOUNCE_RECORD, 222, NEUTRINO_UDS_NAME); - g_Timerd->registerEvent(CTimerdClient::EVT_RECORD_START, 222, NEUTRINO_UDS_NAME); - g_Timerd->registerEvent(CTimerdClient::EVT_RECORD_STOP, 222, NEUTRINO_UDS_NAME); - g_Timerd->registerEvent(CTimerdClient::EVT_ANNOUNCE_ZAPTO, 222, NEUTRINO_UDS_NAME); - g_Timerd->registerEvent(CTimerdClient::EVT_ZAPTO, 222, NEUTRINO_UDS_NAME); - g_Timerd->registerEvent(CTimerdClient::EVT_SLEEPTIMER, 222, NEUTRINO_UDS_NAME); - g_Timerd->registerEvent(CTimerdClient::EVT_ANNOUNCE_SLEEPTIMER, 222, NEUTRINO_UDS_NAME); - g_Timerd->registerEvent(CTimerdClient::EVT_REMIND, 222, NEUTRINO_UDS_NAME); - g_Timerd->registerEvent(CTimerdClient::EVT_EXEC_PLUGIN, 222, NEUTRINO_UDS_NAME); -} - -void CNeutrinoApp::InitZapitClient() -{ - g_Zapit = new CZapitClient; -#define ZAPIT_EVENT_COUNT 27 - const CZapitClient::events zapit_event[ZAPIT_EVENT_COUNT] = - { - CZapitClient::EVT_ZAP_COMPLETE, - CZapitClient::EVT_ZAP_COMPLETE_IS_NVOD, - CZapitClient::EVT_ZAP_FAILED, - CZapitClient::EVT_ZAP_SUB_COMPLETE, - CZapitClient::EVT_ZAP_SUB_FAILED, - CZapitClient::EVT_ZAP_MOTOR, - CZapitClient::EVT_ZAP_CA_ID, - CZapitClient::EVT_RECORDMODE_ACTIVATED, - CZapitClient::EVT_RECORDMODE_DEACTIVATED, - CZapitClient::EVT_SCAN_COMPLETE, - CZapitClient::EVT_SCAN_FAILED, - CZapitClient::EVT_SCAN_NUM_TRANSPONDERS, - CZapitClient::EVT_SCAN_REPORT_NUM_SCANNED_TRANSPONDERS, - CZapitClient::EVT_SCAN_REPORT_FREQUENCY, - CZapitClient::EVT_SCAN_REPORT_FREQUENCYP, - CZapitClient::EVT_SCAN_SATELLITE, - CZapitClient::EVT_SCAN_NUM_CHANNELS, - CZapitClient::EVT_SCAN_PROVIDER, - CZapitClient::EVT_BOUQUETS_CHANGED, - CZapitClient::EVT_SERVICES_CHANGED, - CZapitClient::EVT_SCAN_SERVICENAME, - CZapitClient::EVT_SCAN_FOUND_TV_CHAN, - CZapitClient::EVT_SCAN_FOUND_RADIO_CHAN, - CZapitClient::EVT_SCAN_FOUND_DATA_CHAN, - CZapitClient::EVT_SDT_CHANGED, - CZapitClient::EVT_PMT_CHANGED, - CZapitClient::EVT_TUNE_COMPLETE, - }; - - for (int i = 0; i < ZAPIT_EVENT_COUNT; i++) - g_Zapit->registerEvent(zapit_event[i], 222, NEUTRINO_UDS_NAME); -} - -void CNeutrinoApp::InitSectiondClient() -{ - g_Sectionsd = new CSectionsdClient; - g_Sectionsd->registerEvent(CSectionsdClient::EVT_TIMESET, 222, NEUTRINO_UDS_NAME); - g_Sectionsd->registerEvent(CSectionsdClient::EVT_GOT_CN_EPG, 222, NEUTRINO_UDS_NAME); - g_Sectionsd->registerEvent(CSectionsdClient::EVT_WRITE_SI_FINISHED, 222, NEUTRINO_UDS_NAME); -} - -#if HAVE_COOL_HARDWARE -#include -#endif - -void wake_up( bool &wakeup) -{ -#if HAVE_COOL_HARDWARE -#ifndef FP_IOCTL_CLEAR_WAKEUP_TIMER -#define FP_IOCTL_CLEAR_WAKEUP_TIMER 10 -#endif - -#define FP_IOCTL_SET_RTC 0x101 -#define FP_IOCTL_GET_RTC 0x102 - - int fd = open("/dev/display", O_RDONLY); - if (fd < 0) { - perror("/dev/display"); - } else { - wakeup_data_t wk; - memset(&wk, 0, sizeof(wk)); - int ret = ioctl(fd, IOC_VFD_GET_WAKEUP, &wk); - if(ret >= 0) - wakeup = ((wk.source == WAKEUP_SOURCE_TIMER) /* || (wk.source == WAKEUP_SOURCE_PWLOST)*/); - close(fd); - } - printf("[timerd] wakeup from standby: %s\n", wakeup ? "yes" : "no"); - if(!wakeup){ - puts("[neutrino.cpp] executing " NEUTRINO_LEAVE_DEEPSTANDBY_SCRIPT "."); - if (my_system(NEUTRINO_LEAVE_DEEPSTANDBY_SCRIPT) != 0) - perror(NEUTRINO_LEAVE_DEEPSTANDBY_SCRIPT " failed"); - } -#endif - -} - -int CNeutrinoApp::run(int argc, char **argv) -{ - CmdParser(argc, argv); - -TIMER_START(); - cs_api_init(); - cs_register_messenger(CSSendMessage); - - g_Locale = new CLocaleManager; - - int loadSettingsErg = loadSetup(NEUTRINO_SETTINGS_FILE); - - initialize_iso639_map(); - - bool show_startwizard = false; - CLocaleManager::loadLocale_ret_t loadLocale_ret = g_Locale->loadLocale(g_settings.language); - if (loadLocale_ret == CLocaleManager::NO_SUCH_LOCALE) - { - strcpy(g_settings.language, "english"); - loadLocale_ret = g_Locale->loadLocale(g_settings.language); - show_startwizard = true; - } - /* setup GUI */ - SetupFonts(); - SetupTiming(); - g_PicViewer = new CPictureViewer(); - CColorSetupNotifier::setPalette(); - - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_NEUTRINO_STARTING)); - hintBox->paint(); - - CVFD::getInstance()->init(font.filename, font.name); - CVFD::getInstance()->Clear(); - CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_NEUTRINO_STARTING)); - - /* set service manager options before starting zapit */ - CServiceManager::getInstance()->KeepNumbers(g_settings.keep_channel_numbers); - //zapit start parameters - Z_start_arg ZapStart_arg; - ZapStart_arg.startchanneltv_id = g_settings.startchanneltv_id; - ZapStart_arg.startchannelradio_id = g_settings.startchannelradio_id; - ZapStart_arg.uselastchannel = g_settings.uselastchannel; - ZapStart_arg.video_mode = g_settings.video_Mode; - ZapStart_arg.ci_clock = g_settings.ci_clock; - ZapStart_arg.volume = g_settings.current_volume; - - /* create decoders, read channels */ - bool zapit_init = CZapit::getInstance()->Start(&ZapStart_arg); - // init audio settings - audioDecoder->SetSRS(g_settings.srs_enable, g_settings.srs_nmgr_enable, g_settings.srs_algo, g_settings.srs_ref_volume); - //audioDecoder->setVolume(g_settings.current_volume, g_settings.current_volume); - audioDecoder->SetHdmiDD((HDMI_ENCODED_MODE)g_settings.hdmi_dd); - audioDecoder->SetSpdifDD(g_settings.spdif_dd ? true : false); - audioDecoder->EnableAnalogOut(g_settings.analog_out ? true : false); - audioSetupNotifier = new CAudioSetupNotifier; - // trigger a change - if(g_settings.avsync != (AVSYNC_TYPE) AVSYNC_ENABLED) - audioSetupNotifier->changeNotify(LOCALE_AUDIOMENU_AVSYNC, NULL); - - //init video settings - g_videoSettings = new CVideoSettings; - g_videoSettings->setVideoSettings(); - - g_RCInput = new CRCInput(); - - /* later on, we'll crash anyway, so tell about it. */ - if (! zapit_init) - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, - "Zapit initialization failed.\nThis is a fatal error, sorry.", - CMessageBox::mbrBack, CMessageBox::mbBack); - - InitZapitClient(); - g_Zapit->setStandby(false); - - //timer start - bool timer_wakeup = false; - wake_up( timer_wakeup ); - pthread_create (&timer_thread, NULL, timerd_main_thread, (void *) timer_wakeup); - - init_cec_setting = true; - if(!(g_settings.shutdown_timer_record_type && timer_wakeup && g_settings.hdmi_cec_mode)){ - //init cec settings - CCECSetup cecsetup; - cecsetup.setCECSettings(); - init_cec_setting = false; - } - g_settings.shutdown_timer_record_type = false; - timer_wakeup = false; - - powerManager = new cPowerManager; - powerManager->Open(); - - cpuFreq = new cCpuFreqManager(); - cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000); - - g_info.delivery_system = CFEManager::getInstance()->getLiveFE()->getInfo()->type == FE_QPSK ? DVB_S : DVB_C; - - g_info.delivery_system = CFEManager::getInstance()->getLiveFE()->getInfo()->type == FE_QPSK ? DVB_S : DVB_C; -#if HAVE_TRIPLEDRAGON - /* only SAT-hd1 before rev 8 has fan, rev 1 is TD (compat hack) */ - g_info.has_fan = (cs_get_revision() > 1 && cs_get_revision() < 8 && g_info.delivery_system == DVB_S); -#else - g_info.has_fan = (cs_get_revision() < 8 && g_info.delivery_system == DVB_S); -#endif - dprintf(DEBUG_NORMAL, "g_info.has_fan: %d\n", g_info.has_fan); - //fan speed - if (g_info.has_fan) - CFanControlNotifier::setSpeed(g_settings.fan_speed); - - dvbsub_init(); - - pthread_create (&nhttpd_thread, NULL, nhttpd_main_thread, (void *) NULL); - - CStreamManager::getInstance()->Start(); - -#ifndef DISABLE_SECTIONSD - CSectionsdClient::epg_config config; - MakeSectionsdConfig(config); - CEitManager::getInstance()->SetConfig(config); - CEitManager::getInstance()->Start(); -#endif - - if (!scanSettings.loadSettings(NEUTRINO_SCAN_SETTINGS_FILE, g_info.delivery_system)) { - dprintf(DEBUG_NORMAL, "Loading of scan settings failed. Using defaults.\n"); - } - - CVFD::getInstance()->showVolume(g_settings.current_volume); - CVFD::getInstance()->setMuted(current_muted); - - g_RemoteControl = new CRemoteControl; - g_EpgData = new CEpgData; - g_InfoViewer = new CInfoViewer; - g_EventList = new CNeutrinoEventList; - - g_CamHandler = new CCAMMenuHandler(); - g_CamHandler->init(); - -#ifndef ASSUME_MDEV - mkdir("/media/sda1", 0755); - mkdir("/media/sdb1", 0755); - my_system("mount", "/dev/sda1", "/media/sda1"); - my_system("mount", "/dev/sdb1", "/media/sdb1"); -#endif - - CFSMounter::automount(); - g_PluginList = new CPlugins; - g_PluginList->setPluginDir(PLUGINDIR); - //load Pluginlist before main menu (only show script menu if at least one script is available - g_PluginList->loadPlugins(); - - MoviePluginChanger = new CMoviePluginChangeExec; - - // setup recording device - setupRecordingDevice(); - - dprintf( DEBUG_NORMAL, "menue setup\n"); - //init Menues - InitMenu(); - - dprintf( DEBUG_NORMAL, "registering as event client\n"); - -#ifndef DISABLE_SECTIONSD - InitSectiondClient(); -#endif - - InitTimerdClient(); - - g_volume = CVolume::getInstance(); - - if (show_startwizard) { - hintBox->hide(); - CStartUpWizard startwizard; - startwizard.exec(NULL, ""); - } - - if(loadSettingsErg) { - hintBox->hide(); - dprintf(DEBUG_INFO, "config file or options missing\n"); - ShowHintUTF(LOCALE_MESSAGEBOX_INFO, loadSettingsErg == 1 ? g_Locale->getText(LOCALE_SETTINGS_NOCONFFILE) - : g_Locale->getText(LOCALE_SETTINGS_MISSINGOPTIONSCONFFILE)); - configfile.setModifiedFlag(true); - saveSetup(NEUTRINO_SETTINGS_FILE); - } - - CHDDDestExec * hdd = new CHDDDestExec(); - hdd->exec(NULL, ""); - delete hdd; - - cCA::GetInstance()->Ready(true); - InitZapper(); - - g_volume->AudioMute(current_muted, true); - SHTDCNT::getInstance()->init(); - - hintBox->hide(); - delete hintBox; - -TIMER_STOP("################################## after all ##################################"); - RealRun(personalize.getWidget(0)/**main**/); - - ExitRun(true, (cs_get_revision() > 7)); - - return 0; -} - -void CNeutrinoApp::quickZap(int msg) -{ - int res; - - StopSubtitles(); - printf("CNeutrinoApp::quickZap haveFreeFrontend %d\n", CFEManager::getInstance()->haveFreeFrontend()); - if(!CFEManager::getInstance()->haveFreeFrontend()) - { - res = channelList->numericZap(g_settings.key_zaphistory); - StartSubtitles(res < 0); - return; - } - if(!bouquetList->Bouquets.empty()) - bouquetList->Bouquets[bouquetList->getActiveBouquetNumber()]->channelList->quickZap(msg, g_settings.zap_cycle); - else - channelList->quickZap(msg); -} - -void CNeutrinoApp::numericZap(int msg) -{ - StopSubtitles(); - int res = channelList->numericZap( msg ); - StartSubtitles(res < 0); -} - -void CNeutrinoApp::showInfo() -{ - StopSubtitles(); - - char *pname = NULL; - if(g_settings.infobar_show_channeldesc){ - CZapitChannel* channel = channelList->getActiveChannel(); - if(channel->pname){ - pname = channel->pname; - } - } - - g_InfoViewer->showTitle(channelList->getActiveChannelNumber(), channelList->getActiveChannelName(), channelList->getActiveSatellitePosition(), channelList->getActiveChannel_ChannelID(), false, 0, pname); - StartSubtitles(); -} - -void CNeutrinoApp::RealRun(CMenuWidget &mainMenu) -{ - neutrino_msg_t msg; - neutrino_msg_data_t data; - - dprintf(DEBUG_NORMAL, "initialized everything\n"); - - g_PluginList->startPlugin("startup.cfg"); - if (!g_PluginList->getScriptOutput().empty()) { - ShowMsgUTF(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMessageBox::mbrBack,CMessageBox::mbBack,NEUTRINO_ICON_SHELL); - } - g_RCInput->clearRCMsg(); - if(g_settings.power_standby || init_cec_setting) - standbyMode(true, true); - - InfoClock = CInfoClock::getInstance(); - if(g_settings.mode_clock) - InfoClock->StartClock(); - - //cCA::GetInstance()->Ready(true); - - while( true ) { - g_RCInput->getMsg(&msg, &data, 100, ((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VOLUME) && (g_RemoteControl->subChannels.size() < 1)) ? true : false); // 10 secs.. - - if( ( mode == mode_tv ) || ( ( mode == mode_radio ) ) ) { - if( (msg == NeutrinoMessages::SHOW_EPG) /* || (msg == CRCInput::RC_info) */ ) { - StopSubtitles(); - t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); - g_EpgData->show(live_channel_id); - StartSubtitles(); - } - else if( msg == CRCInput::RC_epg ) { - StopSubtitles(); - t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); - g_EventList->exec(live_channel_id, channelList->getActiveChannelName()); - StartSubtitles(); - } - else if( ( msg == (neutrino_msg_t) g_settings.key_quickzap_up ) || ( msg == (neutrino_msg_t) g_settings.key_quickzap_down ) ) - { - //quickzap - quickZap(msg); - } - - else if( msg == CRCInput::RC_text) { - g_RCInput->clearRCMsg(); - if(g_settings.mode_clock) - InfoClock->StopClock(); - StopSubtitles(); - tuxtx_stop_subtitle(); - - tuxtx_main(g_RCInput->getFileHandle(), g_RemoteControl->current_PIDs.PIDs.vtxtpid); - - frameBuffer->paintBackground(); - //if(!g_settings.cacheTXT) - // tuxtxt_stop(); - g_RCInput->clearRCMsg(); - // restore mute symbol - if (current_muted) - g_volume->AudioMute(current_muted, true); - if(g_settings.mode_clock) - InfoClock->StartClock(); - StartSubtitles(); - } - else if( msg == CRCInput::RC_setup ) { - if(!g_settings.minimode) { - StopSubtitles(); - if(g_settings.mode_clock) - InfoClock->StopClock(); - mainMenu.exec(NULL, ""); - // restore mute symbol - if (current_muted) - g_volume->AudioMute(current_muted, true); - if(g_settings.mode_clock) - InfoClock->StartClock(); - StartSubtitles(); - saveSetup(NEUTRINO_SETTINGS_FILE); - } - } - else if( ((msg == CRCInput::RC_tv) || (msg == CRCInput::RC_radio)) && ((neutrino_msg_t)g_settings.key_tvradio_mode == CRCInput::RC_nokey)) { - switchTvRadioMode();//used with defined default tv/radio rc key - } - else if( msg == (neutrino_msg_t) g_settings.key_tvradio_mode ) { - switchTvRadioMode(); //used with defined rc key TODO: do we really need this, because we already have a specified key on the remote control - } - else if( msg == (neutrino_msg_t) g_settings.key_subchannel_up || msg == (neutrino_msg_t) g_settings.key_subchannel_down) { - if( !g_RemoteControl->subChannels.empty() ) { - StopSubtitles(); - if( msg == (neutrino_msg_t) g_settings.key_subchannel_up ) - g_RemoteControl->subChannelUp(); - else if( msg == (neutrino_msg_t) g_settings.key_subchannel_down ) - g_RemoteControl->subChannelDown(); - g_InfoViewer->showSubchan(); - } - else if ( msg == CRCInput::RC_left || msg == CRCInput::RC_right) { - if (g_settings.mode_left_right_key_tv == SNeutrinoSettings::VOLUME) { - g_volume->setVolume(msg, true); - } - else if((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) - || (g_settings.mode_left_right_key_tv == SNeutrinoSettings::INFOBAR)) { - if(channelList->getSize()) { - showInfo(); - } - } - } - else - quickZap( msg ); - } - /* in case key_subchannel_up/down redefined */ - else if( msg == CRCInput::RC_left || msg == CRCInput::RC_right) { - if(g_settings.mode_left_right_key_tv == SNeutrinoSettings::VOLUME) { - g_volume->setVolume(msg, true); - } else if(channelList->getSize()) { - showInfo(); - } - } - else if( msg == (neutrino_msg_t) g_settings.key_zaphistory ) { - // Zap-History "Bouquet" - if(g_settings.mode_clock && g_settings.key_zaphistory == CRCInput::RC_home) { - g_settings.mode_clock=false; - InfoClock->StopClock(); - } else { - numericZap( msg ); - } - } - else if (msg == (neutrino_msg_t) g_settings.key_screenshot) { - for(int i = 0; i < g_settings.screenshot_count; i++) { - CScreenShot * sc = new CScreenShot("", (CScreenShot::screenshot_format_t)g_settings.screenshot_format); - sc->MakeFileName(CZapit::getInstance()->GetCurrentChannelID()); - sc->Start(); - } - } - else if( msg == (neutrino_msg_t) g_settings.key_lastchannel ) { - // Quick Zap - numericZap( msg ); - } - else if( msg == (neutrino_msg_t) g_settings.key_plugin ) { - g_PluginList->start_plugin_by_name(g_settings.onekey_plugin.c_str(), 0); - } - else if(msg == (neutrino_msg_t) g_settings.key_timeshift) { - CRecordManager::getInstance()->StartTimeshift(); - } - else if (msg == (neutrino_msg_t) g_settings.key_current_transponder){ - numericZap( msg ); - } - else if (CRCInput::isNumeric(msg)) { - numericZap( msg ); - } - else if(msg == CRCInput::RC_rewind) { - if(g_RemoteControl->is_video_started) { - t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); - if(CRecordManager::getInstance()->RecordingStatus(live_channel_id)) - CMoviePlayerGui::getInstance().exec(NULL, "rtimeshift"); - } - } - else if( msg == CRCInput::RC_record) { - CRecordManager::getInstance()->exec(NULL, "Record"); - } - else if( msg == CRCInput::RC_stop ) { - CRecordManager::getInstance()->exec(NULL, "Stop_record"); - } - else if( msg == CRCInput::RC_red ) { - // eventlist - if (g_settings.personalize[SNeutrinoSettings::P_MAIN_RED_BUTTON] == CPersonalizeGui::PERSONALIZE_ACTIVE_MODE_ENABLED)// EventList Menu - Personalization Check - { - StopSubtitles(); - usermenu.showUserMenu(SNeutrinoSettings::BUTTON_RED); - StartSubtitles(); - } - else - ShowHintUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_PERSONALIZE_MENUDISABLEDHINT),450, 10); - } - else if ((msg == CRCInput::RC_audio) && !g_settings.audio_run_player) - { - StopSubtitles(); - usermenu.showUserMenu(SNeutrinoSettings::BUTTON_GREEN); - StartSubtitles(); - } - else if( msg == CRCInput::RC_green) - { - if (g_settings.personalize[SNeutrinoSettings::P_MAIN_GREEN_BUTTON] == CPersonalizeGui::PERSONALIZE_ACTIVE_MODE_ENABLED) - { - StopSubtitles(); - usermenu.showUserMenu(SNeutrinoSettings::BUTTON_GREEN); - StartSubtitles(); - } - else - ShowHintUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_PERSONALIZE_MENUDISABLEDHINT),450, 10); - } - else if( msg == CRCInput::RC_yellow ) { // NVODs - if (g_settings.personalize[SNeutrinoSettings::P_MAIN_YELLOW_BUTTON] == CPersonalizeGui::PERSONALIZE_ACTIVE_MODE_ENABLED) - { - StopSubtitles(); - usermenu.showUserMenu(SNeutrinoSettings::BUTTON_YELLOW); - StartSubtitles(); - } - else - ShowHintUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_PERSONALIZE_MENUDISABLEDHINT),450, 10); - } - else if( (msg == CRCInput::RC_green) || ((msg == CRCInput::RC_audio) && !g_settings.audio_run_player) ) - { - StopSubtitles(); - usermenu.showUserMenu(SNeutrinoSettings::BUTTON_GREEN); - StartSubtitles(); - } - else if( msg == CRCInput::RC_yellow ) { // NVODs - StopSubtitles(); - usermenu.showUserMenu(SNeutrinoSettings::BUTTON_YELLOW); - StartSubtitles(); - } - else if( msg == CRCInput::RC_blue ) { - if (g_settings.personalize[SNeutrinoSettings::P_MAIN_BLUE_BUTTON] == CPersonalizeGui::PERSONALIZE_ACTIVE_MODE_ENABLED)// Features Menu - Personalization Check - { - StopSubtitles(); - usermenu.showUserMenu(SNeutrinoSettings::BUTTON_BLUE); - StartSubtitles(); - } - else - ShowHintUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_PERSONALIZE_MENUDISABLEDHINT), 450, 10); - } - else if( (msg == CRCInput::RC_audio) && g_settings.audio_run_player) { - //open mediaplayer menu in audio mode, user can select between audioplayer and internetradio - CMediaPlayerMenu * media = CMediaPlayerMenu::getInstance(); - media->setMenuTitel(LOCALE_MAINMENU_AUDIOPLAYER); - media->setUsageMode(CMediaPlayerMenu::MODE_AUDIO); - media->exec(NULL, ""); - } - else if( msg == CRCInput::RC_video || msg == CRCInput::RC_play ) { - //open moviebrowser via media player menu object - CMediaPlayerMenu::getInstance()->exec(NULL,"movieplayer"); - } - else if (CRCInput::isNumeric(msg) && g_RemoteControl->director_mode ) { - g_RemoteControl->setSubChannel(CRCInput::getNumericValue(msg)); - g_InfoViewer->showSubchan(); - } - else if( ( msg == CRCInput::RC_help ) || ( msg == CRCInput::RC_info) || - ( msg == NeutrinoMessages::SHOW_INFOBAR ) ) - { - bool show_info = ((msg != NeutrinoMessages::SHOW_INFOBAR) || (g_InfoViewer->is_visible || g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR] != 0)); - // turn on LCD display - CVFD::getInstance()->wake_up(); - - // show Infoviewer - if(show_info && channelList->getSize()) { - showInfo(); - } - } - else if (msg == CRCInput::RC_timer) - { - CTimerList Timerlist; - Timerlist.exec(NULL, ""); - } - else { - if (msg == CRCInput::RC_home) { - if(g_settings.mode_clock && g_settings.key_zaphistory == CRCInput::RC_home) { - g_settings.mode_clock=false; - InfoClock->StopClock(); - } - CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); - } - handleMsg(msg, data); - } - } - else { - // mode == mode_scart - if( msg == CRCInput::RC_home ) { - if( mode == mode_scart ) { - // Scart-Mode verlassen - scartMode( false ); - } - } - else { - handleMsg(msg, data); - } - } - } -} - -int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) -{ - int res = 0; - neutrino_msg_t msg = _msg; - - if(msg == NeutrinoMessages::EVT_ZAP_COMPLETE) { - CZapit::getInstance()->GetAudioMode(g_settings.audio_AnalogMode); - if(g_settings.audio_AnalogMode < 0 || g_settings.audio_AnalogMode > 2) - g_settings.audio_AnalogMode = 0; - - g_RCInput->killTimer(scrambled_timer); - - scrambled_timer = g_RCInput->addTimer(10*1000*1000, true); - SelectSubtitles(); - StartSubtitles(!g_InfoViewer->is_visible); - - /* update scan settings for manual scan to current channel */ - CScanSetup::getInstance()->updateManualSettings(); - } - if ((msg == NeutrinoMessages::EVT_TIMER)) { - if(data == scrambled_timer) { - scrambled_timer = 0; - if(g_settings.scrambled_message && videoDecoder->getBlank() && videoDecoder->getPlayState()) { - const char * text = g_Locale->getText(LOCALE_SCRAMBLED_CHANNEL); - ShowHintUTF (LOCALE_MESSAGEBOX_INFO, text, g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth (text, true) + 10, 5); - } - return messages_return::handled; - } - } - - res = res | g_RemoteControl->handleMsg(msg, data); - res = res | g_InfoViewer->handleMsg(msg, data); - res = res | channelList->handleMsg(msg, data); - res = res | CRecordManager::getInstance()->handleMsg(msg, data); - - if( res != messages_return::unhandled ) { - if( ( msg>= CRCInput::RC_WithData ) && ( msg< CRCInput::RC_WithData+ 0x10000000 ) ) - delete[] (unsigned char*) data; - return( res & ( 0xFFFFFFFF - messages_return::unhandled ) ); - } - - /* we assume g_CamHandler free/delete data if needed */ - res = g_CamHandler->handleMsg(msg, data); - if( res != messages_return::unhandled ) { - return(res & (0xFFFFFFFF - messages_return::unhandled)); - } - - /* ================================== KEYS ================================================ */ - if( msg == CRCInput::RC_ok || (!g_InfoViewer->virtual_zap_mode && (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites))) { - if( (mode == mode_tv) || (mode == mode_radio) || (mode == mode_ts)) { - if(g_settings.mode_clock) - InfoClock->StopClock(); - - StopSubtitles(); - -_show: - int nNewChannel = -1; - int old_num = 0; - int old_b = bouquetList->getActiveBouquetNumber(); - //int old_mode = g_settings.channel_mode; - int old_mode = GetChannelMode(); - printf("************************* ZAP START: bouquetList %p size %d old_b %d\n", bouquetList, bouquetList->Bouquets.size(), old_b);fflush(stdout); - - if(!bouquetList->Bouquets.empty()) { - old_num = bouquetList->Bouquets[old_b]->channelList->getSelected(); - } -//_show: - if(msg == CRCInput::RC_ok) - { - if( !bouquetList->Bouquets.empty() && bouquetList->Bouquets[old_b]->channelList->getSize() > 0) - nNewChannel = bouquetList->Bouquets[old_b]->channelList->exec();//with ZAP! - else - nNewChannel = bouquetList->exec(true); - // restore mute symbol - if (current_muted) - g_volume->AudioMute(current_muted, true); - } else if(msg == CRCInput::RC_sat) { - SetChannelMode(LIST_MODE_SAT); - nNewChannel = bouquetList->exec(true); - } else if(msg == CRCInput::RC_favorites) { - SetChannelMode(LIST_MODE_FAV); - nNewChannel = bouquetList->exec(true); - } -_repeat: - CVFD::getInstance ()->showServicename(channelList->getActiveChannelName()); - CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); - printf("************************* ZAP RES: nNewChannel %d\n", nNewChannel);fflush(stdout); - if(nNewChannel == -1) { // restore orig. bouquet and selected channel on cancel - /* FIXME if mode was changed while browsing, - * other modes selected bouquet not restored */ - SetChannelMode(old_mode); - bouquetList->activateBouquet(old_b, false); - if(!bouquetList->Bouquets.empty()) - bouquetList->Bouquets[bouquetList->getActiveBouquetNumber()]->channelList->setSelected(old_num); - StartSubtitles(mode == mode_tv); - } - else if(nNewChannel == -3) { // list mode changed - printf("************************* ZAP NEW MODE: bouquetList %p size %d\n", bouquetList, bouquetList->Bouquets.size());fflush(stdout); - nNewChannel = bouquetList->exec(true); - goto _repeat; - } - //else if(nNewChannel == -4) - if(g_channel_list_changed) - { - SetChannelMode(old_mode); - g_channel_list_changed = 0; - if(old_b_id < 0) old_b_id = old_b; - //g_Zapit->saveBouquets(); - /* lets do it in sync */ - reloadhintBox->paint(); - g_bouquetManager->saveBouquets(); - g_bouquetManager->saveUBouquets(); - g_bouquetManager->renumServices(); - channelsInit(/*true*/); - t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); - channelList->adjustToChannelID(live_channel_id);//FIXME what if deleted ? - bouquetList->activateBouquet(old_b_id, false); - msg = CRCInput::RC_ok; - goto _show; - } - - if(g_settings.mode_clock) - InfoClock->StartClock(); - - return messages_return::handled; - } - } - else if (msg == CRCInput::RC_standby_on) { - if (data == 0) - g_RCInput->postMsg(NeutrinoMessages::STANDBY_ON, 0); - return messages_return::cancel_all | messages_return::handled; - } - else if ((msg == CRCInput::RC_standby_off) || (msg == CRCInput::RC_power_on)) { - if (data == 0) - g_RCInput->postMsg(NeutrinoMessages::STANDBY_OFF, 0); - return messages_return::handled; - } - else if (msg == CRCInput::RC_power_off) { - g_RCInput->postMsg(NeutrinoMessages::SHUTDOWN, 0); - return messages_return::cancel_all | messages_return::handled; - } - else if (msg == (neutrino_msg_t) g_settings.key_power_off /*CRCInput::RC_standby*/) { - if (data == 0) { - neutrino_msg_t new_msg; - - /* Note: pressing the power button on the dbox (not the remote control) over 1 second */ - /* shuts down the system even if !g_settings.shutdown_real_rcdelay (see below) */ - gettimeofday(&standby_pressed_at, NULL); - - if ((mode != mode_standby) && (g_settings.shutdown_real) && !recordingstatus) { - new_msg = NeutrinoMessages::SHUTDOWN; - } - else { - new_msg = (mode == mode_standby) ? NeutrinoMessages::STANDBY_OFF : NeutrinoMessages::STANDBY_ON; - //printf("standby: new msg %X\n", new_msg); - if ((g_settings.shutdown_real_rcdelay)) { - neutrino_msg_t _msg_; - neutrino_msg_data_t mdata; - struct timeval endtime; - time_t seconds; - - int timeout = 0; - int timeout1 = 0; - - sscanf(g_settings.repeat_blocker, "%d", &timeout); - sscanf(g_settings.repeat_genericblocker, "%d", &timeout1); - - if (timeout1 > timeout) - timeout = timeout1; - - timeout += 500; - //printf("standby: timeout %d\n", timeout); - - while(true) { - g_RCInput->getMsg_ms(&_msg_, &mdata, timeout); - - //printf("standby: input msg %X\n", msg); - if (_msg_ == CRCInput::RC_timeout) - break; - - gettimeofday(&endtime, NULL); - seconds = endtime.tv_sec - standby_pressed_at.tv_sec; - if (endtime.tv_usec < standby_pressed_at.tv_usec) - seconds--; - //printf("standby: input seconds %d\n", seconds); - if (seconds >= 1) { - if (_msg_ == CRCInput::RC_standby) - new_msg = NeutrinoMessages::SHUTDOWN; - break; - } - } - } - } - g_RCInput->postMsg(new_msg, 0); - return messages_return::cancel_all | messages_return::handled; - } - return messages_return::handled; -#if 0 - else /* data == 1: KEY_POWER released */ - if (standby_pressed_at.tv_sec != 0) /* check if we received a KEY_POWER pressed event before */ - { /* required for correct handling of KEY_POWER events of */ - /* the power button on the dbox (not the remote control) */ - struct timeval endtime; - gettimeofday(&endtime, NULL); - time_t seconds = endtime.tv_sec - standby_pressed_at.tv_sec; - if (endtime.tv_usec < standby_pressed_at.tv_usec) - seconds--; - if (seconds >= 1) { - g_RCInput->postMsg(NeutrinoMessages::SHUTDOWN, 0); - return messages_return::cancel_all | messages_return::handled; - } - } -#endif - } - else if ((msg == CRCInput::RC_plus) || (msg == CRCInput::RC_minus)) - { - g_volume->setVolume(msg, (mode != mode_scart)); - return messages_return::handled; - } - else if( msg == CRCInput::RC_spkr ) { - if( mode == mode_standby ) { - //switch lcd off/on - CVFD::getInstance()->togglePower(); - } - else { - //mute - g_volume->AudioMute(!current_muted, true); - } - return messages_return::handled; - } - else if( msg == CRCInput::RC_mute_on ) { - g_volume->AudioMute(true, true); - return messages_return::handled; - } - else if( msg == CRCInput::RC_mute_off ) { - g_volume->AudioMute(false, true); - return messages_return::handled; - } - else if( msg == CRCInput::RC_analog_on ) { - g_settings.analog_out = 1; - audioDecoder->EnableAnalogOut(true); - return messages_return::handled; - } - else if( msg == CRCInput::RC_analog_off ) { - g_settings.analog_out = 0; - audioDecoder->EnableAnalogOut(false); - return messages_return::handled; - } - else if( msg == CRCInput::RC_mode ) { - g_videoSettings->nextMode(); - return messages_return::handled; - } - else if( msg == CRCInput::RC_next ) { - g_videoSettings->next43Mode(); - return messages_return::handled; - } - else if( msg == CRCInput::RC_prev ) { - g_videoSettings->SwitchFormat(); - return messages_return::handled; - } - else if (msg == (neutrino_msg_t) g_settings.key_screenshot) { - //video+osd scaled to osd size - CScreenShot * sc = new CScreenShot("", (CScreenShot::screenshot_format_t)g_settings.screenshot_format); - sc->EnableOSD(true); - sc->MakeFileName(CZapit::getInstance()->GetCurrentChannelID()); - sc->Start(); - } - - /* ================================== MESSAGES ================================================ */ - else if (msg == NeutrinoMessages::EVT_VOLCHANGED) { - //setVolume(msg, false, true); - return messages_return::handled; - } -#ifdef HAVE_CONTROLD - else if( msg == NeutrinoMessages::EVT_VCRCHANGED ) { - if (g_settings.vcr_AutoSwitch) { - if( data != VCR_STATUS_OFF ) - g_RCInput->postMsg( NeutrinoMessages::VCR_ON, 0 ); - else - g_RCInput->postMsg( NeutrinoMessages::VCR_OFF, 0 ); - } - return messages_return::handled | messages_return::cancel_info; - } -#endif - else if( msg == NeutrinoMessages::EVT_MUTECHANGED ) { - //FIXME unused ? - return messages_return::handled; - } - else if( msg == NeutrinoMessages::EVT_SERVICESCHANGED ) { - printf("NeutrinoMessages::EVT_SERVICESCHANGED\n");fflush(stdout); - channelsInit(); - t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); - channelList->adjustToChannelID(live_channel_id);//FIXME what if deleted ? - if(old_b_id >= 0) { - bouquetList->activateBouquet(old_b_id, false); - old_b_id = -1; - g_RCInput->postMsg(CRCInput::RC_ok, 0); - } - } - else if( msg == NeutrinoMessages::EVT_BOUQUETSCHANGED ) { - printf("NeutrinoMessages::EVT_BOUQUETSCHANGED\n");fflush(stdout); - channelsInit(); - t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); - channelList->adjustToChannelID(live_channel_id);//FIXME what if deleted ? - return messages_return::handled; - } - else if( msg == NeutrinoMessages::EVT_RECORDMODE ) { - /* sent by rcinput, when got msg from zapit about record activated/deactivated */ - /* should be sent when no record running */ - printf("NeutrinoMessages::EVT_RECORDMODE: %s\n", ( data ) ? "on" : "off"); - //if(!CRecordManager::getInstance()->RecordingStatus() && was_record && (!data)) - - /* no records left and record mode off FIXME check !*/ - if(!CRecordManager::getInstance()->RecordingStatus() && (!data)) - { - if(mode == mode_standby) { - g_Zapit->setStandby(true); - cpuFreq->SetCpuFreq(g_settings.standby_cpufreq * 1000 * 1000); - } - } - recordingstatus = data; - autoshift = CRecordManager::getInstance()->TimeshiftOnly(); - CVFD::getInstance()->ShowIcon(VFD_ICON_CAM1, recordingstatus != 0); - - if( ( !g_InfoViewer->is_visible ) && data && !autoshift) - g_RCInput->postMsg( NeutrinoMessages::SHOW_INFOBAR, 0 ); - - return messages_return::handled; - } - else if (msg == NeutrinoMessages::RECORD_START) { - //FIXME better at announce ? - if( mode == mode_standby ) { - cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000); - if(!recordingstatus && g_settings.ci_standby_reset) { - g_CamHandler->exec(NULL, "ca_ci_reset0"); - g_CamHandler->exec(NULL, "ca_ci_reset1"); - } - } - CRecordManager::getInstance()->Record((CTimerd::RecordingInfo *) data); - autoshift = CRecordManager::getInstance()->TimeshiftOnly(); - - delete[] (unsigned char*) data; - return messages_return::handled | messages_return::cancel_all; - } - else if( msg == NeutrinoMessages::RECORD_STOP) { - CTimerd::RecordingStopInfo* recinfo = (CTimerd::RecordingStopInfo*)data; - printf("NeutrinoMessages::RECORD_STOP: eventID %d channel_id %llx\n", recinfo->eventID, recinfo->channel_id); - CRecordManager::getInstance()->Stop(recinfo); - autoshift = CRecordManager::getInstance()->TimeshiftOnly(); - - delete[] (unsigned char*) data; - return messages_return::handled; - } - else if( msg == NeutrinoMessages::EVT_PMT_CHANGED) { - res = messages_return::handled; - t_channel_id channel_id = *(t_channel_id*) data; - CRecordManager::getInstance()->Update(channel_id); - return res; - } - - else if( msg == NeutrinoMessages::ZAPTO) { - CTimerd::EventInfo * eventinfo = (CTimerd::EventInfo *) data; - if (eventinfo->channel_id != CZapit::getInstance()->GetCurrentChannelID()){ - if( (recordingstatus == 0) || (recordingstatus && CRecordManager::getInstance()->TimeshiftOnly()) || (recordingstatus && CFEManager::getInstance()->haveFreeFrontend()) || - (recordingstatus && channelList->SameTP(eventinfo->channel_id)) ) { - bool isTVMode = CServiceManager::getInstance()->IsChannelTVChannel(eventinfo->channel_id); - - dvbsub_stop(); - - if ((!isTVMode) && (mode != mode_radio)) { - radioMode(false); - } - else if (isTVMode && (mode != mode_tv)) { - tvMode(false); - } - channelList->zapTo_ChannelID(eventinfo->channel_id); - } - } - delete[] (unsigned char*) data; - return messages_return::handled; - } - else if( msg == NeutrinoMessages::ANNOUNCE_ZAPTO) { - if( mode == mode_standby ) { - standbyMode( false ); - } - if( mode != mode_scart ) { - CTimerd::RecordingInfo * eventinfo = (CTimerd::RecordingInfo *) data; - std::string name = g_Locale->getText(LOCALE_ZAPTOTIMER_ANNOUNCE); - getAnnounceEpgName( eventinfo, name); - ShowHintUTF( LOCALE_MESSAGEBOX_INFO, name.c_str() ); - } - delete [] (unsigned char*) data; - return messages_return::handled; - } - else if( msg == NeutrinoMessages::ANNOUNCE_RECORD) { - my_system(NEUTRINO_RECORDING_TIMER_SCRIPT); - CTimerd::RecordingInfo * eventinfo = (CTimerd::RecordingInfo *) data; - if (g_settings.recording_type == RECORDING_FILE) { - char * recordingDir = eventinfo->recordingDir; - for(int i=0 ; i < NETWORK_NFS_NR_OF_ENTRIES ; i++) { - if (strcmp(g_settings.network_nfs_local_dir[i],recordingDir) == 0) { - printf("[neutrino] waking up %s (%s)\n",g_settings.network_nfs_ip[i].c_str(),recordingDir); - if(my_system("ether-wake",g_settings.network_nfs_mac[i]) != 0) - perror("ether-wake failed"); - break; - } - } - if(has_hdd) { - wakeup_hdd(g_settings.network_nfs_recordingdir); - } - } - - if( g_settings.recording_zap_on_announce && (mode != mode_standby) && (eventinfo->channel_id != CZapit::getInstance()->GetCurrentChannelID())) { - CRecordManager::getInstance()->StopAutoRecord(); - bool recordingStatus = CRecordManager::getInstance()->RecordingStatus(); - if ( !recordingStatus || (recordingStatus && CRecordManager::getInstance()->TimeshiftOnly()) || (recordingStatus && CFEManager::getInstance()->haveFreeFrontend()) || - (recordingStatus && channelList->SameTP(eventinfo->channel_id)) ){ - dvbsub_stop(); - t_channel_id channel_id=eventinfo->channel_id; - g_Zapit->zapTo_serviceID_NOWAIT(channel_id); - } - } - if(( mode != mode_scart ) && ( mode != mode_standby )){ - std::string name = g_Locale->getText(LOCALE_RECORDTIMER_ANNOUNCE); - getAnnounceEpgName(eventinfo, name); - ShowHintUTF(LOCALE_MESSAGEBOX_INFO, name.c_str()); - } - delete[] (unsigned char*) data; - return messages_return::handled; - } - else if( msg == NeutrinoMessages::ANNOUNCE_SLEEPTIMER) { - if( mode != mode_scart && mode != mode_standby) - skipSleepTimer = (ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, g_settings.shutdown_real ? LOCALE_SHUTDOWNTIMER_ANNOUNCE:LOCALE_SLEEPTIMERBOX_ANNOUNCE,CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, true) == CMessageBox::mbrYes); - return messages_return::handled; - } - else if( msg == NeutrinoMessages::SLEEPTIMER) { - if(data) {//INACTIVITY SLEEPTIMER - skipShutdownTimer = - (ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, g_settings.shutdown_real ? LOCALE_SHUTDOWNTIMER_ANNOUNCE:LOCALE_SLEEPTIMERBOX_ANNOUNCE, - CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, true) == CMessageBox::mbrYes);//FIXME - if(skipShutdownTimer) { - printf("NeutrinoMessages::INACTIVITY SLEEPTIMER: skiping\n"); - skipShutdownTimer = false; - return messages_return::handled; - } - }else{ //MAIN-MENU SLEEPTIMER - if(skipSleepTimer) { - printf("NeutrinoMessages::SLEEPTIMER: skiping\n"); - skipSleepTimer = false; - return messages_return::handled; - } - } - if(g_settings.shutdown_real) - ExitRun(true, (cs_get_revision() > 7)); - else if(mode != mode_standby) - standbyMode( true ); - return messages_return::handled; - } - else if( msg == NeutrinoMessages::RELOAD_SETUP ) { - bool tmp = g_settings.make_hd_list; - loadSetup(NEUTRINO_SETTINGS_FILE); - if(tmp != g_settings.make_hd_list) - g_Zapit->reinitChannels(); - - return messages_return::handled; - } - else if( msg == NeutrinoMessages::STANDBY_TOGGLE ) { - standbyMode( !(mode & mode_standby) ); - g_RCInput->clearRCMsg(); - return messages_return::handled; - } - else if( msg == NeutrinoMessages::STANDBY_ON ) { - if( mode != mode_standby ) { - standbyMode( true ); - } - g_RCInput->clearRCMsg(); - return messages_return::handled; - } - else if( msg == NeutrinoMessages::STANDBY_OFF ) { - if( mode == mode_standby ) { - standbyMode( false ); - } - g_RCInput->clearRCMsg(); - return messages_return::handled; - } - else if( msg == NeutrinoMessages::ANNOUNCE_SHUTDOWN) { - if( mode != mode_scart ) - skipShutdownTimer = (ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, LOCALE_SHUTDOWNTIMER_ANNOUNCE, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 5) == CMessageBox::mbrYes); - } - else if( msg == NeutrinoMessages::SHUTDOWN ) { - if(!skipShutdownTimer) { - ExitRun(true, (cs_get_revision() > 7)); - } - else { - skipShutdownTimer=false; - } - return messages_return::handled; - } - else if( msg == NeutrinoMessages::REBOOT ) { - FILE *f = fopen("/tmp/.reboot", "w"); - fclose(f); - ExitRun(true); - } - else if (msg == NeutrinoMessages::EVT_POPUP || msg == NeutrinoMessages::EVT_EXTMSG) { - if (mode != mode_scart) { - std::string timeout="-1"; - std::string text = (char*)data; - std::string::size_type pos; - - pos = text.find("&timeout=", 0); - if (pos != std::string::npos) { - timeout = text.substr( pos+9, text.length()+1 ); - text[pos] = '\0'; - } - - if (msg == NeutrinoMessages::EVT_POPUP) - ShowHintUTF(LOCALE_MESSAGEBOX_INFO, text.c_str(), 0, atoi(timeout.c_str())); - else if (msg == NeutrinoMessages::EVT_EXTMSG) - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, text, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO, 0, atoi(timeout.c_str())); - - } - delete[] (unsigned char*) data; - return messages_return::handled; - } - else if (msg == NeutrinoMessages::EVT_RECORDING_ENDED) { - /* FIXME TODO, when/if needed, monitor record status somewhere - * and report possible error to user if any with this message ? - * not used/not supported for now */ - //delete[] (unsigned char*) data; - - return messages_return::handled; - } - else if( msg == NeutrinoMessages::REMIND) { - std::string text = (char*)data; - std::string::size_type pos; - while((pos=text.find('/'))!= std::string::npos) - { - text[pos] = '\n'; - } - if( mode != mode_scart ) - ShowMsgUTF(LOCALE_TIMERLIST_TYPE_REMIND, text, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8 - delete[] (unsigned char*) data; - return messages_return::handled; - } - else if (msg == NeutrinoMessages::LOCK_RC) - { - CRCLock rcLock; - rcLock.exec(NULL,CRCLock::NO_USER_INPUT); - return messages_return::handled; - } - else if( msg == NeutrinoMessages::CHANGEMODE ) { - - if((data & mode_mask)== mode_radio) { - if( mode != mode_radio ) { - radioMode((data & norezap) != norezap); - } - } - if((data & mode_mask)== mode_tv) { - if( mode != mode_tv ) { - tvMode((data & norezap) != norezap); - } - } - if((data & mode_mask)== mode_standby) { - if(mode != mode_standby) - standbyMode( true ); - } - if((data & mode_mask)== mode_audio) { - lastMode=mode; - mode=mode_audio; - } - if((data & mode_mask)== mode_pic) { - lastMode=mode; - mode=mode_pic; - } - if((data & mode_mask)== mode_ts && CMoviePlayerGui::getInstance().Playing()) { - if(mode == mode_radio) - videoDecoder->StopPicture(); - lastMode=mode; - mode=mode_ts; - } - } - else if( msg == NeutrinoMessages::VCR_ON ) { - if( mode != mode_scart ) { - scartMode( true ); - } - else - CVFD::getInstance()->setMode(CVFD::MODE_SCART); - } - - else if( msg == NeutrinoMessages::VCR_OFF ) { - if( mode == mode_scart ) { - scartMode( false ); - } - } - else if (msg == NeutrinoMessages::EVT_START_PLUGIN) { - g_PluginList->startPlugin((const char *)data); - if (!g_PluginList->getScriptOutput().empty()) { - ShowMsgUTF(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMessageBox::mbrBack,CMessageBox::mbBack,NEUTRINO_ICON_SHELL); - } - - delete[] (unsigned char*) data; - return messages_return::handled; - } - else if (msg == NeutrinoMessages::EVT_SERVICES_UPD) { - SDTreloadChannels = true; - g_InfoViewer->SDT_freq_update = true; - if( !g_InfoViewer->is_visible && !autoshift){ - g_RCInput->postMsg(NeutrinoMessages::SHOW_INFOBAR , 0); - } - return messages_return::handled; -// ShowHintUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_EXTRA_ZAPIT_SDT_CHANGED), -// CMessageBox::mbrBack,CMessageBox::mbBack, NEUTRINO_ICON_INFO); - } - if ((msg >= CRCInput::RC_WithData) && (msg < CRCInput::RC_WithData + 0x10000000)) - delete [] (unsigned char*) data; - - return messages_return::unhandled; -} - -extern time_t timer_minutes;//timermanager.cpp -extern bool timer_is_rec;//timermanager.cpp - -void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) -{ - bool do_shutdown = true; - - CRecordManager::getInstance()->StopAutoRecord(); - if(CRecordManager::getInstance()->RecordingStatus()) { - do_shutdown = - (ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, LOCALE_SHUTDOWN_RECODING_QUERY, CMessageBox::mbrNo, - CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, true) == CMessageBox::mbrYes); - } - - if(do_shutdown) { - if(SDTreloadChannels){ - SDT_ReloadChannels(); - //SDTreloadChannels = false; - } - - - delete CRecordManager::getInstance(); - - dprintf(DEBUG_INFO, "exit\n"); - StopSubtitles(); - g_Zapit->stopPlayBack(); - - frameBuffer->paintBackground(); - videoDecoder->ShowPicture(DATADIR "/neutrino/icons/shutdown.jpg"); - - if(g_settings.epg_save /* && timeset && g_Sectionsd->getIsTimeSet ()*/) { - saveEpg(true);// true CVFD::MODE_SHUTDOWN - } - CVFD::getInstance()->setMode(CVFD::MODE_SHUTDOWN); - - stop_daemons(true /*retcode*/);//need here for timer_is_rec before saveSetup - g_settings.shutdown_timer_record_type = timer_is_rec; - saveSetup(NEUTRINO_SETTINGS_FILE); - - if(retcode) { - puts("[neutrino.cpp] executing " NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT "."); - if (my_system(NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT) != 0) - perror(NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT " failed"); - - printf("entering off state\n"); - mode = mode_off; - //CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_SHUTDOWN)); - - my_system("/etc/init.d/rcK"); - sync(); - my_system("/bin/umount", "-a"); - sleep(1); - { - standby_data_t standby; - time_t mtime = time(NULL); - struct tm *tmtime = localtime(&mtime); - time_t fp_timer = 0; - - if(timer_minutes) { - fp_timer = timer_minutes - mtime/60; - if(fp_timer < 1) - fp_timer = 1; - } - printf("now: %ld, timer %ld, FP timer %ldmin\n", mtime/60, timer_minutes, fp_timer);fflush(stdout); - int leds = 0x40; - switch(g_settings.led_deep_mode){ - case 0: - leds = 0x0;//off leds - break; - case 1: - leds = 0x60;//on led1 & 2 - break; - case 2: - leds = 0x20;//led1 on , 2 off - break; - case 3: - leds = 0x40;//led2 off, 2 on - break; - default: - break; - } - if(leds && g_settings.led_blink && fp_timer) - leds |= 0x80; - - standby.brightness = cs_get_revision() == 10 ? 0 : g_settings.lcd_setting[SNeutrinoSettings::LCD_DEEPSTANDBY_BRIGHTNESS]; - standby.flags = leds; - standby.current_hour = tmtime->tm_hour; - standby.current_minute = tmtime->tm_min; - standby.timer_minutes_hi = fp_timer >> 8;; - standby.timer_minutes_lo = fp_timer & 0xFF; - - stop_video(); - - int fd = open("/dev/display", O_RDONLY); - if (fd < 0) { - perror("/dev/display"); - reboot(LINUX_REBOOT_CMD_RESTART); - } else { - - if (ioctl(fd, IOC_VFD_STANDBY, (standby_data_t *) &standby)) { - perror("IOC_VFD_STANDBY"); - reboot(LINUX_REBOOT_CMD_RESTART); - } else { - while(true) sleep(1); - } - } - } - } else { - delete g_RCInput; - //fan speed - if (g_info.has_fan) { - CFanControlNotifier::setSpeed(0); - } - //CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_REBOOT)); - stop_video(); - Cleanup(); - //_exit(retcode); - exit(retcode); - } - } -} - -void CNeutrinoApp::saveEpg(bool cvfd_mode) -{ - struct stat my_stat; - if(stat(g_settings.epg_dir.c_str(), &my_stat) == 0){ - if(!cvfd_mode){//skip saveepg in standby mode, if last saveepg time < 15 Min. - std::string index_xml = g_settings.epg_dir.c_str(); - index_xml += "/index.xml"; - time_t t=0; - if(stat(index_xml.c_str(), &my_stat) == 0){ - if(difftime(time(&t), my_stat.st_ctime) < 900){ - return; - } - } - } - printf("[neutrino] Saving EPG to %s...\n", g_settings.epg_dir.c_str()); - - CVFD::getInstance()->Clear(); - CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); - CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_EPG_SAVING)); - - g_Sectionsd->writeSI2XML(g_settings.epg_dir.c_str()); - - neutrino_msg_t msg; - neutrino_msg_data_t data; - while( true ) { - g_RCInput->getMsg(&msg, &data, 1200); // 120 secs.. - if (( msg == CRCInput::RC_timeout ) || (msg == NeutrinoMessages::EVT_SI_FINISHED)) { - //printf("Msg %x timeout %d EVT_SI_FINISHED %x\n", msg, CRCInput::RC_timeout, NeutrinoMessages::EVT_SI_FINISHED); - CVFD::getInstance()->Clear(); - CVFD::getInstance()->setMode(cvfd_mode ? CVFD::MODE_SHUTDOWN : CVFD::MODE_STANDBY);// true CVFD::MODE_SHUTDOWN , false CVFD::MODE_STANDBY - break; - } else if (!cvfd_mode){ - printf("wait for epg saving, Msg %x \n", (int) msg); - handleMsg(msg, data); - } - } - } -} - -void CNeutrinoApp::tvMode( bool rezap ) -{ - INFO("rezap %d current mode %d", rezap, mode); - if (mode == mode_radio) { - if (g_settings.radiotext_enable && g_Radiotext) { - delete g_Radiotext; - g_Radiotext = NULL; - } - - videoDecoder->StopPicture(); - CVFD::getInstance()->ShowIcon(VFD_ICON_RADIO, false); - StartSubtitles(!rezap); - } - g_InfoViewer->setUpdateTimer(LCD_UPDATE_TIME_TV_MODE); - - g_volume->Init(); - - CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); - CVFD::getInstance()->ShowIcon(VFD_ICON_TV, true); - - if( mode == mode_standby ) { - CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); - videoDecoder->Standby(false); - } - - bool stopauto = (mode != mode_ts); - mode = mode_tv; - if(stopauto /*&& autoshift*/) { - //printf("standby on: autoshift ! stopping ...\n"); - CRecordManager::getInstance()->StopAutoRecord(); - //recordingstatus = 0; - } - - frameBuffer->useBackground(false); - frameBuffer->paintBackground(); - - g_RemoteControl->tvMode(); - SetChannelMode(g_settings.channel_mode); - if( rezap ) { - t_channel_id last_chid = CZapit::getInstance()->GetLastTVChannel(); - channelList->setSelected(0xfffffff); /* make sure that zapTo_ChannelID will zap */ - if(CServiceManager::getInstance()->FindChannel(last_chid)) - channelList->zapTo_ChannelID(last_chid); - else - channelList->zapTo(0); - } -#ifdef USEACTIONLOG - g_ActionLog->println("mode: tv"); -#endif -} - -void CNeutrinoApp::scartMode( bool bOnOff ) -{ - //printf( ( bOnOff ) ? "mode: scart on\n" : "mode: scart off\n" ); - - if( bOnOff ) { - // SCART AN - frameBuffer->useBackground(false); - frameBuffer->paintBackground(); - - //g_Controld->setScartMode( 1 ); - CVFD::getInstance()->setMode(CVFD::MODE_SCART); - lastMode = mode; - mode = mode_scart; - } else { - // SCART AUS - //g_Controld->setScartMode( 0 ); - - mode = mode_unknown; - //re-set mode - if( lastMode == mode_radio ) { - radioMode( false ); - } - else if( lastMode == mode_tv ) { - tvMode( false ); - } - else if( lastMode == mode_standby ) { - standbyMode( true ); - } - } -} - -void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) -{ - //static bool wasshift = false; - INFO("%s", bOnOff ? "ON" : "OFF" ); - - if(lockStandbyCall) - return; - - lockStandbyCall = true; - - if( bOnOff ) { - if( mode == mode_scart ) { - //g_Controld->setScartMode( 0 ); - } - g_InfoViewer->setUpdateTimer(0); // delete timer - StopSubtitles(); - if(SDTreloadChannels && !CRecordManager::getInstance()->RecordingStatus()){ - SDT_ReloadChannels(); - //SDTreloadChannels = false; - } - frameBuffer->useBackground(false); - frameBuffer->paintBackground(); - - /* wasshift = */ CRecordManager::getInstance()->StopAutoRecord(); - - if(mode == mode_radio && g_Radiotext) - g_Radiotext->radiotext_stop(); - - - bool stream_status = CStreamManager::getInstance()->StreamStatus(); - if(!fromDeepStandby && !CRecordManager::getInstance()->RecordingStatus() && !stream_status) { - g_Zapit->setStandby(true); - } else { - g_Zapit->stopPlayBack(); - } - - videoDecoder->Standby(true); - - g_Sectionsd->setPauseScanning(!fromDeepStandby); - g_Sectionsd->setServiceChanged(0, false); - - lastMode = mode; - mode = mode_standby; - - if(!CRecordManager::getInstance()->RecordingStatus() ) { - //only save epg when not recording - if(g_settings.epg_save && !fromDeepStandby && g_settings.epg_save_standby) { - saveEpg(false);//false CVFD::MODE_STANDBY - } - } - - if(CVFD::getInstance()->getMode() != CVFD::MODE_STANDBY){ - CVFD::getInstance()->Clear(); - CVFD::getInstance()->setMode(CVFD::MODE_STANDBY); - } - - if(g_settings.mode_clock) { - InfoClock->StopClock(); - } - - //remember tuned channel-id - standby_channel_id = CZapit::getInstance()->GetCurrentChannelID(); - - puts("[neutrino.cpp] executing " NEUTRINO_ENTER_STANDBY_SCRIPT "."); - if (my_system(NEUTRINO_ENTER_STANDBY_SCRIPT) != 0) - perror(NEUTRINO_ENTER_STANDBY_SCRIPT " failed"); - - if(!CRecordManager::getInstance()->RecordingStatus()) - cpuFreq->SetCpuFreq(g_settings.standby_cpufreq * 1000 * 1000); - - //fan speed - if (g_info.has_fan) - CFanControlNotifier::setSpeed(1); - - frameBuffer->setActive(false); - // Active standby on - powerManager->SetStandby(true, false); - } else { - // Active standby off - cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000); - powerManager->SetStandby(false, false); - videoDecoder->Standby(false); - - if(init_cec_setting){ - //init cec settings - CCECSetup cecsetup; - cecsetup.setCECSettings(); - init_cec_setting = false; - } - - if(!recordingstatus && g_settings.ci_standby_reset) { - g_CamHandler->exec(NULL, "ca_ci_reset0"); - g_CamHandler->exec(NULL, "ca_ci_reset1"); - } - frameBuffer->setActive(true); - //fan speed - if (g_info.has_fan) - CFanControlNotifier::setSpeed(g_settings.fan_speed); - - puts("[neutrino.cpp] executing " NEUTRINO_LEAVE_STANDBY_SCRIPT "."); - if (my_system(NEUTRINO_LEAVE_STANDBY_SCRIPT) != 0) - perror(NEUTRINO_LEAVE_STANDBY_SCRIPT " failed"); - - CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); - g_Zapit->setStandby(false); - /* the old code did: - if(was_record) g_Zapit->startPlayBack() - unfortunately this bypasses the parental PIN code check if a record timer - was set on a locked channel, then the box put in standby and after the - recording started, the box was woken up. - The channelList->setSelected(); channelList->zapTo_ChannelID() sequence - does trigger the PIN check - If the channel is the same (as during a recording), then it will only - check PIN and not zap, so we should be fine here - */ - mode = mode_unknown; - if( lastMode == mode_radio ) { - radioMode( false ); - } else { - /* for standby -> tv mode from radio mode in case of record */ - videoDecoder->StopPicture(); - tvMode( false ); - } - t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); - if(!recordingstatus) { //only switch to standby_channel_id when not recording - live_channel_id = standby_channel_id; - } - channelList->setSelected(0xfffffff); /* make sure that zapTo_ChannelID will zap */ - channelList->zapTo_ChannelID(live_channel_id); - - g_Sectionsd->setPauseScanning(false); - //g_Sectionsd->setServiceChanged(live_channel_id, true ); - - if(g_settings.mode_clock) - InfoClock->StartClock(); - - g_volume->AudioMute(current_muted, true); - StartSubtitles(); - } - lockStandbyCall = false; -} - -void CNeutrinoApp::radioMode( bool rezap) -{ - //printf("radioMode: rezap %s\n", rezap ? "yes" : "no"); - INFO("rezap %d current mode %d", rezap, mode); - if (mode == mode_tv) { - CVFD::getInstance()->ShowIcon(VFD_ICON_TV, false); - StopSubtitles(); - } - g_InfoViewer->setUpdateTimer(LCD_UPDATE_TIME_RADIO_MODE); - CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); - CVFD::getInstance()->ShowIcon(VFD_ICON_RADIO, true); - - if( mode == mode_standby ) { - CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); - videoDecoder->Standby(false); - } - mode = mode_radio; - - CRecordManager::getInstance()->StopAutoRecord(); - - g_RemoteControl->radioMode(); - SetChannelMode(g_settings.channel_mode_radio); - - if (g_settings.radiotext_enable && !g_Radiotext) - g_Radiotext = new CRadioText; - - if( rezap ) { - t_channel_id last_chid = CZapit::getInstance()->GetLastRADIOChannel(); - channelList->setSelected(0xfffffff); /* make sure that zapTo_ChannelID will zap */ - if(CServiceManager::getInstance()->FindChannel(last_chid)) - channelList->zapTo_ChannelID(last_chid); - else - channelList->zapTo(0); - } - videoDecoder->ShowPicture(DATADIR "/neutrino/icons/radiomode.jpg"); -} - -//switching from current mode to tv or radio mode or to optional parameter prev_mode -void CNeutrinoApp::switchTvRadioMode(const int prev_mode) -{ - if (prev_mode != mode_unknown){ - if (prev_mode == mode_tv && mode != mode_tv ) - tvMode(); - else if(prev_mode == mode_radio && mode != mode_radio) - radioMode(); - }else { - if (mode == mode_radio ) - tvMode(); - else if(mode == mode_tv) - radioMode(); - } -} - -//switching clock on or off depends of current displayed or not -void CNeutrinoApp::switchClockOnOff() -{ - if(g_settings.mode_clock) { - g_settings.mode_clock=false; - InfoClock->StopClock(); - } else { - g_settings.mode_clock=true; - InfoClock->StartClock(); - } -} - -/************************************************************************************** -* CNeutrinoApp - exec, menuitem callback (shutdown) * -**************************************************************************************/ - -int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) -{ - // printf("ac: %s\n", actionKey.c_str()); - int returnval = menu_return::RETURN_REPAINT; - - if(actionKey == "help_recording") { - ShowLocalizedMessage(LOCALE_SETTINGS_HELP, LOCALE_RECORDINGMENU_HELP, CMessageBox::mbrBack, CMessageBox::mbBack); - } - else if(actionKey=="shutdown") { - ExitRun(true, 1); - } - else if(actionKey=="reboot") - { - FILE *f = fopen("/tmp/.reboot", "w"); - fclose(f); - ExitRun(true); - unlink("/tmp/.reboot"); - returnval = menu_return::RETURN_NONE; - } - else if (actionKey=="clock_switch") - { - switchClockOnOff(); - returnval = menu_return::RETURN_EXIT_ALL; - } - else if (actionKey=="tv_radio_switch")//used in mainmenu - { - switchTvRadioMode(); - returnval = menu_return::RETURN_EXIT_ALL; - } - else if (actionKey=="tv")//used in mainmenu - { - switchTvRadioMode(mode_tv); - returnval = menu_return::RETURN_EXIT_ALL; - } - else if (actionKey=="radio")//used in mainmenu - { - switchTvRadioMode(mode_radio); - returnval = menu_return::RETURN_EXIT_ALL; - } - else if(actionKey=="scart") { - g_RCInput->postMsg( NeutrinoMessages::VCR_ON, 0 ); - returnval = menu_return::RETURN_EXIT_ALL; - } - else if(actionKey=="savesettings") { - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_MAINSETTINGS_SAVESETTINGSNOW_HINT)); // UTF-8 - hintBox->paint(); - - saveSetup(NEUTRINO_SETTINGS_FILE); - - if(g_settings.cacheTXT) { - tuxtxt_init(); - } else - tuxtxt_close(); - - //g_Sectionsd->setEventsAreOldInMinutes((unsigned short) (g_settings.epg_old_hours*60)); - //g_Sectionsd->setHoursToCache((unsigned short) (g_settings.epg_cache_days*24)); - - hintBox->hide(); - delete hintBox; - } - else if(actionKey=="recording") { - setupRecordingDevice(); - } - else if(actionKey=="reloadplugins") { - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SERVICEMENU_GETPLUGINS_HINT)); - hintBox->paint(); - - g_PluginList->loadPlugins(); - - hintBox->hide(); - delete hintBox; - } - else if(actionKey=="restart") { - if (recordingstatus) - DisplayErrorMessage(g_Locale->getText(LOCALE_SERVICEMENU_RESTART_REFUSED_RECORDING)); - else { - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SERVICEMENU_RESTART_HINT)); - hintBox->paint(); - - saveSetup(NEUTRINO_SETTINGS_FILE); - - /* this is an ugly mess :-( */ - delete g_RCInput; - delete g_Sectionsd; - delete g_RemoteControl; - delete g_fontRenderer; - - delete hintBox; - - stop_daemons(true); - stop_video(); - /* g_Timerd, g_Zapit and CVFD are used in stop_daemons */ - delete g_Timerd; - delete g_Zapit; //do we really need this? - delete CVFD::getInstance(); - - for(int i = 3; i < 256; i++) - close(i); - execvp(global_argv[0], global_argv); // no return if successful - exit(1); - } - } - else if(actionKey == "moviedir") { - parent->hide(); - - chooserDir(g_settings.network_nfs_moviedir, false, NULL, sizeof(g_settings.network_nfs_moviedir)-1); - - return menu_return::RETURN_REPAINT; - } - else if(actionKey == "movieplugin") { - parent->hide(); - CMenuWidget MoviePluginSelector(LOCALE_MOVIEPLAYER_DEFPLUGIN, NEUTRINO_ICON_FEATURES); - MoviePluginSelector.addItem(GenericMenuSeparator); - - char id[5]; - int cnt = 0; - int enabled_count = 0; - for(unsigned int count=0;count < (unsigned int) g_PluginList->getNumberOfPlugins();count++) { - if (g_PluginList->getType(count)== CPlugins::P_TYPE_TOOL && !g_PluginList->isHidden(count)) { - // zB vtxt-plugins - sprintf(id, "%d", count); - enabled_count++; - MoviePluginSelector.addItem(new CMenuForwarderNonLocalized(g_PluginList->getName(count), true, NULL, MoviePluginChanger, id, CRCInput::convertDigitToKey(count)), (cnt == 0)); - cnt++; - } - } - - MoviePluginSelector.exec(NULL, ""); - return menu_return::RETURN_REPAINT; - } - else if(actionKey == "clearSectionsd") - { - g_Sectionsd->freeMemory(); - } - - return returnval; -} - -/************************************************************************************** -* changeNotify - features menu recording start / stop * -**************************************************************************************/ -bool CNeutrinoApp::changeNotify(const neutrino_locale_t OptionName, void * /*data*/) -{ - if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LANGUAGESETUP_SELECT)) - { - g_Locale->loadLocale(g_settings.language); - return true; - } - return false; -} - -/************************************************************************************** -* Main programm - no function here * -**************************************************************************************/ -void stop_daemons(bool stopall) -{ - dvbsub_close(); - tuxtxt_stop(); - tuxtxt_close(); - - if (g_Radiotext) { - delete g_Radiotext; - g_Radiotext = NULL; - } - printf("httpd shutdown\n"); - pthread_cancel(nhttpd_thread); - pthread_join(nhttpd_thread, NULL); - printf("httpd shutdown done\n"); - CStreamManager::getInstance()->Stop(); - if(stopall) { - printf("timerd shutdown\n"); - g_Timerd->shutdown(); - pthread_join(timer_thread, NULL); - printf("timerd shutdown done\n"); - } -#ifndef DISABLE_SECTIONSD - printf("sectionsd shutdown\n"); - CEitManager::getInstance()->Stop(); - printf("sectionsd shutdown done\n"); -#endif - tuxtx_stop_subtitle(); - printf("zapit shutdown\n"); - if(!stopall && g_settings.hdmi_cec_mode && g_settings.hdmi_cec_standby){ - videoDecoder->SetCECMode((VIDEO_HDMI_CEC_MODE)0); - } - - delete &CMoviePlayerGui::getInstance(); - CZapit::getInstance()->Stop(); - printf("zapit shutdown done\n"); - CVFD::getInstance()->Clear(); - if(stopall) { - if (cpuFreq) - cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000); - if (powerManager) { - /* if we were in standby, leave it otherwise, the next - start of neutrino will fail in "_write_gxa" in - framebuffer.cpp - => this is needed because the drivers are crap :( */ - powerManager->SetStandby(false, false); - powerManager->Close(); - delete powerManager; - } - cs_deregister_messenger(); - } -} - -void stop_video() -{ - delete videoDecoder; - delete videoDemux; - delete CFrameBuffer::getInstance(); - cs_api_exit(); -} - -void sighandler (int signum) -{ - signal (signum, SIG_IGN); - switch (signum) { - case SIGTERM: - case SIGINT: - delete CRecordManager::getInstance(); - //CNeutrinoApp::getInstance()->saveSetup(NEUTRINO_SETTINGS_FILE); - stop_daemons(); - stop_video(); - //_exit(0); - exit(0); - default: - break; - } -} - -int main(int argc, char **argv) -{ - setDebugLevel(DEBUG_NORMAL); - signal(SIGTERM, sighandler); // TODO: consider the following - signal(SIGINT, sighandler); // NOTES: The effects of signal() in a multithreaded - signal(SIGHUP, SIG_IGN); // process are unspecified (signal(2)) - /* don't die in streamts.cpp from a SIGPIPE if client disconnects */ - signal(SIGPIPE, SIG_IGN); - - tzset(); - - return CNeutrinoApp::getInstance()->run(argc, argv); -} - -void CNeutrinoApp::loadKeys(const char * fname) -{ - bool res; - CConfigFile & tconfig = configfile; - - if(fname) { - CConfigFile newconfig(',', true); - - res = newconfig.loadConfig(fname); - if(!res) return; - tconfig = newconfig; - } - - //rc-key configuration - g_settings.key_tvradio_mode = tconfig.getInt32( "key_tvradio_mode", CRCInput::RC_nokey ); - g_settings.key_power_off = tconfig.getInt32( "key_power_off", CRCInput::RC_standby ); - - g_settings.key_channelList_pageup = tconfig.getInt32( "key_channelList_pageup", CRCInput::RC_page_up ); - g_settings.key_channelList_pagedown = tconfig.getInt32( "key_channelList_pagedown", CRCInput::RC_page_down ); - g_settings.key_channelList_cancel = tconfig.getInt32( "key_channelList_cancel", CRCInput::RC_home ); - g_settings.key_channelList_sort = tconfig.getInt32( "key_channelList_sort", CRCInput::RC_blue ); - g_settings.key_channelList_addrecord = tconfig.getInt32( "key_channelList_addrecord", CRCInput::RC_red ); - g_settings.key_channelList_addremind = tconfig.getInt32( "key_channelList_addremind", CRCInput::RC_yellow ); - - g_settings.key_list_start = tconfig.getInt32( "key_list_start", CRCInput::RC_nokey ); - g_settings.key_list_end = tconfig.getInt32( "key_list_end", CRCInput::RC_nokey ); - g_settings.key_timeshift = tconfig.getInt32( "key_timeshift", CRCInput::RC_pause ); - g_settings.key_plugin = tconfig.getInt32( "key_plugin", CRCInput::RC_nokey ); - g_settings.key_unlock = tconfig.getInt32( "key_unlock", CRCInput::RC_setup ); - g_settings.key_screenshot = tconfig.getInt32( "key_screenshot", CRCInput::RC_nokey ); - g_settings.key_current_transponder = tconfig.getInt32( "key_current_transponder", CRCInput::RC_games ); - - g_settings.key_quickzap_up = tconfig.getInt32( "key_quickzap_up", CRCInput::RC_up ); - g_settings.key_quickzap_down = tconfig.getInt32( "key_quickzap_down", CRCInput::RC_down ); - g_settings.key_subchannel_up = tconfig.getInt32( "key_subchannel_up", CRCInput::RC_right ); - g_settings.key_subchannel_down = tconfig.getInt32( "key_subchannel_down", CRCInput::RC_left ); - g_settings.key_zaphistory = tconfig.getInt32( "key_zaphistory", CRCInput::RC_home ); - g_settings.key_lastchannel = tconfig.getInt32( "key_lastchannel", CRCInput::RC_0 ); - - g_settings.key_bouquet_up = tconfig.getInt32( "key_bouquet_up", CRCInput::RC_right); - g_settings.key_bouquet_down = tconfig.getInt32( "key_bouquet_down", CRCInput::RC_left); - - g_settings.mpkey_rewind = tconfig.getInt32( "mpkey.rewind", CRCInput::RC_rewind ); - g_settings.mpkey_forward = tconfig.getInt32( "mpkey.forward", CRCInput::RC_forward ); - g_settings.mpkey_pause = tconfig.getInt32( "mpkey.pause", CRCInput::RC_pause ); - g_settings.mpkey_stop = tconfig.getInt32( "mpkey.stop", CRCInput::RC_stop ); - g_settings.mpkey_play = tconfig.getInt32( "mpkey.play", CRCInput::RC_play ); - g_settings.mpkey_audio = tconfig.getInt32( "mpkey.audio", CRCInput::RC_green ); - g_settings.mpkey_time = tconfig.getInt32( "mpkey.time", CRCInput::RC_setup ); - g_settings.mpkey_bookmark = tconfig.getInt32( "mpkey.bookmark", CRCInput::RC_blue ); - g_settings.mpkey_plugin = tconfig.getInt32( "mpkey.plugin", CRCInput::RC_red ); - - /* options */ - g_settings.menu_left_exit = tconfig.getInt32( "menu_left_exit", 0 ); - g_settings.audio_run_player = tconfig.getInt32( "audio_run_player", 1 ); - g_settings.key_click = tconfig.getInt32( "key_click", 1 ); - strcpy(g_settings.repeat_blocker, tconfig.getString("repeat_blocker", "150").c_str()); - strcpy(g_settings.repeat_genericblocker, tconfig.getString("repeat_genericblocker", "100").c_str()); - - g_settings.bouquetlist_mode = tconfig.getInt32( "bouquetlist_mode", 0 ); - g_settings.sms_channel = tconfig.getInt32( "sms_channel", 0 ); - g_settings.mode_left_right_key_tv = tconfig.getInt32( "mode_left_right_key_tv", SNeutrinoSettings::ZAP); -} - -void CNeutrinoApp::saveKeys(const char * fname) -{ - CConfigFile & tconfig = configfile; - if(fname) { - CConfigFile newconfig(',', true); - tconfig = newconfig; - } - //rc-key configuration - tconfig.setInt32( "key_tvradio_mode", g_settings.key_tvradio_mode ); - tconfig.setInt32( "key_power_off", g_settings.key_power_off ); - - tconfig.setInt32( "key_channelList_pageup", g_settings.key_channelList_pageup ); - tconfig.setInt32( "key_channelList_pagedown", g_settings.key_channelList_pagedown ); - tconfig.setInt32( "key_channelList_cancel", g_settings.key_channelList_cancel ); - tconfig.setInt32( "key_channelList_sort", g_settings.key_channelList_sort ); - tconfig.setInt32( "key_channelList_addrecord", g_settings.key_channelList_addrecord ); - tconfig.setInt32( "key_channelList_addremind", g_settings.key_channelList_addremind ); - - tconfig.setInt32( "key_list_start", g_settings.key_list_start ); - tconfig.setInt32( "key_list_end", g_settings.key_list_end ); - tconfig.setInt32( "key_timeshift", g_settings.key_timeshift ); - tconfig.setInt32( "key_plugin", g_settings.key_plugin ); - tconfig.setInt32( "key_unlock", g_settings.key_unlock ); - tconfig.setInt32( "key_screenshot", g_settings.key_screenshot ); - tconfig.setInt32( "key_current_transponder", g_settings.key_current_transponder ); - - tconfig.setInt32( "key_quickzap_up", g_settings.key_quickzap_up ); - tconfig.setInt32( "key_quickzap_down", g_settings.key_quickzap_down ); - tconfig.setInt32( "key_subchannel_up", g_settings.key_subchannel_up ); - tconfig.setInt32( "key_subchannel_down", g_settings.key_subchannel_down ); - tconfig.setInt32( "key_zaphistory", g_settings.key_zaphistory ); - tconfig.setInt32( "key_lastchannel", g_settings.key_lastchannel ); - - tconfig.setInt32( "key_bouquet_up", g_settings.key_bouquet_up ); - tconfig.setInt32( "key_bouquet_down", g_settings.key_bouquet_down ); - - tconfig.setInt32( "mpkey.rewind", g_settings.mpkey_rewind ); - tconfig.setInt32( "mpkey.forward", g_settings.mpkey_forward ); - tconfig.setInt32( "mpkey.pause", g_settings.mpkey_pause ); - tconfig.setInt32( "mpkey.stop", g_settings.mpkey_stop ); - tconfig.setInt32( "mpkey.play", g_settings.mpkey_play ); - tconfig.setInt32( "mpkey.audio", g_settings.mpkey_audio ); - tconfig.setInt32( "mpkey.time", g_settings.mpkey_time ); - tconfig.setInt32( "mpkey.bookmark", g_settings.mpkey_bookmark ); - tconfig.setInt32( "mpkey.plugin", g_settings.mpkey_plugin ); - - tconfig.setInt32( "menu_left_exit", g_settings.menu_left_exit ); - tconfig.setInt32( "audio_run_player", g_settings.audio_run_player ); - tconfig.setInt32( "key_click", g_settings.key_click ); - tconfig.setString( "repeat_blocker", g_settings.repeat_blocker ); - tconfig.setString( "repeat_genericblocker", g_settings.repeat_genericblocker ); - - tconfig.setInt32( "bouquetlist_mode", g_settings.bouquetlist_mode ); - tconfig.setInt32( "sms_channel", g_settings.sms_channel ); - tconfig.setInt32( "mode_left_right_key_tv", g_settings.mode_left_right_key_tv ); - - if(fname) - tconfig.saveConfig(fname); -} - -void CNeutrinoApp::StopSubtitles() -{ - printf("[neutrino] %s\n", __FUNCTION__); - int ttx, dvbpid, ttxpid, ttxpage; - - dvbpid = dvbsub_getpid(); - tuxtx_subtitle_running(&ttxpid, &ttxpage, &ttx); - - if(dvbpid) - dvbsub_pause(); - if(ttx) { - tuxtx_pause_subtitle(true); - frameBuffer->paintBackground(); - } -} - -void CNeutrinoApp::StartSubtitles(bool show) -{ - printf("%s: %s\n", __FUNCTION__, show ? "Show" : "Not show"); - if(!show) - return; - dvbsub_start(0); - tuxtx_pause_subtitle(false); -} - -void CNeutrinoApp::SelectSubtitles() -{ - /* called on NeutrinoMessages::EVT_ZAP_COMPLETE, should be safe to use zapit current channel */ - CZapitChannel * cc = CZapit::getInstance()->GetCurrentChannel(); - - if(!g_settings.auto_subs || cc == NULL) - return; - - for(int i = 0; i < 3; i++) { - if(strlen(g_settings.pref_subs[i]) == 0 || !strcmp(g_settings.pref_subs[i], "none")) - continue; - - std::string temp(g_settings.pref_subs[i]); - - for(int j = 0 ; j < (int)cc->getSubtitleCount() ; j++) { - CZapitAbsSub* s = cc->getChannelSub(j); - if (s->thisSubType == CZapitAbsSub::DVB) { - CZapitDVBSub* sd = reinterpret_cast(s); - std::map::const_iterator it; - for(it = iso639.begin(); it != iso639.end(); ++it) { - if(temp == it->second && sd->ISO639_language_code == it->first) { - printf("CNeutrinoApp::SelectSubtitles: found DVB %s, pid %x\n", sd->ISO639_language_code.c_str(), sd->pId); - dvbsub_stop(); - dvbsub_setpid(sd->pId); - return; - } - } - } - } - for(int j = 0 ; j < (int)cc->getSubtitleCount() ; j++) { - CZapitAbsSub* s = cc->getChannelSub(j); - if (s->thisSubType == CZapitAbsSub::TTX) { - CZapitTTXSub* sd = reinterpret_cast(s); - std::map::const_iterator it; - for(it = iso639.begin(); it != iso639.end(); ++it) { - if(temp == it->second && sd->ISO639_language_code == it->first) { - int page = ((sd->teletext_magazine_number & 0xFF) << 8) | sd->teletext_page_number; - printf("CNeutrinoApp::SelectSubtitles: found TTX %s, pid %x page %03X\n", sd->ISO639_language_code.c_str(), sd->pId, page); - tuxtx_stop_subtitle(); - tuxtx_set_pid(sd->pId, page, (char *) sd->ISO639_language_code.c_str()); - return; - } - } - } - } - } -} - -void CNeutrinoApp::SDT_ReloadChannels() -{ - SDTreloadChannels = false; - //g_Zapit->reinitChannels(); - channelsInit(); - t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); - channelList->adjustToChannelID(live_channel_id);//FIXME what if deleted ? - if(old_b_id >= 0) { - bouquetList->activateBouquet(old_b_id, false); - old_b_id = -1; - g_RCInput->postMsg(CRCInput::RC_ok, 0); - } -} - -void CNeutrinoApp::getAnnounceEpgName(CTimerd::RecordingInfo * eventinfo, std::string &name) -{ - - name += "\n"; - - std::string zAddData = CServiceManager::getInstance()->GetServiceName(eventinfo->channel_id); - if( zAddData.empty()) { - zAddData = g_Locale->getText(LOCALE_TIMERLIST_PROGRAM_UNKNOWN); - } - - if(eventinfo->epgID!=0) { - CEPGData epgdata; - zAddData += " :\n"; - if (CEitManager::getInstance()->getEPGid(eventinfo->epgID, eventinfo->epg_starttime, &epgdata)) { - zAddData += epgdata.title; - } - else if(strlen(eventinfo->epgTitle)!=0) { - zAddData += eventinfo->epgTitle; - } - } - else if(strlen(eventinfo->epgTitle)!=0) { - zAddData += " :\n"; - zAddData += eventinfo->epgTitle; - } - - name += zAddData; -} - -void CNeutrinoApp::Cleanup() -{ -#ifdef EXIT_CLEANUP - INFO("cleanup..."); - printf("cleanup 10\n");fflush(stdout); - delete g_Sectionsd; g_Sectionsd = NULL; - delete g_Timerd; g_Timerd = NULL; - delete g_Zapit; g_Zapit = NULL; - delete g_RemoteControl; g_RemoteControl = NULL; - - printf("cleanup 11\n");fflush(stdout); - delete g_fontRenderer; g_fontRenderer = NULL; - printf("cleanup 12\n");fflush(stdout); - delete g_PicViewer; g_PicViewer = NULL; - printf("cleanup 13\n");fflush(stdout); - delete g_PluginList; g_PluginList = NULL; - printf("cleanup 16\n");fflush(stdout); - delete g_CamHandler; g_CamHandler = NULL; - printf("cleanup 17\n");fflush(stdout); - delete g_volume; g_volume = NULL; - printf("cleanup 18\n");fflush(stdout); - delete g_EpgData; g_EpgData = NULL; - printf("cleanup 19\n");fflush(stdout); - delete g_InfoViewer; g_InfoViewer = NULL; - printf("cleanup 11\n");fflush(stdout); - delete g_EventList; g_EventList = NULL; - printf("cleanup 12\n");fflush(stdout); - delete g_Locale; g_Locale = NULL; - delete g_videoSettings; g_videoSettings = NULL; - delete g_Radiotext; g_Radiotext = NULL; - - printf("cleanup 13\n");fflush(stdout); - delete audioSetupNotifier; audioSetupNotifier = NULL; - delete MoviePluginChanger; MoviePluginChanger = NULL; - printf("cleanup 14\n");fflush(stdout); - - delete TVbouquetList; TVbouquetList = NULL; - delete RADIObouquetList; RADIObouquetList = NULL; - - delete TVfavList; TVfavList = NULL; - delete RADIOfavList; RADIOfavList = NULL; - - delete TVchannelList; TVchannelList = NULL; - delete RADIOchannelList; RADIOchannelList = NULL; - delete TVallList; TVallList = NULL; - delete RADIOallList; RADIOallList = NULL; - delete TVsatList; TVsatList = NULL; - delete RADIOsatList; RADIOsatList = NULL; - - printf("cleanup 1\n");fflush(stdout); - for (int i = 0; i < FONT_TYPE_COUNT; i++) { - delete g_Font[i]; - g_Font[i] = NULL; - } - printf("cleanup 2\n");fflush(stdout); - delete g_SignalFont; g_SignalFont = NULL; - printf("cleanup 3\n");fflush(stdout); - configfile.clear(); - - printf("cleanup 4\n");fflush(stdout); - delete CZapit::getInstance(); - printf("cleanup 5\n");fflush(stdout); - delete CEitManager::getInstance(); - printf("cleanup 6\n");fflush(stdout); - delete CVFD::getInstance(); - malloc_stats(); -#endif -} From 141b1b9d6504cea30ca6c0bd360b9a1df0177052 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 31 Jan 2013 11:14:38 +0100 Subject: [PATCH 10/86] src/gui/channellist.cpp: minitv osd fix Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/17cfb97f9e39a0735630a014113f27d7099bdc9e Author: Jacek Jendrzej Date: 2013-01-31 (Thu, 31 Jan 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index f58e96ec3..d643bca1b 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -467,7 +467,6 @@ void CChannelList::calcSize() widthDetails = width; if (g_settings.channellist_minitv){ widthDetails = frameBuffer->getScreenWidth() - frameBuffer->getScreenX(); - infozone_width = widthDetails - width; } height = h_max ((frameBuffer->getScreenHeight() / 20 * 16), (frameBuffer->getScreenHeight() / 20 * 2)); if (g_settings.channellist_minitv) @@ -510,7 +509,7 @@ void CChannelList::calcSize() y = frameBuffer->getScreenY(); pig_width = widthDetails / 3 - 16; pig_height = pig_width / 16 * 9; - +// infozone_width = pig_width - 8; infozone_height = height - theight - pig_height; } else @@ -2100,7 +2099,7 @@ void CChannelList::paint_pig (int _x, int _y, int w, int h) void CChannelList::paint_events(int index) { readEvents(chanlist[index]->channel_id); - frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUHEAD_PLUS_0); + frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, widthDetails - width, infozone_height,COL_MENUHEAD_PLUS_0); char text1[10]; CChannelEventList::iterator e; @@ -2141,7 +2140,7 @@ void CChannelList::paint_events(int index) if ((y+ theight+ pig_height + i*ffheight) < (y+ height)) { g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, timewidth, text1, COL_MENUCONTENTDARK, 0, true); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5+timewidth+5, y+ theight+ pig_height + i*ffheight, infozone_width - timewidth - 20, e->description, COL_MENUCONTENTDARK, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5+timewidth+5, y+ theight+ pig_height + i*ffheight, widthDetails - width - timewidth - 20, e->description, COL_MENUCONTENTDARK, 0, true); } else { From ec290afd1236aa674fe6172f5ab0b92988b2b7ad Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 31 Jan 2013 12:24:34 +0100 Subject: [PATCH 11/86] add .rej ~ to .gitignore Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/43aaec7cfcfc931ec8ef28f2ed2c8c570a15ae1f Author: Jacek Jendrzej Date: 2013-01-31 (Thu, 31 Jan 2013) Origin message was: ------------------ -add .rej ~ to .gitignore ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index f72cf9363..a0653ebd8 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,10 @@ INSTALL *.la .*.swp +### editor crap +*.rej +*~ + ### binaries that fall out of the build lib/sectionsdclient/sectionsdcontrol src/neutrino From fe38ed371a334b67273e1df117d98be0dfe6123e Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 31 Jan 2013 16:18:05 +0100 Subject: [PATCH 12/86] src/gui/channellist.cpp: fix possible segfault Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2e5b54c509509a331f575b5f0ba67c65bc162ff3 Author: Jacek Jendrzej Date: 2013-01-31 (Thu, 31 Jan 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index d643bca1b..a2641d25d 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2126,12 +2126,15 @@ void CChannelList::paint_events(int index) do { //printf("%d seconds in the past - deleted %s\n", dif, e->description.c_str()); - if(!evtlist.empty()) - e = evtlist.erase(e); + e = evtlist.erase( e ); + if (e == evtlist.end()) + break; dif = azeit - e->startTime; } - while (!evtlist.empty() && dif > 0 ); + while ( dif > 0 ); } + if (e == evtlist.end()) + break; //Display the remaining events struct tm *tmStartZeit = localtime(&e->startTime); strftime(text1, sizeof(text1), "%H:%M", tmStartZeit ); From b18550b83604243481d85b60588ceccdb1832779 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Thu, 31 Jan 2013 14:26:16 +0100 Subject: [PATCH 13/86] getservices: fix FindChannelFuzzy() * for services with duplicate tsid/onid/sid, not all channels were found (function returned NULL if the first match was not the correct one) * add compatibility with "wrong" ubouquets.xml for non-sat boxes: the position parameter was ignored before and is not too useful outside sat anyway Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0995ff504214d31e9d5e5275e06b1e214dd73ce9 Author: Stefan Seyfried Date: 2013-01-31 (Thu, 31 Jan 2013) Origin message was: ------------------ getservices: fix FindChannelFuzzy() * for services with duplicate tsid/onid/sid, not all channels were found (function returned NULL if the first match was not the correct one) * add compatibility with "wrong" ubouquets.xml for non-sat boxes: the position parameter was ignored before and is not too useful outside sat anyway ------------------ This commit was generated by Migit --- src/zapit/src/getservices.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/zapit/src/getservices.cpp b/src/zapit/src/getservices.cpp index 693da3522..db97238a1 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -222,15 +222,27 @@ CZapitChannel * CServiceManager::FindChannel48(const t_channel_id channel_id) return NULL; } +/* TODO: those FindChannel* functions are naive at best. By using a different construction + * scheme for the channel_id,they could easily be made much more efficient. Side effects would + * need to be checked first, though */ CZapitChannel* CServiceManager::FindChannelFuzzy(const t_channel_id channel_id, const t_satellite_position pos, const freq_id_t freq) { - CZapitChannel *ret; - ret = FindChannel48(channel_id); - if (!ret || !(pos == ret->getSatellitePosition())) - return NULL; - if (abs((int)ret->getFreqId() - (int)freq) < 3) - return ret; + for (channel_map_iterator_t it = allchans.begin(); it != allchans.end(); ++it) { + CZapitChannel *ret = &it->second; + if ((ret->getChannelID() & 0xFFFFFFFFFFFFULL) != (channel_id & 0xFFFFFFFFFFFFULL)) + continue; + /* use position only on SAT boxes. + * Cable/terr does not need thix: There usually is no second cable provider + * to choose from and people are wondering why their ubouquets are no longer + * working => because they had the wrong 's="x"' attribute. + * TODO: think about mixed-mode (sat/cable/terrestrial) operation */ + if (frontendType == FE_QPSK && pos != ret->getSatellitePosition()) + continue; + /* match +-2MHz to make old ubouquets work with updated satellites.xml */ + if (abs((int)ret->getFreqId() - (int)freq) < 3) + return ret; + } return NULL; } From 2ec2af7c3fcb458b0ad3bf20a1d51509a12fd658 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 31 Jan 2013 17:28:18 +0100 Subject: [PATCH 14/86] cables.xml: add "antennengemeinschaft penig" thx Zeng! Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4b8d0e156ed42b9c8826bd42a2fba5d891117702 Author: vanhofen Date: 2013-01-31 (Thu, 31 Jan 2013) Origin message was: ------------------ - cables.xml: add "antennengemeinschaft penig" thx Zeng! ------------------ This commit was generated by Migit --- data/cables.xml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/data/cables.xml b/data/cables.xml index 2a3ed0c75..ce0008bf5 100644 --- a/data/cables.xml +++ b/data/cables.xml @@ -515,6 +515,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + From 3378aeeb504a4adf810bd4f87fd4bdc48996d19d Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 31 Jan 2013 19:50:35 +0100 Subject: [PATCH 15/86] src/gui/channellist.cpp: miniTV osd fix - Screen coordinate x could possibly receive a value under 0 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/49667088f7d0ee14ea5ea47b8b30bd00d39e3def Author: Michael Liebmann Date: 2013-01-31 (Thu, 31 Jan 2013) Origin message was: ------------------ * src/gui/channellist.cpp: miniTV osd fix - Screen coordinate x could possibly receive a value under 0 ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index a2641d25d..ee9ed6bc9 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -94,6 +94,8 @@ extern int old_b_id; extern cVideo * videoDecoder; +#define ConnectLineBox_Width 16 + CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vlist, bool ) { frameBuffer = CFrameBuffer::getInstance(); @@ -465,9 +467,6 @@ void CChannelList::calcSize() int fw = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth(); width = w_max (((g_settings.channellist_extended)?(frameBuffer->getScreenWidth() / 20 * (fw+6)):(frameBuffer->getScreenWidth() / 20 * (fw+5))), 100); widthDetails = width; - if (g_settings.channellist_minitv){ - widthDetails = frameBuffer->getScreenWidth() - frameBuffer->getScreenX(); - } height = h_max ((frameBuffer->getScreenHeight() / 20 * 16), (frameBuffer->getScreenHeight() / 20 * 2)); if (g_settings.channellist_minitv) height = h_max ((frameBuffer->getScreenHeight() / 20 * 17), 0); @@ -505,11 +504,14 @@ void CChannelList::calcSize() if (g_settings.channellist_minitv) { width = frameBuffer->getScreenWidth() / 3 * 2; + widthDetails = frameBuffer->getScreenWidth() - frameBuffer->getScreenX() - 2*ConnectLineBox_Width; x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - widthDetails) / 2; + if (x < ConnectLineBox_Width) + x = ConnectLineBox_Width; y = frameBuffer->getScreenY(); - pig_width = widthDetails / 3 - 16; - pig_height = pig_width / 16 * 9; -// infozone_width = pig_width - 8; + infozone_width = widthDetails - width; + pig_width = infozone_width; + pig_height = (pig_width * 9) / 16; infozone_height = height - theight - pig_height; } else @@ -1602,8 +1604,6 @@ void CChannelList::clearItem2DetailsLine() void CChannelList::paintItem2DetailsLine (int pos, int /*ch_index*/) { -#define ConnectLineBox_Width 16 - int xpos = x - ConnectLineBox_Width; int ypos1 = y + theight+0 + pos*fheight; int ypos2 = y + height; @@ -2099,7 +2099,7 @@ void CChannelList::paint_pig (int _x, int _y, int w, int h) void CChannelList::paint_events(int index) { readEvents(chanlist[index]->channel_id); - frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, widthDetails - width, infozone_height,COL_MENUHEAD_PLUS_0); + frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUHEAD_PLUS_0); char text1[10]; CChannelEventList::iterator e; @@ -2143,7 +2143,7 @@ void CChannelList::paint_events(int index) if ((y+ theight+ pig_height + i*ffheight) < (y+ height)) { g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, timewidth, text1, COL_MENUCONTENTDARK, 0, true); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5+timewidth+5, y+ theight+ pig_height + i*ffheight, widthDetails - width - timewidth - 20, e->description, COL_MENUCONTENTDARK, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5+timewidth+5, y+ theight+ pig_height + i*ffheight, infozone_width - timewidth - 20, e->description, COL_MENUCONTENTDARK, 0, true); } else { From 95a719d92ee14bfae9636216ed0e9370d4287912 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 1 Feb 2013 22:59:07 +0100 Subject: [PATCH 16/86] channellist.cpp: fix round borders for infozone Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ec4a5bf3c1211a948d9975e2fd7c9d5928f78c68 Author: vanhofen Date: 2013-02-01 (Fri, 01 Feb 2013) Origin message was: ------------------ - channellist.cpp: fix round borders for infozone ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index ee9ed6bc9..90ea2619a 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -572,7 +572,7 @@ int CChannelList::show() if (g_settings.channellist_minitv) { - frameBuffer->paintBoxRel(x,y,widthDetails,height + info_height,COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_ALL); + frameBuffer->paintBoxRel(x+width,y+theight,infozone_width,pig_height+infozone_height,COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); } paintHead(); @@ -2099,7 +2099,7 @@ void CChannelList::paint_pig (int _x, int _y, int w, int h) void CChannelList::paint_events(int index) { readEvents(chanlist[index]->channel_id); - frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUHEAD_PLUS_0); + frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); char text1[10]; CChannelEventList::iterator e; From 28a4b5f5d6b14d78d127dffcd2a9c0d5c705d5da Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 1 Feb 2013 23:26:33 +0100 Subject: [PATCH 17/86] channellist.cpp: change color for infozone Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1e45607ae1af87d6d3abd3e3ac43461f7090354e Author: vanhofen Date: 2013-02-01 (Fri, 01 Feb 2013) Origin message was: ------------------ - channellist.cpp: change color for infozone ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 90ea2619a..7bed6bda8 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -572,7 +572,7 @@ int CChannelList::show() if (g_settings.channellist_minitv) { - frameBuffer->paintBoxRel(x+width,y+theight,infozone_width,pig_height+infozone_height,COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + frameBuffer->paintBoxRel(x+width,y+theight,infozone_width,pig_height+infozone_height,COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); } paintHead(); @@ -2099,7 +2099,7 @@ void CChannelList::paint_pig (int _x, int _y, int w, int h) void CChannelList::paint_events(int index) { readEvents(chanlist[index]->channel_id); - frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); char text1[10]; CChannelEventList::iterator e; From 5c3119d73f7211837526df8e924f4be5cf8b4ff4 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 2 Feb 2013 02:10:35 +0100 Subject: [PATCH 18/86] channellist.cpp: rework header and buttonbar * paint channellogo in mini-tv-mode * strech the positions of right elements in header marginally * paint buttonbar over the full width Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/77bbdfa0c9dfad1bb2f101ec5f43d40a675e6755 Author: vanhofen Date: 2013-02-02 (Sat, 02 Feb 2013) Origin message was: ------------------ - channellist.cpp: rework header and buttonbar * paint channellogo in mini-tv-mode * strech the positions of right elements in header marginally * paint buttonbar over the full width ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 7bed6bda8..7fbe6b0e3 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -512,7 +512,7 @@ void CChannelList::calcSize() infozone_width = widthDetails - width; pig_width = infozone_width; pig_height = (pig_width * 9) / 16; - infozone_height = height - theight - pig_height; + infozone_height = height - theight - pig_height - footerHeight; } else { @@ -572,7 +572,7 @@ int CChannelList::show() if (g_settings.channellist_minitv) { - frameBuffer->paintBoxRel(x+width,y+theight,infozone_width,pig_height+infozone_height,COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + frameBuffer->paintBoxRel(x+width,y+theight,infozone_width,pig_height+infozone_height,COL_MENUCONTENT_PLUS_0); } paintHead(); @@ -1629,19 +1629,17 @@ void CChannelList::paintItem2DetailsLine (int pos, int /*ch_index*/) void CChannelList::showChannelLogo() { - if (g_settings.channellist_minitv) - return; if(g_settings.infobar_show_channellogo){ static int logo_w = 0; static int logo_h = 0; - int logo_w_max = width / 4; - frameBuffer->paintBoxRel(x + width - logo_off - logo_w, y+(theight-logo_h)/2, logo_w, logo_h, COL_MENUHEAD_PLUS_0); + int logo_w_max = widthDetails / 4; + frameBuffer->paintBoxRel(x + widthDetails - logo_off - logo_w, y+(theight-logo_h)/2, logo_w, logo_h, COL_MENUHEAD_PLUS_0); std::string lname; if(g_PicViewer->GetLogoName(chanlist[selected]->channel_id, chanlist[selected]->getName(), lname, &logo_w, &logo_h)) { if((logo_h > theight) || (logo_w > logo_w_max)) g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, logo_w_max, theight); - g_PicViewer->DisplayImage(lname, x + width - logo_off - logo_w, y+(theight-logo_h)/2, logo_w, logo_h); + g_PicViewer->DisplayImage(lname, x + widthDetails - logo_off - logo_w, y+(theight-logo_h)/2, logo_w, logo_h); } } } @@ -1730,7 +1728,7 @@ void CChannelList::paintButtonBar(bool is_current) //paint buttons int y_foot = y + (height - footerHeight); - ::paintButtons(x, y_foot, width,num_buttons, Button, footerHeight,0,false,COL_INFOBAR_SHADOW,NULL,0,true, buttonID_rest); + ::paintButtons(x, y_foot, widthDetails,num_buttons, Button, footerHeight,0,false,COL_INFOBAR_SHADOW,NULL,0,true, buttonID_rest); } void CChannelList::paintItem(int pos) @@ -1957,6 +1955,7 @@ void CChannelList::paintHead() char timestr[10] = {0}; time_t now = time(NULL); struct tm *tm = localtime(&now); + bool gotTime = g_Sectionsd->getIsTimeSet(); if(gotTime) { @@ -1973,28 +1972,24 @@ void CChannelList::paintHead() // head frameBuffer->paintBoxRel(x,y, widthDetails,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_INFO, x + width - iw1 - 4, y, theight); //y+ 5 ); - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MENU, x + width - iw1 - iw2 - 8, y, theight);//y + 5); // icon for bouquet list button + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_INFO, x + widthDetails - iw1 - 10, y, theight); //y+ 5 ); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MENU, x + widthDetails - iw1 - iw2 - 14, y, theight);//y + 5); // icon for bouquet list button if (g_settings.channellist_new_zap_mode) frameBuffer->paintIcon(this->new_mode_active ? NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE : NEUTRINO_ICON_BUTTON_MUTE_ZAP_INACTIVE, - x + width - iw1 - iw2 - iw3 - 12, y, theight); + x + widthDetails - iw1 - iw2 - iw3 - 18, y, theight); if (gotTime) { int iw3x = (g_settings.channellist_new_zap_mode) ? iw3 : -4; - if (g_settings.channellist_minitv) - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + widthDetails - 16 -timestr_len, - y+theight, timestr_len, timestr, COL_MENUHEAD, 0, true); // UTF-8 - else - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + width - iw1 - iw2 - iw3x - 16 -timestr_len, + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + widthDetails - iw1 - iw2 - iw3x - 28 -timestr_len, y+theight, timestr_len, timestr, COL_MENUHEAD, 0, true); // UTF-8 timestr_len += 4; } timestr_len += iw1 + iw2 + 12; if (g_settings.channellist_new_zap_mode) - timestr_len += iw3 + 4; - logo_off = timestr_len + 4; + timestr_len += iw3 + 10; + logo_off = timestr_len + 10; g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, widthDetails - timestr_len, name, COL_MENUHEAD, 0, true); // UTF-8 } @@ -2099,7 +2094,7 @@ void CChannelList::paint_pig (int _x, int _y, int w, int h) void CChannelList::paint_events(int index) { readEvents(chanlist[index]->channel_id); - frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUCONTENT_PLUS_0); char text1[10]; CChannelEventList::iterator e; @@ -2140,7 +2135,7 @@ void CChannelList::paint_events(int index) strftime(text1, sizeof(text1), "%H:%M", tmStartZeit ); //printf("%s %s\n", text1, e->description.c_str()); int timewidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getRenderWidth(text1, true); - if ((y+ theight+ pig_height + i*ffheight) < (y+ height)) + if ((y+ theight+ pig_height + i*ffheight) < (y+ theight+ pig_height + infozone_height)) { g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, timewidth, text1, COL_MENUCONTENTDARK, 0, true); g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5+timewidth+5, y+ theight+ pig_height + i*ffheight, infozone_width - timewidth - 20, e->description, COL_MENUCONTENTDARK, 0, true); From 9554af5953d5036d7bbb248642901399fc46e2b5 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sun, 3 Feb 2013 07:05:40 +0100 Subject: [PATCH 19/86] src/gui/channellist.cpp: miniTV fix locale - Add locale for menuhint - Sort header for locale Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1c85803632f4dca1addd70afe3f4dec7a614e36d Author: Michael Liebmann Date: 2013-02-03 (Sun, 03 Feb 2013) Origin message was: ------------------ * src/gui/channellist.cpp: miniTV fix locale - Add locale for menuhint - Sort header for locale ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/system/locals.h | 4 ++-- src/system/locals_intern.h | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 0e369832e..0cdfc45f8 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -739,6 +739,7 @@ menu.hint_channellist_epg_align Hier kann man festlegen, wie der Text für das E menu.hint_channellist_extended Bei aktivierter Funktion wird vor dem Sendernamen ein Balken eingeblendet,\nder den Sendungsfortschritt anzeigt menu.hint_channellist_fonts Ändern Sie in der Kanalliste die Schriftgrößen menu.hint_channellist_foot Definiert welche Informationen im unteren Sendungsfenster angezeigt werden sollen +menu.hint_channellist_minitv Schaltet den MiniTV Modus ein/aus menu.hint_channellist_setup Hier können Sie Anzeigeoptionen für die Kanalliste auswählen menu.hint_ci Conditional-Access-Menü zum Einrichten\nIhres CI-Moduls oder der eingebetteten Conax-Karte menu.hint_colors Konfigurieren Sie die Menü-Farben diff --git a/data/locale/english.locale b/data/locale/english.locale index 235f7cc6d..59e417038 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -739,6 +739,7 @@ menu.hint_channellist_epg_align EPG event align menu.hint_channellist_extended Show current event progress bar menu.hint_channellist_fonts Change channel list font sizes menu.hint_channellist_foot Show additional information\nin bottom box +menu.hint_channellist_minitv Switches the MiniTV mode on/off menu.hint_channellist_setup Configure channe list GUI options menu.hint_ci Conditional access menu\nto setup your CI CAM or embeded Conax card menu.hint_colors Configure GUI colors diff --git a/src/system/locals.h b/src/system/locals.h index 01aa97c15..12bac4375 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -232,7 +232,6 @@ typedef enum LOCALE_CHANNELLIST_EPGTEXT_ALIGN_LEFT, LOCALE_CHANNELLIST_EPGTEXT_ALIGN_RIGHT, LOCALE_CHANNELLIST_EXTENDED, - LOCALE_CHANNELLIST_MINITV, LOCALE_CHANNELLIST_FAVS, LOCALE_CHANNELLIST_FOOT, LOCALE_CHANNELLIST_FOOT_FREQ, @@ -248,6 +247,7 @@ typedef enum LOCALE_CHANNELLIST_MAKE_HDLIST, LOCALE_CHANNELLIST_MAKE_NEWLIST, LOCALE_CHANNELLIST_MAKE_REMOVEDLIST, + LOCALE_CHANNELLIST_MINITV, LOCALE_CHANNELLIST_NEW_ZAP_MODE, LOCALE_CHANNELLIST_NONEFOUND, LOCALE_CHANNELLIST_PROVS, @@ -764,9 +764,9 @@ typedef enum LOCALE_MENU_HINT_CHANNELLIST_COLORED, LOCALE_MENU_HINT_CHANNELLIST_EPG_ALIGN, LOCALE_MENU_HINT_CHANNELLIST_EXTENDED, - LOCALE_MENU_HINT_CHANNELLIST_MINITV, LOCALE_MENU_HINT_CHANNELLIST_FONTS, LOCALE_MENU_HINT_CHANNELLIST_FOOT, + LOCALE_MENU_HINT_CHANNELLIST_MINITV, LOCALE_MENU_HINT_CHANNELLIST_SETUP, LOCALE_MENU_HINT_CI, LOCALE_MENU_HINT_COLORS, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 1e5fd4c65..03cea3b94 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -232,7 +232,6 @@ const char * locale_real_names[] = "channellist.epgtext_align_left", "channellist.epgtext_align_right", "channellist.extended", - "channellist.minitv", "channellist.favs", "channellist.foot", "channellist.foot_freq", @@ -248,6 +247,7 @@ const char * locale_real_names[] = "channellist.make_hdlist", "channellist.make_newlist", "channellist.make_removedlist", + "channellist.minitv", "channellist.new_zap_mode", "channellist.nonefound", "channellist.provs", @@ -764,9 +764,9 @@ const char * locale_real_names[] = "menu.hint_channellist_colored", "menu.hint_channellist_epg_align", "menu.hint_channellist_extended", - "menu.hint_channellist_minitv", "menu.hint_channellist_fonts", "menu.hint_channellist_foot", + "menu.hint_channellist_minitv", "menu.hint_channellist_setup", "menu.hint_ci", "menu.hint_colors", From 368800c80d282db80ccca537a5b081b035e4c753 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 4 Feb 2013 15:07:27 +0100 Subject: [PATCH 20/86] yweb: disable horizontal scrolling in screenshot-pages Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/01c6cf0104d8edc7006ec5f8c1569bdd3898daab Author: vanhofen Date: 2013-02-04 (Mon, 04 Feb 2013) Origin message was: ------------------ - yweb: disable horizontal scrolling in screenshot-pages ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/web/Y_Main.css | 8 ++++++++ src/nhttpd/web/Y_Tools_remote_osd.yhtm | 8 ++++++-- src/nhttpd/web/Y_Version.txt | 4 ++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/nhttpd/web/Y_Main.css b/src/nhttpd/web/Y_Main.css index 7f48c980d..83ec64950 100644 --- a/src/nhttpd/web/Y_Main.css +++ b/src/nhttpd/web/Y_Main.css @@ -846,3 +846,11 @@ a.timer { .lt_table td { white-space: pre-wrap; } + +/* screenshots */ +td.shot { + vertical-align: top; +} +img#shot { + width: 100%; +} diff --git a/src/nhttpd/web/Y_Tools_remote_osd.yhtm b/src/nhttpd/web/Y_Tools_remote_osd.yhtm index f45c62466..476286fa0 100644 --- a/src/nhttpd/web/Y_Tools_remote_osd.yhtm +++ b/src/nhttpd/web/Y_Tools_remote_osd.yhtm @@ -37,8 +37,12 @@ function do_clearshot2(){ - - + +
{=include-block:Y_Blocks.txt;remote=} + {=include-block:Y_Blocks.txt;remote=} + + +
diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index e8859d88d..224de84ad 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.8.0.31 -date=19.11.2012 +version=2.8.0.32 +date=04.02.2013 type=Release info=Port Coolstream From ca1569c428f58bf79ac0ae15f5f39f7eb0dc5a8c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 4 Feb 2013 22:25:15 +0100 Subject: [PATCH 21/86] channellist: make miniTV switchable Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d8bd46e9d1d94aae3f46ec6a96084399c28150a0 Author: vanhofen Date: 2013-02-04 (Mon, 04 Feb 2013) Origin message was: ------------------ - channellist: make miniTV switchable ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 7 +++++-- data/locale/english.locale | 7 +++++-- src/gui/channellist.cpp | 22 +++++++++++++--------- src/gui/osd_setup.cpp | 15 ++++++++++++--- src/neutrino.cpp | 4 ++-- src/system/locals.h | 7 +++++-- src/system/locals_intern.h | 7 +++++-- src/system/settings.h | 2 +- 8 files changed, 48 insertions(+), 23 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 0cdfc45f8..4fd9fcb3b 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -200,6 +200,10 @@ bouquetname.new Neue Kanäle bouquetname.other Unbekannter Provider bouquetname.removed Gelöschte Kanäle cablesetup.provider Kabelanbieter +channellist.additional Zusatzinformationen +channellist.additional_off aus +channellist.additional_on ein +channellist.additional_on_minitv ein (mit MiniTV) channellist.current_tp Aktueller Transponder channellist.edit Bearbeiten channellist.epgtext_align_left links @@ -220,7 +224,6 @@ channellist.keep_numbers Dauerhafte Kanalnummern channellist.make_hdlist Erzeuge Bouquet mit HD-Kanälen channellist.make_newlist Erzeuge Bouquet mit neuen Kanälen channellist.make_removedlist Erzeuge Bouquet mit gelöschten Kanälen -channellist.minitv Kanalliste mit MiniTV channellist.new_zap_mode Quickzap in Liste channellist.nonefound Es wurden keine Kanäle gefunden!\nFühren Sie bitte eine Kanalsuche durch\n(MENU-Taste -> Service) channellist.provs Anbieter @@ -734,12 +737,12 @@ menu.hint_cache_txt Startet das Zwischenspeichern des Teletext nach\nKanalwechse menu.hint_cec_mode CEC-Modus menu.hint_cec_standby CEC-Standby menu.hint_cec_view_on CEC view ON +menu.hint_channellist_additional Definiert, ob zusätzliche Informationen im Hauptfenster angezeigt werden sollen menu.hint_channellist_colored Definiert ob die aktuelle oder nächste Sendung in einer anderen Farbe dargestellt werden soll menu.hint_channellist_epg_align Hier kann man festlegen, wie der Text für das EPG in der Liste\nrechts vom Programmnamen ausgerichtet wird menu.hint_channellist_extended Bei aktivierter Funktion wird vor dem Sendernamen ein Balken eingeblendet,\nder den Sendungsfortschritt anzeigt menu.hint_channellist_fonts Ändern Sie in der Kanalliste die Schriftgrößen menu.hint_channellist_foot Definiert welche Informationen im unteren Sendungsfenster angezeigt werden sollen -menu.hint_channellist_minitv Schaltet den MiniTV Modus ein/aus menu.hint_channellist_setup Hier können Sie Anzeigeoptionen für die Kanalliste auswählen menu.hint_ci Conditional-Access-Menü zum Einrichten\nIhres CI-Moduls oder der eingebetteten Conax-Karte menu.hint_colors Konfigurieren Sie die Menü-Farben diff --git a/data/locale/english.locale b/data/locale/english.locale index 59e417038..d056c15a4 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -200,6 +200,10 @@ bouquetname.new New channels bouquetname.other Unknown provider bouquetname.removed Removed channels cablesetup.provider cable provider +channellist.additional Additional informations +channellist.additional_off off +channellist.additional_on on +channellist.additional_on_minitv on (with MiniTV) channellist.current_tp Current transponder channellist.edit Edit channellist.epgtext_align_left left @@ -220,7 +224,6 @@ channellist.keep_numbers Persistent channel numbers channellist.make_hdlist Create list of HD channels channellist.make_newlist Create list of new channels channellist.make_removedlist Create list of removed channels -channellist.minitv Channellist with MiniTV channellist.new_zap_mode Quickzap in list channellist.nonefound No channels were found!\nPlease execute a scan\n(MENU-key -> service) channellist.provs Providers @@ -734,12 +737,12 @@ menu.hint_cache_txt Start teletext caching after channel switch menu.hint_cec_mode CEC mode menu.hint_cec_standby CEC standby menu.hint_cec_view_on CEC view ON +menu.hint_channellist_additional Show additional informations\nin main box menu.hint_channellist_colored Use different color for current or next event menu.hint_channellist_epg_align EPG event align menu.hint_channellist_extended Show current event progress bar menu.hint_channellist_fonts Change channel list font sizes menu.hint_channellist_foot Show additional information\nin bottom box -menu.hint_channellist_minitv Switches the MiniTV mode on/off menu.hint_channellist_setup Configure channe list GUI options menu.hint_ci Conditional access menu\nto setup your CI CAM or embeded Conax card menu.hint_colors Configure GUI colors diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 7fbe6b0e3..aa3baa67e 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -468,7 +468,7 @@ void CChannelList::calcSize() width = w_max (((g_settings.channellist_extended)?(frameBuffer->getScreenWidth() / 20 * (fw+6)):(frameBuffer->getScreenWidth() / 20 * (fw+5))), 100); widthDetails = width; height = h_max ((frameBuffer->getScreenHeight() / 20 * 16), (frameBuffer->getScreenHeight() / 20 * 2)); - if (g_settings.channellist_minitv) + if (g_settings.channellist_additional) height = h_max ((frameBuffer->getScreenHeight() / 20 * 17), 0); CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, name.c_str()); @@ -501,7 +501,7 @@ void CChannelList::calcSize() height = theight + footerHeight + listmaxshow * fheight; info_height = 2*fheight + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getHeight() + 10; - if (g_settings.channellist_minitv) + if (g_settings.channellist_additional) { width = frameBuffer->getScreenWidth() / 3 * 2; widthDetails = frameBuffer->getScreenWidth() - frameBuffer->getScreenX() - 2*ConnectLineBox_Width; @@ -511,7 +511,10 @@ void CChannelList::calcSize() y = frameBuffer->getScreenY(); infozone_width = widthDetails - width; pig_width = infozone_width; - pig_height = (pig_width * 9) / 16; + if (g_settings.channellist_additional == 2) // with miniTV + pig_height = (pig_width * 9) / 16; + else + pig_height = 0; infozone_height = height - theight - pig_height - footerHeight; } else @@ -570,7 +573,7 @@ int CChannelList::show() COSDFader fader(g_settings.menu_Content_alpha); fader.StartFadeIn(); - if (g_settings.channellist_minitv) + if (g_settings.channellist_additional) { frameBuffer->paintBoxRel(x+width,y+theight,infozone_width,pig_height+infozone_height,COL_MENUCONTENT_PLUS_0); } @@ -906,7 +909,7 @@ int CChannelList::show() void CChannelList::hide() { - if (g_settings.channellist_minitv) + if (g_settings.channellist_additional == 2) // with miniTV { // widthDetails = frameBuffer->getScreenWidth() - frameBuffer->getScreenX(); videoDecoder->Pig(-1, -1, -1, -1); @@ -1593,7 +1596,7 @@ void CChannelList::paintDetails(int index) g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ widthDetails- 10- from_len, y+ height+ 5+ 3*fheight, from_len, cFrom, colored_event_N ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8 } } - if ((g_settings.channellist_minitv) && (p_event != NULL)) + if ((g_settings.channellist_additional) && (p_event != NULL)) paint_events(index); } @@ -1995,9 +1998,10 @@ void CChannelList::paintHead() void CChannelList::paint() { - if (g_settings.channellist_minitv) + if (g_settings.channellist_additional == 2) // with miniTV { - paint_pig(x+width, y+theight+1, pig_width, pig_height); + // 5px offset - same value as in list below + paint_pig(x+width+5, y+theight+5, pig_width-10, pig_height-10); } numwidth = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(MaxChanNr().c_str()); @@ -2137,7 +2141,7 @@ void CChannelList::paint_events(int index) int timewidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getRenderWidth(text1, true); if ((y+ theight+ pig_height + i*ffheight) < (y+ theight+ pig_height + infozone_height)) { - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, timewidth, text1, COL_MENUCONTENTDARK, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, timewidth, text1, COL_MENUCONTENTINACTIVE, 0, true); g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5+timewidth+5, y+ theight+ pig_height + i*ffheight, infozone_width - timewidth - 20, e->description, COL_MENUCONTENTDARK, 0, true); } else diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 3fd4e292d..c2edea012 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -354,6 +354,14 @@ const CMenuOptionChooser::keyval INFOBAR_SHOW_RES_MODE_OPTIONS[INFOBAR_SHOW_RES_ { 2, LOCALE_OPTIONS_OFF } }; +#define CHANNELLIST_ADDITIONAL_OPTION_COUNT 3 +const CMenuOptionChooser::keyval CHANNELLIST_ADDITIONAL_OPTIONS[CHANNELLIST_ADDITIONAL_OPTION_COUNT] = +{ + { 0, LOCALE_CHANNELLIST_ADDITIONAL_OFF }, + { 1, LOCALE_CHANNELLIST_ADDITIONAL_ON }, + { 2, LOCALE_CHANNELLIST_ADDITIONAL_ON_MINITV } +}; + #define CHANNELLIST_FOOT_OPTIONS_COUNT 3 const CMenuOptionChooser::keyval CHANNELLIST_FOOT_OPTIONS[CHANNELLIST_FOOT_OPTIONS_COUNT]= { @@ -796,9 +804,10 @@ void COsdSetup::showOsdChanlistSetup(CMenuWidget *menu_chanlist) CMenuOptionChooser * mc; menu_chanlist->addIntroItems(LOCALE_MISCSETTINGS_CHANNELLIST); - // channel list with minitv - mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_MINITV, &g_settings.channellist_minitv, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); - mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_MINITV); + + // channellist additional + mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_ADDITIONAL, &g_settings.channellist_additional, CHANNELLIST_ADDITIONAL_OPTIONS, CHANNELLIST_ADDITIONAL_OPTION_COUNT, true); + mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_ADDITIONAL); menu_chanlist->addItem(mc); // epg align diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 3974c1178..f7e09d56b 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -605,12 +605,12 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.mode_clock = configfile.getInt32( "mode_clock", 0); g_settings.zapto_pre_time = configfile.getInt32( "zapto_pre_time", 0); g_settings.spectrum = configfile.getBool("spectrum" , false); + g_settings.channellist_additional = configfile.getInt32("channellist_additional", 0); //default off g_settings.channellist_epgtext_align_right = configfile.getBool("channellist_epgtext_align_right" , false); g_settings.channellist_extended = configfile.getBool("channellist_extended" , true); g_settings.channellist_foot = configfile.getInt32("channellist_foot" , 1);//default next Event g_settings.channellist_new_zap_mode = configfile.getInt32("channellist_new_zap_mode", 1); g_settings.channellist_sort_mode = configfile.getInt32("channellist_sort_mode", 0);//sort mode: alpha, freq, sat - g_settings.channellist_minitv = configfile.getInt32("channellist_minitv", 0); //default off //screen configuration g_settings.screen_xres = configfile.getInt32("screen_xres", 100); @@ -1027,11 +1027,11 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32( "mode_clock", g_settings.mode_clock ); configfile.setInt32( "zapto_pre_time", g_settings.zapto_pre_time ); configfile.setBool("spectrum", g_settings.spectrum); + configfile.setInt32("channellist_additional", g_settings.channellist_additional); configfile.setBool("channellist_epgtext_align_right", g_settings.channellist_epgtext_align_right); configfile.setBool("channellist_extended" , g_settings.channellist_extended); configfile.setInt32("channellist_foot" , g_settings.channellist_foot); configfile.setInt32("channellist_new_zap_mode", g_settings.channellist_new_zap_mode); - configfile.setInt32("channellist_minitv", g_settings.channellist_minitv); configfile.setInt32("remote_control_hardware", g_settings.remote_control_hardware); configfile.setBool ( "audiochannel_up_down_enable", g_settings.audiochannel_up_down_enable ); configfile.setInt32("channellist_sort_mode", g_settings.channellist_sort_mode); diff --git a/src/system/locals.h b/src/system/locals.h index 12bac4375..a92c67abd 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -227,6 +227,10 @@ typedef enum LOCALE_BOUQUETNAME_OTHER, LOCALE_BOUQUETNAME_REMOVED, LOCALE_CABLESETUP_PROVIDER, + LOCALE_CHANNELLIST_ADDITIONAL, + LOCALE_CHANNELLIST_ADDITIONAL_OFF, + LOCALE_CHANNELLIST_ADDITIONAL_ON, + LOCALE_CHANNELLIST_ADDITIONAL_ON_MINITV, LOCALE_CHANNELLIST_CURRENT_TP, LOCALE_CHANNELLIST_EDIT, LOCALE_CHANNELLIST_EPGTEXT_ALIGN_LEFT, @@ -247,7 +251,6 @@ typedef enum LOCALE_CHANNELLIST_MAKE_HDLIST, LOCALE_CHANNELLIST_MAKE_NEWLIST, LOCALE_CHANNELLIST_MAKE_REMOVEDLIST, - LOCALE_CHANNELLIST_MINITV, LOCALE_CHANNELLIST_NEW_ZAP_MODE, LOCALE_CHANNELLIST_NONEFOUND, LOCALE_CHANNELLIST_PROVS, @@ -761,12 +764,12 @@ typedef enum LOCALE_MENU_HINT_CEC_MODE, LOCALE_MENU_HINT_CEC_STANDBY, LOCALE_MENU_HINT_CEC_VIEW_ON, + LOCALE_MENU_HINT_CHANNELLIST_ADDITIONAL, LOCALE_MENU_HINT_CHANNELLIST_COLORED, LOCALE_MENU_HINT_CHANNELLIST_EPG_ALIGN, LOCALE_MENU_HINT_CHANNELLIST_EXTENDED, LOCALE_MENU_HINT_CHANNELLIST_FONTS, LOCALE_MENU_HINT_CHANNELLIST_FOOT, - LOCALE_MENU_HINT_CHANNELLIST_MINITV, LOCALE_MENU_HINT_CHANNELLIST_SETUP, LOCALE_MENU_HINT_CI, LOCALE_MENU_HINT_COLORS, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 03cea3b94..d65c50631 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -227,6 +227,10 @@ const char * locale_real_names[] = "bouquetname.other", "bouquetname.removed", "cablesetup.provider", + "channellist.additional", + "channellist.additional_off", + "channellist.additional_on", + "channellist.additional_on_minitv", "channellist.current_tp", "channellist.edit", "channellist.epgtext_align_left", @@ -247,7 +251,6 @@ const char * locale_real_names[] = "channellist.make_hdlist", "channellist.make_newlist", "channellist.make_removedlist", - "channellist.minitv", "channellist.new_zap_mode", "channellist.nonefound", "channellist.provs", @@ -761,12 +764,12 @@ const char * locale_real_names[] = "menu.hint_cec_mode", "menu.hint_cec_standby", "menu.hint_cec_view_on", + "menu.hint_channellist_additional", "menu.hint_channellist_colored", "menu.hint_channellist_epg_align", "menu.hint_channellist_extended", "menu.hint_channellist_fonts", "menu.hint_channellist_foot", - "menu.hint_channellist_minitv", "menu.hint_channellist_setup", "menu.hint_ci", "menu.hint_colors", diff --git a/src/system/settings.h b/src/system/settings.h index cb6261825..e13334304 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -416,12 +416,12 @@ struct SNeutrinoSettings int pip_y; int bigFonts; int big_windows; + int channellist_additional; int channellist_epgtext_align_right; int channellist_extended; int channellist_foot; int channellist_new_zap_mode; int channellist_sort_mode; - int channellist_minitv; char repeat_blocker[4]; char repeat_genericblocker[4]; int remote_control_hardware; From 536c7913abbb3e024c15f2cebebe6605d4f1cf1f Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 4 Feb 2013 23:43:16 +0100 Subject: [PATCH 22/86] osd_setup.cpp: add 'channellist.additional' to channellist's submenu very ugly: same code two times Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ce0025c7cde8bc2016ebe376cc624e632ac36c2e Author: vanhofen Date: 2013-02-04 (Mon, 04 Feb 2013) Origin message was: ------------------ - osd_setup.cpp: add 'channellist.additional' to channellist's submenu very ugly: same code two times ------------------ This commit was generated by Migit --- src/gui/osd_setup.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index c2edea012..1d23aa17c 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -902,9 +902,15 @@ int COsdSetup::showContextChanlistMenu() menu_chanlist->enableFade(false); menu_chanlist->setSelected(cselected); + CMenuOptionChooser * mc; + menu_chanlist->addIntroItems(LOCALE_MISCSETTINGS_CHANNELLIST);//, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_CANCEL); - CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_CHANNELLIST_EPGTEXT_ALIGN, &g_settings.channellist_epgtext_align_right, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS_COUNT, true); + mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_ADDITIONAL, &g_settings.channellist_additional, CHANNELLIST_ADDITIONAL_OPTIONS, CHANNELLIST_ADDITIONAL_OPTION_COUNT, true); + mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_ADDITIONAL); + menu_chanlist->addItem(mc); + + mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_CHANNELLIST_EPGTEXT_ALIGN, &g_settings.channellist_epgtext_align_right, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_EPG_ALIGN); menu_chanlist->addItem(mc); From 00d0c54a19cbbb98f005d72266b68dd5d846195e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 5 Feb 2013 00:30:16 +0100 Subject: [PATCH 23/86] channellist.cpp: fix shortcuts in submenu and add a seperator line Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ee0cb25258a30e455c06bea98b5aab02f3c24fdd Author: vanhofen Date: 2013-02-05 (Tue, 05 Feb 2013) Origin message was: ------------------ - channellist.cpp: fix shortcuts in submenu and add a seperator line ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index aa3baa67e..075eac562 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -304,6 +304,7 @@ int CChannelList::doChannelMenu(void) { int i = 0; int select = -1; + int shortcut = 0; static int old_selected = 0; char cnt[5]; bool enabled = true; @@ -333,9 +334,10 @@ int CChannelList::doChannelMenu(void) menu->addItem(new CMenuForwarder(LOCALE_FAVORITES_MENUEADD, true, NULL, selector, cnt, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE), old_selected == i++); snprintf(cnt, sizeof(cnt), "%d", i); bool reset_enabled = chanlist[selected]->flags & CZapitChannel::NEW; - menu->addItem(new CMenuForwarder(LOCALE_CHANNELLIST_RESET_FLAGS, reset_enabled, NULL, selector, cnt, CRCInput::convertDigitToKey(0)), old_selected == i++); + menu->addItem(new CMenuForwarder(LOCALE_CHANNELLIST_RESET_FLAGS, reset_enabled, NULL, selector, cnt, CRCInput::convertDigitToKey(shortcut++)), old_selected == i++); snprintf(cnt, sizeof(cnt), "%d", i); - menu->addItem(new CMenuForwarder(LOCALE_MAINMENU_SETTINGS, true, NULL, selector, cnt, CRCInput::convertDigitToKey(0)), old_selected == i++); + menu->addItem(new CMenuSeparator(CMenuSeparator::LINE)); + menu->addItem(new CMenuForwarder(LOCALE_MAINMENU_SETTINGS, true, NULL, selector, cnt, CRCInput::convertDigitToKey(shortcut++)), old_selected == i++); menu->exec(NULL, ""); delete menu; delete selector; From f199acd4b7fd54f5eb0e0a12e2e1239592311ac9 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 5 Feb 2013 00:44:13 +0100 Subject: [PATCH 24/86] osd_setup.cpp: fix color-hotkey for channellist-submenu and add a seperator line Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e07e95bfb24a450dd2461df46a50d8c3583c5bb4 Author: vanhofen Date: 2013-02-05 (Tue, 05 Feb 2013) Origin message was: ------------------ - osd_setup.cpp: fix color-hotkey for channellist-submenu and add a seperator line ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/osd_setup.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 1d23aa17c..a5e4e8fd6 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -926,6 +926,8 @@ int COsdSetup::showContextChanlistMenu() mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_COLORED); menu_chanlist->addItem(mc); + menu_chanlist->addItem(new CMenuSeparator(CMenuSeparator::LINE)); + CMenuWidget *fontSettingsSubMenu = new CMenuWidget(LOCALE_FONTMENU_HEAD, NEUTRINO_ICON_KEYBINDING); fontSettingsSubMenu->enableSaveScreen(true); fontSettingsSubMenu->enableFade(false); @@ -940,7 +942,7 @@ int COsdSetup::showContextChanlistMenu() fontSettingsSubMenu->addItem(GenericMenuSeparatorLine); fontSettingsSubMenu->addItem(new CMenuForwarder(LOCALE_OPTIONS_DEFAULT, true, NULL, this, font_sizes_groups[i].actionkey)); - CMenuForwarder * mf = new CMenuDForwarder(LOCALE_FONTMENU_HEAD, true, NULL, fontSettingsSubMenu, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); + CMenuForwarder * mf = new CMenuDForwarder(LOCALE_FONTMENU_HEAD, true, NULL, fontSettingsSubMenu, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); mf->setHint("", LOCALE_MENU_HINT_FONTS); menu_chanlist->addItem(mf); From 21694b1d47240a74054ca1f79ce80ef141799083 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 5 Feb 2013 00:58:31 +0100 Subject: [PATCH 25/86] channellist.cpp: fix wrong time for no further events patch by TangoCash. thx! Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3bdb3bbc07d5d0b2f80c9cf6b3a9bb04afa58f44 Author: vanhofen Date: 2013-02-05 (Tue, 05 Feb 2013) Origin message was: ------------------ - channellist.cpp: fix wrong time for no further events patch by TangoCash. thx! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 075eac562..495ba5c86 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2114,6 +2114,7 @@ void CChannelList::paint_events(int index) evt.description = g_Locale->getText(LOCALE_EPGLIST_NOEVENTS); evt.eventID = 0; + evt.startTime = time_t(82800); evtlist.push_back(evt); } @@ -2170,6 +2171,7 @@ void CChannelList::readEvents(const t_channel_id channel_id) CChannelEvent evt; evt.description = g_Locale->getText(LOCALE_EPGLIST_NOEVENTS); evt.eventID = 0; + evt.startTime = time_t(82800); evtlist.push_back(evt); } else From 05945fdeeda4dead68a416d7889617145d9a7c04 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 5 Feb 2013 01:36:28 +0100 Subject: [PATCH 26/86] channellist.cpp: remove time for no further events thx to TangoCash. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/54ed166d1faffa57f215b1a4ba1a46af4c1776a0 Author: vanhofen Date: 2013-02-05 (Tue, 05 Feb 2013) Origin message was: ------------------ - channellist.cpp: remove time for no further events thx to TangoCash. ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 495ba5c86..7055a4259 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2102,7 +2102,8 @@ void CChannelList::paint_events(int index) readEvents(chanlist[index]->channel_id); frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUCONTENT_PLUS_0); - char text1[10]; + char startTime[10]; + int startTimeWidth = 0; CChannelEventList::iterator e; time_t azeit; time(&azeit); @@ -2114,7 +2115,6 @@ void CChannelList::paint_events(int index) evt.description = g_Locale->getText(LOCALE_EPGLIST_NOEVENTS); evt.eventID = 0; - evt.startTime = time_t(82800); evtlist.push_back(evt); } @@ -2137,15 +2137,20 @@ void CChannelList::paint_events(int index) } if (e == evtlist.end()) break; + //Display the remaining events - struct tm *tmStartZeit = localtime(&e->startTime); - strftime(text1, sizeof(text1), "%H:%M", tmStartZeit ); - //printf("%s %s\n", text1, e->description.c_str()); - int timewidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getRenderWidth(text1, true); if ((y+ theight+ pig_height + i*ffheight) < (y+ theight+ pig_height + infozone_height)) { - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, timewidth, text1, COL_MENUCONTENTINACTIVE, 0, true); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5+timewidth+5, y+ theight+ pig_height + i*ffheight, infozone_width - timewidth - 20, e->description, COL_MENUCONTENTDARK, 0, true); + if (e->eventID) + { + struct tm *tmStartZeit = localtime(&e->startTime); + strftime(startTime, sizeof(startTime), "%H:%M", tmStartZeit ); + //printf("%s %s\n", text1, e->description.c_str()); + startTimeWidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getRenderWidth(startTime, true); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, startTimeWidth, startTime, COL_MENUCONTENTINACTIVE, 0, true); + startTimeWidth = startTimeWidth +5; + } + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5+startTimeWidth, y+ theight+ pig_height + i*ffheight, infozone_width - startTimeWidth - 20, e->description, COL_MENUCONTENTDARK, 0, true); } else { @@ -2171,7 +2176,6 @@ void CChannelList::readEvents(const t_channel_id channel_id) CChannelEvent evt; evt.description = g_Locale->getText(LOCALE_EPGLIST_NOEVENTS); evt.eventID = 0; - evt.startTime = time_t(82800); evtlist.push_back(evt); } else From c5de0e7e67742d5ba719754b17d42e25ce37fdac Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 5 Feb 2013 17:01:18 +0100 Subject: [PATCH 27/86] channellist.cpp: determinate startTimeWidth from a fixed value Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d6f4ea5baa296764f00d986498e34b753c6f89f4 Author: vanhofen Date: 2013-02-05 (Tue, 05 Feb 2013) Origin message was: ------------------ - channellist.cpp: determinate startTimeWidth from a fixed value ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 7055a4259..914d88ef9 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2145,8 +2145,8 @@ void CChannelList::paint_events(int index) { struct tm *tmStartZeit = localtime(&e->startTime); strftime(startTime, sizeof(startTime), "%H:%M", tmStartZeit ); - //printf("%s %s\n", text1, e->description.c_str()); - startTimeWidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getRenderWidth(startTime, true); + //printf("%s %s\n", startTime, e->description.c_str()); + startTimeWidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getRenderWidth("88:88"); // use a fixed value g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, startTimeWidth, startTime, COL_MENUCONTENTINACTIVE, 0, true); startTimeWidth = startTimeWidth +5; } From 99ceae9f067f34665cb118c55cac5f158e92c78a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 5 Feb 2013 23:56:48 +0100 Subject: [PATCH 28/86] channellist.cpp: 'fix' the double determination of dimensions/coordinates Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d4635b690f00fe5f27a53454e64db84d50633bc1 Author: vanhofen Date: 2013-02-05 (Tue, 05 Feb 2013) Origin message was: ------------------ - channellist.cpp: 'fix' the double determination of dimensions/coordinates ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 93 +++++++++++++++++++---------------------- src/gui/channellist.h | 18 ++++---- 2 files changed, 52 insertions(+), 59 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 914d88ef9..b08e32b6f 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -466,12 +466,19 @@ int CChannelList::exec() void CChannelList::calcSize() { const int pic_h = 39; - int fw = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth(); - width = w_max (((g_settings.channellist_extended)?(frameBuffer->getScreenWidth() / 20 * (fw+6)):(frameBuffer->getScreenWidth() / 20 * (fw+5))), 100); - widthDetails = width; - height = h_max ((frameBuffer->getScreenHeight() / 20 * 16), (frameBuffer->getScreenHeight() / 20 * 2)); + + full_width = frameBuffer->getScreenWidth() - frameBuffer->getScreenX() - 2*ConnectLineBox_Width; if (g_settings.channellist_additional) - height = h_max ((frameBuffer->getScreenHeight() / 20 * 17), 0); + width = full_width / 3 * 2; + else + width = full_width; + + height = h_max ((frameBuffer->getScreenHeight() / 20 * 17), 0); + + x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - full_width) / 2; + if (x < ConnectLineBox_Width) + x = ConnectLineBox_Width; + y = frameBuffer->getScreenY(); CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, name.c_str()); @@ -503,27 +510,13 @@ void CChannelList::calcSize() height = theight + footerHeight + listmaxshow * fheight; info_height = 2*fheight + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getHeight() + 10; - if (g_settings.channellist_additional) - { - width = frameBuffer->getScreenWidth() / 3 * 2; - widthDetails = frameBuffer->getScreenWidth() - frameBuffer->getScreenX() - 2*ConnectLineBox_Width; - x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - widthDetails) / 2; - if (x < ConnectLineBox_Width) - x = ConnectLineBox_Width; - y = frameBuffer->getScreenY(); - infozone_width = widthDetails - width; - pig_width = infozone_width; - if (g_settings.channellist_additional == 2) // with miniTV - pig_height = (pig_width * 9) / 16; - else - pig_height = 0; - infozone_height = height - theight - pig_height - footerHeight; - } + infozone_width = full_width - width; + pig_width = infozone_width; + if (g_settings.channellist_additional == 2) // with miniTV + pig_height = (pig_width * 9) / 16; else - { - x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2; - y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - (height+ info_height)) / 2; - } + pig_height = 0; + infozone_height = height - theight - pig_height - footerHeight; } bool CChannelList::updateSelection(int newpos) @@ -913,10 +906,10 @@ void CChannelList::hide() { if (g_settings.channellist_additional == 2) // with miniTV { -// widthDetails = frameBuffer->getScreenWidth() - frameBuffer->getScreenX(); +// full_width = frameBuffer->getScreenWidth() - frameBuffer->getScreenX(); videoDecoder->Pig(-1, -1, -1, -1); } - frameBuffer->paintBackgroundBoxRel(x, y, widthDetails, height+ info_height+ 5); + frameBuffer->paintBackgroundBoxRel(x, y, full_width, height+ info_height+ 5); clearItem2DetailsLine(); } @@ -1505,7 +1498,7 @@ void CChannelList::paintDetails(int index) p_event = &chanlist[index]->currentEvent; } - frameBuffer->paintBoxRel(x+2, y + height + 2, widthDetails-4, info_height - 4, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE);//round + frameBuffer->paintBoxRel(x+2, y + height + 2, full_width-4, info_height - 4, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE);//round if (!p_event->description.empty()) { char cNoch[50] = {0}; // UTF-8 @@ -1529,7 +1522,7 @@ void CChannelList::paintDetails(int index) std::string text2= p_event->text; int xstart = 10; - if (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1, true) > (widthDetails - 30 - seit_len) ) + if (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1, true) > (full_width - 30 - seit_len) ) { // zu breit, Umbruch versuchen... int pos; @@ -1537,7 +1530,7 @@ void CChannelList::paintDetails(int index) pos = text1.find_last_of("[ -.]+"); if ( pos!=-1 ) text1 = text1.substr( 0, pos ); - } while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1, true) > (widthDetails - 30 - seit_len) ) ); + } while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1, true) > (full_width - 30 - seit_len) ) ); std::string text3 = ""; /* not perfect, but better than crashing... */ if (p_event->description.length() > text1.length()) @@ -1547,7 +1540,7 @@ void CChannelList::paintDetails(int index) text3= text3+ " - "; xstart += g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text3, true); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2* fheight, widthDetails - 30- noch_len, text3, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2* fheight, full_width - 30- noch_len, text3, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); } if (!(text2.empty())) { @@ -1556,7 +1549,7 @@ void CChannelList::paintDetails(int index) text2 = text2.substr( 0, text2.find('\n') ); #if 0 //FIXME: to discuss, eat too much cpu time if string long enough int pos = 0; - while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text2, true) > (widthDetails - 30 - noch_len) ) ) { + while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text2, true) > (full_width - 30 - noch_len) ) ) { pos = text2.find_last_of(" "); if ( pos!=-1 ) { @@ -1564,12 +1557,12 @@ void CChannelList::paintDetails(int index) } } #endif - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ xstart, y+ height+ 5+ 2* fheight, widthDetails- xstart- 30- noch_len, text2, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ xstart, y+ height+ 5+ 2* fheight, full_width- xstart- 30- noch_len, text2, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); } - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ fheight, widthDetails - 30 - seit_len, text1, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ widthDetails- 10- seit_len, y+ height+ 5+ fheight, seit_len, cSeit, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8 - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ widthDetails- 10- noch_len, y+ height+ 5+ 2* fheight, noch_len, cNoch, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ fheight, full_width - 30 - seit_len, text1, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- seit_len, y+ height+ 5+ fheight, seit_len, cSeit, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- noch_len, y+ height+ 5+ 2* fheight, noch_len, cNoch, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8 } if(g_settings.channellist_foot == 0) { transponder t; @@ -1581,7 +1574,7 @@ void CChannelList::paintDetails(int index) else desc = desc + " (" + CServiceManager::getInstance()->GetSatelliteName(chanlist[index]->getSatellitePosition()) + ")"; - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 3*fheight, widthDetails - 30, desc.c_str(), COL_MENUCONTENTDARK, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 3*fheight, full_width - 30, desc.c_str(), COL_MENUCONTENTDARK, 0, true); } else if( !displayNext && g_settings.channellist_foot == 1) { // next Event char buf[128] = {0}; @@ -1594,8 +1587,8 @@ void CChannelList::paintDetails(int index) snprintf(buf, sizeof(buf), "%s", CurrentNext.next_name.c_str()); int from_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(cFrom, true); // UTF-8 - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 3*fheight, widthDetails - 30 - from_len, buf, colored_event_N ? COL_COLORED_EVENTS_CHANNELLIST :COL_MENUCONTENTDARK, 0, true); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ widthDetails- 10- from_len, y+ height+ 5+ 3*fheight, from_len, cFrom, colored_event_N ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 3*fheight, full_width - 30 - from_len, buf, colored_event_N ? COL_COLORED_EVENTS_CHANNELLIST :COL_MENUCONTENTDARK, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- from_len, y+ height+ 5+ 3*fheight, from_len, cFrom, colored_event_N ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8 } } if ((g_settings.channellist_additional) && (p_event != NULL)) @@ -1627,7 +1620,7 @@ void CChannelList::paintItem2DetailsLine (int pos, int /*ch_index*/) details_line.paint(); //info box frame - frameBuffer->paintBoxFrame(x, ypos2, widthDetails, info_height, 2, col1, RADIUS_LARGE); + frameBuffer->paintBoxFrame(x, ypos2, full_width, info_height, 2, col1, RADIUS_LARGE); } } } @@ -1637,14 +1630,14 @@ void CChannelList::showChannelLogo() if(g_settings.infobar_show_channellogo){ static int logo_w = 0; static int logo_h = 0; - int logo_w_max = widthDetails / 4; - frameBuffer->paintBoxRel(x + widthDetails - logo_off - logo_w, y+(theight-logo_h)/2, logo_w, logo_h, COL_MENUHEAD_PLUS_0); + int logo_w_max = full_width / 4; + frameBuffer->paintBoxRel(x + full_width - logo_off - logo_w, y+(theight-logo_h)/2, logo_w, logo_h, COL_MENUHEAD_PLUS_0); std::string lname; if(g_PicViewer->GetLogoName(chanlist[selected]->channel_id, chanlist[selected]->getName(), lname, &logo_w, &logo_h)) { if((logo_h > theight) || (logo_w > logo_w_max)) g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, logo_w_max, theight); - g_PicViewer->DisplayImage(lname, x + widthDetails - logo_off - logo_w, y+(theight-logo_h)/2, logo_w, logo_h); + g_PicViewer->DisplayImage(lname, x + full_width - logo_off - logo_w, y+(theight-logo_h)/2, logo_w, logo_h); } } } @@ -1733,7 +1726,7 @@ void CChannelList::paintButtonBar(bool is_current) //paint buttons int y_foot = y + (height - footerHeight); - ::paintButtons(x, y_foot, widthDetails,num_buttons, Button, footerHeight,0,false,COL_INFOBAR_SHADOW,NULL,0,true, buttonID_rest); + ::paintButtons(x, y_foot, full_width,num_buttons, Button, footerHeight,0,false,COL_INFOBAR_SHADOW,NULL,0,true, buttonID_rest); } void CChannelList::paintItem(int pos) @@ -1975,18 +1968,18 @@ void CChannelList::paintHead() frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE, &iw3, &ih); // head - frameBuffer->paintBoxRel(x,y, widthDetails,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round + frameBuffer->paintBoxRel(x,y, full_width,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_INFO, x + widthDetails - iw1 - 10, y, theight); //y+ 5 ); - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MENU, x + widthDetails - iw1 - iw2 - 14, y, theight);//y + 5); // icon for bouquet list button + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_INFO, x + full_width - iw1 - 10, y, theight); //y+ 5 ); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MENU, x + full_width - iw1 - iw2 - 14, y, theight);//y + 5); // icon for bouquet list button if (g_settings.channellist_new_zap_mode) frameBuffer->paintIcon(this->new_mode_active ? NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE : NEUTRINO_ICON_BUTTON_MUTE_ZAP_INACTIVE, - x + widthDetails - iw1 - iw2 - iw3 - 18, y, theight); + x + full_width - iw1 - iw2 - iw3 - 18, y, theight); if (gotTime) { int iw3x = (g_settings.channellist_new_zap_mode) ? iw3 : -4; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + widthDetails - iw1 - iw2 - iw3x - 28 -timestr_len, + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + full_width - iw1 - iw2 - iw3x - 28 -timestr_len, y+theight, timestr_len, timestr, COL_MENUHEAD, 0, true); // UTF-8 timestr_len += 4; } @@ -1995,7 +1988,7 @@ void CChannelList::paintHead() if (g_settings.channellist_new_zap_mode) timestr_len += iw3 + 10; logo_off = timestr_len + 10; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, widthDetails - timestr_len, name, COL_MENUHEAD, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, full_width - timestr_len, name, COL_MENUHEAD, 0, true); // UTF-8 } void CChannelList::paint() diff --git a/src/gui/channellist.h b/src/gui/channellist.h index 4cc43c068..5218a2ee7 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -72,16 +72,16 @@ private: ZapitChannelList chanlist; CZapProtection* zapProtection; - int width; - int widthDetails; - int height; - int x; - int y; + int full_width; + int width; + int height; + int x; + int y; int logo_off; - int pig_width; - int pig_height; - int infozone_width; - int infozone_height; + int pig_width; + int pig_height; + int infozone_width; + int infozone_height; bool historyMode; bool vlist; // "virtual" list, not bouquet From aba592b157268d928e7185fe9702ba64350e5763 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 6 Feb 2013 21:19:49 +0100 Subject: [PATCH 29/86] channellist.cpp: fix restore to fullTV ... when turning miniTV off from the menu inside the channellist Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c6155f29b461fb70a50fc759f31e9913fe39bbf8 Author: vanhofen Date: 2013-02-06 (Wed, 06 Feb 2013) Origin message was: ------------------ - channellist.cpp: fix restore to fullTV ... when turning miniTV off from the menu inside the channellist ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 5 +++-- src/gui/channellist.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index b08e32b6f..524266775 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -110,6 +110,7 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl selected_chid = 0; this->new_mode_active = false; footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+6; //initial height value for buttonbar + previous_channellist_additional = -1; //printf("************ NEW LIST %s : %x\n", name.c_str(), (int) this);fflush(stdout); } @@ -433,6 +434,7 @@ int CChannelList::doChannelMenu(void) break; case 5: // settings { + previous_channellist_additional = g_settings.channellist_additional; COsdSetup osd_setup; osd_setup.showContextChanlistMenu(); //FIXME check font/options changed ? @@ -904,9 +906,8 @@ int CChannelList::show() void CChannelList::hide() { - if (g_settings.channellist_additional == 2) // with miniTV + if ((g_settings.channellist_additional == 2) || (previous_channellist_additional == 2)) // with miniTV { -// full_width = frameBuffer->getScreenWidth() - frameBuffer->getScreenX(); videoDecoder->Pig(-1, -1, -1, -1); } frameBuffer->paintBackgroundBoxRel(x, y, full_width, height+ info_height+ 5); diff --git a/src/gui/channellist.h b/src/gui/channellist.h index 5218a2ee7..4e22099f3 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -82,6 +82,7 @@ private: int pig_height; int infozone_width; int infozone_height; + int previous_channellist_additional; bool historyMode; bool vlist; // "virtual" list, not bouquet From c50fa440ac971e5bc22f3d60602226e8bd6a8f59 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 6 Feb 2013 22:14:10 +0100 Subject: [PATCH 30/86] yweb: rework Y_Tools_remote_osd.yhtm * use only one file to make osd-shots * add a (not really) zoom-function * add posibility to change filename * add needed locals * remove Y_Tools_fbshot.yhtm Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c2668d2f2cff77d13759afbcec9203a5ef35df7e Author: vanhofen Date: 2013-02-06 (Wed, 06 Feb 2013) Origin message was: ------------------ - yweb: rework Y_Tools_remote_osd.yhtm * use only one file to make osd-shots * add a (not really) zoom-function * add posibility to change filename * add needed locals * remove Y_Tools_fbshot.yhtm ------------------ This commit was generated by Migit --- src/nhttpd/web/Makefile.am | 1 - src/nhttpd/web/Y_Boxcontrol_Menue.yhtm | 7 ++-- src/nhttpd/web/Y_Main.css | 4 ++ src/nhttpd/web/Y_Tools_fbshot.yhtm | 56 -------------------------- src/nhttpd/web/Y_Tools_remote_osd.yhtm | 35 +++++++++++----- src/nhttpd/web/Y_Version.txt | 4 +- src/nhttpd/web/languages/Deutsch | 2 + src/nhttpd/web/languages/English | 2 + 8 files changed, 38 insertions(+), 73 deletions(-) delete mode 100644 src/nhttpd/web/Y_Tools_fbshot.yhtm diff --git a/src/nhttpd/web/Makefile.am b/src/nhttpd/web/Makefile.am index 7a1a58268..094ff6968 100644 --- a/src/nhttpd/web/Makefile.am +++ b/src/nhttpd/web/Makefile.am @@ -75,7 +75,6 @@ install_DATA = channels.js \ Y_Tools_Boxcontrol.yhtm \ Y_Tools_Check_Install.yhtm \ Y_Tools_Cmd.yhtm \ - Y_Tools_fbshot.yhtm \ Y_Tools_Flash_Menue.yhtm \ Y_Tools_Flash_Upload.yhtm \ Y_Tools_Info_Menue.yhtm \ diff --git a/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm b/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm index c75361b24..88d93b977 100644 --- a/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm +++ b/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm @@ -72,8 +72,7 @@ function init(){ {=var-set:lcshot={=if-file-exists:/bin/lcshot~true~{=if-file-exists:/var/bin/lcshot~true~false=}=}=} -{=var-set:fbshot={=if-file-exists:/bin/fbshot~true~{=if-file-exists:/var/bin/fbshot~true~{=if-file-exists:/bin/dboxshot~true~{=if-file-exists:/var/bin/dboxshot~true~false=}=}=}=}=} -{=var-set:dboxshot={=if-file-exists:/bin/dboxshot~true~{=if-file-exists:/var/bin/dboxshot~true~false=}=}=} +{=var-set:fbshot={=if-file-exists:/bin/fbshot~true~{=if-file-exists:/var/bin/fbshot~true~false=}=}=}

{=L:main.boxcontrol=}

@@ -106,13 +105,13 @@ function init(){
  • {=if-equal:{=var-get:fbshot=}~true~ - {=L:bc.menue.osd_screenshot=} + {=L:bc.menue.osd_screenshot=} ~ {=L:bc.menue.osd_screenshot=} =}
  • - {=if-equal:{=var-get:dboxshot=}~true~ + {=if-equal:{=var-get:fbshot=}~true~ {=L:bc.menue.remote_osd=} ~ {=L:bc.menue.remote_osd=} diff --git a/src/nhttpd/web/Y_Main.css b/src/nhttpd/web/Y_Main.css index 83ec64950..45255fb96 100644 --- a/src/nhttpd/web/Y_Main.css +++ b/src/nhttpd/web/Y_Main.css @@ -853,4 +853,8 @@ td.shot { } img#shot { width: 100%; + background-color: #ffffff; +} +img#shot:hover { + cursor: pointer; } diff --git a/src/nhttpd/web/Y_Tools_fbshot.yhtm b/src/nhttpd/web/Y_Tools_fbshot.yhtm deleted file mode 100644 index 9b16935f4..000000000 --- a/src/nhttpd/web/Y_Tools_fbshot.yhtm +++ /dev/null @@ -1,56 +0,0 @@ -{=var-set:cancache=yPInstall=} -{=include-block:Y_Blocks.txt;head=} - - - - -{=var-set:wait_text={=L:bc.osd.shap_wait_text=}=}{=include-block:Y_Blocks.txt;snip_wait=} -
    -
    - {=var-set:help_url=Help-BoxControl-OSD_Screenshot=}{=var-set:menu={=L:bc.menue.osd_screenshot=}=}{=include-block:Y_Blocks.txt;work_menu=}
    -
    - - {=var-set:dboxshot={=if-file-exists:/bin/dboxshot~true~{=if-file-exists:/var/bin/dboxshot~true~false=}=}=} - -  Filename: -
    - -
    -
    - - diff --git a/src/nhttpd/web/Y_Tools_remote_osd.yhtm b/src/nhttpd/web/Y_Tools_remote_osd.yhtm index 476286fa0..4a30ff29f 100644 --- a/src/nhttpd/web/Y_Tools_remote_osd.yhtm +++ b/src/nhttpd/web/Y_Tools_remote_osd.yhtm @@ -7,14 +7,16 @@ function rcsim(_key) { $('statusline').show(); $('buttons').hide(); dbox_rcsim(_key); - window.setTimeout("do_dboxshot()",750); + window.setTimeout("do_snapshot()",750); } -function do_dboxshot(){ - var res = dbox_exec_tools("fbshot fb /tmp/a.png"); +function do_snapshot(){ + var filename = id("filename").value; + var res = dbox_exec_tools("fbshot fb /tmp/"+filename+".png"); var _shot = document.getElementById("shot"); - _shot.src = "/tmp/a.png?"+Math.random(); + _shot.src = "/tmp/"+filename+".png?"+Math.random(); $('statusline').hide(); $('buttons').show(); + show_obj("shot", true); } function do_clearshot(){ window.setTimeout("do_clearshot2()", 500); @@ -22,26 +24,39 @@ function do_clearshot(){ function do_clearshot2(){ dbox_exec_tools("fbshot_clear"); } +function do_zoomshot(){ + // not a really zoom-function + var _remote = document.getElementById('remote'); + + if (_remote.style.display == 'none') + _remote.style.display='inline'; + else + _remote.style.display='none'; +} //]]> - -
    + +
    {=var-set:help_url=Help-BoxControl-Remote_OSD=}{=var-set:menu={=L:bc.menue.remote_osd=}=}{=include-block:Y_Blocks.txt;work_menu=}
    - + wait
    -
    + {=include-block:Y_Blocks.txt;remote=} - +
    diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index 224de84ad..6e468eaee 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.8.0.32 -date=04.02.2013 +version=2.8.0.33 +date=06.02.2013 type=Release info=Port Coolstream diff --git a/src/nhttpd/web/languages/Deutsch b/src/nhttpd/web/languages/Deutsch index 54c919d3e..95a5977ee 100644 --- a/src/nhttpd/web/languages/Deutsch +++ b/src/nhttpd/web/languages/Deutsch @@ -51,6 +51,7 @@ check=Prüfen help=Hilfe attention=Achtung! directory=Verzeichnis +filename=Dateiname restriced_by_management_ip=Zugriff verwehrt wg. ManagementIP # ==========Main Menue @@ -128,6 +129,7 @@ bc.msg.send_message=Nachricht senden ======== Boxcontrol - Remote & OSD bc.osd.shot=Schnappschuss bc.osd.delete_shots=Schnappschuss löschen +bc.osd.zoom_shot=Schnappschuss zoomen bc.osd.shap_wait_text=Schnappschuss wird erstellt ======== Boxcontrol - TV-Screenshot diff --git a/src/nhttpd/web/languages/English b/src/nhttpd/web/languages/English index b4a2e43e9..4bedd9afa 100644 --- a/src/nhttpd/web/languages/English +++ b/src/nhttpd/web/languages/English @@ -51,6 +51,7 @@ check=check help=Help attention=Attention! directory=Directory +filename=Filename restriced_by_management_ip=restricted by ManagementIP #========= MAIN Menue @@ -130,6 +131,7 @@ bc.msg.send_message=send message ======== Boxcontrol - Remote & OSD bc.osd.shot=Shot bc.osd.delete_shots=Delete shots +bc.osd.zoom_shot=Zoom shot bc.osd.shap_wait_text=Take Snapshot ======== Boxcontrol - TV-Screenshot From 132c4abd7886941a4230443e160164de2cfbe853 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sat, 9 Feb 2013 10:36:11 +0100 Subject: [PATCH 31/86] channellist.cpp: add epg-desc to blue button ... ... if g_settings.channellist_additional is not off. initially patch by TangoCash with marginal modifications Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/31080fa98c63942d32e21389bdaca0a14438228f Author: TangoCash Date: 2013-02-09 (Sat, 09 Feb 2013) Origin message was: ------------------ - channellist.cpp: add epg-desc to blue button ... ... if g_settings.channellist_additional is not off. initially patch by TangoCash with marginal modifications ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 115 ++++++++++++++++++++++++++++++++++++++-- src/gui/channellist.h | 8 +++ 2 files changed, 119 insertions(+), 4 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 524266775..cc0189d75 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -452,6 +452,7 @@ int CChannelList::doChannelMenu(void) int CChannelList::exec() { displayNext = 0; // always start with current events + displayList = 1; // always start with event list int nNewChannel = show(); if ( nNewChannel > -1 && nNewChannel < (int) chanlist.size()) { if(this->historyMode && chanlist[nNewChannel]) { @@ -698,6 +699,7 @@ int CChannelList::show() } else if (msg == CRCInput::RC_up || (int) msg == g_settings.key_channelList_pageup) { + displayList = 1; int step = ((int) msg == g_settings.key_channelList_pageup) ? listmaxshow : 1; // browse or step 1 int new_selected = selected - step; if (new_selected < 0) { @@ -710,6 +712,7 @@ int CChannelList::show() } else if (msg == CRCInput::RC_down || (int) msg == g_settings.key_channelList_pagedown) { + displayList = 1; int step = ((int) msg == g_settings.key_channelList_pagedown) ? listmaxshow : 1; // browse or step 1 int new_selected = selected + step; if (new_selected >= (int) chanlist.size()) { @@ -840,9 +843,16 @@ int CChannelList::show() } else if ( msg == CRCInput::RC_blue ) { - displayNext = !displayNext; + if (g_settings.channellist_additional) + displayList = !displayList; + else + displayNext = !displayNext; + paintHead(); // update button bar paint(); + + if (!displayList && g_settings.channellist_additional) + showdescription(selected); } else if ( msg == CRCInput::RC_green ) { @@ -1683,10 +1693,20 @@ void CChannelList::paintButtonBar(bool is_current) int Bindex = 2 + (smode ? 1:0); //manage now/next button - if (displayNext) - Button[Bindex].locale = LOCALE_INFOVIEWER_NOW; + if (g_settings.channellist_additional) + { + if (displayList) + Button[Bindex].locale = LOCALE_FONTSIZE_CHANNELLIST_DESCR; + else + Button[Bindex].locale = LOCALE_FONTMENU_EVENTLIST; + } else - Button[Bindex].locale = LOCALE_INFOVIEWER_NEXT; + { + if (displayNext) + Button[Bindex].locale = LOCALE_INFOVIEWER_NOW; + else + Button[Bindex].locale = LOCALE_INFOVIEWER_NEXT; + } Bindex++; //manage record button @@ -2177,3 +2197,90 @@ void CChannelList::readEvents(const t_channel_id channel_id) return; } + +void CChannelList::showdescription(int index) +{ + CZapitChannel* chan = chanlist[index]; + CChannelEvent *p_event=NULL; + p_event = &chan->currentEvent; + epgData.info2.clear(); + epgText.clear(); + CEitManager::getInstance()->getEPGid(p_event->eventID, p_event->startTime, &epgData); + if (!(epgData.info2.empty())) + { + int ffheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getHeight(); + frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUCONTENT_PLUS_0); + processTextToArray(epgData.info2); + for (unsigned int i = 1; (i < epgText.size()+1) && ((y+ theight+ pig_height + i*ffheight) < (y+ theight+ pig_height + infozone_height)); i++) + { + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, infozone_width - 20, epgText[i-1].first, COL_MENUCONTENTDARK , 0, true); + } + } +} + +void CChannelList::addTextToArray(const std::string & text, int screening) // UTF-8 +{ + //printf("line: >%s<\n", text.c_str() ); + if (text==" ") + { + emptyLineCount ++; + if (emptyLineCount<2) + { + epgText.push_back(epg_pair(text,screening)); + } + } + else + { + emptyLineCount = 0; + epgText.push_back(epg_pair(text,screening)); + } +} + +void CChannelList::processTextToArray(std::string text, int screening) // UTF-8 +{ + std::string aktLine = ""; + std::string aktWord = ""; + int aktWidth = 0; + text += ' '; + char* text_= (char*) text.c_str(); + + while (*text_!=0) + { + if ( (*text_==' ') || (*text_=='\n') || (*text_=='-') || (*text_=='.') ) + { + if (*text_!='\n') + aktWord += *text_; + + int aktWordWidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getRenderWidth(aktWord, true); + if ((aktWordWidth+aktWidth)<(infozone_width - 20)) + {//space ok, add + aktWidth += aktWordWidth; + aktLine += aktWord; + + if (*text_=='\n') + { //enter-handler + addTextToArray( aktLine, screening ); + aktLine = ""; + aktWidth= 0; + } + aktWord = ""; + } + else + {//new line needed + addTextToArray( aktLine, screening); + aktLine = aktWord; + aktWidth = aktWordWidth; + aktWord = ""; + if (*text_=='\n') + continue; + } + } + else + { + aktWord += *text_; + } + text_++; + } + //add the rest + addTextToArray( aktLine + aktWord, screening ); +} diff --git a/src/gui/channellist.h b/src/gui/channellist.h index 4e22099f3..699f404d1 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -84,9 +84,11 @@ private: int infozone_height; int previous_channellist_additional; + CEPGData epgData; bool historyMode; bool vlist; // "virtual" list, not bouquet bool displayNext; + bool displayList; int info_height; bool new_mode_active; @@ -108,6 +110,12 @@ private: void paint_events(int index); CChannelEventList evtlist; void readEvents(const t_channel_id channel_id); + void showdescription(int index); + typedef std::pair epg_pair; + std::vector epgText; + int emptyLineCount; + void addTextToArray( const std::string & text, int screening ); + void processTextToArray(std::string text, int screening = 0); public: CChannelList(const char * const Name, bool historyMode = false, bool _vlist = false, bool new_mode_active = false ); From dd85ec4ee5cdbc7d90a5e176d473e534bc4f34ac Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sun, 10 Feb 2013 10:17:42 +0100 Subject: [PATCH 32/86] update_ext.cpp: Fix wildcard handling for delete list Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/de36ce60c421f0a5991a230b0bbbf950e07d8b7f Author: Michael Liebmann Date: 2013-02-10 (Sun, 10 Feb 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/update_ext.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gui/update_ext.cpp b/src/gui/update_ext.cpp index 50619921f..601b11647 100644 --- a/src/gui/update_ext.cpp +++ b/src/gui/update_ext.cpp @@ -596,13 +596,13 @@ bool CExtUpdate::readBackupList(const std::string & dstPath) // read DeleteList for(it = deleteList.begin(); it != deleteList.end(); ++it) { line = *it; - if (lstat(line.c_str(), &FileInfo) != -1) { - if ((line.find("*") != std::string::npos) || (line.find("?") != std::string::npos)) { - // Wildcards - WRITE_UPDATE_LOG("delete file list: %s\n", line.c_str()); - deleteFileList(line.c_str()); - } - else if (S_ISREG(FileInfo.st_mode)) { + if ((line.find("*") != std::string::npos) || (line.find("?") != std::string::npos)) { + // Wildcards + WRITE_UPDATE_LOG("delete file list: %s\n", line.c_str()); + deleteFileList(line.c_str()); + } + else if (lstat(line.c_str(), &FileInfo) != -1) { + if (S_ISREG(FileInfo.st_mode)) { // File WRITE_UPDATE_LOG("delete file: %s\n", line.c_str()); unlink(line.c_str()); From 8b1b3b1418e83e3982a43508b554de0eb831067b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 10 Feb 2013 21:03:43 +0100 Subject: [PATCH 33/86] channellist.cpp: enable to lock new_zap_mode Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/15d787f79bd8424b03e3e6112d8a14fabb0ef392 Author: vanhofen Date: 2013-02-10 (Sun, 10 Feb 2013) Origin message was: ------------------ - channellist.cpp: enable to lock new_zap_mode ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 3 +++ data/locale/english.locale | 3 +++ src/gui/channellist.cpp | 26 ++++++++++++++++---------- src/gui/channellist.h | 3 +-- src/gui/miscsettings_menu.cpp | 9 ++++++++- src/system/locals.h | 3 +++ src/system/locals_intern.h | 3 +++ 7 files changed, 37 insertions(+), 13 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 4fd9fcb3b..765b6a7cd 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -225,6 +225,9 @@ channellist.make_hdlist Erzeuge Bouquet mit HD-Kanälen channellist.make_newlist Erzeuge Bouquet mit neuen Kanälen channellist.make_removedlist Erzeuge Bouquet mit gelöschten Kanälen channellist.new_zap_mode Quickzap in Liste +channellist.new_zap_mode_active aktiv +channellist.new_zap_mode_allow erlauben +channellist.new_zap_mode_off aus channellist.nonefound Es wurden keine Kanäle gefunden!\nFühren Sie bitte eine Kanalsuche durch\n(MENU-Taste -> Service) channellist.provs Anbieter channellist.recording_not_possible Aufnahme nicht möglich! diff --git a/data/locale/english.locale b/data/locale/english.locale index d056c15a4..dd9e2e276 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -225,6 +225,9 @@ channellist.make_hdlist Create list of HD channels channellist.make_newlist Create list of new channels channellist.make_removedlist Create list of removed channels channellist.new_zap_mode Quickzap in list +channellist.new_zap_mode_active active +channellist.new_zap_mode_allow allow +channellist.new_zap_mode_off off channellist.nonefound No channels were found!\nPlease execute a scan\n(MENU-key -> service) channellist.provs Providers channellist.recording_not_possible Recording not possible! diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index cc0189d75..c1e34f806 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -96,7 +96,7 @@ extern cVideo * videoDecoder; #define ConnectLineBox_Width 16 -CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vlist, bool ) +CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vlist) { frameBuffer = CFrameBuffer::getInstance(); name = pName; @@ -108,7 +108,6 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl this->historyMode = phistoryMode; vlist = _vlist; selected_chid = 0; - this->new_mode_active = false; footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+6; //initial height value for buttonbar previous_channellist_additional = -1; //printf("************ NEW LIST %s : %x\n", name.c_str(), (int) this);fflush(stdout); @@ -539,7 +538,7 @@ bool CChannelList::updateSelection(int newpos) showChannelLogo(); } - if(this->new_mode_active && SameTP()) { + if((g_settings.channellist_new_zap_mode == 2 /* active */) && SameTP()) { actzap = true; zapTo(selected); } @@ -563,8 +562,6 @@ int CChannelList::show() return res; } - this->new_mode_active = 0; - calcSize(); displayNext = false; @@ -777,7 +774,17 @@ int CChannelList::show() } else if (( msg == CRCInput::RC_spkr ) && g_settings.channellist_new_zap_mode ) { if(CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_ts) { - this->new_mode_active = (this->new_mode_active ? 0 : 1); + switch (g_settings.channellist_new_zap_mode) { + case 2: /* active */ + g_settings.channellist_new_zap_mode = 1; /* allow */ + break; + case 1: /* allow */ + g_settings.channellist_new_zap_mode = 2; /* active */ + break; + default: + break; + + } paintHead(); showChannelLogo(); } @@ -900,7 +907,6 @@ int CChannelList::show() res = bouquetList->exec(true); printf("CChannelList:: bouquetList->exec res %d\n", res); } - this->new_mode_active = 0; if(NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode()) return -1; @@ -1151,7 +1157,7 @@ void CChannelList::zapTo(int pos, bool /* forceStoreToLastChannels */) zapToChannel(chan); tuned = pos; - if(this->new_mode_active) + if(g_settings.channellist_new_zap_mode == 2 /* active */) selected_in_new_mode = pos; else selected = pos; @@ -1187,7 +1193,7 @@ void CChannelList::zapToChannel(CZapitChannel *channel) g_RemoteControl->zapTo_ChannelID(channel->getChannelID(), channel->getName(), !channel->bAlwaysLocked); CNeutrinoApp::getInstance()->channelList->adjustToChannelID(channel->getChannelID()); } - if(!this->new_mode_active) { + if(g_settings.channellist_new_zap_mode != 2 /* not active */) { /* remove recordModeActive from infobar */ if(g_settings.auto_timeshift && !CNeutrinoApp::getInstance()->recordingstatus) { g_InfoViewer->handleMsg(NeutrinoMessages::EVT_RECORDMODE, 0); @@ -1994,7 +2000,7 @@ void CChannelList::paintHead() frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_INFO, x + full_width - iw1 - 10, y, theight); //y+ 5 ); frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MENU, x + full_width - iw1 - iw2 - 14, y, theight);//y + 5); // icon for bouquet list button if (g_settings.channellist_new_zap_mode) - frameBuffer->paintIcon(this->new_mode_active ? + frameBuffer->paintIcon((g_settings.channellist_new_zap_mode == 2 /* active */) ? NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE : NEUTRINO_ICON_BUTTON_MUTE_ZAP_INACTIVE, x + full_width - iw1 - iw2 - iw3 - 18, y, theight); diff --git a/src/gui/channellist.h b/src/gui/channellist.h index 699f404d1..567e9dce8 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -91,7 +91,6 @@ private: bool displayList; int info_height; - bool new_mode_active; int ChannelList_Rec; void paintDetails(int index); @@ -118,7 +117,7 @@ private: void processTextToArray(std::string text, int screening = 0); public: - CChannelList(const char * const Name, bool historyMode = false, bool _vlist = false, bool new_mode_active = false ); + CChannelList(const char * const Name, bool historyMode = false, bool _vlist = false); ~CChannelList(); void SetChannelList(ZapitChannelList* channels); diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 9cb4d2692..97f6b0214 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -134,6 +134,13 @@ const CMenuOptionChooser::keyval MISCSETTINGS_FILESYSTEM_IS_UTF8_OPTIONS[MISCSET { 1, LOCALE_FILESYSTEM_IS_UTF8_OPTION_UTF8 } }; +#define CHANNELLIST_NEW_ZAP_MODE_OPTION_COUNT 3 +const CMenuOptionChooser::keyval CHANNELLIST_NEW_ZAP_MODE_OPTIONS[CHANNELLIST_NEW_ZAP_MODE_OPTION_COUNT] = +{ + { 0, LOCALE_CHANNELLIST_NEW_ZAP_MODE_OFF }, + { 1, LOCALE_CHANNELLIST_NEW_ZAP_MODE_ALLOW }, + { 2, LOCALE_CHANNELLIST_NEW_ZAP_MODE_ACTIVE } +}; #ifdef CPU_FREQ #define CPU_FREQ_OPTION_COUNT 13 @@ -392,7 +399,7 @@ void CMiscMenue::showMiscSettingsMenuChanlist(CMenuWidget *ms_chanlist) mc->setHint("", LOCALE_MENU_HINT_ZAP_CYCLE); ms_chanlist->addItem(mc); - mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_NEW_ZAP_MODE, &g_settings.channellist_new_zap_mode, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true ); + mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_NEW_ZAP_MODE, &g_settings.channellist_new_zap_mode, CHANNELLIST_NEW_ZAP_MODE_OPTIONS, CHANNELLIST_NEW_ZAP_MODE_OPTION_COUNT, true ); mc->setHint("", LOCALE_MENU_HINT_NEW_ZAP_MODE); ms_chanlist->addItem(mc); } diff --git a/src/system/locals.h b/src/system/locals.h index a92c67abd..709e86e34 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -252,6 +252,9 @@ typedef enum LOCALE_CHANNELLIST_MAKE_NEWLIST, LOCALE_CHANNELLIST_MAKE_REMOVEDLIST, LOCALE_CHANNELLIST_NEW_ZAP_MODE, + LOCALE_CHANNELLIST_NEW_ZAP_MODE_ACTIVE, + LOCALE_CHANNELLIST_NEW_ZAP_MODE_ALLOW, + LOCALE_CHANNELLIST_NEW_ZAP_MODE_OFF, LOCALE_CHANNELLIST_NONEFOUND, LOCALE_CHANNELLIST_PROVS, LOCALE_CHANNELLIST_RECORDING_NOT_POSSIBLE, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index d65c50631..692062856 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -252,6 +252,9 @@ const char * locale_real_names[] = "channellist.make_newlist", "channellist.make_removedlist", "channellist.new_zap_mode", + "channellist.new_zap_mode_active", + "channellist.new_zap_mode_allow", + "channellist.new_zap_mode_off", "channellist.nonefound", "channellist.provs", "channellist.recording_not_possible", From b9eccd608c34cf38070434367f8041afa696d124 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 10 Feb 2013 22:00:22 +0100 Subject: [PATCH 34/86] neutrino.cpp: remove double determination of g_info.delivery_system Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c4f8bf17a96da94a3233e4a7b928149066b63088 Author: vanhofen Date: 2013-02-10 (Sun, 10 Feb 2013) Origin message was: ------------------ - neutrino.cpp: remove double determination of g_info.delivery_system ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index f7e09d56b..d37359229 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1828,8 +1828,6 @@ TIMER_START(); cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000); g_info.delivery_system = CFEManager::getInstance()->getLiveFE()->getInfo()->type == FE_QPSK ? DVB_S : DVB_C; - - g_info.delivery_system = CFEManager::getInstance()->getLiveFE()->getInfo()->type == FE_QPSK ? DVB_S : DVB_C; #if HAVE_TRIPLEDRAGON /* only SAT-hd1 before rev 8 has fan, rev 1 is TD (compat hack) */ g_info.has_fan = (cs_get_revision() > 1 && cs_get_revision() < 8 && g_info.delivery_system == DVB_S); From 111fd98545c3015a65c23db832513534da412cc8 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 10 Feb 2013 23:25:16 +0100 Subject: [PATCH 35/86] yweb: supplement to c50fa440ac971e5bc22f3d60602226e8bd6a8f59 * add a background-image to zoomshot-button Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e2b22e656e9bc553b6060348eae186ed4f3a1885 Author: vanhofen Date: 2013-02-10 (Sun, 10 Feb 2013) Origin message was: ------------------ - yweb: supplement to c50fa440ac971e5bc22f3d60602226e8bd6a8f59 * add a background-image to zoomshot-button ------------------ This commit was generated by Migit --- src/nhttpd/web/Y_Main.css | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nhttpd/web/Y_Main.css b/src/nhttpd/web/Y_Main.css index 45255fb96..15a1b39f5 100644 --- a/src/nhttpd/web/Y_Main.css +++ b/src/nhttpd/web/Y_Main.css @@ -39,6 +39,7 @@ button[ytype="timedown"]{background-image:url(/images/time_down.png);} button[ytype="timeadd"]{background-image:url(/images/time_add.png);} button[ytype="shot"]{background-image:url(/images/snapshot.png);} button[ytype="clearshot"]{background-image:url(/images/remove.png);} +button[ytype="zoomshot"]{background-image:url(/images/fullscreen.png);} button[ytype="go"]{background-image:url(/images/accept.png);} button[ytype="download"]{background-image:url(/images/wget.gif);} button[ytype="clear"]{background-image:url(/images/remove.png);} From ce549b87b4e682ac35f4a72b891ec42238789772 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 11 Feb 2013 10:39:34 +0100 Subject: [PATCH 36/86] src/gui/infoviewer.cpp: fix channel name getRenderWidth for unicode Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/158ad4243f4697fbe596e529264391eb35ed2517 Author: Jacek Jendrzej Date: 2013-02-11 (Mon, 11 Feb 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/infoviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index b495afb1f..497140554 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -717,7 +717,7 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con std::string prov_name = pname; prov_name=prov_name.substr(prov_name.find_first_of("]")+1); - int chname_width = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth (ChannelName); + int chname_width = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth (ChannelName, true);// UTF-8 chname_width += (chname_width/(ChannelName.size()-1)/2); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString( ChanNameX + 10 + ChanNumWidth + chname_width, ChanNameY + time_height -SHADOW_OFFSET/2, From f1476814eafe2994132f4a3ec38a13985a8e8b29 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 12 Feb 2013 11:31:41 +0100 Subject: [PATCH 37/86] yweb: add the workbox around the remote control Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9feb5249a4c7f14dce6003fdc34d40f264f09830 Author: vanhofen Date: 2013-02-12 (Tue, 12 Feb 2013) Origin message was: ------------------ - yweb: add the workbox around the remote control ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/web/Y_Tools_Rcsim.yhtm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/nhttpd/web/Y_Tools_Rcsim.yhtm b/src/nhttpd/web/Y_Tools_Rcsim.yhtm index ff2157ed7..cad052b82 100644 --- a/src/nhttpd/web/Y_Tools_Rcsim.yhtm +++ b/src/nhttpd/web/Y_Tools_Rcsim.yhtm @@ -18,6 +18,12 @@ function rcsim(_key) -{=include-block:Y_Blocks.txt;remote=} +
    +
    + {=var-set:help_url==}{=var-set:menu={=L:bc.menue.remote=}=}{=include-block:Y_Blocks.txt;work_menu=}
    +
    + {=include-block:Y_Blocks.txt;remote=} +
    +
    From 6e650d822b1898d16fd45383ddc075d6e33c1704 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 12 Feb 2013 13:21:43 +0100 Subject: [PATCH 38/86] yweb: fix a little syntax error in Y_Settings_nhttpd.yhtm Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/08fd651d6070e4e1c891134822e0a2f01f4d4d21 Author: vanhofen Date: 2013-02-12 (Tue, 12 Feb 2013) Origin message was: ------------------ - yweb: fix a little syntax error in Y_Settings_nhttpd.yhtm ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/web/Y_Settings_nhttpd.yhtm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nhttpd/web/Y_Settings_nhttpd.yhtm b/src/nhttpd/web/Y_Settings_nhttpd.yhtm index 655e54b5b..5418e22a4 100644 --- a/src/nhttpd/web/Y_Settings_nhttpd.yhtm +++ b/src/nhttpd/web/Y_Settings_nhttpd.yhtm @@ -99,7 +99,7 @@ function do_submit() {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ {=L:set.nhttpd.ips_without_keep_alive=}
    {=L:set.nhttpd.ips_without_keep_alive_desc=} - + =} From fb7b462bbd4cf101233182f9d6a0364f1feb19fc Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 12 Feb 2013 13:58:21 +0100 Subject: [PATCH 39/86] controlapi.cpp: make ScreenshotCGI() more configurable Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/133740da14553a69695fd5561967210343ca4a2b Author: vanhofen Date: 2013-02-12 (Tue, 12 Feb 2013) Origin message was: ------------------ - controlapi.cpp: make ScreenshotCGI() more configurable ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/doc/nhttpd_controlapi.html | 12 +++++++++--- .../tuxboxapi/coolstream/controlapi.cpp | 19 ++++++++++++++++--- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/nhttpd/doc/nhttpd_controlapi.html b/src/nhttpd/doc/nhttpd_controlapi.html index e87fa6c56..2632352cc 100644 --- a/src/nhttpd/doc/nhttpd_controlapi.html +++ b/src/nhttpd/doc/nhttpd_controlapi.html @@ -1829,11 +1829,17 @@ Die Pluginliste wird neu geladen.
    42. Screenshot erstellen
    Handler: http://dbox/control/screenshot

    -Parameter: keine
    -Rükgabe: ok
    +Parameter: name=<dateiname>&osd=1|0&video=1|0

    +Rückgabe: ok

    -Screenshot mit TV Bild und OSD wird erstellt und unter /tmp/screenshot.png abgelegt. +Screenshot mit TV Bild und OSD wird erstellt und unter /tmp/<dateiname>.png abgelegt.
    +
    +Beispiel:
    +
    +>>>http://dbox/control/screenshot?osd=0&video=1
    +ok
      

    diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index f212fab5f..8434428db 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -1463,10 +1463,23 @@ void CControlAPI::ReloadPluginsCGI(CyhookHandler *hh) void CControlAPI::ScreenshotCGI(CyhookHandler *hh) { - CScreenShot * sc = new CScreenShot("/tmp/screenshot.png", (CScreenShot::screenshot_format_t)0 /*PNG*/); - sc->EnableOSD(true); + bool enableOSD = true; + bool enableVideo = true; + std::string filename = "screenshot"; + + if(hh->ParamList["osd"] == "0") + enableOSD = false; + if(hh->ParamList["video"] == "0") + enableVideo = false; + if(hh->ParamList["name"] != "") + filename = hh->ParamList["name"]; + + CScreenShot * sc = new CScreenShot("/tmp/" + filename + ".png", (CScreenShot::screenshot_format_t)0 /*PNG*/); + sc->EnableOSD(enableOSD); + sc->EnableVideo(enableVideo); sc->Start(); - hh->SendOk(); + + hh->SendOk(); // FIXME what if sc->Start() failed? } //----------------------------------------------------------------------------- From 75aa795138abe834754414e50ca54a38319e3801 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 12 Feb 2013 15:34:07 +0100 Subject: [PATCH 40/86] sectionsd.cpp: Remove invalid events (duration <= 1 sec.) from event list Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6e9cc3d8376365897f59e9cf3acd86b00940a99f Author: Michael Liebmann Date: 2013-02-12 (Tue, 12 Feb 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/eitd/sectionsd.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 412c860cd..fe421da58 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -1537,8 +1537,19 @@ bool CEventsThread::addEvents() for (SIevents::const_iterator e = eit.events().begin(); e != eit.events().end(); ++e) { if (!(e->times.empty())) { +#if 0 if ( ( e->times.begin()->startzeit < zeit + secondsToCache ) && - ( ( e->times.begin()->startzeit + (long)e->times.begin()->dauer ) > zeit - oldEventsAre ) ) + ( ( e->times.begin()->startzeit + (long)e->times.begin()->dauer ) > zeit - oldEventsAre ) && + ( e->times.begin()->dauer < 60 ) ) { + char x_startTime[10]; + struct tm *x_tmStartTime = localtime(&e->times.begin()->startzeit); + strftime(x_startTime, sizeof(x_startTime)-1, "%H:%M", x_tmStartTime ); + printf("####[%s - #%d] - startzeit: %s, dauer: %d, channel_id: 0x%llX\n", __FUNCTION__, __LINE__, x_startTime, e->times.begin()->dauer, e->get_channel_id()); + } +#endif + if ( ( e->times.begin()->startzeit < zeit + secondsToCache ) && + ( ( e->times.begin()->startzeit + (long)e->times.begin()->dauer ) > zeit - oldEventsAre ) && + ( e->times.begin()->dauer > 1 ) ) { addEvent(*e, wait_for_time ? zeit: 0, e->table_id == 0x4e); event_count++; From 177ebb4fba2e074f1e80b2ec2ff18547676b7e39 Mon Sep 17 00:00:00 2001 From: tomworld Date: Tue, 12 Feb 2013 07:59:23 +0100 Subject: [PATCH 41/86] channellist.cpp: Use extra font for event list Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/105c6b4c705003bd937e7979d82035192f956351 Author: tomworld Date: 2013-02-12 (Tue, 12 Feb 2013) Origin message was: ------------------ * channellist.cpp: Use extra font for event list ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 3 ++- src/gui/channellist.cpp | 15 ++++++++------- src/gui/channellist.h | 2 ++ src/gui/osd_setup.cpp | 6 ++++-- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + src/system/settings.h | 17 +++++++++-------- 8 files changed, 28 insertions(+), 18 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 765b6a7cd..725eee14d 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -523,6 +523,7 @@ fontmenu.sizes Schriftgrössen fontsize.channel_num_zap Direktauswahl fontsize.channellist Kanalliste fontsize.channellist_descr Beschreibung +fontsize.channellist_event Eventliste fontsize.channellist_number Nummer fontsize.epg_date EPG Datum fontsize.epg_info1 EPG Info 1 diff --git a/data/locale/english.locale b/data/locale/english.locale index dd9e2e276..f02f9fd0b 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -523,12 +523,13 @@ fontmenu.sizes Font sizes fontsize.channel_num_zap direct selection fontsize.channellist Channellist fontsize.channellist_descr Description +fontsize.channellist_event Event list fontsize.channellist_number Number fontsize.epg_date EPG Date fontsize.epg_info1 EPG Info 1 fontsize.epg_info2 EPG Info 2 fontsize.epg_title EPG Title -fontsize.eventlist_datetime Date / Dime +fontsize.eventlist_datetime Date / Time fontsize.eventlist_itemlarge Large fontsize.eventlist_itemsmall Small fontsize.eventlist_title Title diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index c1e34f806..d3042a094 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -110,6 +110,7 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl selected_chid = 0; footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+6; //initial height value for buttonbar previous_channellist_additional = -1; + eventFont = SNeutrinoSettings::FONT_TYPE_CHANNELLIST_EVENT; //printf("************ NEW LIST %s : %x\n", name.c_str(), (int) this);fflush(stdout); } @@ -2119,6 +2120,7 @@ void CChannelList::paint_pig (int _x, int _y, int w, int h) void CChannelList::paint_events(int index) { + ffheight = g_Font[eventFont]->getHeight(); readEvents(chanlist[index]->channel_id); frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUCONTENT_PLUS_0); @@ -2127,7 +2129,6 @@ void CChannelList::paint_events(int index) CChannelEventList::iterator e; time_t azeit; time(&azeit); - int ffheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getHeight(); if ( evtlist.empty() ) { @@ -2166,11 +2167,11 @@ void CChannelList::paint_events(int index) struct tm *tmStartZeit = localtime(&e->startTime); strftime(startTime, sizeof(startTime), "%H:%M", tmStartZeit ); //printf("%s %s\n", startTime, e->description.c_str()); - startTimeWidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getRenderWidth("88:88"); // use a fixed value - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, startTimeWidth, startTime, COL_MENUCONTENTINACTIVE, 0, true); + startTimeWidth = g_Font[eventFont]->getRenderWidth("88:88"); // use a fixed value + g_Font[eventFont]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, startTimeWidth, startTime, COL_MENUCONTENTINACTIVE, 0, true); startTimeWidth = startTimeWidth +5; } - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5+startTimeWidth, y+ theight+ pig_height + i*ffheight, infozone_width - startTimeWidth - 20, e->description, COL_MENUCONTENTDARK, 0, true); + g_Font[eventFont]->RenderString(x+ width+5+startTimeWidth, y+ theight+ pig_height + i*ffheight, infozone_width - startTimeWidth - 20, e->description, COL_MENUCONTENTDARK, 0, true); } else { @@ -2206,6 +2207,7 @@ void CChannelList::readEvents(const t_channel_id channel_id) void CChannelList::showdescription(int index) { + ffheight = g_Font[eventFont]->getHeight(); CZapitChannel* chan = chanlist[index]; CChannelEvent *p_event=NULL; p_event = &chan->currentEvent; @@ -2214,12 +2216,11 @@ void CChannelList::showdescription(int index) CEitManager::getInstance()->getEPGid(p_event->eventID, p_event->startTime, &epgData); if (!(epgData.info2.empty())) { - int ffheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getHeight(); frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUCONTENT_PLUS_0); processTextToArray(epgData.info2); for (unsigned int i = 1; (i < epgText.size()+1) && ((y+ theight+ pig_height + i*ffheight) < (y+ theight+ pig_height + infozone_height)); i++) { - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, infozone_width - 20, epgText[i-1].first, COL_MENUCONTENTDARK , 0, true); + g_Font[eventFont]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, infozone_width - 20, epgText[i-1].first, COL_MENUCONTENTDARK , 0, true); } } } @@ -2257,7 +2258,7 @@ void CChannelList::processTextToArray(std::string text, int screening) // UTF-8 if (*text_!='\n') aktWord += *text_; - int aktWordWidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getRenderWidth(aktWord, true); + int aktWordWidth = g_Font[eventFont]->getRenderWidth(aktWord, true); if ((aktWordWidth+aktWidth)<(infozone_width - 20)) {//space ok, add aktWidth += aktWordWidth; diff --git a/src/gui/channellist.h b/src/gui/channellist.h index 567e9dce8..7fa9e8ed0 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -67,6 +67,8 @@ private: int fheight; // Fonthoehe Channellist-Inhalt int theight; // Fonthoehe Channellist-Titel int footerHeight; + int eventFont; + int ffheight; std::string name; ZapitChannelList chanlist; diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index a5e4e8fd6..f7bb7a301 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -81,11 +81,12 @@ COsdSetup::~COsdSetup() } //font settings -const SNeutrinoSettings::FONT_TYPES channellist_font_sizes[4] = +const SNeutrinoSettings::FONT_TYPES channellist_font_sizes[5] = { SNeutrinoSettings::FONT_TYPE_CHANNELLIST, SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR, SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER, + SNeutrinoSettings::FONT_TYPE_CHANNELLIST_EVENT, SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP }; @@ -131,7 +132,7 @@ const SNeutrinoSettings::FONT_TYPES other_font_sizes[5] = font_sizes_groups font_sizes_groups[6] = { {LOCALE_FONTMENU_MENU , 5, other_font_sizes , "fontsize.doth", LOCALE_MENU_HINT_MENU_FONTS }, - {LOCALE_FONTMENU_CHANNELLIST, 4, channellist_font_sizes, "fontsize.dcha", LOCALE_MENU_HINT_CHANNELLIST_FONTS }, + {LOCALE_FONTMENU_CHANNELLIST, 5, channellist_font_sizes, "fontsize.dcha", LOCALE_MENU_HINT_CHANNELLIST_FONTS }, {LOCALE_FONTMENU_EVENTLIST , 4, eventlist_font_sizes , "fontsize.deve", LOCALE_MENU_HINT_EVENTLIST_FONTS }, {LOCALE_FONTMENU_EPG , 4, epg_font_sizes , "fontsize.depg", LOCALE_MENU_HINT_EPG_FONTS }, {LOCALE_FONTMENU_INFOBAR , 4, infobar_font_sizes , "fontsize.dinf", LOCALE_MENU_HINT_INFOBAR_FONTS }, @@ -160,6 +161,7 @@ font_sizes_struct neutrino_font[FONT_TYPE_COUNT] = {LOCALE_FONTSIZE_CHANNELLIST , 20, FONT_STYLE_BOLD , 1}, {LOCALE_FONTSIZE_CHANNELLIST_DESCR , 20, FONT_STYLE_REGULAR, 1}, {LOCALE_FONTSIZE_CHANNELLIST_NUMBER , 14, FONT_STYLE_BOLD , 2}, + {LOCALE_FONTSIZE_CHANNELLIST_EVENT , 17, FONT_STYLE_REGULAR, 2}, {LOCALE_FONTSIZE_CHANNEL_NUM_ZAP , 40, FONT_STYLE_BOLD , 0}, {LOCALE_FONTSIZE_INFOBAR_NUMBER , 50, FONT_STYLE_BOLD , 0}, {LOCALE_FONTSIZE_INFOBAR_CHANNAME , 30, FONT_STYLE_BOLD , 0}, diff --git a/src/system/locals.h b/src/system/locals.h index 709e86e34..0b34fd393 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -550,6 +550,7 @@ typedef enum LOCALE_FONTSIZE_CHANNEL_NUM_ZAP, LOCALE_FONTSIZE_CHANNELLIST, LOCALE_FONTSIZE_CHANNELLIST_DESCR, + LOCALE_FONTSIZE_CHANNELLIST_EVENT, LOCALE_FONTSIZE_CHANNELLIST_NUMBER, LOCALE_FONTSIZE_EPG_DATE, LOCALE_FONTSIZE_EPG_INFO1, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 692062856..c7afa4d8f 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -550,6 +550,7 @@ const char * locale_real_names[] = "fontsize.channel_num_zap", "fontsize.channellist", "fontsize.channellist_descr", + "fontsize.channellist_event", "fontsize.channellist_number", "fontsize.epg_date", "fontsize.epg_info1", diff --git a/src/system/settings.h b/src/system/settings.h index e13334304..b3183671e 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -463,7 +463,7 @@ struct SNeutrinoSettings // Font sizes -#define FONT_TYPE_COUNT 23 +#define FONT_TYPE_COUNT 24 enum FONT_TYPES { FONT_TYPE_MENU = 0, FONT_TYPE_MENU_TITLE = 1, @@ -481,13 +481,14 @@ struct SNeutrinoSettings FONT_TYPE_CHANNELLIST = 13, FONT_TYPE_CHANNELLIST_DESCR = 14, FONT_TYPE_CHANNELLIST_NUMBER = 15, - FONT_TYPE_CHANNEL_NUM_ZAP = 16, - FONT_TYPE_INFOBAR_NUMBER = 17, - FONT_TYPE_INFOBAR_CHANNAME = 18, - FONT_TYPE_INFOBAR_INFO = 19, - FONT_TYPE_INFOBAR_SMALL = 20, - FONT_TYPE_FILEBROWSER_ITEM = 21, - FONT_TYPE_MENU_HINT = 22 + FONT_TYPE_CHANNELLIST_EVENT = 16, + FONT_TYPE_CHANNEL_NUM_ZAP = 17, + FONT_TYPE_INFOBAR_NUMBER = 18, + FONT_TYPE_INFOBAR_CHANNAME = 19, + FONT_TYPE_INFOBAR_INFO = 20, + FONT_TYPE_INFOBAR_SMALL = 21, + FONT_TYPE_FILEBROWSER_ITEM = 22, + FONT_TYPE_MENU_HINT = 23 }; // lcdd From a46d3a42efaaeeed83bc5201c02c980380afb149 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 12 Feb 2013 18:03:50 +0100 Subject: [PATCH 42/86] add progressbar opt to infobar Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/63c66c1f4e35b8f6739d6b5b9ac2b3ed78c79865 Author: Jacek Jendrzej Date: 2013-02-12 (Tue, 12 Feb 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 5 +++ data/locale/english.locale | 5 +++ src/gui/infoviewer.cpp | 85 ++++++++++++++++++++++++++++++++------ src/gui/osd_setup.cpp | 13 ++++++ src/neutrino.cpp | 2 + src/system/locals.h | 5 +++ src/system/locals_intern.h | 5 +++ src/system/settings.h | 1 + 8 files changed, 109 insertions(+), 12 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 725eee14d..7aa10869e 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1132,6 +1132,11 @@ miscsettings.infobar_disp_5 Logo/Signalbalken miscsettings.infobar_disp_6 Logo+Kanalnummer/Signalbalken miscsettings.infobar_disp_log Logo miscsettings.infobar_logo_hdd_dir Logo Verz. +miscsettings.infobar_progressbar Fortschrittsbalken Opt. +miscsettings.infobar_progressbar_0 Standard +miscsettings.infobar_progressbar_1 unterhalb Kanalname +miscsettings.infobar_progressbar_2 unterhalb Kanalname schmal +miscsettings.infobar_progressbar_3 zwischen EPG-Events schmal miscsettings.infobar_sat_display Kabel-/Satellitenanbieter miscsettings.infobar_show Info bei EPG Änderungen miscsettings.infobar_show_dd_available DD-Verfügbarkeit anzeigen diff --git a/data/locale/english.locale b/data/locale/english.locale index f02f9fd0b..b599fb699 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -928,6 +928,11 @@ menu.hint_pictureviewer_scaling Picture scaling algorithm menu.hint_pictureviewer_slide_time Slideshow interval, in seconds menu.hint_picview View pictures menu.hint_plugins_hdd_dir Select directory to load\nplugins from +miscsettings.infobar_progressbar progressbar options +miscsettings.infobar_progressbar_0 standard +miscsettings.infobar_progressbar_1 below channel name +miscsettings.infobar_progressbar_2 small below channel name +miscsettings.infobar_progressbar_3 narrow between EPG-Events menu.hint_power_leds Configure power-button LEDs behavior menu.hint_pref_lang Select preferred audio and EPG language\nselect 'none' to disable menu.hint_pref_subs Select preferred subtitle language\nselect 'none' to disable diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 497140554..08d00c5d8 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -450,6 +450,22 @@ void CInfoViewer::show_current_next(bool new_chan, int epgpos) // nicht gefunden / noch nicht geladen /* see the comment in display_Info() for a reasoning for this calculation */ int CurrInfoY = (BoxEndY + ChanNameY + time_height) / 2; // lower end of current info box + if(g_settings.infobar_progressbar){ + int pb_h = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() - 4; + switch(g_settings.infobar_progressbar) + { + case 1: + case 2: + CurrInfoY += (pb_h/3); + break; + case 3: + CurrInfoY -= (pb_h/3); + break; + default: + break; + } + } + neutrino_locale_t loc; if (! gotTime) loc = LOCALE_INFOVIEWER_WAITTIME; @@ -1415,30 +1431,67 @@ void CInfoViewer::display_Info(const char *current, const char *next, int height = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getHeight(); int CurrInfoY = (BoxEndY + ChanNameY + time_height) / 2; int NextInfoY = CurrInfoY + height; // lower end of next info box - int xStart; int InfoX = ChanInfoX + 10; - xStart = InfoX; + int xStart = InfoX; if (starttimes) xStart += info_time_width + 10; - //colored_events init - bool colored_event_C = false; - bool colored_event_N = false; - if (g_settings.colored_events_infobar == 1) - colored_event_C = true; - if (g_settings.colored_events_infobar == 2) - colored_event_N = true; + int pb_h = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() - 4; + switch(g_settings.infobar_progressbar) + { + case 1: + case 2: + CurrInfoY += (pb_h/3); + NextInfoY += (pb_h/3); + break; + case 3: + CurrInfoY -= (pb_h/3); + NextInfoY += (pb_h/3); + break; + default: + break; + } if (pb_pos > -1) { int pb_w = 112; + int pb_startx = BoxEndX - pb_w - SHADOW_OFFSET; + int pb_starty = ChanNameY - (pb_h + 10); + int pb_shadow = COL_INFOBAR_SHADOW_PLUS_0; + int pb_color = g_settings.progressbar_color ? COL_INFOBAR_SHADOW_PLUS_0 : COL_INFOBAR_PLUS_0; + if(g_settings.infobar_progressbar){ + pb_startx = xStart; + pb_w = BoxEndX - 10 - xStart; + pb_shadow = 0; + } + switch(g_settings.infobar_progressbar) + { + case 1: + + pb_starty = CurrInfoY - ((pb_h * 2) + (pb_h / 6)) ; + pb_h = (pb_h/3); + pb_color = COL_INFOBAR_SHADOW_PLUS_0; + break; + case 2: + pb_starty = CurrInfoY - ((pb_h * 2) + (pb_h / 5)) ; + pb_h = (pb_h/5); + pb_color = COL_INFOBAR_SHADOW_PLUS_0; + break; + case 3: + pb_starty = CurrInfoY + ((pb_h / 3)-(pb_h/5)) ; + pb_h = (pb_h/5); + break; + default: + break; + } + int pb_p = pb_pos * pb_w / 100; - int pb_h = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() - 4; if (pb_p > pb_w) pb_p = pb_w; - timescale->paintProgressBar(BoxEndX - pb_w - SHADOW_OFFSET, ChanNameY - (pb_h + 10) , pb_w, pb_h, pb_p, pb_w, - 0, 0, g_settings.progressbar_color ? COL_INFOBAR_SHADOW_PLUS_0 : COL_INFOBAR_PLUS_0, COL_INFOBAR_SHADOW_PLUS_0, "", COL_INFOBAR); + + timescale->paintProgressBar(pb_startx, pb_starty, pb_w, pb_h, pb_p, pb_w, + 0, 0, pb_color, pb_shadow, "", COL_INFOBAR); //printf("paintProgressBar(%d, %d, %d, %d)\n", BoxEndX - pb_w - SHADOW_OFFSET, ChanNameY - (pb_h + 10) , pb_w, pb_h); } @@ -1452,6 +1505,14 @@ void CInfoViewer::display_Info(const char *current, const char *next, int nextTimeX = BoxEndX - nextTimeW - 10; static int oldCurrTimeX = currTimeX; // remember the last pos. of remaining time, in case we change from 20/100min to 21/99min + //colored_events init + bool colored_event_C = false; + bool colored_event_N = false; + if (g_settings.colored_events_infobar == 1) + colored_event_C = true; + if (g_settings.colored_events_infobar == 2) + colored_event_N = true; + if (current != NULL && update_current) { frameBuffer->paintBox(InfoX, CurrInfoY - height, currTimeX, CurrInfoY, COL_INFOBAR_PLUS_0); diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index f7bb7a301..0b59388d6 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -727,6 +727,14 @@ const CMenuOptionChooser::keyval LOCALE_MISCSETTINGS_INFOBAR_DISP_OPTIONS[LOCAL { 5 , LOCALE_MISCSETTINGS_INFOBAR_DISP_5 }, { 6 , LOCALE_MISCSETTINGS_INFOBAR_DISP_6 } }; +#define LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR_COUNT 4 +const CMenuOptionChooser::keyval LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR_OPTIONS[LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR_COUNT]= +{ + { 0 , LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR_0 }, + { 1 , LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR_1 }, + { 2 , LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR_2 }, + { 3 , LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR_3 } +}; //infobar void COsdSetup::showOsdInfobarSetup(CMenuWidget *menu_infobar) @@ -755,6 +763,11 @@ void COsdSetup::showOsdInfobarSetup(CMenuWidget *menu_infobar) mc->setHint("", LOCALE_MENU_HINT_INFOBAR_SAT); menu_infobar->addItem(mc); + // infobar progress + mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR, &g_settings.infobar_progressbar, LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR_OPTIONS, LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR_COUNT, true); + mc->setHint("", LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR); + menu_infobar->addItem(mc); + // flash/hdd progress mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SHOW_SYSFS_HDD, &g_settings.infobar_show_sysfs_hdd, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_INFOBAR_FILESYS); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index d37359229..744d2ab71 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -383,6 +383,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.progressbar_color = configfile.getBool("progressbar_color", true ); g_settings.infobar_show = configfile.getInt32("infobar_show", 1); g_settings.infobar_show_channellogo = configfile.getInt32("infobar_show_channellogo" , 3 ); + g_settings.infobar_progressbar = configfile.getInt32("infobar_progressbar" , 0 ); g_settings.casystem_display = configfile.getInt32("casystem_display", 2 );//mini ca mode default g_settings.scrambled_message = configfile.getBool("scrambled_message", true ); g_settings.volume_pos = configfile.getInt32("volume_pos", 0 ); @@ -840,6 +841,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setBool("progressbar_color" , g_settings.progressbar_color ); configfile.setInt32("infobar_show", g_settings.infobar_show); configfile.setInt32("infobar_show_channellogo" , g_settings.infobar_show_channellogo ); + configfile.setInt32("infobar_progressbar" , g_settings.infobar_progressbar ); configfile.setInt32("casystem_display" , g_settings.casystem_display ); configfile.setBool("scrambled_message" , g_settings.scrambled_message ); configfile.setInt32("volume_pos" , g_settings.volume_pos ); diff --git a/src/system/locals.h b/src/system/locals.h index 0b34fd393..0d60d5f1f 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1159,6 +1159,11 @@ typedef enum LOCALE_MISCSETTINGS_INFOBAR_DISP_6, LOCALE_MISCSETTINGS_INFOBAR_DISP_LOG, LOCALE_MISCSETTINGS_INFOBAR_LOGO_HDD_DIR, + LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR, + LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR_0, + LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR_1, + LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR_2, + LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR_3, LOCALE_MISCSETTINGS_INFOBAR_SAT_DISPLAY, LOCALE_MISCSETTINGS_INFOBAR_SHOW, LOCALE_MISCSETTINGS_INFOBAR_SHOW_DD_AVAILABLE, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index c7afa4d8f..bfc2aa6b9 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1159,6 +1159,11 @@ const char * locale_real_names[] = "miscsettings.infobar_disp_6", "miscsettings.infobar_disp_log", "miscsettings.infobar_logo_hdd_dir", + "miscsettings.infobar_progressbar", + "miscsettings.infobar_progressbar_0", + "miscsettings.infobar_progressbar_1", + "miscsettings.infobar_progressbar_2", + "miscsettings.infobar_progressbar_3", "miscsettings.infobar_sat_display", "miscsettings.infobar_show", "miscsettings.infobar_show_dd_available", diff --git a/src/system/settings.h b/src/system/settings.h index b3183671e..713b5161e 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -68,6 +68,7 @@ struct SNeutrinoSettings int fan_speed; int infobar_show; int infobar_show_channellogo; + int infobar_progressbar; int progressbar_color; int casystem_display; int scrambled_message; From 7b1136be219da8afdbee1d267cd9e29bc70f4b5c Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 12 Feb 2013 19:26:46 +0100 Subject: [PATCH 43/86] add progressbar hint loc Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6fb981b44766de2caf2fb438f901f708ce3118d6 Author: Jacek Jendrzej Date: 2013-02-12 (Tue, 12 Feb 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/osd_setup.cpp | 2 +- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 7aa10869e..abbe56b57 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -803,6 +803,7 @@ menu.hint_infobar_fonts Ändern Sie in der Infobar die Schriftgrößen menu.hint_infobar_logo Logo- und Signal-Optionen menu.hint_infobar_logo_dir Hier wählen Sie das Verzeichnis für die Senderlogos menu.hint_infobar_on_epg Zeigt einen Hinweis bei EPG-Änderungen +menu.hint_infobar_progressbar Wählt die Optionen des Fortschrittsbalken in der Infobar menu.hint_infobar_radiotext Zeigt Radiotext in einen Fenster, wenn verfügbar menu.hint_infobar_res Zeige die gesendete Auflösung in Symbolen menu.hint_infobar_sat Zeigt die aktuellen Satelliten- oder Kabel-Provider diff --git a/data/locale/english.locale b/data/locale/english.locale index b599fb699..d6169d587 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -803,6 +803,7 @@ menu.hint_infobar_fonts Change infobar font sizes menu.hint_infobar_logo Logo / signal options menu.hint_infobar_logo_dir Select directory to search for channels logo menu.hint_infobar_on_epg Show infobar on current EPG event change +menu.hint_infobar_progressbar Selects the options of Progressbar in the Infobar menu.hint_infobar_radiotext Show radiotext window menu.hint_infobar_res Show channel resolution icons menu.hint_infobar_sat Show current satellite or cable provider diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 0b59388d6..874dbf1f1 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -765,7 +765,7 @@ void COsdSetup::showOsdInfobarSetup(CMenuWidget *menu_infobar) // infobar progress mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR, &g_settings.infobar_progressbar, LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR_OPTIONS, LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR_COUNT, true); - mc->setHint("", LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR); + mc->setHint("", LOCALE_MENU_HINT_INFOBAR_PROGRESSBAR); menu_infobar->addItem(mc); // flash/hdd progress diff --git a/src/system/locals.h b/src/system/locals.h index 0d60d5f1f..38203a667 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -830,6 +830,7 @@ typedef enum LOCALE_MENU_HINT_INFOBAR_LOGO, LOCALE_MENU_HINT_INFOBAR_LOGO_DIR, LOCALE_MENU_HINT_INFOBAR_ON_EPG, + LOCALE_MENU_HINT_INFOBAR_PROGRESSBAR, LOCALE_MENU_HINT_INFOBAR_RADIOTEXT, LOCALE_MENU_HINT_INFOBAR_RES, LOCALE_MENU_HINT_INFOBAR_SAT, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index bfc2aa6b9..a712c50d2 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -830,6 +830,7 @@ const char * locale_real_names[] = "menu.hint_infobar_logo", "menu.hint_infobar_logo_dir", "menu.hint_infobar_on_epg", + "menu.hint_infobar_progressbar", "menu.hint_infobar_radiotext", "menu.hint_infobar_res", "menu.hint_infobar_sat", From d91211cf7468f4c67f8a8d3fa36104479d50c85a Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 12 Feb 2013 20:16:17 +0100 Subject: [PATCH 44/86] channellist.cpp: Fix time display in event list - fix compiler warning Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b2f5ca589d42889d4906542a38064034ec3eae76 Author: Michael Liebmann Date: 2013-02-12 (Tue, 12 Feb 2013) Origin message was: ------------------ * channellist.cpp: Fix time display in event list - fix compiler warning ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index d3042a094..34a01ff60 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2125,6 +2125,7 @@ void CChannelList::paint_events(int index) frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUCONTENT_PLUS_0); char startTime[10]; + int eventStartTimeWidth = g_Font[eventFont]->getRenderWidth("22:22") + 5; // use a fixed value int startTimeWidth = 0; CChannelEventList::iterator e; time_t azeit; @@ -2167,9 +2168,8 @@ void CChannelList::paint_events(int index) struct tm *tmStartZeit = localtime(&e->startTime); strftime(startTime, sizeof(startTime), "%H:%M", tmStartZeit ); //printf("%s %s\n", startTime, e->description.c_str()); - startTimeWidth = g_Font[eventFont]->getRenderWidth("88:88"); // use a fixed value + startTimeWidth = eventStartTimeWidth; g_Font[eventFont]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, startTimeWidth, startTime, COL_MENUCONTENTINACTIVE, 0, true); - startTimeWidth = startTimeWidth +5; } g_Font[eventFont]->RenderString(x+ width+5+startTimeWidth, y+ theight+ pig_height + i*ffheight, infozone_width - startTimeWidth - 20, e->description, COL_MENUCONTENTDARK, 0, true); } @@ -2218,10 +2218,8 @@ void CChannelList::showdescription(int index) { frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUCONTENT_PLUS_0); processTextToArray(epgData.info2); - for (unsigned int i = 1; (i < epgText.size()+1) && ((y+ theight+ pig_height + i*ffheight) < (y+ theight+ pig_height + infozone_height)); i++) - { + for (int i = 1; (i < (int)epgText.size()+1) && ((y+ theight+ pig_height + i*ffheight) < (y+ theight+ pig_height + infozone_height)); i++) g_Font[eventFont]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, infozone_width - 20, epgText[i-1].first, COL_MENUCONTENTDARK , 0, true); - } } } From 88b988942b1aebae88a07410afc99a56c51d7f5a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 12 Feb 2013 23:12:20 +0100 Subject: [PATCH 45/86] yweb: merge tv-shot and osd-shot to one page * use internal screenshot-function to make osd-shots Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/71f2c8c9a77e201d6cb2d03f8fc446560079f914 Author: vanhofen Date: 2013-02-12 (Tue, 12 Feb 2013) Origin message was: ------------------ - yweb: merge tv-shot and osd-shot to one page * use internal screenshot-function to make osd-shots ------------------ This commit was generated by Migit --- src/nhttpd/web/Makefile.am | 2 +- src/nhttpd/web/Y_Boxcontrol_Menue.yhtm | 17 +--- src/nhttpd/web/Y_Main.css | 19 ++++- src/nhttpd/web/Y_Menue.yhtm | 2 +- src/nhttpd/web/Y_Tools_Screenshot.yhtm | 112 +++++++++++++++++++++++++ src/nhttpd/web/Y_Tools_remote_osd.yhtm | 66 --------------- src/nhttpd/web/languages/Deutsch | 26 ++---- src/nhttpd/web/languages/English | 26 ++---- src/nhttpd/web/scripts/Y_Tools.sh | 10 ++- 9 files changed, 158 insertions(+), 122 deletions(-) create mode 100644 src/nhttpd/web/Y_Tools_Screenshot.yhtm delete mode 100644 src/nhttpd/web/Y_Tools_remote_osd.yhtm diff --git a/src/nhttpd/web/Makefile.am b/src/nhttpd/web/Makefile.am index 094ff6968..858dbdf7d 100644 --- a/src/nhttpd/web/Makefile.am +++ b/src/nhttpd/web/Makefile.am @@ -82,7 +82,7 @@ install_DATA = channels.js \ Y_Tools_lcshot.yhtm \ Y_Tools_Menue.yhtm \ Y_Tools_Rcsim.yhtm \ - Y_Tools_remote_osd.yhtm \ + Y_Tools_Screenshot.yhtm \ Y_Tools_Timer_Sync.js \ Y_Tools_Timer_Sync.yhtm \ Y_Tools_tvshot.yhtm \ diff --git a/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm b/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm index 88d93b977..eb2e9bf05 100644 --- a/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm +++ b/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm @@ -101,21 +101,8 @@ function init(){
  • ~=}
  • - {=L:bc.menue.tv_screenshot=} -
  • -
  • - {=if-equal:{=var-get:fbshot=}~true~ - {=L:bc.menue.osd_screenshot=} - ~ - {=L:bc.menue.osd_screenshot=} - =} -
  • -
  • - {=if-equal:{=var-get:fbshot=}~true~ - {=L:bc.menue.remote_osd=} - ~ - {=L:bc.menue.remote_osd=} - =} + OSD-{=L:bc.menue.screenshot=} + TV-{=L:bc.menue.screenshot=}
  • diff --git a/src/nhttpd/web/Y_Main.css b/src/nhttpd/web/Y_Main.css index 15a1b39f5..705b64cad 100644 --- a/src/nhttpd/web/Y_Main.css +++ b/src/nhttpd/web/Y_Main.css @@ -12,6 +12,18 @@ button,input,select,form,td { font-family: Verdana, Geneva, Arial, 'Lucida Grande',Tahoma, Helvetica, sans-serif; color:#555555; } +.left { + float: left; +} +.right { + float: right; +} +.clear { + clear: both; + line-height: 0px; + height: 0; + overflow: hidden; +} /* buttons */ a img:hover { position:relative; @@ -37,7 +49,7 @@ button[ytype="zap"]{background-image:url(/images/zap.png);} button[ytype="timeup"]{background-image:url(/images/time_up.png);} button[ytype="timedown"]{background-image:url(/images/time_down.png);} button[ytype="timeadd"]{background-image:url(/images/time_add.png);} -button[ytype="shot"]{background-image:url(/images/snapshot.png);} +button[ytype="snapshot"]{background-image:url(/images/snapshot.png);} button[ytype="clearshot"]{background-image:url(/images/remove.png);} button[ytype="zoomshot"]{background-image:url(/images/fullscreen.png);} button[ytype="go"]{background-image:url(/images/accept.png);} @@ -849,12 +861,17 @@ a.timer { } /* screenshots */ +#screenshot_header { + height: 30px; +} td.shot { vertical-align: top; } img#shot { width: 100%; background-color: #ffffff; + border: 1px solid #f5f5f5; + margin: 10px 0; } img#shot:hover { cursor: pointer; diff --git a/src/nhttpd/web/Y_Menue.yhtm b/src/nhttpd/web/Y_Menue.yhtm index b2965a68d..0ba6a9ad0 100644 --- a/src/nhttpd/web/Y_Menue.yhtm +++ b/src/nhttpd/web/Y_Menue.yhtm @@ -120,7 +120,7 @@ function vlc() { - + diff --git a/src/nhttpd/web/Y_Tools_Screenshot.yhtm b/src/nhttpd/web/Y_Tools_Screenshot.yhtm new file mode 100644 index 000000000..165f4fb95 --- /dev/null +++ b/src/nhttpd/web/Y_Tools_Screenshot.yhtm @@ -0,0 +1,112 @@ +{=include-block:Y_Blocks.txt;head=} + + + + + +
    +
    + {=var-set:help_url==}{=var-set:menu={=L:bc.menue.screenshot=}=}{=include-block:Y_Blocks.txt;work_menu=}
    +
    +
    +
    +
    +   +   +   +
    +
    +
    + {=L:filename=}: + OSD: + TV: +
    +
    +
    +
    + +
    + + + + + + +
    + {=include-block:Y_Blocks.txt;remote=} + + +
    +
    +
    + + diff --git a/src/nhttpd/web/Y_Tools_remote_osd.yhtm b/src/nhttpd/web/Y_Tools_remote_osd.yhtm deleted file mode 100644 index 4a30ff29f..000000000 --- a/src/nhttpd/web/Y_Tools_remote_osd.yhtm +++ /dev/null @@ -1,66 +0,0 @@ -{=include-block:Y_Blocks.txt;head=} - - - - - -
    -
    - {=var-set:help_url=Help-BoxControl-Remote_OSD=}{=var-set:menu={=L:bc.menue.remote_osd=}=}{=include-block:Y_Blocks.txt;work_menu=}
    -
    -
    - - wait -
    - - - - - -
    - {=include-block:Y_Blocks.txt;remote=} - - -
    -
    -
    - - diff --git a/src/nhttpd/web/languages/Deutsch b/src/nhttpd/web/languages/Deutsch index 95a5977ee..c8ca664e0 100644 --- a/src/nhttpd/web/languages/Deutsch +++ b/src/nhttpd/web/languages/Deutsch @@ -85,14 +85,8 @@ bc.menue.remote=Fernbedienung bc.menue.lcd_screenshot_desc=LCD Screenshot erstellen bc.menue.lcd_screenshot=LCD Screenshot bc.menue.lcd_screenshot_desc_ni=lcshot nicht installiert in /bin oder /var/bin -bc.menue.osd_screenshot_desc=OSD Screenshot erstellen -bc.menue.osd_screenshot=OSD Screenshot -bc.menue.osd_screenshot_desc_ni=fbshot nicht installiert in /bin oder /var/bin -bc.menue.tv_screenshot_desc=TV Screenshot erstellen -bc.menue.tv_screenshot=TV Screenshot -bc.menue.remote_osd_desc=Fernbedienung und On Screen Display -bc.menue.remote_osd=Fernbed. & OSD -bc.menue.remote_osd_desc_ni=dboxshot nicht installiert in /bin oder /var/bin +bc.menue.screenshot=Screenshot +bc.menue.screenshot_desc=Screenshot des OSDs und/oder des TV-Bildes erstellen bc.menue.decrease_volume=Lautstärke verringern bc.menue.increase_volume=Lautstärke erhöhen @@ -126,16 +120,12 @@ bc.msg.message_to_screen=Meldung auf Bildschirm bc.msg.popup_to_screen=Popup auf Bildschirm bc.msg.send_message=Nachricht senden -======== Boxcontrol - Remote & OSD -bc.osd.shot=Schnappschuss -bc.osd.delete_shots=Schnappschuss löschen -bc.osd.zoom_shot=Schnappschuss zoomen -bc.osd.shap_wait_text=Schnappschuss wird erstellt - -======== Boxcontrol - TV-Screenshot -bc.tv.shot=Schnappschuss -bc.tv.delete_shot=Schnappschuss löschen -bc.tv.shap_wait_text=Schnappschuss wird erstellt +======== Boxcontrol - Screenshot +bc.screenshot.create=Schnappschuss +bc.screenshot.delete=Schnappschuss löschen +bc.screenshot.zoom=Schnappschuss zoomen +bc.screenshot.wait_text=Schnappschuss wird erstellt +bc.screenshot.checkenable=OSD und/oder TV muss aktiviert sein! ========= Boxcontrol - Others bc.channels=Sender diff --git a/src/nhttpd/web/languages/English b/src/nhttpd/web/languages/English index 4bedd9afa..d49bac530 100644 --- a/src/nhttpd/web/languages/English +++ b/src/nhttpd/web/languages/English @@ -87,14 +87,8 @@ bc.menue.remote=Remote bc.menue.lcd_screenshot_desc=make lcd screenshot bc.menue.lcd_screenshot=LCD Screenshot bc.menue.lcd_screenshot_desc_ni=lcshot not installed at /bin or /var/bin -bc.menue.osd_screenshot_desc=make osd screenshot -bc.menue.osd_screenshot=OSD Screenshot -bc.menue.osd_screenshot_desc_ni=fbshot not installed at /bin or /var/bin -bc.menue.tv_screenshot_desc=make tv screenshot -bc.menue.tv_screenshot=TV Screenshot -bc.menue.remote_osd_desc=remote and osd -bc.menue.remote_osd=Remote & OSD -bc.menue.remote_osd_desc_ni=dboxshot not installed at /bin or /var/bin +bc.menue.screenshot=Screenshot +bc.menue.screenshot_desc=make screenshots from OSD and/or TV bc.menue.decrease_volume=decrease volumen bc.menue.increase_volume=increase volumen @@ -128,16 +122,12 @@ bc.msg.message_to_screen=Message on screen bc.msg.popup_to_screen=Message as popup bc.msg.send_message=send message -======== Boxcontrol - Remote & OSD -bc.osd.shot=Shot -bc.osd.delete_shots=Delete shots -bc.osd.zoom_shot=Zoom shot -bc.osd.shap_wait_text=Take Snapshot - -======== Boxcontrol - TV-Screenshot -bc.tv.shot=Shot -bc.tv.delete_shot=Delete shot -bc.tv.shap_wait_text=Take Snapshot +======== Boxcontrol - Screenshot +bc.screenshot.create=Screenshot +bc.screenshot.delete=Delete screenshot +bc.screenshot.zoom=Zoom screenshot +bc.screenshot.wait_text=Create screenshot +bc.screenshot.checkenable=OSD and/or TV must be enabled! ========= Boxcontrol - Others bc.channels=Channels diff --git a/src/nhttpd/web/scripts/Y_Tools.sh b/src/nhttpd/web/scripts/Y_Tools.sh index 5d5eb37e9..8f13589c2 100755 --- a/src/nhttpd/web/scripts/Y_Tools.sh +++ b/src/nhttpd/web/scripts/Y_Tools.sh @@ -480,7 +480,13 @@ do_fbshot_clear() rm /tmp/*.bmp rm /tmp/*.png } - +# ----------------------------------------------------------- +# delete screenshots +# ----------------------------------------------------------- +do_screenshot_clear() +{ + rm -f /tmp/*.png +} # ----------------------------------------------------------- # Settings Backup/Restore # ----------------------------------------------------------- @@ -547,7 +553,7 @@ case "$1" in lcshot) shift 1; do_lcshot $* ;; fbshot) shift 1; do_fbshot $* ;; fbshot_clear) do_fbshot_clear ;; - tvshot_clear) rm -f /tmp/screenshot.png ;; + screenshot_clear) do_screenshot_clear ;; get_update_version) wget -O /tmp/version.txt "http://git.coolstreamtech.de/?p=cst-public-gui-neutrino.git;a=blob_plain;f=src/nhttpd/web/Y_Version.txt" ;; settings_backup_restore) shift 1; do_settings_backup_restore $* ;; exec_cmd) shift 1; $* ;; From 05933cc072b832ebca33dde7079226772cd75876 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 12 Feb 2013 23:16:45 +0100 Subject: [PATCH 46/86] yweb: remove unused variable from Y_Boxcontrol_Menue.yhtm Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/73d44517e7456dce4efbc3d065dd715fbc88c2a6 Author: vanhofen Date: 2013-02-12 (Tue, 12 Feb 2013) Origin message was: ------------------ - yweb: remove unused variable from Y_Boxcontrol_Menue.yhtm ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/web/Y_Boxcontrol_Menue.yhtm | 1 - 1 file changed, 1 deletion(-) diff --git a/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm b/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm index eb2e9bf05..536cd1dc7 100644 --- a/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm +++ b/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm @@ -72,7 +72,6 @@ function init(){ {=var-set:lcshot={=if-file-exists:/bin/lcshot~true~{=if-file-exists:/var/bin/lcshot~true~false=}=}=} -{=var-set:fbshot={=if-file-exists:/bin/fbshot~true~{=if-file-exists:/var/bin/fbshot~true~false=}=}=}

    {=L:main.boxcontrol=}

    From d1a7930db86592d8f9a4ed3c3e12b37f0055ba5d Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 12 Feb 2013 23:44:52 +0100 Subject: [PATCH 47/86] Sort english.locale Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c7f250c2a76b7db35a10ca33de578584abc59c09 Author: Michael Liebmann Date: 2013-02-12 (Tue, 12 Feb 2013) Origin message was: ------------------ * Sort english.locale ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/english.locale | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/data/locale/english.locale b/data/locale/english.locale index d6169d587..f4405d184 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -929,11 +929,6 @@ menu.hint_pictureviewer_scaling Picture scaling algorithm menu.hint_pictureviewer_slide_time Slideshow interval, in seconds menu.hint_picview View pictures menu.hint_plugins_hdd_dir Select directory to load\nplugins from -miscsettings.infobar_progressbar progressbar options -miscsettings.infobar_progressbar_0 standard -miscsettings.infobar_progressbar_1 below channel name -miscsettings.infobar_progressbar_2 small below channel name -miscsettings.infobar_progressbar_3 narrow between EPG-Events menu.hint_power_leds Configure power-button LEDs behavior menu.hint_pref_lang Select preferred audio and EPG language\nselect 'none' to disable menu.hint_pref_subs Select preferred subtitle language\nselect 'none' to disable @@ -1138,6 +1133,11 @@ miscsettings.infobar_disp_5 Logo+signal miscsettings.infobar_disp_6 Logo+channel number+signal miscsettings.infobar_disp_log Logo miscsettings.infobar_logo_hdd_dir Logo dir +miscsettings.infobar_progressbar progressbar options +miscsettings.infobar_progressbar_0 standard +miscsettings.infobar_progressbar_1 below channel name +miscsettings.infobar_progressbar_2 small below channel name +miscsettings.infobar_progressbar_3 narrow between EPG-Events miscsettings.infobar_sat_display Satellite display on infobar miscsettings.infobar_show show Info on EPG change miscsettings.infobar_show_dd_available show DD availability From e98cad99047d7694f45b6ee0b85bf672e2409f26 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 13 Feb 2013 23:31:12 +0100 Subject: [PATCH 48/86] channellist.cpp: Show channel list vertically centered Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/91d76a94871c3c6fbdfb088e7e7f6e6287567f81 Author: Michael Liebmann Date: 2013-02-13 (Wed, 13 Feb 2013) Origin message was: ------------------ * channellist.cpp: Show channel list vertically centered ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 34a01ff60..1967f4cce 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -512,6 +512,7 @@ void CChannelList::calcSize() listmaxshow = (height - theight - footerHeight -0)/fheight; height = theight + footerHeight + listmaxshow * fheight; info_height = 2*fheight + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getHeight() + 10; + y += (frameBuffer->getScreenHeight() - height - info_height) / 2; infozone_width = full_width - width; pig_width = infozone_width; From 8bd619017014b0ed2f6163ecd26451d4c20c561b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 14 Feb 2013 19:06:43 +0100 Subject: [PATCH 49/86] infoviewer.cpp: change width of infobar.txt-field ... ... in dependency from g_settings.infobar_progressbar Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0986c3af8a7d9562021f33e9e7e547f685c9c41c Author: vanhofen Date: 2013-02-14 (Thu, 14 Feb 2013) Origin message was: ------------------ - infoviewer.cpp: change width of infobar.txt-field ... ... in dependency from g_settings.infobar_progressbar ------------------ This commit was generated by Migit --- src/gui/infoviewer.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 08d00c5d8..e6beea975 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1757,7 +1757,7 @@ void CInfoViewer::showInfoFile() /*if (recordModeActive) return;*/ char infotext[80]; - int fd, xStart, xOffset, yStart, width, height, tWidth, tIndent; + int fd, xStart, yStart, width, height, iOffset, oOffset, tWidth, tIndent, pb_w; ssize_t cnt; fd = open("/tmp/infobar.txt", O_RDONLY); //read textcontent from this file @@ -1773,14 +1773,16 @@ void CInfoViewer::showInfoFile() } infotext[cnt-1] = '\0'; - xStart = BoxStartX + ChanWidth + 140; //140px space for the little rec/ts-bar - xOffset = 5; //same value as the used RADIUS_SMALL + iOffset = RADIUS_SMALL; // inner left/right offset + oOffset = 140; // outer left/right offset + pb_w = 112; // same value as int pb_w in display_Info() + xStart = BoxStartX + ChanWidth + oOffset; yStart = BoxStartY; - width = BoxEndX - xStart - 225; //225px space for the progress-bar + width = BoxEndX - xStart - (g_settings.infobar_progressbar ? oOffset : oOffset + pb_w); height = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getHeight() + 2; tWidth = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getRenderWidth(infotext); - if (tWidth < (width - (xOffset * 2)) ) - tIndent = (width - (xOffset * 2) - tWidth) / 2; + if (tWidth < (width - (iOffset * 2)) ) + tIndent = (width - (iOffset * 2) - tWidth) / 2; else tIndent = 0; //shadow @@ -1789,7 +1791,7 @@ void CInfoViewer::showInfoFile() frameBuffer->paintBoxRel(xStart, yStart, width, height, COL_INFOBAR_PLUS_0, RADIUS_SMALL, CORNER_ALL); //content g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString( - xStart + xOffset + tIndent, yStart + height, width - xOffset, (std::string)infotext, COL_INFOBAR, height, false); + xStart + iOffset + tIndent, yStart + height, width - iOffset, (std::string)infotext, COL_INFOBAR, height, false); } void CInfoViewer::killTitle() From 2b9e5b9bd99ba6d889df67bd22afbc6b9429231a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 14 Feb 2013 19:16:54 +0100 Subject: [PATCH 50/86] fix terrible typo Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/fe78bf05806bd52fce3e1a63d99d98be9d0cda02 Author: vanhofen Date: 2013-02-14 (Thu, 14 Feb 2013) Origin message was: ------------------ - fix terrible typo ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/audioplayer.h | 2 +- src/gui/pictureviewer.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/audioplayer.h b/src/gui/audioplayer.h index daba3d8a9..e4f0c6894 100644 --- a/src/gui/audioplayer.h +++ b/src/gui/audioplayer.h @@ -260,7 +260,7 @@ class CAudioPlayerGui : public CMenuTarget void stop(); bool playNext(bool allow_rotate = false); bool playPrev(bool allow_rotate = false); - int getAdioPayerM_currend() {return m_current;} + int getAudioPlayerM_current() {return m_current;} }; diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 4dbd38422..44b4a8bcb 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -235,7 +235,7 @@ int CPictureViewerGui::show() bool update=true; if (audioplayer) - m_currentTitle = m_audioPlayer->getAdioPayerM_currend(); + m_currentTitle = m_audioPlayer->getAudioPlayerM_current(); while (loop) { @@ -563,17 +563,17 @@ int CPictureViewerGui::show() // control keys for audioplayer else if (audioplayer && msg==CRCInput::RC_pause) { - m_currentTitle = m_audioPlayer->getAdioPayerM_currend(); + m_currentTitle = m_audioPlayer->getAudioPlayerM_current(); m_audioPlayer->pause(); } else if (audioplayer && msg==CRCInput::RC_stop) { - m_currentTitle = m_audioPlayer->getAdioPayerM_currend(); + m_currentTitle = m_audioPlayer->getAudioPlayerM_current(); m_audioPlayer->stop(); } else if (audioplayer && msg==CRCInput::RC_play) { - m_currentTitle = m_audioPlayer->getAdioPayerM_currend(); + m_currentTitle = m_audioPlayer->getAudioPlayerM_current(); if (m_currentTitle > -1) m_audioPlayer->play((unsigned int)m_currentTitle); } From 72fd77bb5f11f62dafd9274ad7ce87eae627c898 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 15 Feb 2013 22:55:45 +0100 Subject: [PATCH 51/86] Revert "- channellist.cpp: enable to lock new_zap_mode" This reverts commit 8b1b3b1418e83e3982a43508b554de0eb831067b because the display of infobar while zapping is broken with this commit. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/fb892d18ff25d45c3757b007244a5592d57f351e Author: vanhofen Date: 2013-02-15 (Fri, 15 Feb 2013) ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 3 --- data/locale/english.locale | 3 --- src/gui/channellist.cpp | 26 ++++++++++---------------- src/gui/channellist.h | 3 ++- src/gui/miscsettings_menu.cpp | 9 +-------- src/system/locals.h | 3 --- src/system/locals_intern.h | 3 --- 7 files changed, 13 insertions(+), 37 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index abbe56b57..21aefc8db 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -225,9 +225,6 @@ channellist.make_hdlist Erzeuge Bouquet mit HD-Kanälen channellist.make_newlist Erzeuge Bouquet mit neuen Kanälen channellist.make_removedlist Erzeuge Bouquet mit gelöschten Kanälen channellist.new_zap_mode Quickzap in Liste -channellist.new_zap_mode_active aktiv -channellist.new_zap_mode_allow erlauben -channellist.new_zap_mode_off aus channellist.nonefound Es wurden keine Kanäle gefunden!\nFühren Sie bitte eine Kanalsuche durch\n(MENU-Taste -> Service) channellist.provs Anbieter channellist.recording_not_possible Aufnahme nicht möglich! diff --git a/data/locale/english.locale b/data/locale/english.locale index f4405d184..e731c32ba 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -225,9 +225,6 @@ channellist.make_hdlist Create list of HD channels channellist.make_newlist Create list of new channels channellist.make_removedlist Create list of removed channels channellist.new_zap_mode Quickzap in list -channellist.new_zap_mode_active active -channellist.new_zap_mode_allow allow -channellist.new_zap_mode_off off channellist.nonefound No channels were found!\nPlease execute a scan\n(MENU-key -> service) channellist.provs Providers channellist.recording_not_possible Recording not possible! diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 1967f4cce..76c77e4fa 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -96,7 +96,7 @@ extern cVideo * videoDecoder; #define ConnectLineBox_Width 16 -CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vlist) +CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vlist, bool ) { frameBuffer = CFrameBuffer::getInstance(); name = pName; @@ -108,6 +108,7 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl this->historyMode = phistoryMode; vlist = _vlist; selected_chid = 0; + this->new_mode_active = false; footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+6; //initial height value for buttonbar previous_channellist_additional = -1; eventFont = SNeutrinoSettings::FONT_TYPE_CHANNELLIST_EVENT; @@ -540,7 +541,7 @@ bool CChannelList::updateSelection(int newpos) showChannelLogo(); } - if((g_settings.channellist_new_zap_mode == 2 /* active */) && SameTP()) { + if(this->new_mode_active && SameTP()) { actzap = true; zapTo(selected); } @@ -564,6 +565,8 @@ int CChannelList::show() return res; } + this->new_mode_active = 0; + calcSize(); displayNext = false; @@ -776,17 +779,7 @@ int CChannelList::show() } else if (( msg == CRCInput::RC_spkr ) && g_settings.channellist_new_zap_mode ) { if(CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_ts) { - switch (g_settings.channellist_new_zap_mode) { - case 2: /* active */ - g_settings.channellist_new_zap_mode = 1; /* allow */ - break; - case 1: /* allow */ - g_settings.channellist_new_zap_mode = 2; /* active */ - break; - default: - break; - - } + this->new_mode_active = (this->new_mode_active ? 0 : 1); paintHead(); showChannelLogo(); } @@ -909,6 +902,7 @@ int CChannelList::show() res = bouquetList->exec(true); printf("CChannelList:: bouquetList->exec res %d\n", res); } + this->new_mode_active = 0; if(NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode()) return -1; @@ -1159,7 +1153,7 @@ void CChannelList::zapTo(int pos, bool /* forceStoreToLastChannels */) zapToChannel(chan); tuned = pos; - if(g_settings.channellist_new_zap_mode == 2 /* active */) + if(this->new_mode_active) selected_in_new_mode = pos; else selected = pos; @@ -1195,7 +1189,7 @@ void CChannelList::zapToChannel(CZapitChannel *channel) g_RemoteControl->zapTo_ChannelID(channel->getChannelID(), channel->getName(), !channel->bAlwaysLocked); CNeutrinoApp::getInstance()->channelList->adjustToChannelID(channel->getChannelID()); } - if(g_settings.channellist_new_zap_mode != 2 /* not active */) { + if(!this->new_mode_active) { /* remove recordModeActive from infobar */ if(g_settings.auto_timeshift && !CNeutrinoApp::getInstance()->recordingstatus) { g_InfoViewer->handleMsg(NeutrinoMessages::EVT_RECORDMODE, 0); @@ -2002,7 +1996,7 @@ void CChannelList::paintHead() frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_INFO, x + full_width - iw1 - 10, y, theight); //y+ 5 ); frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MENU, x + full_width - iw1 - iw2 - 14, y, theight);//y + 5); // icon for bouquet list button if (g_settings.channellist_new_zap_mode) - frameBuffer->paintIcon((g_settings.channellist_new_zap_mode == 2 /* active */) ? + frameBuffer->paintIcon(this->new_mode_active ? NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE : NEUTRINO_ICON_BUTTON_MUTE_ZAP_INACTIVE, x + full_width - iw1 - iw2 - iw3 - 18, y, theight); diff --git a/src/gui/channellist.h b/src/gui/channellist.h index 7fa9e8ed0..248f3c6cb 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -93,6 +93,7 @@ private: bool displayList; int info_height; + bool new_mode_active; int ChannelList_Rec; void paintDetails(int index); @@ -119,7 +120,7 @@ private: void processTextToArray(std::string text, int screening = 0); public: - CChannelList(const char * const Name, bool historyMode = false, bool _vlist = false); + CChannelList(const char * const Name, bool historyMode = false, bool _vlist = false, bool new_mode_active = false ); ~CChannelList(); void SetChannelList(ZapitChannelList* channels); diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 97f6b0214..9cb4d2692 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -134,13 +134,6 @@ const CMenuOptionChooser::keyval MISCSETTINGS_FILESYSTEM_IS_UTF8_OPTIONS[MISCSET { 1, LOCALE_FILESYSTEM_IS_UTF8_OPTION_UTF8 } }; -#define CHANNELLIST_NEW_ZAP_MODE_OPTION_COUNT 3 -const CMenuOptionChooser::keyval CHANNELLIST_NEW_ZAP_MODE_OPTIONS[CHANNELLIST_NEW_ZAP_MODE_OPTION_COUNT] = -{ - { 0, LOCALE_CHANNELLIST_NEW_ZAP_MODE_OFF }, - { 1, LOCALE_CHANNELLIST_NEW_ZAP_MODE_ALLOW }, - { 2, LOCALE_CHANNELLIST_NEW_ZAP_MODE_ACTIVE } -}; #ifdef CPU_FREQ #define CPU_FREQ_OPTION_COUNT 13 @@ -399,7 +392,7 @@ void CMiscMenue::showMiscSettingsMenuChanlist(CMenuWidget *ms_chanlist) mc->setHint("", LOCALE_MENU_HINT_ZAP_CYCLE); ms_chanlist->addItem(mc); - mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_NEW_ZAP_MODE, &g_settings.channellist_new_zap_mode, CHANNELLIST_NEW_ZAP_MODE_OPTIONS, CHANNELLIST_NEW_ZAP_MODE_OPTION_COUNT, true ); + mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_NEW_ZAP_MODE, &g_settings.channellist_new_zap_mode, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true ); mc->setHint("", LOCALE_MENU_HINT_NEW_ZAP_MODE); ms_chanlist->addItem(mc); } diff --git a/src/system/locals.h b/src/system/locals.h index 38203a667..48a6f1c1f 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -252,9 +252,6 @@ typedef enum LOCALE_CHANNELLIST_MAKE_NEWLIST, LOCALE_CHANNELLIST_MAKE_REMOVEDLIST, LOCALE_CHANNELLIST_NEW_ZAP_MODE, - LOCALE_CHANNELLIST_NEW_ZAP_MODE_ACTIVE, - LOCALE_CHANNELLIST_NEW_ZAP_MODE_ALLOW, - LOCALE_CHANNELLIST_NEW_ZAP_MODE_OFF, LOCALE_CHANNELLIST_NONEFOUND, LOCALE_CHANNELLIST_PROVS, LOCALE_CHANNELLIST_RECORDING_NOT_POSSIBLE, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index a712c50d2..ee4f87d9d 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -252,9 +252,6 @@ const char * locale_real_names[] = "channellist.make_newlist", "channellist.make_removedlist", "channellist.new_zap_mode", - "channellist.new_zap_mode_active", - "channellist.new_zap_mode_allow", - "channellist.new_zap_mode_off", "channellist.nonefound", "channellist.provs", "channellist.recording_not_possible", From 317d65f0f426ae4ef8f801a7feff0c49ad1dae78 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 16 Feb 2013 10:28:38 +0100 Subject: [PATCH 52/86] icons: add missing hint_restart.png Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/fe3f4ce8630a3a72b4c8d91f3c06a05a234d5150 Author: vanhofen Date: 2013-02-16 (Sat, 16 Feb 2013) Origin message was: ------------------ - icons: add missing hint_restart.png ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/icons/Makefile.am | 1 + data/icons/hint_restart.png | Bin 0 -> 2936 bytes 2 files changed, 1 insertion(+) create mode 100644 data/icons/hint_restart.png diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am index b8b41539d..c09bb872c 100644 --- a/data/icons/Makefile.am +++ b/data/icons/Makefile.am @@ -110,6 +110,7 @@ install_DATA += \ hint_reboot.png \ hint_recording.png \ hint_reload.png \ + hint_restart.png \ hint_save.png \ hint_scan.png \ hint_scripts.png \ diff --git a/data/icons/hint_restart.png b/data/icons/hint_restart.png new file mode 100644 index 0000000000000000000000000000000000000000..2ac75bd1bf285bf4f54b6cbf9413cd67b7f791e8 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-L2$3X5gBp}Y!8 zr2%91o`#5X1|fn8-QE2izWL@nKKZ0cc)jfF@NjuuQBlk3J9^AIZ=P$O*UMh^df6{r zt`OTJk2rDn-Qlp?tuUD;AS7f00Kn(F1i$|h+S|KOUEPV&(l)fV`aEW{bi{0y-Yza~ zExx12tV6Bzbk_pEpFOARVg~2J!I-dVng|B~MIoJ%L_Cxdw=9zylS#@eDQPVljo&3> i_1`LYYEk^e*Z%<|Z`=5TgFtuy0000 Date: Sat, 16 Feb 2013 13:14:50 +0100 Subject: [PATCH 53/86] icons: add missing multimedia.png Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/aa1d9ce4507024a270f1b9696e5f1363ddd077f2 Author: vanhofen Date: 2013-02-16 (Sat, 16 Feb 2013) Origin message was: ------------------ - icons: add missing multimedia.png ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/icons/Makefile.am | 1 + data/icons/multimedia.png | Bin 0 -> 371 bytes 2 files changed, 1 insertion(+) create mode 100644 data/icons/multimedia.png diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am index c09bb872c..ac3fbc5e7 100644 --- a/data/icons/Makefile.am +++ b/data/icons/Makefile.am @@ -163,6 +163,7 @@ install_DATA += \ mp3-5.jpg \ mp3-6.jpg \ mp3-7.jpg \ + multimedia.png \ mute.png \ mute_small.png \ mute_zap_gray.png \ diff --git a/data/icons/multimedia.png b/data/icons/multimedia.png new file mode 100644 index 0000000000000000000000000000000000000000..72ea0c77c5e3957c8a06a0468f1a95ff6c58b3ce GIT binary patch literal 371 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaN3?zjj6;1;wg8-ipS0D`p($dl_rYt%-IxMa% zto|%cPEM@RtSSi-(%BNm#oD%wrp3j@Q>IM0bL&p1&irhk2F8*gzhDN3XE)M7oFs2| z7lsa2Sq~tGv%n*=n1O*?2!t6g-L3lr6l5>)^mS#w%Ot?VZ7%gsg%2pS$J50zMB;LC zf&=@Sg$o%C$}-pmTAYqr|1!4PSL*P@$jWLT54Xcdy?btD;*+PubK{x)?>4P%H9M9jCid!82D>vuz*Q0;meHB_UZ=L_U zr%x69SSDkA`UZIx56TW(KatdV)fGZs_qp|NqyY z^Dt(x+|8}?HCytAea`O2gy%Xdj^7NMZ&|Fx5Z!Qqk>Qzooa*z6!lgieFnGH9xvX literal 0 HcmV?d00001 From 2a6783f83e596be8949b931545be16adcb030749 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 16 Feb 2013 16:38:05 +0100 Subject: [PATCH 54/86] icons: remove unneeded radio.jpg Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5357724b4c2709245d4fc8205a42eb20eb89b9dd Author: vanhofen Date: 2013-02-16 (Sat, 16 Feb 2013) Origin message was: ------------------ - icons: remove unneeded radio.jpg ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/icons/radio.jpg | Bin 65088 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 data/icons/radio.jpg diff --git a/data/icons/radio.jpg b/data/icons/radio.jpg deleted file mode 100644 index 4a9072c536bee00993a2b6d8a3c7a380ea00ddeb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 65088 zcmb5U1yEaE+cugilqwY076>lIrASNB1VRZA9Ezk!2ox<&TcpJcA*6UA1ef9t4@DCS zG+2wfOVQx;&-4D@H)qb7Grz3t**mjk-S=cB`&yU${rz_q@BpN)r4G1q1pv50{s8_? z0A2vDUA_A6MjqG6+YQPaH?Cj5K}A7vlkyJLojbRwZr{FpkLJPMd(`)C-+n;)h-MDd!_U`SwwEx%R?>_))%4?5q0Ipr(1YD)Q za*g`R-wps9xyftfQ~x&nU*pPEa*sDDC~uK3t3Ci+C0D-kZ|~QxUL&6d{Ck=D2F+u! zn-8DsQE*z*in~#Asn9{+OJs4|#NVQqlyYZa1inx!Z?pCIkdRFz&%$~IaP{93|4)to z%=&K;@>Ow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lwZ-te&5pzYn0QpJvYhURbF3?sZ2*!@Hz9BnGvX;Jua_Ix(HtPmH&s7$iHj) z-`P2*2Y?;^za;QNADzDmTtU@`1KI&M$w2eZ|L+s7gBSbn190cxS4vy`YQpY2*;7DN mJL^_<^&76gZv+F!7jJ^+fCM)HWVuCD{O1q;kMC3bn)pB59wUqZ From 5d4baefb897cd6e6dfef91dcc045633888e0770f Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 16 Feb 2013 21:25:02 +0100 Subject: [PATCH 55/86] src/gui/infoviewer.cpp: fix div by zero Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0fc78c5738d5a4c9ccd8b76187cbc3f2b13cecaa Author: Jacek Jendrzej Date: 2013-02-16 (Sat, 16 Feb 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/infoviewer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index e6beea975..e9c3712c6 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -734,7 +734,10 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con prov_name=prov_name.substr(prov_name.find_first_of("]")+1); int chname_width = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth (ChannelName, true);// UTF-8 - chname_width += (chname_width/(ChannelName.size()-1)/2); + unsigned int chann_size = ChannelName.size(); + if(ChannelName.empty()) + chann_size = 1; + chname_width += (chname_width/chann_size/2); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString( ChanNameX + 10 + ChanNumWidth + chname_width, ChanNameY + time_height -SHADOW_OFFSET/2, BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 5 - ChanNumWidth - chname_width, From 18c1d242d187870f00c3556ef8d31e9e7eef79aa Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 17 Feb 2013 21:39:10 +0100 Subject: [PATCH 56/86] icons: remove unneeded ddfill.png Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b19bd8758015351507d75f79a556e275d684b3cf Author: vanhofen Date: 2013-02-17 (Sun, 17 Feb 2013) Origin message was: ------------------ - icons: remove unneeded ddfill.png ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/icons/Makefile.am | 1 - data/icons/ddfill.png | Bin 136 -> 0 bytes 2 files changed, 1 deletion(-) delete mode 100644 data/icons/ddfill.png diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am index ac3fbc5e7..6d2b7b202 100644 --- a/data/icons/Makefile.am +++ b/data/icons/Makefile.am @@ -69,7 +69,6 @@ install_DATA += \ dd.png \ dd_avail.png \ dd_gray.png \ - ddfill.png \ down.png \ error.png \ features.png \ diff --git a/data/icons/ddfill.png b/data/icons/ddfill.png deleted file mode 100644 index 88e3fc272211d1656ceffa5228024f8e9e9827f0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 136 zcmeAS@N?(olHy`uVBq!ia0vp^Qa~)g$P6TnZ_d99WHFWm z`2{mLJiCzw Date: Sun, 17 Feb 2013 21:55:21 +0100 Subject: [PATCH 57/86] channellist.cpp: allow colored events (for time) in right eventlist Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ddbac1b248345b433e0fbd26b30f1625e8e91a4f Author: vanhofen Date: 2013-02-17 (Sun, 17 Feb 2013) Origin message was: ------------------ - channellist.cpp: allow colored events (for time) in right eventlist ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 76c77e4fa..bcedccc05 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2164,7 +2164,7 @@ void CChannelList::paint_events(int index) strftime(startTime, sizeof(startTime), "%H:%M", tmStartZeit ); //printf("%s %s\n", startTime, e->description.c_str()); startTimeWidth = eventStartTimeWidth; - g_Font[eventFont]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, startTimeWidth, startTime, COL_MENUCONTENTINACTIVE, 0, true); + g_Font[eventFont]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, startTimeWidth, startTime, (g_settings.colored_events_channellist == 2 /* next */) ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTINACTIVE, 0, true); } g_Font[eventFont]->RenderString(x+ width+5+startTimeWidth, y+ theight+ pig_height + i*ffheight, infozone_width - startTimeWidth - 20, e->description, COL_MENUCONTENTDARK, 0, true); } From 119f0c82f6cbb95c1995d6460e16c94efb5ad729 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 17 Feb 2013 22:55:28 +0100 Subject: [PATCH 58/86] Revert "Revert '- channellist.cpp: enable to lock new_zap_mode'" This reverts commit 72fd77bb5f11f62dafd9274ad7ce87eae627c898. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/505c4ba80dc4334fd6828a0ada9fd7b22ec5d66f Author: vanhofen Date: 2013-02-17 (Sun, 17 Feb 2013) ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 3 +++ data/locale/english.locale | 3 +++ src/gui/channellist.cpp | 26 ++++++++++++++++---------- src/gui/channellist.h | 3 +-- src/gui/miscsettings_menu.cpp | 9 ++++++++- src/system/locals.h | 3 +++ src/system/locals_intern.h | 3 +++ 7 files changed, 37 insertions(+), 13 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 21aefc8db..abbe56b57 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -225,6 +225,9 @@ channellist.make_hdlist Erzeuge Bouquet mit HD-Kanälen channellist.make_newlist Erzeuge Bouquet mit neuen Kanälen channellist.make_removedlist Erzeuge Bouquet mit gelöschten Kanälen channellist.new_zap_mode Quickzap in Liste +channellist.new_zap_mode_active aktiv +channellist.new_zap_mode_allow erlauben +channellist.new_zap_mode_off aus channellist.nonefound Es wurden keine Kanäle gefunden!\nFühren Sie bitte eine Kanalsuche durch\n(MENU-Taste -> Service) channellist.provs Anbieter channellist.recording_not_possible Aufnahme nicht möglich! diff --git a/data/locale/english.locale b/data/locale/english.locale index e731c32ba..f4405d184 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -225,6 +225,9 @@ channellist.make_hdlist Create list of HD channels channellist.make_newlist Create list of new channels channellist.make_removedlist Create list of removed channels channellist.new_zap_mode Quickzap in list +channellist.new_zap_mode_active active +channellist.new_zap_mode_allow allow +channellist.new_zap_mode_off off channellist.nonefound No channels were found!\nPlease execute a scan\n(MENU-key -> service) channellist.provs Providers channellist.recording_not_possible Recording not possible! diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index bcedccc05..543789098 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -96,7 +96,7 @@ extern cVideo * videoDecoder; #define ConnectLineBox_Width 16 -CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vlist, bool ) +CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vlist) { frameBuffer = CFrameBuffer::getInstance(); name = pName; @@ -108,7 +108,6 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl this->historyMode = phistoryMode; vlist = _vlist; selected_chid = 0; - this->new_mode_active = false; footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+6; //initial height value for buttonbar previous_channellist_additional = -1; eventFont = SNeutrinoSettings::FONT_TYPE_CHANNELLIST_EVENT; @@ -541,7 +540,7 @@ bool CChannelList::updateSelection(int newpos) showChannelLogo(); } - if(this->new_mode_active && SameTP()) { + if((g_settings.channellist_new_zap_mode == 2 /* active */) && SameTP()) { actzap = true; zapTo(selected); } @@ -565,8 +564,6 @@ int CChannelList::show() return res; } - this->new_mode_active = 0; - calcSize(); displayNext = false; @@ -779,7 +776,17 @@ int CChannelList::show() } else if (( msg == CRCInput::RC_spkr ) && g_settings.channellist_new_zap_mode ) { if(CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_ts) { - this->new_mode_active = (this->new_mode_active ? 0 : 1); + switch (g_settings.channellist_new_zap_mode) { + case 2: /* active */ + g_settings.channellist_new_zap_mode = 1; /* allow */ + break; + case 1: /* allow */ + g_settings.channellist_new_zap_mode = 2; /* active */ + break; + default: + break; + + } paintHead(); showChannelLogo(); } @@ -902,7 +909,6 @@ int CChannelList::show() res = bouquetList->exec(true); printf("CChannelList:: bouquetList->exec res %d\n", res); } - this->new_mode_active = 0; if(NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode()) return -1; @@ -1153,7 +1159,7 @@ void CChannelList::zapTo(int pos, bool /* forceStoreToLastChannels */) zapToChannel(chan); tuned = pos; - if(this->new_mode_active) + if(g_settings.channellist_new_zap_mode == 2 /* active */) selected_in_new_mode = pos; else selected = pos; @@ -1189,7 +1195,7 @@ void CChannelList::zapToChannel(CZapitChannel *channel) g_RemoteControl->zapTo_ChannelID(channel->getChannelID(), channel->getName(), !channel->bAlwaysLocked); CNeutrinoApp::getInstance()->channelList->adjustToChannelID(channel->getChannelID()); } - if(!this->new_mode_active) { + if(g_settings.channellist_new_zap_mode != 2 /* not active */) { /* remove recordModeActive from infobar */ if(g_settings.auto_timeshift && !CNeutrinoApp::getInstance()->recordingstatus) { g_InfoViewer->handleMsg(NeutrinoMessages::EVT_RECORDMODE, 0); @@ -1996,7 +2002,7 @@ void CChannelList::paintHead() frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_INFO, x + full_width - iw1 - 10, y, theight); //y+ 5 ); frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MENU, x + full_width - iw1 - iw2 - 14, y, theight);//y + 5); // icon for bouquet list button if (g_settings.channellist_new_zap_mode) - frameBuffer->paintIcon(this->new_mode_active ? + frameBuffer->paintIcon((g_settings.channellist_new_zap_mode == 2 /* active */) ? NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE : NEUTRINO_ICON_BUTTON_MUTE_ZAP_INACTIVE, x + full_width - iw1 - iw2 - iw3 - 18, y, theight); diff --git a/src/gui/channellist.h b/src/gui/channellist.h index 248f3c6cb..7fa9e8ed0 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -93,7 +93,6 @@ private: bool displayList; int info_height; - bool new_mode_active; int ChannelList_Rec; void paintDetails(int index); @@ -120,7 +119,7 @@ private: void processTextToArray(std::string text, int screening = 0); public: - CChannelList(const char * const Name, bool historyMode = false, bool _vlist = false, bool new_mode_active = false ); + CChannelList(const char * const Name, bool historyMode = false, bool _vlist = false); ~CChannelList(); void SetChannelList(ZapitChannelList* channels); diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 9cb4d2692..97f6b0214 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -134,6 +134,13 @@ const CMenuOptionChooser::keyval MISCSETTINGS_FILESYSTEM_IS_UTF8_OPTIONS[MISCSET { 1, LOCALE_FILESYSTEM_IS_UTF8_OPTION_UTF8 } }; +#define CHANNELLIST_NEW_ZAP_MODE_OPTION_COUNT 3 +const CMenuOptionChooser::keyval CHANNELLIST_NEW_ZAP_MODE_OPTIONS[CHANNELLIST_NEW_ZAP_MODE_OPTION_COUNT] = +{ + { 0, LOCALE_CHANNELLIST_NEW_ZAP_MODE_OFF }, + { 1, LOCALE_CHANNELLIST_NEW_ZAP_MODE_ALLOW }, + { 2, LOCALE_CHANNELLIST_NEW_ZAP_MODE_ACTIVE } +}; #ifdef CPU_FREQ #define CPU_FREQ_OPTION_COUNT 13 @@ -392,7 +399,7 @@ void CMiscMenue::showMiscSettingsMenuChanlist(CMenuWidget *ms_chanlist) mc->setHint("", LOCALE_MENU_HINT_ZAP_CYCLE); ms_chanlist->addItem(mc); - mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_NEW_ZAP_MODE, &g_settings.channellist_new_zap_mode, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true ); + mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_NEW_ZAP_MODE, &g_settings.channellist_new_zap_mode, CHANNELLIST_NEW_ZAP_MODE_OPTIONS, CHANNELLIST_NEW_ZAP_MODE_OPTION_COUNT, true ); mc->setHint("", LOCALE_MENU_HINT_NEW_ZAP_MODE); ms_chanlist->addItem(mc); } diff --git a/src/system/locals.h b/src/system/locals.h index 48a6f1c1f..38203a667 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -252,6 +252,9 @@ typedef enum LOCALE_CHANNELLIST_MAKE_NEWLIST, LOCALE_CHANNELLIST_MAKE_REMOVEDLIST, LOCALE_CHANNELLIST_NEW_ZAP_MODE, + LOCALE_CHANNELLIST_NEW_ZAP_MODE_ACTIVE, + LOCALE_CHANNELLIST_NEW_ZAP_MODE_ALLOW, + LOCALE_CHANNELLIST_NEW_ZAP_MODE_OFF, LOCALE_CHANNELLIST_NONEFOUND, LOCALE_CHANNELLIST_PROVS, LOCALE_CHANNELLIST_RECORDING_NOT_POSSIBLE, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index ee4f87d9d..a712c50d2 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -252,6 +252,9 @@ const char * locale_real_names[] = "channellist.make_newlist", "channellist.make_removedlist", "channellist.new_zap_mode", + "channellist.new_zap_mode_active", + "channellist.new_zap_mode_allow", + "channellist.new_zap_mode_off", "channellist.nonefound", "channellist.provs", "channellist.recording_not_possible", From 5cb52c38dd01b7f473ce890bf0b5f5991142e505 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 17 Feb 2013 22:57:37 +0100 Subject: [PATCH 59/86] channellist.cpp: fix broken display of infobar while zapping Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9632f3bad75b52e491a1b44e722490204c76facc Author: vanhofen Date: 2013-02-17 (Sun, 17 Feb 2013) Origin message was: ------------------ - channellist.cpp: fix broken display of infobar while zapping ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 33 ++++++++++++++++++++------------- src/gui/channellist.h | 1 + 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 543789098..2b01333cd 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -107,6 +107,7 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl zapProtection = NULL; this->historyMode = phistoryMode; vlist = _vlist; + new_zap_mode = 0; selected_chid = 0; footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+6; //initial height value for buttonbar previous_channellist_additional = -1; @@ -499,7 +500,7 @@ void CChannelList::calcSize() frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MENU, &icol_w, &icol_h); theight = std::max(theight, icol_h); - if(g_settings.channellist_new_zap_mode) + if(new_zap_mode) { frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE, &icol_w, &icol_h); theight = std::max(theight, icol_h); @@ -540,7 +541,7 @@ bool CChannelList::updateSelection(int newpos) showChannelLogo(); } - if((g_settings.channellist_new_zap_mode == 2 /* active */) && SameTP()) { + if((new_zap_mode == 2 /* active */) && SameTP()) { actzap = true; zapTo(selected); } @@ -564,6 +565,8 @@ int CChannelList::show() return res; } + new_zap_mode = g_settings.channellist_new_zap_mode; + calcSize(); displayNext = false; @@ -774,14 +777,14 @@ int CChannelList::show() loop=false; } } - else if (( msg == CRCInput::RC_spkr ) && g_settings.channellist_new_zap_mode ) { + else if (( msg == CRCInput::RC_spkr ) && new_zap_mode ) { if(CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_ts) { - switch (g_settings.channellist_new_zap_mode) { + switch (new_zap_mode) { case 2: /* active */ - g_settings.channellist_new_zap_mode = 1; /* allow */ + new_zap_mode = 1; /* allow */ break; case 1: /* allow */ - g_settings.channellist_new_zap_mode = 2; /* active */ + new_zap_mode = 2; /* active */ break; default: break; @@ -901,6 +904,10 @@ int CChannelList::show() } } } + if (g_settings.channellist_new_zap_mode != new_zap_mode) + g_settings.channellist_new_zap_mode = new_zap_mode; + new_zap_mode = 0; + hide(); fader.Stop(); @@ -1159,7 +1166,7 @@ void CChannelList::zapTo(int pos, bool /* forceStoreToLastChannels */) zapToChannel(chan); tuned = pos; - if(g_settings.channellist_new_zap_mode == 2 /* active */) + if(new_zap_mode == 2 /* active */) selected_in_new_mode = pos; else selected = pos; @@ -1195,7 +1202,7 @@ void CChannelList::zapToChannel(CZapitChannel *channel) g_RemoteControl->zapTo_ChannelID(channel->getChannelID(), channel->getName(), !channel->bAlwaysLocked); CNeutrinoApp::getInstance()->channelList->adjustToChannelID(channel->getChannelID()); } - if(g_settings.channellist_new_zap_mode != 2 /* not active */) { + if(new_zap_mode != 2 /* not active */) { /* remove recordModeActive from infobar */ if(g_settings.auto_timeshift && !CNeutrinoApp::getInstance()->recordingstatus) { g_InfoViewer->handleMsg(NeutrinoMessages::EVT_RECORDMODE, 0); @@ -1993,7 +2000,7 @@ void CChannelList::paintHead() int iw1, iw2, iw3, ih = 0; frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_INFO, &iw1, &ih); frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MENU, &iw2, &ih); - if (g_settings.channellist_new_zap_mode) + if (new_zap_mode) frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE, &iw3, &ih); // head @@ -2001,20 +2008,20 @@ void CChannelList::paintHead() frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_INFO, x + full_width - iw1 - 10, y, theight); //y+ 5 ); frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MENU, x + full_width - iw1 - iw2 - 14, y, theight);//y + 5); // icon for bouquet list button - if (g_settings.channellist_new_zap_mode) - frameBuffer->paintIcon((g_settings.channellist_new_zap_mode == 2 /* active */) ? + if (new_zap_mode) + frameBuffer->paintIcon((new_zap_mode == 2 /* active */) ? NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE : NEUTRINO_ICON_BUTTON_MUTE_ZAP_INACTIVE, x + full_width - iw1 - iw2 - iw3 - 18, y, theight); if (gotTime) { - int iw3x = (g_settings.channellist_new_zap_mode) ? iw3 : -4; + int iw3x = (new_zap_mode) ? iw3 : -4; g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + full_width - iw1 - iw2 - iw3x - 28 -timestr_len, y+theight, timestr_len, timestr, COL_MENUHEAD, 0, true); // UTF-8 timestr_len += 4; } timestr_len += iw1 + iw2 + 12; - if (g_settings.channellist_new_zap_mode) + if (new_zap_mode) timestr_len += iw3 + 10; logo_off = timestr_len + 10; g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, full_width - timestr_len, name, COL_MENUHEAD, 0, true); // UTF-8 diff --git a/src/gui/channellist.h b/src/gui/channellist.h index 7fa9e8ed0..61bfed57a 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -64,6 +64,7 @@ private: unsigned int liststart; unsigned int listmaxshow; unsigned int numwidth; + int new_zap_mode; int fheight; // Fonthoehe Channellist-Inhalt int theight; // Fonthoehe Channellist-Titel int footerHeight; From 7add27227acf8da467abe5a9671792b1854dce16 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 17 Feb 2013 23:20:04 +0100 Subject: [PATCH 60/86] channellist.cpp: fix logo position if new_zap_mode is off Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/782c9f107c14da6b99fce724b55571e200be82d3 Author: vanhofen Date: 2013-02-17 (Sun, 17 Feb 2013) Origin message was: ------------------ - channellist.cpp: fix logo position if new_zap_mode is off ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 2b01333cd..442633615 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2014,7 +2014,7 @@ void CChannelList::paintHead() x + full_width - iw1 - iw2 - iw3 - 18, y, theight); if (gotTime) { - int iw3x = (new_zap_mode) ? iw3 : -4; + int iw3x = (new_zap_mode) ? iw3 : -10; g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + full_width - iw1 - iw2 - iw3x - 28 -timestr_len, y+theight, timestr_len, timestr, COL_MENUHEAD, 0, true); // UTF-8 timestr_len += 4; From 544cec7f7ff03963b20d8bb6137d6f5df6b36606 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 18 Feb 2013 21:00:19 +0100 Subject: [PATCH 61/86] channellist.cpp: show pic instead of miniTV in radiomode Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8a7687abe189f8db85b2930c6c593416dccc0296 Author: vanhofen Date: 2013-02-18 (Mon, 18 Feb 2013) Origin message was: ------------------ - channellist.cpp: show pic instead of miniTV in radiomode ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 442633615..a8f013829 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2032,7 +2032,12 @@ void CChannelList::paint() if (g_settings.channellist_additional == 2) // with miniTV { // 5px offset - same value as in list below - paint_pig(x+width+5, y+theight+5, pig_width-10, pig_height-10); + if(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_tv) { + paint_pig(x+width+5, y+theight+5, pig_width-10, pig_height-10); + } + else if(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_radio) { + g_PicViewer->DisplayImage(DATADIR "/neutrino/icons/radiomode.jpg", x+width+5, y+theight+5, pig_width-10, pig_height-10, frameBuffer->TM_NONE); + } } numwidth = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(MaxChanNr().c_str()); From 9bfda4ef8002f023f627d5f993d638c5ebb1373a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 18 Feb 2013 21:54:52 +0100 Subject: [PATCH 62/86] channellist.cpp: change order of painting to be more liquid Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b307f4c8d4295e12305c8cc3b6e35cc3b696fedf Author: vanhofen Date: 2013-02-18 (Mon, 18 Feb 2013) Origin message was: ------------------ - channellist.cpp: change order of painting to be more liquid ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index a8f013829..5efe68fd9 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -573,11 +573,6 @@ int CChannelList::show() COSDFader fader(g_settings.menu_Content_alpha); fader.StartFadeIn(); - if (g_settings.channellist_additional) - { - frameBuffer->paintBoxRel(x+width,y+theight,infozone_width,pig_height+infozone_height,COL_MENUCONTENT_PLUS_0); - } - paintHead(); paint(); @@ -2029,23 +2024,17 @@ void CChannelList::paintHead() void CChannelList::paint() { - if (g_settings.channellist_additional == 2) // with miniTV - { - // 5px offset - same value as in list below - if(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_tv) { - paint_pig(x+width+5, y+theight+5, pig_width-10, pig_height-10); - } - else if(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_radio) { - g_PicViewer->DisplayImage(DATADIR "/neutrino/icons/radiomode.jpg", x+width+5, y+theight+5, pig_width-10, pig_height-10, frameBuffer->TM_NONE); - } - } - numwidth = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(MaxChanNr().c_str()); liststart = (selected/listmaxshow)*listmaxshow; updateEvents(this->historyMode ? 0:liststart, this->historyMode ? 0:(liststart + listmaxshow)); - frameBuffer->paintBoxRel(x, y+theight, width, height-footerHeight-theight, COL_MENUCONTENT_PLUS_0, 0, CORNER_BOTTOM); + // paint background for main box + frameBuffer->paintBoxRel(x, y+theight, width, height-footerHeight-theight, COL_MENUCONTENT_PLUS_0); + if (g_settings.channellist_additional) + // paint background for right box + frameBuffer->paintBoxRel(x+width,y+theight,infozone_width,pig_height+infozone_height,COL_MENUCONTENT_PLUS_0); + for(unsigned int count = 0; count < listmaxshow; count++) { paintItem(count); } @@ -2058,6 +2047,19 @@ void CChannelList::paint() frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs*(sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); showChannelLogo(); + + if (g_settings.channellist_additional == 2) // with miniTV + { + // paint box for miniTV again - important! + frameBuffer->paintBoxRel(x+width, y+theight , pig_width, pig_height, COL_MENUCONTENT_PLUS_0); + // 5px offset - same value as in list below + if(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_tv) { + paint_pig(x+width+5, y+theight+5, pig_width-10, pig_height-10); + } + else if(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_radio) { + g_PicViewer->DisplayImage(DATADIR "/neutrino/icons/radiomode.jpg", x+width+5, y+theight+5, pig_width-10, pig_height-10, frameBuffer->TM_NONE); + } + } } bool CChannelList::isEmpty() const @@ -2127,7 +2129,7 @@ std::string CChannelList::MaxChanNr() void CChannelList::paint_pig (int _x, int _y, int w, int h) { frameBuffer->paintBackgroundBoxRel (_x, _y, w, h); - printf("CChannelList::paint_pig x %d y %d w %d h %d osd_w %d osd_w %d\n", _x, _y, w, h, frameBuffer->getScreenWidth(true), frameBuffer->getScreenHeight(true)); + //printf("CChannelList::paint_pig x %d y %d w %d h %d osd_w %d osd_w %d\n", _x, _y, w, h, frameBuffer->getScreenWidth(true), frameBuffer->getScreenHeight(true)); videoDecoder->Pig(_x, _y, w, h, frameBuffer->getScreenWidth(true), frameBuffer->getScreenHeight(true)); } From 2800b5617882ac0d10effb778991cb613e87e45e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 19 Feb 2013 00:11:12 +0100 Subject: [PATCH 63/86] audioplayer.cpp: restore correct background when leaving screensaver and remove background-pic from screensaver-loop Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6e828fa0a4a96a51b36367a47ad254b81f7fff59 Author: vanhofen Date: 2013-02-19 (Tue, 19 Feb 2013) Origin message was: ------------------ - audioplayer.cpp: restore correct background when leaving screensaver and remove background-pic from screensaver-loop ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 13f2184df..bded5bdfc 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -420,8 +420,6 @@ int CAudioPlayerGui::show() videoDecoder->ShowPicture(fname); } else if (pic_index) { pic_index = 0; - videoDecoder->StopPicture(); - videoDecoder->ShowPicture(DATADIR "/neutrino/icons/mp3.jpg"); } } else pic_index = 0; @@ -2330,11 +2328,8 @@ void CAudioPlayerGui::screensaver(bool on) { g_RCInput->killTimer(stimer); m_screensaver = false; -#if 0 - m_frameBuffer->loadPal("radiomode.pal", 18, COL_MAXFREE); - m_frameBuffer->useBackground(m_frameBuffer->loadBackground(NEUTRINO_ICON_RADIOMODE));// set useBackground true or false - m_frameBuffer->paintBackground(); -#endif + videoDecoder->StopPicture(); + videoDecoder->ShowPicture(DATADIR "/neutrino/icons/mp3.jpg"); paint(); m_idletime = time(NULL); } From 58bfc8e31e7f3a59f008c5d822942f075a8e0f01 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 19 Feb 2013 11:11:58 +0100 Subject: [PATCH 64/86] audioplayer.cpp: fix cursor-background with round borders Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/59642214f77a9d43badd45d03db7b2ee34bf07f9 Author: vanhofen Date: 2013-02-19 (Tue, 19 Feb 2013) Origin message was: ------------------ - audioplayer.cpp: fix cursor-background with round borders ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index bded5bdfc..e8bd6ba24 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1588,6 +1588,7 @@ void CAudioPlayerGui::paintItem(int pos) c_rad_small = 0; } + m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_fheight, COL_MENUCONTENT_PLUS_0); m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_fheight, bgcolor, c_rad_small); if ((pos + m_liststart) < m_playlist.size()) From 2b4cf29743dbe713da85f862a83a373538bc5967 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 19 Feb 2013 11:27:46 +0100 Subject: [PATCH 65/86] CComponents: move class into its own source directory The components could over time become quite large, so it makes more sense, coming features to split into multiple files and to do it in a separate directory. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0a961a4cf6446378b7af2e0a0f476ae9885bd749 Author: Thilo Graf Date: 2013-02-19 (Tue, 19 Feb 2013) ------------------ This commit was generated by Migit --- configure.ac | 1 + src/Makefile.am | 1 + src/gui/Makefile.am | 2 +- src/gui/audioplayer.h | 2 +- src/gui/bedit/bouqueteditor_channels.h | 2 +- src/gui/bedit/bouqueteditor_chanselect.h | 2 +- src/gui/channellist.cpp | 2 +- src/gui/components/Makefile.am | 20 +++++++++++++++++++ .../{widget/components.h => components/cc.h} | 8 ++++---- src/gui/{widget => components}/components.cpp | 11 +++++----- src/gui/widget/Makefile.am | 1 - src/gui/widget/menue.h | 2 +- 12 files changed, 38 insertions(+), 16 deletions(-) create mode 100644 src/gui/components/Makefile.am rename src/gui/{widget/components.h => components/cc.h} (94%) rename src/gui/{widget => components}/components.cpp (96%) diff --git a/configure.ac b/configure.ac index f5e82089c..0e7a39895 100644 --- a/configure.ac +++ b/configure.ac @@ -176,6 +176,7 @@ src/driver/audiodec/Makefile src/driver/Makefile src/gui/Makefile src/gui/bedit/Makefile +src/gui/components/Makefile src/gui/widget/Makefile src/system/Makefile data/Makefile diff --git a/src/Makefile.am b/src/Makefile.am index 93560a0cb..dd1b2ebed 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -48,6 +48,7 @@ endif neutrino_LDADD = \ daemonc/libneutrino_daemonc.a \ gui/bedit/libneutrino_gui_bedit.a \ + gui/components/libneutrino_gui_components.a \ gui/libtimerlist.a \ gui/libneutrino_gui.a \ gui/widget/libneutrino_gui_widget.a \ diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 4f084a469..4da8fc6a1 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -18,7 +18,7 @@ noinst_HEADERS = git_version.h .PHONY: makeversion -SUBDIRS = widget bedit +SUBDIRS = bedit components widget INCLUDES = \ -I$(top_builddir) \ diff --git a/src/gui/audioplayer.h b/src/gui/audioplayer.h index e4f0c6894..74284ed4a 100644 --- a/src/gui/audioplayer.h +++ b/src/gui/audioplayer.h @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/gui/bedit/bouqueteditor_channels.h b/src/gui/bedit/bouqueteditor_channels.h index bcc653e74..d3132af0d 100644 --- a/src/gui/bedit/bouqueteditor_channels.h +++ b/src/gui/bedit/bouqueteditor_channels.h @@ -35,7 +35,7 @@ #include #include -#include +#include #include #include diff --git a/src/gui/bedit/bouqueteditor_chanselect.h b/src/gui/bedit/bouqueteditor_chanselect.h index 963862550..58ad2ebf3 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.h +++ b/src/gui/bedit/bouqueteditor_chanselect.h @@ -34,7 +34,7 @@ #include #include -#include +#include #include #include diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 5efe68fd9..7e78f77a4 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -55,7 +55,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/gui/components/Makefile.am b/src/gui/components/Makefile.am new file mode 100644 index 000000000..5765a440c --- /dev/null +++ b/src/gui/components/Makefile.am @@ -0,0 +1,20 @@ +AM_CPPFLAGS = -fno-rtti -fno-exceptions + +INCLUDES = \ + -I$(top_builddir) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/zapit/include \ + -I$(top_srcdir)/lib \ + -I$(top_srcdir)/lib/libeventserver \ + -I$(top_srcdir)/lib/libconfigfile \ + -I$(top_srcdir)/lib/libcoolstream \ + -I$(top_srcdir)/lib/xmltree \ + @FREETYPE_CFLAGS@ + + +noinst_LIBRARIES = libneutrino_gui_components.a + + +libneutrino_gui_components_a_SOURCES = \ + components.cpp diff --git a/src/gui/widget/components.h b/src/gui/components/cc.h similarity index 94% rename from src/gui/widget/components.h rename to src/gui/components/cc.h index c7ec2586a..522146dfc 100644 --- a/src/gui/widget/components.h +++ b/src/gui/components/cc.h @@ -1,9 +1,9 @@ /* - GUI window component classes - Neutrino-GUI + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' - Copyright(C) 2012, Thilo Graf (dbt) - - This class contains generic components for GUI-related parts. + Classes for generic for GUI-related components. + Copyright (C) 2012, 2013, Thilo Graf 'dbt' License: GPL diff --git a/src/gui/widget/components.cpp b/src/gui/components/components.cpp similarity index 96% rename from src/gui/widget/components.cpp rename to src/gui/components/components.cpp index be43e39b5..63893826f 100644 --- a/src/gui/widget/components.cpp +++ b/src/gui/components/components.cpp @@ -1,9 +1,10 @@ /* - GUI window component classes - Neutrino-GUI + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' - Copyright(C) 2012, Thilo Graf (dbt) - - This class contains generic components for GUI-related parts. + Classes for generic for GUI-related components. + Copyright (C) 2012, 2013, Thilo Graf 'dbt' + Copyright (C) 2012, Michael Liebmann 'micha-bbg' License: GPL @@ -29,7 +30,7 @@ #include #include -#include +#include "cc.h" diff --git a/src/gui/widget/Makefile.am b/src/gui/widget/Makefile.am index 4b12dbb6a..6cdfee1fe 100644 --- a/src/gui/widget/Makefile.am +++ b/src/gui/widget/Makefile.am @@ -22,7 +22,6 @@ noinst_LIBRARIES = libneutrino_gui_widget.a libneutrino_gui_widget2.a libneutrino_gui_widget_a_SOURCES = \ buttons.cpp \ colorchooser.cpp \ - components.cpp \ drawable.cpp \ helpbox.cpp \ hintbox.cpp \ diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index 1d694afa9..d5d33db33 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include From 76d3e3f7b13e77318d5d7683e81a1acfce1abcdc Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 19 Feb 2013 12:07:29 +0100 Subject: [PATCH 66/86] yweb: return to /bin/fbshot for osd-only screenshots the internal screenshot function seems paralyzed sometimes. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/bf56c88ee40471043b7f4676726886588e1ce9d3 Author: vanhofen Date: 2013-02-19 (Tue, 19 Feb 2013) Origin message was: ------------------ - yweb: return to /bin/fbshot for osd-only screenshots the internal screenshot function seems paralyzed sometimes. ------------------ This commit was generated by Migit --- src/nhttpd/web/Y_Tools_Screenshot.yhtm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/nhttpd/web/Y_Tools_Screenshot.yhtm b/src/nhttpd/web/Y_Tools_Screenshot.yhtm index 165f4fb95..2d6c836cc 100644 --- a/src/nhttpd/web/Y_Tools_Screenshot.yhtm +++ b/src/nhttpd/web/Y_Tools_Screenshot.yhtm @@ -1,3 +1,5 @@ +{=var-set:fbshot={=if-file-exists:/bin/fbshot~true~{=if-file-exists:/var/bin/fbshot~true~false=}=}=} + {=include-block:Y_Blocks.txt;head=} @@ -41,8 +43,12 @@ function do_snapshot() { filename = id("filename").value; } - var _null = loadSyncURL("/control/screenshot?name="+filename+"&osd="+enableOSD+"&video="+enableVideo); - window.setTimeout("do_showshot('"+filename+"');", (enableVideo == 1) ? 3500 : 1500); + if ({=var-get:fbshot=} == true && enableVideo == 0) + dbox_exec_tools("fbshot fb /tmp/"+filename+".png"); + else + loadSyncURL("/control/screenshot?name="+filename+"&osd="+enableOSD+"&video="+enableVideo); + + window.setTimeout("do_showshot('"+filename+"');", (enableVideo == 1) ? 6500 : 3000); } function do_showshot(_filename) { if (_filename == "") @@ -102,7 +108,7 @@ function do_zoomshot(){ {=include-block:Y_Blocks.txt;remote=} - + From 0d6d5afd3e7585b6d5f7d3b10d310217b2933eb6 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 19 Feb 2013 22:09:47 +0100 Subject: [PATCH 67/86] audioplayer.cpp: ignore first keypress when screensaver is on just quit the screensaver and return to loop Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/95b51f699314122b7040a18575bf3f56546fe22f Author: vanhofen Date: 2013-02-19 (Tue, 19 Feb 2013) Origin message was: ------------------ - audioplayer.cpp: ignore first keypress when screensaver is on just quit the screensaver and return to loop ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index e8bd6ba24..19fe0fcc5 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -432,6 +432,11 @@ int CAudioPlayerGui::show() if (m_screensaver) { screensaver(false); + if (msg < CRCInput::RC_MaxRC) { + // ignore first keypress - just quit the screensaver + g_RCInput->clearRCMsg(); + continue; + } } } From 8e93ba0e33ca6f788988c0d90b3502f303471816 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 20 Feb 2013 00:59:39 +0100 Subject: [PATCH 68/86] audioplayer.cpp: remove not working code with mute-icon handling Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ed52353607f44b77d986fdfd9bcc7ebb6f475d81 Author: vanhofen Date: 2013-02-20 (Wed, 20 Feb 2013) Origin message was: ------------------ - audioplayer.cpp: remove not working code with mute-icon handling ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 19fe0fcc5..883584a1a 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -360,6 +360,9 @@ int CAudioPlayerGui::show() int ret = menu_return::RETURN_REPAINT; + // clear whole screen + m_frameBuffer->paintBackground(); + CVFD::getInstance()->setMode(CVFD::MODE_AUDIO); paintLCD(); @@ -898,9 +901,6 @@ int CAudioPlayerGui::show() ret = menu_return::RETURN_EXIT_ALL; loop = false; } - // update mute icon - //paintHead(); - //paintLCD(); } } hide(); @@ -1669,20 +1669,6 @@ void CAudioPlayerGui::paintHead() } //m_frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MENU, m_x + m_width - 30, ypos); #endif -#if 1 - if ( CNeutrinoApp::getInstance()->isMuted() ) - { -#if 0 - int xpos = m_x + m_width - 75; - ypos = m_y + m_title_height; - if (m_theight > 32) - ypos = (m_theight - 32) / 2 + m_y + m_title_height; - m_frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MUTE, xpos, ypos); -#endif - m_frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE, &iw, &ih); - m_frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MUTE, xpos - iw, ypos, m_theight); - } -#endif } //------------------------------------------------------------------------ From ff7b56035d4ee396726a1c49448b8252c5ecb7db Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 20 Feb 2013 02:09:26 +0100 Subject: [PATCH 69/86] audioplayer: don't paint something if screensaver is active Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/178ec028cbc8b9e6f684a5fdd117ce20484b6f38 Author: vanhofen Date: 2013-02-20 (Wed, 20 Feb 2013) Origin message was: ------------------ - audioplayer: don't paint something if screensaver is active ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 883584a1a..ca8ae6c22 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1721,7 +1721,9 @@ const struct button_label AudioPlayerButtons[][4] = void CAudioPlayerGui::paintFoot() { - // printf("paintFoot{\n"); + if (m_screensaver) + return; + const struct button_label ScondLineButtons[3] = { { NEUTRINO_ICON_BUTTON_OKAY , LOCALE_AUDIOPLAYER_PLAY }, @@ -1786,6 +1788,9 @@ const struct button_label ScondLineButtons[3] = //------------------------------------------------------------------------ void CAudioPlayerGui::paintInfo() { + if (m_screensaver) + return; + int c_rad_mid = RADIUS_MID; if (m_state == CAudioPlayerGui::STOP && m_show_playlist) m_frameBuffer->paintBackgroundBoxRel(m_x, m_y, m_width, m_title_height); @@ -1882,8 +1887,8 @@ void CAudioPlayerGui::paint() m_frameBuffer->paintBoxRel(m_x + m_width - 13, ypos + 2 + sbs*(sb-4)/sbc , 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3, RADIUS_SMALL); } - paintFoot(); paintInfo(); + paintFoot(); m_visible = true; } @@ -2099,11 +2104,9 @@ void CAudioPlayerGui::play(unsigned int pos) //LCD paintLCD(); // Display - if (!m_screensaver) - paintInfo(); + paintInfo(); m_key_level = 1; - if (!m_screensaver) - paintFoot(); + paintFoot(); } } //------------------------------------------------------------------------ From d37d693cc83f05b1df8839a0bac8ba7fd5e78550 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 20 Feb 2013 03:00:09 +0100 Subject: [PATCH 70/86] audioplayer.cpp: fix display of buttons and round corners in footer Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/92e6d383bd8c76580e5d405039be807482f4b48b Author: vanhofen Date: 2013-02-20 (Wed, 20 Feb 2013) Origin message was: ------------------ - audioplayer.cpp: fix display of buttons and round corners in footer ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index ca8ae6c22..ab701f6cb 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1739,49 +1739,49 @@ const struct button_label ScondLineButtons[3] = top = m_y + (m_height - 2 * m_buttonHeight); int ButtonWidth = (m_width - 20) / 5; - //int ButtonWidth2 = (m_width - 50) / 2; - m_frameBuffer->paintBoxRel(m_x, top, m_width, 2 * m_buttonHeight, COL_INFOBAR_SHADOW_PLUS_1, c_rad_mid, CORNER_BOTTOM); - m_frameBuffer->paintHLine(m_x, m_x + m_width, top, COL_INFOBAR_SHADOW_PLUS_1); + + m_frameBuffer->paintBoxRel(m_x, top, m_width, 2 * m_buttonHeight, COL_INFOBAR_SHADOW_PLUS_1, c_rad_mid, (m_show_playlist ? CORNER_BOTTOM : CORNER_ALL)); + // why? m_frameBuffer->paintHLine(m_x, m_x + m_width, top, COL_INFOBAR_SHADOW_PLUS_1); if (!m_playlist.empty()) - ::paintButtons(m_x, top+m_buttonHeight, m_width, 3, ScondLineButtons, m_buttonHeight, ButtonWidth); + ::paintButtons(m_x + c_rad_mid, top+m_buttonHeight, m_width - (2*c_rad_mid), 3, ScondLineButtons, m_buttonHeight, ButtonWidth); if (m_key_level == 0) { if (m_playlist.empty()) { if (m_inetmode) - ::paintButtons(m_x, top, m_width, 2, AudioPlayerButtons[7], m_buttonHeight, ButtonWidth); + ::paintButtons(m_x + c_rad_mid, top, m_width - (2*c_rad_mid), 2, AudioPlayerButtons[7], m_buttonHeight, ButtonWidth); else - ::paintButtons(m_x, top, m_width, 1, &(AudioPlayerButtons[7][0]), m_buttonHeight, ButtonWidth); + ::paintButtons(m_x + c_rad_mid, top, m_width - (2*c_rad_mid), 1, &(AudioPlayerButtons[7][0]), m_buttonHeight, ButtonWidth); } else if (m_inetmode) - ::paintButtons(m_x, top, m_width, 4, AudioPlayerButtons[8], m_buttonHeight, ButtonWidth); + ::paintButtons(m_x + c_rad_mid, top, m_width - (2*c_rad_mid), 4, AudioPlayerButtons[8], m_buttonHeight, ButtonWidth); else - ::paintButtons(m_x, top, m_width, 4, AudioPlayerButtons[1], m_buttonHeight, ButtonWidth); + ::paintButtons(m_x + c_rad_mid, top, m_width - (2*c_rad_mid), 4, AudioPlayerButtons[1], m_buttonHeight, ButtonWidth); } else if (m_key_level == 1) { if (m_curr_audiofile.FileType != CFile::STREAM_AUDIO) - ::paintButtons(m_x, top, m_width, 4, AudioPlayerButtons[0], m_buttonHeight, ButtonWidth); + ::paintButtons(m_x + c_rad_mid, top, m_width - (2*c_rad_mid), 4, AudioPlayerButtons[0], m_buttonHeight, ButtonWidth); else - ::paintButtons( m_x, top, m_width, 2, AudioPlayerButtons[6], m_buttonHeight, ButtonWidth); + ::paintButtons(m_x + c_rad_mid, top, m_width - (2*c_rad_mid), 2, AudioPlayerButtons[6], m_buttonHeight, ButtonWidth); } else { // key_level == 2 if (m_state == CAudioPlayerGui::STOP) { if (m_select_title_by_name) - ::paintButtons(m_x /*+ ButtonWidth*/, top, m_width, 2, AudioPlayerButtons[5], m_buttonHeight, ButtonWidth); + ::paintButtons(m_x + c_rad_mid, top, m_width - (2*c_rad_mid), 2, AudioPlayerButtons[5], m_buttonHeight, ButtonWidth); else - ::paintButtons(m_x/* + ButtonWidth*/, top, m_width, 2, AudioPlayerButtons[4], m_buttonHeight, ButtonWidth); + ::paintButtons(m_x + c_rad_mid, top, m_width - (2*c_rad_mid), 2, AudioPlayerButtons[4], m_buttonHeight, ButtonWidth); } else { if (m_select_title_by_name) - ::paintButtons(m_x/* + ButtonWidth*/, top, m_width, 2, AudioPlayerButtons[3], m_buttonHeight, ButtonWidth); + ::paintButtons(m_x + c_rad_mid, top, m_width - (2*c_rad_mid), 2, AudioPlayerButtons[3], m_buttonHeight, ButtonWidth); else - ::paintButtons(m_x/* + ButtonWidth*/, top, m_width, 2, AudioPlayerButtons[2], m_buttonHeight, ButtonWidth); + ::paintButtons(m_x + c_rad_mid, top, m_width - (2*c_rad_mid), 2, AudioPlayerButtons[2], m_buttonHeight, ButtonWidth); } } } From 19857a55216931b4a7a5d6d3d2b0b4ee5e8d567a Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Wed, 20 Feb 2013 15:20:55 +0100 Subject: [PATCH 71/86] my_popen: close filedescriptors before exec Signed-off-by: Jacek Jendrzej Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3064107b907d8f564044841a2f1fd393cef3b4b7 Author: Stefan Seyfried Date: 2013-02-20 (Wed, 20 Feb 2013) ------------------ This commit was generated by Migit --- src/system/helpers.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 16ca36bd0..998dcabaa 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -129,6 +129,9 @@ FILE* my_popen( pid_t& pid, const char *cmdstring, const char *type) close(pfd[0]); } } + int maxfd = getdtablesize(); + for(int i = 3; i < maxfd; i++) + close(i); execl("/bin/sh", "sh", "-c", cmdstring, (char *)0); exit(0); } From 50b512e21b4226318c5b13fde788e65424551f7e Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 17 Feb 2013 19:10:49 +0100 Subject: [PATCH 72/86] infoviewer_bb: limit text width to available space only use the available space to draw the button texts Signed-off-by: Jacek Jendrzej Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ab191b1c76eaa5faa6f0ad01c4c692bad23346b3 Author: Stefan Seyfried Date: 2013-02-17 (Sun, 17 Feb 2013) ------------------ This commit was generated by Migit --- src/gui/infoviewer_bb.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 62c3bca74..0ef15bf1c 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -347,12 +347,21 @@ void CInfoViewerBB::showBBButtons(const int modus) } if (paint) { + int last_x = minX; frameBuffer->paintBoxRel(g_InfoViewer->ChanInfoX, BBarY, minX - g_InfoViewer->ChanInfoX, InfoHeightY_Info, COL_INFOBAR_BUTTONS_BACKGROUND, RADIUS_SMALL, CORNER_BOTTOM); //round - for (i = 0; i < CInfoViewerBB::BUTTON_MAX; i++) { + for (i = BUTTON_MAX; i > 0;) { + --i; if ((bbButtonInfo[i].x <= g_InfoViewer->ChanInfoX) || (bbButtonInfo[i].x >= g_InfoViewer->BoxEndX) || (!bbButtonInfo[i].paint)) continue; - if ((bbButtonInfo[i].x > 0) && ((bbButtonInfo[i].x + bbButtonInfo[i].w) <= minX)) { - + if (bbButtonInfo[i].x > 0) { + if (bbButtonInfo[i].x + bbButtonInfo[i].w > last_x) /* text too long */ + bbButtonInfo[i].w = last_x - bbButtonInfo[i].x; + last_x = bbButtonInfo[i].x; + if (bbButtonInfo[i].w - bbButtonInfo[i].cx <= 0) { + printf("[infoviewer_bb:%d cannot paint icon %d (not enough space)\n", + __LINE__, i); + continue; + } frameBuffer->paintIcon(bbButtonInfo[i].icon, bbButtonInfo[i].x, BBarY, InfoHeightY_Info); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(bbButtonInfo[i].x + bbButtonInfo[i].cx, BBarFontY, From c6a4da54f62a9e752243c1b2d9d316066c0f71ae Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 17 Feb 2013 19:07:55 +0100 Subject: [PATCH 73/86] infoviewer_bb: smarter use of available space for buttons of a button is not going to be painted, the space can be used for other buttons which might otherwise have their text cut off Signed-off-by: Jacek Jendrzej Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0042ad1e7fc5e3104cb637ae5edf2668fa3cf940 Author: Stefan Seyfried Date: 2013-02-17 (Sun, 17 Feb 2013) ------------------ This commit was generated by Migit --- src/gui/infoviewer_bb.cpp | 49 ++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 0ef15bf1c..e57ca7231 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -4,13 +4,7 @@ Copyright (C) 2001 Steffen Hehn 'McClean' Homepage: http://dbox.cyberphoria.org/ - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. - + Copyright (C) 2012-2013 Stefan Seyfried License: GPL @@ -276,7 +270,7 @@ void CInfoViewerBB::getBBButtonInfo() minX = std::min(bbIconMinX, g_InfoViewer->ChanInfoX + (((g_InfoViewer->BoxEndX - g_InfoViewer->ChanInfoX) * 75) / 100)); int MaxBr = minX - (g_InfoViewer->ChanInfoX + 10); bbButtonMaxX = g_InfoViewer->ChanInfoX + 10; - int br = 0; + int br = 0, count = 0; for (int i = 0; i < CInfoViewerBB::BUTTON_MAX; i++) { if ((i == CInfoViewerBB::BUTTON_SUBS) && (g_RemoteControl->subChannels.empty())) { // no subchannels bbButtonInfo[i].paint = false; @@ -284,15 +278,17 @@ void CInfoViewerBB::getBBButtonInfo() // continue; } else + { + count++; bbButtonInfo[i].paint = true; - br += bbButtonInfo[i].w; - bbButtonInfo[i].x = bbButtonMaxX; - bbButtonMaxX += bbButtonInfo[i].w; - bbButtonMaxW = std::max(bbButtonMaxW, bbButtonInfo[i].w); - } - if (br > MaxBr) { // TODO: Cut to long strings - printf("[infoviewer.cpp - %s, line #%d] width ColorButtons (%d) > MaxBr (%d)\n", __FUNCTION__, __LINE__, br, MaxBr); + br += bbButtonInfo[i].w; + bbButtonInfo[i].x = bbButtonMaxX; + bbButtonMaxX += bbButtonInfo[i].w; + bbButtonMaxW = std::max(bbButtonMaxW, bbButtonInfo[i].w); + } } + if (br > MaxBr) + printf("[infoviewer_bb:%s#%d] width br (%d) > MaxBr (%d) count %d\n", __func__, __LINE__, br, MaxBr, count); #if 0 int Btns = 0; // counting buttons @@ -321,14 +317,25 @@ void CInfoViewerBB::getBBButtonInfo() bbButtonInfo[CInfoViewerBB::BUTTON_AUDIO].w + rest; } #endif -#if 1 bbButtonMaxX = g_InfoViewer->ChanInfoX + 10; int step = MaxBr / 4; - bbButtonInfo[CInfoViewerBB::BUTTON_EPG].x = bbButtonMaxX; - bbButtonInfo[CInfoViewerBB::BUTTON_AUDIO].x = bbButtonMaxX + step; - bbButtonInfo[CInfoViewerBB::BUTTON_SUBS].x = bbButtonMaxX + 2*step; - bbButtonInfo[CInfoViewerBB::BUTTON_FEAT].x = bbButtonMaxX + 3*step; -#endif + if (count > 0) { /* avoid div-by-zero :-) */ + step = MaxBr / count; + count = 0; + for (int i = 0; i < BUTTON_MAX; i++) { + if (!bbButtonInfo[i].paint) + continue; + bbButtonInfo[i].x = bbButtonMaxX + step * count; + // printf("%s: i = %d count = %d b.x = %d\n", __func__, i, count, bbButtonInfo[i].x); + count++; + } + } else { + printf("[infoviewer_bb:%s#%d: count <= 0???\n", __func__, __LINE__); + bbButtonInfo[BUTTON_EPG].x = bbButtonMaxX; + bbButtonInfo[BUTTON_AUDIO].x = bbButtonMaxX + step; + bbButtonInfo[BUTTON_SUBS].x = bbButtonMaxX + 2*step; + bbButtonInfo[BUTTON_FEAT].x = bbButtonMaxX + 3*step; + } } void CInfoViewerBB::showBBButtons(const int modus) From 6b2332d31c1bfcde3585221a69c6046b4fd4538a Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 17 Feb 2013 18:06:29 +0100 Subject: [PATCH 74/86] infoviewer_bb: don't start HDD percent thread once per second Only start the HDD percent determination once per infobar display Signed-off-by: Jacek Jendrzej Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d78bb41e3ba7dd8e0d8140e0a78db3094219b8b8 Author: Stefan Seyfried Date: 2013-02-17 (Sun, 17 Feb 2013) ------------------ This commit was generated by Migit --- src/gui/infoviewer_bb.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index e57ca7231..5ac2f1970 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -108,6 +108,13 @@ void CInfoViewerBB::Init() tmp_bbButtonInfoText[i] = ""; } + // get HDD info in a separate thread + if (g_settings.infobar_show_sysfs_hdd && !hddperTflag) { + hddperTflag=true; + pthread_create(&hddperT, NULL, hddperThread, (void*) this); + pthread_detach(hddperT); + } + InfoHeightY_Info = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() + 5; setBBOffset(); @@ -614,13 +621,6 @@ void CInfoViewerBB::showSysfsHdd() percent = (u * 100ULL) / t; showBarSys(percent); - //HDD info in a seperate thread - if(!hddperTflag) { - hddperTflag=true; - pthread_create(&hddperT, NULL, hddperThread, (void*) this); - pthread_detach(hddperT); - } - if (check_dir(g_settings.network_nfs_recordingdir) == 0) showBarHdd(hddpercent); else From 01982a3c4accd0250ce0c449a4db384a01c7910d Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 17 Feb 2013 18:04:11 +0100 Subject: [PATCH 75/86] infoviewer_bb: fix flickering HDD bar display Signed-off-by: Jacek Jendrzej Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/de6e94cb9d36627e45ca4525ee1d2b2a232ff15d Author: Stefan Seyfried Date: 2013-02-17 (Sun, 17 Feb 2013) ------------------ This commit was generated by Migit --- src/gui/infoviewer_bb.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 5ac2f1970..82f53c622 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -631,12 +631,11 @@ void CInfoViewerBB::showSysfsHdd() void* CInfoViewerBB::hddperThread(void *arg) { CInfoViewerBB *infoViewerBB = (CInfoViewerBB*) arg; - - infoViewerBB->hddpercent = 0; long t, u; if (get_fs_usage(g_settings.network_nfs_recordingdir, t, u)) infoViewerBB->hddpercent = (u * 100ULL) / t; - + else + infoViewerBB->hddpercent = 0; infoViewerBB->hddperTflag=false; pthread_exit(NULL); } From 1e9d977728f28615eb3bc573c4af9221deac3460 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 17 Feb 2013 17:36:19 +0100 Subject: [PATCH 76/86] sectionsd: retry getting eit_version Sometimes at first start, the cn thread does not fetch the EIT version and thus automatic updates don't work. The cause of this is not 100% clear, for now let's add a workaround to try a bit longer fetching it. Signed-off-by: Jacek Jendrzej Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a0cefea55a4e57ea38c9c273f4df29320c8b85c5 Author: Stefan Seyfried Date: 2013-02-17 (Sun, 17 Feb 2013) ------------------ This commit was generated by Migit --- src/eitd/eitd.h | 2 ++ src/eitd/sectionsd.cpp | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/eitd/eitd.h b/src/eitd/eitd.h index 31858afe2..e0aead9c3 100644 --- a/src/eitd/eitd.h +++ b/src/eitd/eitd.h @@ -244,6 +244,7 @@ class CCNThread : public CEventsThread private: /* overloaded hooks */ void addFilters(); + bool shouldSleep(); void beforeSleep(); void beforeWait(); void afterWait(); @@ -254,6 +255,7 @@ class CCNThread : public CEventsThread OpenThreads::Mutex update_mutex; bool updating; cDemux * eitDmx; + int eit_retry; void sendCNEvent(); public: diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index fe421da58..7a81ff341 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -1575,6 +1575,23 @@ bool CEventsThread::addEvents() return true; } +bool CCNThread::shouldSleep() +{ + if (!scanning || channel_is_blacklisted) + return true; + if (!sendToSleepNow) + return false; + if (eit_version != 0xff) + return true; + + if (++eit_retry > 1) { + xprintf("%s::%s eit_retry > 1 (%d) -> going to sleep\n", name.c_str(), __func__, eit_retry); + return true; + } + sendToSleepNow = false; + return false; +} + /* default check if thread should go to sleep */ bool CEventsThread::shouldSleep() { @@ -1648,6 +1665,7 @@ CCNThread::CCNThread() updating = false; eitDmx = new cDemux(0); + eit_retry = 0; } /* CN thread hooks */ @@ -1713,6 +1731,7 @@ void CCNThread::beforeSleep() /* send a "no epg" event anyway before going to sleep */ sendCNEvent(); } + eit_retry = 0; } void CCNThread::processSection() From 1bacbc64e2606a83d935786644cfae1b3bb1dda6 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 17 Feb 2013 17:35:35 +0100 Subject: [PATCH 77/86] sectionsd: silence debug spam disable some debug messages, remove unneeded newlines from other messages Signed-off-by: Jacek Jendrzej Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e7dd3083e6fcd5151da7314d3c66694e05659e7d Author: Stefan Seyfried Date: 2013-02-17 (Sun, 17 Feb 2013) ------------------ This commit was generated by Migit --- src/eitd/sectionsd.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 7a81ff341..e8697f118 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -55,7 +55,7 @@ //#define ENABLE_SDT //FIXME //#define DEBUG_SDT_THREAD -#define DEBUG_TIME_THREAD +//#define DEBUG_TIME_THREAD #define DEBUG_SECTION_THREADS #define DEBUG_CN_THREAD @@ -884,7 +884,7 @@ static void commandserviceChanged(int connfd, char *data, const unsigned dataLen t_channel_id uniqueServiceKey = (((sectionsd::commandSetServiceChanged *)data)->channel_id); - xprintf("[sectionsd] commandserviceChanged: Service change to " PRINTF_CHANNEL_ID_TYPE "\n\n", uniqueServiceKey); + xprintf("[sectionsd] commandserviceChanged: Service change to " PRINTF_CHANNEL_ID_TYPE "\n", uniqueServiceKey); static t_channel_id time_trigger_last = 0; @@ -927,7 +927,7 @@ static void commandserviceChanged(int connfd, char *data, const unsigned dataLen else dprintf("[sectionsd] commandserviceChanged: no change...\n"); - xprintf("[sectionsd] commandserviceChanged: Service changed to " PRINTF_CHANNEL_ID_TYPE "\n\n", uniqueServiceKey); + dprintf("[sectionsd] commandserviceChanged: Service changed to " PRINTF_CHANNEL_ID_TYPE "\n", uniqueServiceKey); } static void commandGetIsScanningActive(int connfd, char* /*data*/, const unsigned /*dataLength*/) @@ -1426,7 +1426,7 @@ int CSectionThread::Sleep() TIMEVAL_TO_TIMESPEC(&now, &abs_wait); abs_wait.tv_sec += sleep_time; } - xprintf("%s: going to sleep for %d seconds...\n", name.c_str(), sleep_time); + dprintf("%s: going to sleep for %d seconds...\n", name.c_str(), sleep_time); pthread_mutex_lock(&start_stop_mutex); beforeWait(); @@ -1474,7 +1474,7 @@ void CSectionThread::run() real_pause(); rs = Sleep(); #ifdef DEBUG_SECTION_THREADS - xprintf("%s: wakeup, running %d scanning %d blacklisted %d reason %d\n\n", + xprintf("%s: wakeup, running %d scanning %d blacklisted %d reason %d\n", name.c_str(), running, scanning, channel_is_blacklisted, rs); #endif } while (checkSleep()); @@ -1749,7 +1749,7 @@ void CCNThread::processSection() unlockMessaging(); #ifdef DEBUG_CN_THREAD - xprintf("%s: have CN: timeoutsDMX %d messaging_have_CN %x messaging_got_CN %x\n\n", + xprintf("%s: have CN: timeoutsDMX %d messaging_have_CN %x messaging_got_CN %x\n", name.c_str(), timeoutsDMX, messaging_have_CN, messaging_got_CN); #endif dprintf("[cnThread] got current_next (0x%x) - sending event!\n", messaging_have_CN); From d8072117aea1d1892b0929666d4477e81c57b3c9 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 17 Feb 2013 16:55:33 +0100 Subject: [PATCH 78/86] sectionsd: remove newline from SIsectionTIME message Signed-off-by: Jacek Jendrzej Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f8cd0ac2f7cee8ddb21b827692bc2c4a19469f33 Author: Stefan Seyfried Date: 2013-02-17 (Sun, 17 Feb 2013) ------------------ This commit was generated by Migit --- src/eitd/SIsections.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/eitd/SIsections.cpp b/src/eitd/SIsections.cpp index 04ad15596..102c560ef 100644 --- a/src/eitd/SIsections.cpp +++ b/src/eitd/SIsections.cpp @@ -174,12 +174,18 @@ void SIsectionTIME::parse(uint8_t *buf) if(tdt.getSectionLength() < 5) return; dvbtime = parseDVBtime(tdt.getUtcTimeMjd(), tdt.getUtcTimeBcd()); - xcprintf("SIsectionTIME::parse: TDT time: %s", ctime(&dvbtime)); + char *ct = ctime(&dvbtime); + /* ctime() appends a useless \n... */ + ct[strlen(ct) - 1] = 0; + /* ...and xcprintf adds another \n... */ + xcprintf("SIsectionTIME::parse: TDT time: %s", ct); parsed = true; } else { TimeOffsetSection tot(buf); dvbtime = parseDVBtime(tot.getUtcTimeMjd(), tot.getUtcTimeBcd()); - xcprintf("SIsectionTIME::parse: TOT time: %s", ctime(&dvbtime)); + char *ct = ctime(&dvbtime); + ct[strlen(ct) - 1] = 0; + xcprintf("SIsectionTIME::parse: TOT time: %s", ct); const DescriptorList &dlist = *tot.getDescriptors(); for (DescriptorConstIterator dit = dlist.begin(); dit != dlist.end(); ++dit) { uint8_t dtype = (*dit)->getTag(); From a6df33802b36e4bddbc47c56cbd19ca56228b7b5 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 17 Feb 2013 15:34:27 +0100 Subject: [PATCH 79/86] sectionsd: only step time if difference is > 2min in order to avoid unnecessary system time jumps, only step time if the difference is bigger than 120 seconds, else use adjtime Signed-off-by: Jacek Jendrzej Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c5ef1bf14c76e2ea8eeb9a04f10142abf7629bca Author: Stefan Seyfried Date: 2013-02-17 (Sun, 17 Feb 2013) ------------------ This commit was generated by Migit --- src/eitd/sectionsd.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index e8697f118..68aa1bf2a 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -1279,7 +1279,8 @@ void CTimeThread::sendTimeEvent(bool ntp, time_t tim) eventServer->sendEvent(CSectionsdClient::EVT_TIMESET, CEventServer::INITID_SECTIONSD, &actTime, sizeof(actTime) ); #endif if(ntp || tim) {} - eventServer->sendEvent(CSectionsdClient::EVT_TIMESET, CEventServer::INITID_SECTIONSD, &timediff, sizeof(timediff)); + if (timediff) + eventServer->sendEvent(CSectionsdClient::EVT_TIMESET, CEventServer::INITID_SECTIONSD, &timediff, sizeof(timediff)); setTimeSet(); } @@ -1313,11 +1314,26 @@ void CTimeThread::setSystemTime(time_t tim) tmTime->tm_mday, tmTime->tm_mon+1, tmTime->tm_year+1900, tmTime->tm_hour, tmTime->tm_min, tmTime->tm_sec, ctime(&tim)); +#if 0 /* if new time less than current for less than 1 second, ignore */ if(timediff < 0 && timediff > (int64_t) -1000000) { timediff = 0; return; } +#endif + if (timediff == 0) /* very unlikely... :-) */ + return; + if (abs(timediff) < 120000000LL) { + struct timeval oldd; + tv.tv_sec = timediff / 1000000LL; + tv.tv_usec = timediff % 1000000LL; + if (adjtime(&tv, &oldd)) + perror("adjtime"); + xprintf("difference is < 120s, using adjtime(%d, %d). oldd(%d, %d)\n", + (int)tv.tv_sec, (int)tv.tv_usec, (int)oldd.tv_sec, (int)oldd.tv_usec); + timediff = 0; + return; + } tv.tv_sec = tim; tv.tv_usec = 0; From 857fb1d1b3cec4d64961776291e167b4b932c621 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 20 Feb 2013 21:13:52 +0100 Subject: [PATCH 80/86] src/eitd/sectionsd.cpp fix compil unused variable 'rs' Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1df14bd8af186c19a9d3720b4222e1eb701a8a69 Author: Jacek Jendrzej Date: 2013-02-20 (Wed, 20 Feb 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/eitd/sectionsd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 68aa1bf2a..24edbaac0 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -1365,8 +1365,8 @@ void CTimeThread::run() if(!scanning) sleep_time = 0; real_pause(); - int rs = Sleep(); #ifdef DEBUG_TIME_THREAD + int rs = Sleep(); xprintf("%s: wakeup, running %d scanning %d channel %llx reason %d\n", name.c_str(), running, scanning, current_service, rs); #endif From b082afd1e2dfc346a78719366ecb374c08bee3d4 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Tue, 5 Feb 2013 19:39:20 +0100 Subject: [PATCH 81/86] sectionsd: on-disk epg data has lower priority than on-air data Signed-off-by: Jacek Jendrzej Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0a366a4ae4dca12868e9a11e53c122c47596e89f Author: Stefan Seyfried Date: 2013-02-05 (Tue, 05 Feb 2013) ------------------ This commit was generated by Migit --- src/eitd/xmlutil.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/eitd/xmlutil.cpp b/src/eitd/xmlutil.cpp index b700011f3..44dd9c033 100644 --- a/src/eitd/xmlutil.cpp +++ b/src/eitd/xmlutil.cpp @@ -1,6 +1,6 @@ /* * (C) 2001 by fnbrd, - * Copyright (C) 2008, 2009 Stefan Seyfried + * Copyright (C) 2008-2009, 2012-2013 Stefan Seyfried * * Copyright (C) 2011-2012 CoolStream International Ltd * @@ -321,6 +321,7 @@ void *insertEventsfromFile(void * data) uint8_t tid = xmlGetNumericAttribute(event, "tid", 16); if(tid) e.table_id = tid; + e.table_id |= 0x80; /* make sure on-air data has a lower table_id */ node = event->xmlChildrenNode; From 626db78811ad1a0410b08b679f1688fff79768cd Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 20 Feb 2013 23:52:30 +0100 Subject: [PATCH 82/86] audioplayer.cpp: center horizontally Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ac3e482cca532c449a6d42f24de94c793efb83bb Author: vanhofen Date: 2013-02-20 (Wed, 20 Feb 2013) Origin message was: ------------------ - audioplayer.cpp: center horizontally ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index ab701f6cb..2e36d2076 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -275,7 +275,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_current = 0; m_selected = 0; - m_width=(g_settings.screen_EndX - g_settings.screen_StartX) - ConnectLineBox_Width - 5; + m_width=(g_settings.screen_EndX - g_settings.screen_StartX) - 2*ConnectLineBox_Width - 5; m_height = (g_settings.screen_EndY - g_settings.screen_StartY - 5); m_sheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); @@ -293,7 +293,9 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_listmaxshow = (m_height - m_info_height - m_title_height - m_theight - 2*m_buttonHeight) / (m_fheight); m_height = m_theight + m_info_height + m_title_height + 2*m_buttonHeight + m_listmaxshow * m_fheight; // recalc height - m_x = getScreenStartX( m_width + ConnectLineBox_Width ) + ConnectLineBox_Width; + m_x = getScreenStartX( m_width ); + if (m_x < ConnectLineBox_Width) + m_x = ConnectLineBox_Width; m_y = getScreenStartY( m_height ); m_idletime=time(NULL); From a8bb955813b33891155b01810a3a8d758b0a3fbc Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 20 Feb 2013 23:53:55 +0100 Subject: [PATCH 83/86] upnpbrowser.cpp: center horizontally Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5a4722ab84843fb093ba46cb778db05e2b1bd42e Author: vanhofen Date: 2013-02-20 (Wed, 20 Feb 2013) Origin message was: ------------------ - upnpbrowser.cpp: center horizontally ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/upnpbrowser.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index f88f9a49c..be46fe341 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -127,7 +127,7 @@ int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/ #endif m_LastMode=(CNeutrinoApp::getInstance()->getLastMode()); - m_width=(g_settings.screen_EndX - g_settings.screen_StartX) - ConnectLineBox_Width; + m_width=(g_settings.screen_EndX - g_settings.screen_StartX) - 2*ConnectLineBox_Width; m_height = (g_settings.screen_EndY - g_settings.screen_StartY); m_sheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); @@ -140,7 +140,9 @@ int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/ m_listmaxshow = (m_height - m_info_height - m_title_height - m_theight - 2*m_buttonHeight) / (m_fheight); m_height = m_theight + m_info_height + m_title_height + 2*m_buttonHeight + m_listmaxshow * m_fheight; // recalc height - m_x=getScreenStartX( m_width + ConnectLineBox_Width ) + ConnectLineBox_Width; + m_x=getScreenStartX( m_width ); + if (m_x < ConnectLineBox_Width) + m_x = ConnectLineBox_Width; m_y=getScreenStartY( m_height ); // Stop sectionsd From 85eb0ab46b3bc00426d56e7954d1d0a53a7d7cef Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 21 Feb 2013 06:12:23 +0100 Subject: [PATCH 84/86] src/eitd/sectionsd.cpp: Calling function 'Sleep()' restored Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9be5730183afa4bdc346dd986248b80f9ccfff99 Author: Michael Liebmann Date: 2013-02-21 (Thu, 21 Feb 2013) Origin message was: ------------------ * src/eitd/sectionsd.cpp: Calling function 'Sleep()' restored ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/eitd/sectionsd.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 24edbaac0..bfa5ac087 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -1365,7 +1365,9 @@ void CTimeThread::run() if(!scanning) sleep_time = 0; real_pause(); -#ifdef DEBUG_TIME_THREAD +#ifndef DEBUG_TIME_THREAD + Sleep(); +#else int rs = Sleep(); xprintf("%s: wakeup, running %d scanning %d channel %llx reason %d\n", name.c_str(), running, scanning, current_service, rs); From 0e01a7b32c3689e04a6246c362d020cd87d4fefe Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 3 Nov 2012 13:56:26 +0100 Subject: [PATCH 85/86] neutrino: fix 32<->64bit format string warnings use portable C99 format string macros for 64bit types to fix many warnings when compiling for 64bit architectures, add some (int) casts for size_t Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4dbeb3a31e7357a03b5a4e43000adc1c56719124 Author: Stefan Seyfried Date: 2012-11-03 (Sat, 03 Nov 2012) ------------------ This commit was generated by Migit --- src/Makefile.am | 2 +- src/daemonc/Makefile.am | 2 +- src/daemonc/remotecontrol.cpp | 2 +- src/driver/Makefile.am | 2 +- src/driver/netfile.cpp | 4 +- src/driver/rcinput.cpp | 10 +-- src/driver/record.cpp | 44 +++++------ src/eitd/Makefile.am | 2 +- src/eitd/SIevents.cpp | 3 +- src/eitd/dmx.cpp | 3 +- src/eitd/sectionsd.cpp | 48 ++++++------ src/eitd/xmlutil.cpp | 4 +- src/gui/Makefile.am | 2 +- src/gui/cam_menu.cpp | 1 + src/gui/channellist.cpp | 8 +- src/gui/epgview.cpp | 10 +-- src/gui/filebrowser.cpp | 12 +-- src/gui/hdd_menu.cpp | 12 +-- src/gui/moviebrowser.cpp | 85 +++++++++------------ src/gui/movieinfo.cpp | 14 ++-- src/gui/scan.cpp | 10 +-- src/gui/scan_setup.cpp | 2 +- src/gui/zapit_setup.cpp | 6 +- src/neutrino.cpp | 18 ++--- src/nhttpd/tuxboxapi/coolstream/Makefile.am | 2 +- src/system/helpers.cpp | 2 +- src/timerd/Makefile.am | 2 +- src/timerd/timermanager.cpp | 10 ++- src/zapit/include/zapit/types.h | 8 +- src/zapit/src/Makefile.am | 2 +- src/zapit/src/bouquets.cpp | 2 +- src/zapit/src/capmt.cpp | 5 +- src/zapit/src/femanager.cpp | 9 ++- src/zapit/src/frontend.cpp | 6 +- src/zapit/src/getservices.cpp | 12 +-- src/zapit/src/pzapit.cpp | 10 +-- src/zapit/src/scan.cpp | 12 +-- src/zapit/src/scanbat.cpp | 6 +- src/zapit/src/transponder.cpp | 5 +- src/zapit/src/zapit.cpp | 24 +++--- 40 files changed, 198 insertions(+), 225 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index dd1b2ebed..2ddf170c6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ -AM_CXXFLAGS = -fno-rtti -fno-exceptions +AM_CXXFLAGS = -fno-rtti -fno-exceptions -D__STDC_FORMAT_MACROS SUBDIRS = zapit gui daemonc driver system eitd timerd nhttpd diff --git a/src/daemonc/Makefile.am b/src/daemonc/Makefile.am index 076234a8e..e917cea61 100644 --- a/src/daemonc/Makefile.am +++ b/src/daemonc/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -fno-rtti -fno-exceptions +AM_CPPFLAGS = -fno-rtti -fno-exceptions -D__STDC_FORMAT_MACROS INCLUDES = \ -I$(top_builddir) \ diff --git a/src/daemonc/remotecontrol.cpp b/src/daemonc/remotecontrol.cpp index 11e5373f9..dae21cb4d 100644 --- a/src/daemonc/remotecontrol.cpp +++ b/src/daemonc/remotecontrol.cpp @@ -344,7 +344,7 @@ int CRemoteControl::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data #endif else if (msg == NeutrinoMessages::EVT_TUNE_COMPLETE) { t_channel_id chid = *(t_channel_id *)data; -printf("CRemoteControl::handleMsg: EVT_TUNE_COMPLETE (%016llx)\n", chid); +printf("CRemoteControl::handleMsg: EVT_TUNE_COMPLETE (%016" PRIx64 ")\n", chid); if(chid) g_Sectionsd->setServiceChanged( chid, true ); else diff --git a/src/driver/Makefile.am b/src/driver/Makefile.am index 1216726f1..d2202e20e 100644 --- a/src/driver/Makefile.am +++ b/src/driver/Makefile.am @@ -1,4 +1,4 @@ -AM_CXXFLAGS = -fno-rtti -fno-exceptions +AM_CXXFLAGS = -fno-rtti -fno-exceptions -D__STDC_FORMAT_MACROS SUBDIRS = pictureviewer audiodec diff --git a/src/driver/netfile.cpp b/src/driver/netfile.cpp index 3a235e3fa..ae92ff3ef 100644 --- a/src/driver/netfile.cpp +++ b/src/driver/netfile.cpp @@ -2,6 +2,8 @@ | Neutrino-GUI - DBoxII-Project | | Copyright (C) 2004 by Sanaia +| Copyright (C) 2010-2012 Stefan Seyfried +| | netfile - remote file access mapper | | @@ -400,7 +402,7 @@ int request_file(URL *url) /* if we have a entity, announce it to the server */ if(url->entity[0]) { - snprintf(str, sizeof(str)-1, "Content-Length: %d\r\n", strlen(url->entity)); + snprintf(str, sizeof(str)-1, "Content-Length: %d\r\n", (int)strlen(url->entity)); dprintf(stderr, "> %s", str); send(url->fd, str, strlen(str), 0); } diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 270afb8d2..990886912 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -4,13 +4,7 @@ Copyright (C) 2001 Steffen Hehn 'McClean' 2003 thegoodguy - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. - + Copyright (C) 2008-2012 Stefan Seyfried License: GPL @@ -895,7 +889,7 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 p = new unsigned char[sizeof(int64_t)]; *(int64_t*) p = timeNew - timeOld; #endif - printf("[neutrino] CSectionsdClient::EVT_TIMESET: timediff %lld\n", *(int64_t*) p); + printf("[neutrino] CSectionsdClient::EVT_TIMESET: timediff %" PRId64 "\n", *(int64_t*) p); /* FIXME what this code really do ? */ if ((int64_t)last_keypress > *(int64_t*)p) last_keypress += *(int64_t *)p; diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 86baeec8e..2db21c4c0 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -222,7 +222,7 @@ bool CRecordInstance::Stop(bool remove_event) CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, rec_stop_msg.c_str()); hintBox.paint(); - printf("%s: channel %llx recording_id %d\n", __FUNCTION__, channel_id, recording_id); + printf("%s: channel %" PRIx64 " recording_id %d\n", __func__, channel_id, recording_id); SaveXml(); /* Stop do close fd - if started */ record->Stop(); @@ -257,7 +257,7 @@ bool CRecordInstance::Update() CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(channel_id); if(channel == NULL) { - printf("%s: channel %llx not found!\n", __FUNCTION__, channel_id); + printf("%s: channel %" PRIx64 " not found!\n", __func__, channel_id); return false; } @@ -385,10 +385,10 @@ record_error_msg_t CRecordInstance::Record() { APIDList apid_list; - printf("%s: channel %llx recording_id %d\n", __FUNCTION__, channel_id, recording_id); + printf("%s: channel %" PRIx64 " recording_id %d\n", __func__, channel_id, recording_id); CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(channel_id); if(channel == NULL) { - printf("%s: channel %llx not found!\n", __FUNCTION__, channel_id); + printf("%s: channel %" PRIx64 " not found!\n", __func__, channel_id); return RECORD_INVALID_CHANNEL; } @@ -416,7 +416,7 @@ record_error_msg_t CRecordInstance::Record() } } recording_id = g_Timerd->addImmediateRecordTimerEvent(channel_id, now, record_end, epgid, epg_time, apidmode); - printf("%s: channel %llx -> timer eventID %d\n", __FUNCTION__, channel_id, recording_id); + printf("%s: channel %" PRIx64 " -> timer eventID %d\n", __func__, channel_id, recording_id); } return ret; } @@ -648,7 +648,7 @@ void CRecordInstance::GetRecordString(std::string &str) { CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(channel_id); if(channel == NULL) { - printf("%s: channel %llx not found!\n", __FUNCTION__, channel_id); + printf("%s: channel %" PRIx64 " not found!\n", __func__, channel_id); str = "Unknown channel : " + GetEpgTitle(); return; } @@ -840,7 +840,7 @@ bool CRecordManager::Record(const CTimerd::RecordingInfo * const eventinfo, cons * neutrino check if this channel_id already recording, may be not needed */ bool direct_record = timeshift || strlen(eventinfo->recordingDir) == 0; - printf("%s channel_id %llx epg: %llx, apidmode 0x%X\n", __FUNCTION__, + printf("%s channel_id %" PRIx64 " epg: %" PRIx64 ", apidmode 0x%X\n", __func__, eventinfo->channel_id, eventinfo->epgID, eventinfo->apids); #if 0 @@ -898,7 +898,7 @@ bool CRecordManager::Record(const CTimerd::RecordingInfo * const eventinfo, cons } } else if(!direct_record) { CTimerd::RecordingInfo * evt = new CTimerd::RecordingInfo(*eventinfo); - printf("%s add %llx : %s to pending\n", __FUNCTION__, evt->channel_id, evt->epgTitle); + printf("%s add %" PRIx64 " : %s to pending\n", __func__, evt->channel_id, evt->epgTitle); nextmap.push_back((CTimerd::RecordingInfo *)evt); } } else @@ -979,7 +979,7 @@ bool CRecordManager::CheckRecording(const CTimerd::RecordingInfo * const eventin void CRecordManager::StartNextRecording() { CTimerd::RecordingInfo * eventinfo = NULL; - printf("%s: pending count %d\n", __FUNCTION__, nextmap.size()); + printf("%s: pending count %d\n", __func__, (int)nextmap.size()); for(nextmap_iterator_t it = nextmap.begin(); it != nextmap.end(); it++) { eventinfo = *it; @@ -1080,7 +1080,7 @@ void CRecordManager::StopInstance(CRecordInstance * inst, bool remove_event) bool CRecordManager::Stop(const t_channel_id channel_id) { - printf("%s: %llx\n", __FUNCTION__, channel_id); + printf("%s: %" PRIx64 "\n", __func__, channel_id); mutex.lock(); @@ -1089,7 +1089,7 @@ bool CRecordManager::Stop(const t_channel_id channel_id) if(inst != NULL) StopInstance(inst); else - printf("%s: channel %llx not recording\n", __FUNCTION__, channel_id); + printf("%s: channel %" PRIx64 " not recording\n", __func__, channel_id); mutex.unlock(); @@ -1106,7 +1106,7 @@ bool CRecordManager::IsRecording(const CTimerd::RecordingStopInfo * recinfo) if(inst != NULL && recinfo->eventID == inst->GetRecordingId()) ret = true; mutex.unlock(); - printf("[%s] eventID: %d, channel_id: 0x%llx, ret: %d\n", __FUNCTION__, recinfo->eventID, recinfo->channel_id, ret); + printf("[%s] eventID: %d, channel_id: 0x%" PRIx64 ", ret: %d\n", __func__, recinfo->eventID, recinfo->channel_id, ret); return ret; } @@ -1114,7 +1114,7 @@ bool CRecordManager::Stop(const CTimerd::RecordingStopInfo * recinfo) { bool ret = false; - printf("%s: eventID %d channel_id %llx\n", __FUNCTION__, recinfo->eventID, recinfo->channel_id); + printf("%s: eventID %d channel_id %" PRIx64 "\n", __func__, recinfo->eventID, recinfo->channel_id); mutex.lock(); @@ -1125,7 +1125,7 @@ bool CRecordManager::Stop(const CTimerd::RecordingStopInfo * recinfo) } else { for(nextmap_iterator_t it = nextmap.begin(); it != nextmap.end(); it++) { if((*it)->eventID == recinfo->eventID) { - printf("%s: removing pending eventID %d channel_id %llx\n", __FUNCTION__, recinfo->eventID, recinfo->channel_id); + printf("%s: removing pending eventID %d channel_id %" PRIx64 "\n", __func__, recinfo->eventID, recinfo->channel_id); /* Note: CTimerd::RecordingInfo is a class! => typecast to avoid destructor call */ delete[] (unsigned char *) (*it); nextmap.erase(it); @@ -1135,7 +1135,7 @@ bool CRecordManager::Stop(const CTimerd::RecordingStopInfo * recinfo) } } if(!ret) - printf("%s: eventID %d channel_id %llx : not found\n", __FUNCTION__, recinfo->eventID, recinfo->channel_id); + printf("%s: eventID %d channel_id %" PRIx64 " : not found\n", __func__, recinfo->eventID, recinfo->channel_id); mutex.unlock(); @@ -1161,7 +1161,7 @@ bool CRecordManager::Update(const t_channel_id channel_id) if(inst != NULL) inst->Update(); else - printf("%s: channel %llx not recording\n", __FUNCTION__, channel_id); + printf("%s: channel %" PRIx64 " not recording\n", __func__, channel_id); mutex.unlock(); return (inst != NULL); @@ -1325,7 +1325,7 @@ int CRecordManager::exec(CMenuTarget* parent, const std::string & actionKey ) snprintf(rec_msg, sizeof(rec_msg)-1, rec_msg1, records-i, records); inst->SetStopMessage(rec_msg); - printf("CRecordManager::exec(ExitAll line %d) found channel %llx recording_id %d\n", __LINE__, channel_id, inst->GetRecordingId()); + printf("CRecordManager::exec(ExitAll line %d) found channel %" PRIx64 " recording_id %d\n", __LINE__, channel_id, inst->GetRecordingId()); g_Timerd->stopTimerEvent(inst->GetRecordingId()); i++; } @@ -1463,7 +1463,7 @@ bool CRecordManager::ShowMenu(void) mutex.lock(); CRecordInstance * inst = FindInstanceID(recording_ids[select]); if(inst == NULL || recording_ids[select] != inst->GetRecordingId()) { - printf("%s: channel %llx event id %d not found\n", __FUNCTION__, channel_ids[select], recording_ids[select]); + printf("%s: channel %" PRIx64 " event id %d not found\n", __func__, channel_ids[select], recording_ids[select]); mutex.unlock(); return false; } @@ -1560,7 +1560,7 @@ bool CRecordManager::CutBackNeutrino(const t_channel_id channel_id, CFrontend * int mode = channel->getServiceType() != ST_DIGITAL_RADIO_SOUND_SERVICE ? NeutrinoMessages::mode_tv : NeutrinoMessages::mode_radio; - printf("%s channel_id %llx mode %d\n", __FUNCTION__, channel_id, mode); + printf("%s channel_id %" PRIx64 " mode %d\n", __func__, channel_id, mode); last_mode = CNeutrinoApp::getInstance()->getMode(); if(last_mode == NeutrinoMessages::mode_standby && recmap.empty()) { @@ -1595,7 +1595,7 @@ bool CRecordManager::CutBackNeutrino(const t_channel_id channel_id, CFrontend * /* stop stream for this channel */ CStreamManager::getInstance()->StopStream(channel_id); ret = g_Zapit->zapTo_record(channel_id) > 0; - printf("%s found same tp, zapTo_record channel_id %llx result %d\n", __FUNCTION__, channel_id, ret); + printf("%s found same tp, zapTo_record channel_id %" PRIx64 " result %d\n", __func__, channel_id, ret); } else { printf("%s mode %d last_mode %d getLastMode %d\n", __FUNCTION__, mode, last_mode, CNeutrinoApp::getInstance()->getLastMode()); @@ -1608,7 +1608,7 @@ bool CRecordManager::CutBackNeutrino(const t_channel_id channel_id, CFrontend * } ret = g_Zapit->zapTo_serviceID(channel_id) > 0; - printf("%s zapTo_serviceID channel_id %llx result %d\n", __FUNCTION__, channel_id, ret); + printf("%s zapTo_serviceID channel_id %" PRIx64 " result %d\n", __func__, channel_id, ret); } if (unlock) CFEManager::getInstance()->unlockFrontend(live_fe); @@ -1634,7 +1634,7 @@ bool CRecordManager::CutBackNeutrino(const t_channel_id channel_id, CFrontend * } else if(!ret && mode_changed /*mode != last_mode*/) CNeutrinoApp::getInstance()->handleMsg( NeutrinoMessages::CHANGEMODE , last_mode); - printf("%s channel_id %llx mode %d : result %s\n", __FUNCTION__, channel_id, mode, ret ? "OK" : "BAD"); + printf("%s channel_id %" PRIx64 " mode %d : result %s\n", __func__, channel_id, mode, ret ? "OK" : "BAD"); return ret; } diff --git a/src/eitd/Makefile.am b/src/eitd/Makefile.am index c151cd6b2..35d3a70ae 100644 --- a/src/eitd/Makefile.am +++ b/src/eitd/Makefile.am @@ -17,7 +17,7 @@ INCLUDES += -I$(top_srcdir)/lib/libtriple endif #AM_CPPFLAGS = -AM_CPPFLAGS = -fno-rtti -fno-exceptions +AM_CPPFLAGS = -fno-rtti -fno-exceptions -D__STDC_FORMAT_MACROS noinst_LIBRARIES = libsectionsd.a libsectionsd_a_SOURCES = \ diff --git a/src/eitd/SIevents.cpp b/src/eitd/SIevents.cpp index f4849c03d..05ad13523 100644 --- a/src/eitd/SIevents.cpp +++ b/src/eitd/SIevents.cpp @@ -5,6 +5,7 @@ * Homepage: http://dbox2.elxsi.de * * Copyright (C) 2011-2012 CoolStream International Ltd + * Copyright (C) 2008, 2012 Stefan Seyfried * * License: GPLv2 * @@ -529,7 +530,7 @@ int SIevent::saveXML2(FILE *file) const void SIevent::dump(void) const { - printf("Unique key: %llx\n", uniqueKey()); + printf("Unique key: %" PRIx64 "\n", uniqueKey()); if(original_network_id) printf("Original-Network-ID: %hu\n", original_network_id); if (service_id) diff --git a/src/eitd/dmx.cpp b/src/eitd/dmx.cpp index 6097b0691..ee75a6e05 100644 --- a/src/eitd/dmx.cpp +++ b/src/eitd/dmx.cpp @@ -5,6 +5,7 @@ * 2003 by thegoodguy * * Copyright (C) 2011-2012 CoolStream International Ltd + * Copyright (C) 2007-2009, 2011-2012 Stefan Seyfried * * License: GPLv2 * @@ -239,7 +240,7 @@ printf(" [%s cache] old section for table 0x%02x sid 0x%04x section 0x%02x last #endif if(seenSections == calcedSections) { #ifdef DEBUG_COMPLETE - xcprintf(" %s cache %02x complete: %d", name.c_str(), filters[filter_index].filter, seenSections.size()); + xcprintf(" %s cache %02x complete: %d", name.c_str(), filters[filter_index].filter, (int)seenSections.size()); #endif /* FIXME this algo fail sometimes: * [cnThread cache] new section for table 0x4e sid 0x0a39 section 0x00 last 0x00 slast 0x00 seen 1 calc 1 diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index bfa5ac087..3b1e799f6 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -255,12 +255,12 @@ static bool deleteEvent(const event_id_t uniqueKey) } if (cn) { // current-next => fill current or next event... -//xprintf("addEvent: current %016llx event %016llx messaging_got_CN %d\n", messaging_current_servicekey, evt.get_channel_id(), messaging_got_CN); +//xprintf("addEvent: current %016" PRIx64 " event %016" PRIx64 " messaging_got_CN %d\n", messaging_current_servicekey, evt.get_channel_id(), messaging_got_CN); readLockMessaging(); // only if it is the current channel... and if we don't have them already. if (evt.get_channel_id() == messaging_current_servicekey && (messaging_got_CN != 0x03)) { -xprintf("addEvent: current %016llx event %016llx running %d messaging_got_CN %d\n", messaging_current_servicekey, evt.get_channel_id(), evt.runningStatus(), messaging_got_CN); +xprintf("addEvent: current %016" PRIx64 " event %016" PRIx64 " running %d messaging_got_CN %d\n", messaging_current_servicekey, evt.get_channel_id(), evt.runningStatus(), messaging_got_CN); unlockMessaging(); writeLockEvents(); @@ -318,7 +318,7 @@ xprintf("addEvent: current %016llx event %016llx running %d messaging_got_CN %d\ { /* if the new event has a lower (== more recent) table ID, replace the old one */ already_exists = false; - dprintf("replacing event %016llx:%02x with %04x:%02x '%.40s'\n", si->second->uniqueKey(), + dprintf("replacing event %016" PRIx64 ":%02x with %04x:%02x '%.40s'\n", si->second->uniqueKey(), si->second->table_id, evt.eventID, evt.table_id, evt.getName().c_str()); } else if (already_exists && ( (evt.table_id == 0x51 || evt.table_id == 0x50 || evt.table_id == 0x4e) && evt.table_id == si->second->table_id && evt.version != si->second->version )) @@ -419,7 +419,7 @@ xprintf("addEvent: current %016llx event %016llx running %d messaging_got_CN %d\ if ((*x)->times.begin()->startzeit + (long)(*x)->times.begin()->dauer <= start_time) break; /* here we have an overlapping event */ - dprintf("%s: delete 0x%016llx.%02x time = 0x%016llx.%02x\n", __func__, + dprintf("%s: delete 0x%016" PRIx64 ".%02x time = 0x%016" PRIx64 ".%02x\n", __func__, x_key, (*x)->table_id, e_key, e->table_id); to_delete.push_back(x_key); } @@ -1310,7 +1310,7 @@ void CTimeThread::setSystemTime(time_t tim) gettimeofday(&tv, NULL); timediff = (int64_t)tim * (int64_t)1000000 - (tv.tv_usec + tv.tv_sec * (int64_t)1000000); - xprintf("%s: timediff %lld, current: %02d.%02d.%04d %02d:%02d:%02d, dvb: %s", name.c_str(), timediff, + xprintf("%s: timediff %" PRId64 ", current: %02d.%02d.%04d %02d:%02d:%02d, dvb: %s", name.c_str(), timediff, tmTime->tm_mday, tmTime->tm_mon+1, tmTime->tm_year+1900, tmTime->tm_hour, tmTime->tm_min, tmTime->tm_sec, ctime(&tim)); @@ -1369,7 +1369,7 @@ void CTimeThread::run() Sleep(); #else int rs = Sleep(); - xprintf("%s: wakeup, running %d scanning %d channel %llx reason %d\n", + xprintf("%s: wakeup, running %d scanning %d channel %" PRIx64 " reason %d\n", name.c_str(), running, scanning, current_service, rs); #endif } while (running && !scanning); @@ -1516,7 +1516,7 @@ void CSectionThread::run() if (timeoutsDMX < 0 || timeoutsDMX >= skipTimeouts) { #ifdef DEBUG_SECTION_THREADS xprintf("%s: skipping to next filter %d from %d (timeouts %d)\n", - name.c_str(), filter_index+1, filters.size(), timeoutsDMX); + name.c_str(), filter_index+1, (int)filters.size(), timeoutsDMX); #endif timeoutsDMX = 0; need_change = true; @@ -1524,7 +1524,7 @@ void CSectionThread::run() if (zeit > lastChanged + skipTime) { #ifdef DEBUG_SECTION_THREADS xprintf("%s: skipping to next filter %d from %d (seconds %d)\n", - name.c_str(), filter_index+1, filters.size(), (int) (zeit - lastChanged)); + name.c_str(), filter_index+1, (int)filters.size(), (int)(zeit - lastChanged)); #endif need_change = true; } @@ -1550,7 +1550,7 @@ bool CEventsThread::addEvents() if (!eit.is_parsed()) return false; - dprintf("[%s] adding %d events (begin)\n", name.c_str(), eit.events().size()); + dprintf("[%s] adding %d events (begin)\n", name.c_str(), (int)eit.events().size()); time_t zeit = time(NULL); for (SIevents::const_iterator e = eit.events().begin(); e != eit.events().end(); ++e) { @@ -1699,7 +1699,7 @@ void CCNThread::addFilters() void CCNThread::beforeWait() { - xprintf("%s: set eit update filter, service = 0x%016llx, current version 0x%x got events %d (%s)\n", + xprintf("%s: set eit update filter, service = 0x%016" PRIx64 ", current version 0x%x got events %d (%s)\n", name.c_str(), messaging_current_servicekey, eit_version, messaging_have_CN, updating ? "active" : "not active"); @@ -1996,11 +1996,11 @@ static void *houseKeepingThread(void *) removeOldEvents(oldEventsAre); // alte Events dprintf("after removeoldevents\n"); readLockEvents(); - printf("[sectionsd] Removed %d old events (%d left).\n", anzEventsAlt - mySIeventsOrderUniqueKey.size(), mySIeventsOrderUniqueKey.size()); + printf("[sectionsd] Removed %d old events (%d left).\n", (int)(anzEventsAlt - mySIeventsOrderUniqueKey.size()), (int)mySIeventsOrderUniqueKey.size()); if (mySIeventsOrderUniqueKey.size() != anzEventsAlt) { print_meminfo(); - dprintf("Removed %d old events.\n", anzEventsAlt - mySIeventsOrderUniqueKey.size()); + dprintf("Removed %d old events.\n", (int)(anzEventsAlt - mySIeventsOrderUniqueKey.size())); } anzEventsAlt = mySIeventsOrderUniqueKey.size(); unlockEvents(); @@ -2009,14 +2009,14 @@ static void *houseKeepingThread(void *) if (mySIeventsOrderUniqueKey.size() != anzEventsAlt) { print_meminfo(); - dprintf("Removed %d waste events.\n", anzEventsAlt - mySIeventsOrderUniqueKey.size()); + dprintf("Removed %d waste events.\n", (int)(anzEventsAlt - mySIeventsOrderUniqueKey.size())); } - dprintf("Number of sptr events (event-ID): %u\n", mySIeventsOrderUniqueKey.size()); - dprintf("Number of sptr events (service-id, start time, event-id): %u\n", mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.size()); - dprintf("Number of sptr events (end time, service-id, event-id): %u\n", mySIeventsOrderFirstEndTimeServiceIDEventUniqueKey.size()); - dprintf("Number of sptr nvod events (event-ID): %u\n", mySIeventsNVODorderUniqueKey.size()); - dprintf("Number of cached meta-services: %u\n", mySIeventUniqueKeysMetaOrderServiceUniqueKey.size()); + dprintf("Number of sptr events (event-ID): %u\n", (unsigned)mySIeventsOrderUniqueKey.size()); + dprintf("Number of sptr events (service-id, start time, event-id): %u\n", (unsigned)mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.size()); + dprintf("Number of sptr events (end time, service-id, event-id): %u\n", (unsigned)mySIeventsOrderFirstEndTimeServiceIDEventUniqueKey.size()); + dprintf("Number of sptr nvod events (event-ID): %u\n", (unsigned)mySIeventsNVODorderUniqueKey.size()); + dprintf("Number of cached meta-services: %u\n", (unsigned)mySIeventUniqueKeysMetaOrderServiceUniqueKey.size()); unlockEvents(); @@ -2097,7 +2097,7 @@ void CEitManager::run() int rc; xprintf("[sectionsd] starting\n"); -printf("SIevent size: %d\n", sizeof(SIevent)); +printf("SIevent size: %d\n", (int)sizeof(SIevent)); /* "export NO_SLOW_ADDEVENT=true" to disable this */ slow_addevent = (getenv("NO_SLOW_ADDEVENT") == NULL); @@ -2476,7 +2476,7 @@ void CEitManager::getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSecti bool CEitManager::getEPGidShort(event_id_t epgID, CShortEPGData * epgdata) { bool ret = false; - dprintf("Request of current EPG for 0x%llx\n", epgID); + dprintf("Request of current EPG for 0x%" PRIx64 "\n", epgID); readLockEvents(); @@ -2501,7 +2501,7 @@ bool CEitManager::getEPGidShort(event_id_t epgID, CShortEPGData * epgdata) bool CEitManager::getEPGid(const event_id_t epgID, const time_t startzeit, CEPGData * epgdata) { bool ret = false; - dprintf("Request of actual EPG for 0x%llx 0x%lx\n", epgID, startzeit); + dprintf("Request of actual EPG for 0x%" PRIx64 " 0x%lx\n", epgID, startzeit); const SIevent& evt = findSIeventForEventUniqueKey(epgID); @@ -2672,7 +2672,7 @@ showProfiling("sectionsd_getChannelEvents end"); bool CEitManager::getComponentTagsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::ComponentTagList& tags) { bool ret = false; - dprintf("Request of ComponentTags for 0x%llx\n", uniqueKey); + dprintf("Request of ComponentTags for 0x%" PRIx64 "\n", uniqueKey); tags.clear(); @@ -2702,7 +2702,7 @@ bool CEitManager::getComponentTagsUniqueKey(const event_id_t uniqueKey, CSection bool CEitManager::getLinkageDescriptorsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::LinkageDescriptorList& descriptors) { bool ret = false; - dprintf("Request of LinkageDescriptors for 0x%llx\n", uniqueKey); + dprintf("Request of LinkageDescriptors for 0x%" PRIx64 "\n", uniqueKey); descriptors.clear(); readLockEvents(); @@ -2744,7 +2744,7 @@ bool CEitManager::getNVODTimesServiceKey(const t_channel_id channel_id, CSection MySIservicesNVODorderUniqueKey::iterator si = mySIservicesNVODorderUniqueKey.find(uniqueServiceKey); if (si != mySIservicesNVODorderUniqueKey.end()) { - dprintf("NVODServices: %u\n", si->second->nvods.size()); + dprintf("NVODServices: %u\n", (unsigned)si->second->nvods.size()); if (!si->second->nvods.empty()) { for (SInvodReferences::iterator ni = si->second->nvods.begin(); ni != si->second->nvods.end(); ++ni) { diff --git a/src/eitd/xmlutil.cpp b/src/eitd/xmlutil.cpp index 44dd9c033..0f3e25e49 100644 --- a/src/eitd/xmlutil.cpp +++ b/src/eitd/xmlutil.cpp @@ -149,7 +149,7 @@ static void addBlacklist(t_original_network_id onid, t_transport_stream_id tsid, ); if (!checkBlacklist(channel_id)) { - xprintf("Add Channel Blacklist for channel 0x%012llx, mask 0x%012llx\n", channel_id, mask); + xprintf("Add Channel Blacklist for channel 0x%012" PRIx64 ", mask 0x%012" PRIx64 "\n", channel_id, mask); ChannelBlacklist *node = new ChannelBlacklist; node->chan = channel_id; node->mask = mask; @@ -168,7 +168,7 @@ static void addNoDVBTimelist(t_original_network_id onid, t_transport_stream_id t ); if (!checkNoDVBTimelist(channel_id)) { - xprintf("Add channel 0x%012llx, mask 0x%012llx to NoDVBTimelist\n", channel_id, mask); + xprintf("Add channel 0x%012" PRIx64 ", mask 0x%012" PRIx64 " to NoDVBTimelist\n", channel_id, mask); ChannelNoDVBTimelist *node = new ChannelNoDVBTimelist; node->chan = channel_id; node->mask = mask; diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 4da8fc6a1..e4b46ab81 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -fno-rtti -fno-exceptions +AM_CPPFLAGS = -fno-rtti -fno-exceptions -D__STDC_FORMAT_MACROS #AM_CPPFLAGS = -fno-rtti BUILT_SOURCES = git_version.h git_version.h: makeversion diff --git a/src/gui/cam_menu.cpp b/src/gui/cam_menu.cpp index 7a8317d4d..67d31ff0e 100644 --- a/src/gui/cam_menu.cpp +++ b/src/gui/cam_menu.cpp @@ -1,6 +1,7 @@ /* Neutrino-GUI - DBoxII-Project + Copyright (C) 2010, 2012 Stefan Seyfried Copyright (C) 2011 CoolStream International Ltd License: GPLv2 diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 7e78f77a4..cf2cd0994 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1034,7 +1034,7 @@ bool CChannelList::adjustToChannelID(const t_channel_id channel_id, bool bToo) unsigned int i; selected_chid = channel_id; - printf("CChannelList::adjustToChannelID me %p [%s] list size %d channel_id %llx\n", this, getName(), chanlist.size(), channel_id); + printf("CChannelList::adjustToChannelID me %p [%s] list size %d channel_id %" PRIx64 "\n", this, getName(), (int)chanlist.size(), channel_id); fflush(stdout); for (i = 0; i < chanlist.size(); i++) { if(chanlist[i] == NULL) { @@ -1128,7 +1128,7 @@ void CChannelList::setSelected( int nChannelNr) // -- Zap to channel with channel_id bool CChannelList::zapTo_ChannelID(const t_channel_id channel_id) { - printf("**************************** CChannelList::zapTo_ChannelID %llx\n", channel_id); + printf("**************************** CChannelList::zapTo_ChannelID %" PRIx64 "\n", channel_id); for (unsigned int i = 0; i < chanlist.size(); i++) { if (chanlist[i]->channel_id == channel_id) { zapTo(i); @@ -1182,7 +1182,7 @@ void CChannelList::zapToChannel(CZapitChannel *channel) if (tuned < chanlist.size() && chanlist[tuned]->last_unlocked_time != 0) chanlist[tuned]->last_unlocked_time = time_monotonic(); - printf("**************************** CChannelList::zapToChannel me %p %s tuned %d new %s -> %llx\n", this, name.c_str(), tuned, channel->getName().c_str(), channel->channel_id); + printf("**************************** CChannelList::zapToChannel me %p %s tuned %d new %s -> %" PRIx64 "\n", this, name.c_str(), tuned, channel->getName().c_str(), channel->channel_id); if(tuned < chanlist.size()) selected_chid = chanlist[tuned]->getChannelID(); @@ -1385,7 +1385,7 @@ CZapitChannel* CChannelList::getPrevNextChannel(int key, unsigned int &sl) if(!g_settings.zap_cycle && bsize > 1) { size_t cactive = sl; - printf("CChannelList::getPrevNextChannel: selected %d total %d active bouquet %d total %d\n", cactive, chanlist.size(), bactive, bsize); + printf("CChannelList::getPrevNextChannel: selected %d total %d active bouquet %d total %d\n", (int)cactive, (int)chanlist.size(), bactive, bsize); if ((key == g_settings.key_quickzap_down) || (key == CRCInput::RC_left)) { if(cactive == 0) { if(bactive == 0) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index c0d7750f8..1a7eafcd9 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -2,15 +2,7 @@ Neutrino-GUI - DBoxII-Project Copyright (C) 2001 Steffen Hehn 'McClean' - Homepage: http://dbox.cyberphoria.org/ - - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. - + Copyright (C) 2007-2012 Stefan Seyfried License: GPL diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 09cef99fa..ef4fd9801 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -2,15 +2,7 @@ Neutrino-GUI - DBoxII-Project Copyright (C) 2001 Steffen Hehn 'McClean' - Homepage: http://dbox.cyberphoria.org/ - - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. - + Copyright (C) 2007-2009, 2011-2012 Stefan Seyfried License: GPL @@ -686,7 +678,7 @@ and add to neutrino playlist if (!answer.empty() && httpres == 0) { -printf("CFileBrowser::readDir_sc: read done, size %d\n", answer.size()); +printf("CFileBrowser::readDir_sc: read done, size %d\n", (int)answer.size()); xmlDocPtr answer_parser = parseXml(answer.c_str()); if (answer_parser != NULL) { diff --git a/src/gui/hdd_menu.cpp b/src/gui/hdd_menu.cpp index 910506fe0..0609f067c 100644 --- a/src/gui/hdd_menu.cpp +++ b/src/gui/hdd_menu.cpp @@ -2,15 +2,7 @@ Neutrino-GUI - DBoxII-Project Copyright (C) 2001 Steffen Hehn 'McClean' - Homepage: http://dbox.cyberphoria.org/ - - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. - + Copyright (C) 2010-2012 Stefan Seyfried License: GPL @@ -227,7 +219,7 @@ int CHDDMenuHandler::doMenu () bool enabled = !CNeutrinoApp::getInstance()->recordingstatus && !removable && !isroot; - snprintf(str, sizeof(str), "%s %s %lld %s", vendor, model, megabytes < 10000 ? megabytes : megabytes/1000, megabytes < 10000 ? "MB" : "GB"); + snprintf(str, sizeof(str), "%s %s %ld %s", vendor, model, (long)(megabytes < 10000 ? megabytes : megabytes/1000), megabytes < 10000 ? "MB" : "GB"); printf("HDD: %s\n", str); tmp_str[i]=str; tempMenu[i] = new CMenuWidget(str, NEUTRINO_ICON_SETTINGS); diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 8ed92f2a4..8f482b622 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1,18 +1,6 @@ /*************************************************************************** Neutrino-GUI - DBoxII-Project - Homepage: http://dbox.cyberphoria.org/ - - $Id: moviebrowser.cpp,v 1.10 2006/09/11 21:11:35 guenther Exp $ - - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. - - License: GPL This program is free software; you can redistribute it and/or modify @@ -41,6 +29,9 @@ Author: Günther@tuxbox.berlios.org based on code of Steffen Hehn 'McClean' + + (C) 2009-2012 Stefan Seyfried + ****************************************************************************/ #ifdef HAVE_CONFIG_H @@ -2129,7 +2120,7 @@ void CMovieBrowser::onDeleteFile(MI_MOVIE_INFO& movieSelectionHandler, bool skip g_RCInput->clearRCMsg(); m_vMovieInfo.erase( (std::vector::iterator)&movieSelectionHandler); - TRACE("List size: %d\n", m_vMovieInfo.size()); + TRACE("List size: %d\n", (int)m_vMovieInfo.size()); //if(m_vMovieInfo.empty()) fileInfoStale(); //if(m_vMovieInfo.empty()) onSetGUIWindow(m_settings.gui); updateSerienames(); @@ -2441,7 +2432,7 @@ void CMovieBrowser::loadAllTsFileNamesFromStorage(void) loadTsFileNamesFromDir(m_dir[i].name); } - TRACE("[mb] Dir%d, Files:%d \r\n",m_dirNames.size(),m_vMovieInfo.size()); + TRACE("[mb] Dir%d, Files:%d\n", (int)m_dirNames.size(), (int)m_vMovieInfo.size()); /* if(m_vMovieInfo.empty()) { @@ -2927,8 +2918,8 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) if(movie_info != NULL) { - strncpy(dirItNr, m_dirNames[movie_info->dirItNr].c_str(),BUFFER_SIZE-1); - snprintf(size,BUFFER_SIZE,"%5llu",movie_info->file.Size>>20); + strncpy(dirItNr, m_dirNames[movie_info->dirItNr].c_str(),BUFFER_SIZE-1); + snprintf(size,BUFFER_SIZE,"%5" PRIu64 "",movie_info->file.Size>>20); } CStringInputSMS titelUserInput(LOCALE_MOVIEBROWSER_INFO_TITLE, &movie_info->epgTitle, (movie_info->epgTitle.empty() || (movie_info->epgTitle.size() < MAX_STRING)) ? MAX_STRING:movie_info->epgTitle.size(), NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789-.: "); @@ -3332,7 +3323,7 @@ bool CMovieBrowser::getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM ite #if 1 // MB_INFO_AUDIO test // we just return the number of audiopids char ltext[10]; - snprintf(ltext, 8,"%d",movie_info.audioPids.size()); + snprintf(ltext, 8,"%d", (int)movie_info.audioPids.size()); ltext[9] = 0; // just to make sure string is terminated *item_string = ltext; #else // MB_INFO_AUDIO test @@ -3409,7 +3400,7 @@ bool CMovieBrowser::getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM ite *item_string = str_tmp; break; case MB_INFO_SIZE: // = 19, - snprintf(str_tmp,MAX_STR_TMP,"%4llu",movie_info.file.Size>>20); + snprintf(str_tmp,MAX_STR_TMP,"%4" PRIu64 "",movie_info.file.Size>>20); *item_string = str_tmp; break; case MB_INFO_MAX_NUMBER: // = 20 @@ -3443,7 +3434,7 @@ void CMovieBrowser::updateSerienames(void) m_vHandleSerienames.push_back(&m_vMovieInfo[i]); } } - TRACE("[mb]->updateSerienames: %d\r\n",m_vHandleSerienames.size()); + TRACE("[mb]->updateSerienames: %d\n", (int)m_vHandleSerienames.size()); // TODO sort(m_serienames.begin(), m_serienames.end(), my_alphasort); m_seriename_stale = false; } @@ -3831,7 +3822,7 @@ static off64_t truncate_movie(MI_MOVIE_INFO * minfo) snprintf(spart, sizeof(spart), "%s.%03d", name, tpart); else snprintf(spart, sizeof(spart), "%s", name); -printf("truncate: part %s to size %lld\n", spart, secoffset); +printf("truncate: part %s to size %" PRId64 "\n", spart, secoffset); truncate(spart, secoffset); minfo->file.Size = newsize; minfo->length = minfo->bookmarks.end/60; @@ -4035,7 +4026,7 @@ static off64_t cut_movie(MI_MOVIE_INFO * minfo, CMovieInfo * cmovie) if(books[bcount].len > SAFE_GOP) books[bcount].len -= SAFE_GOP; books[bcount].ok = 1; -printf("cut: start bookmark %d at %lld len %lld\n", bcount, books[bcount].pos, books[bcount].len); +printf("cut: start bookmark %d at %" PRId64 " len %" PRId64 "\n", bcount, books[bcount].pos, books[bcount].len); bcount++; } for(int book_nr = 0; book_nr < MI_MOVIE_BOOK_USER_MAX; book_nr++) { @@ -4045,7 +4036,7 @@ printf("cut: start bookmark %d at %lld len %lld\n", bcount, books[bcount].pos, b if(books[bcount].len > SAFE_GOP) books[bcount].len -= SAFE_GOP; books[bcount].ok = 1; -printf("cut: jump bookmark %d at %lld len %lld -> skip to %lld\n", bcount, books[bcount].pos, books[bcount].len, books[bcount].pos+books[bcount].len); +printf("cut: jump bookmark %d at %" PRId64 " len %" PRId64 " -> skip to %" PRId64 "\n", bcount, books[bcount].pos, books[bcount].len, books[bcount].pos+books[bcount].len); bcount++; } } @@ -4055,7 +4046,7 @@ printf("cut: jump bookmark %d at %lld len %lld -> skip to %lld\n", bcount, books //if(books[bcount].pos > SAFE_GOP) // books[bcount].pos -= SAFE_GOP; books[bcount].ok = 1; -printf("cut: end bookmark %d at %lld\n", bcount, books[bcount].pos); +printf("cut: end bookmark %d at %" PRId64 "\n", bcount, books[bcount].pos); bcount++; } printf("\n"); @@ -4066,18 +4057,18 @@ printf("\n"); qsort(books, bcount, sizeof(struct mybook), compare_book); for(i = 0; i < bcount; i++) { if(books[i].ok) { - printf("cut: bookmark %d at %lld len %lld -> skip to %lld\n", i, books[i].pos, books[i].len, books[i].pos+books[i].len); + printf("cut: bookmark %d at %" PRId64 " len %" PRId64 " -> skip to %" PRId64 "\n", i, books[i].pos, books[i].len, books[i].pos+books[i].len); newsize -= books[i].len; off64_t curend = books[i].pos + books[i].len; for(int j = i + 1; j < bcount; j++) { if((books[j].pos > books[i].pos) && (books[j].pos < curend)) { off64_t newend = books[j].pos + books[j].len; if(newend > curend) { - printf("cut: bad bookmark %d, position %lld len %lld, ajusting..\n", j, books[j].pos, books[j].len); + printf("cut: bad bookmark %d, position %" PRId64 " len %" PRId64 ", ajusting..\n", j, books[j].pos, books[j].len); books[j].pos = curend; books[j].len = newend - curend; } else { - printf("cut: bad bookmark %d, position %lld len %lld, skipping..\n", j, books[j].pos, books[j].len); + printf("cut: bad bookmark %d, position %" PRId64 " len %" PRId64 ", skipping..\n", j, books[j].pos, books[j].len); books[j].ok = 0; } } @@ -4090,7 +4081,7 @@ printf("\n"); *ptr = 0; find_new_part(npart, dpart, sizeof(dpart) ); tt = time(0); -printf("\n********* new file %s expected size %lld, start time %s", dpart, newsize, ctime (&tt)); +printf("\n********* new file %s expected size %" PRId64 ", start time %s", dpart, newsize, ctime (&tt)); dstfd = open (dpart, O_CREAT|O_WRONLY|O_TRUNC| O_LARGEFILE, 0644); if(dstfd < 0) { perror(dpart); @@ -4110,7 +4101,7 @@ printf("\n********* new file %s expected size %lld, start time %s", dpart, newsi bpos = books[i].pos; bskip = books[i].len; while (!stat64(spart, &s)) { -printf("cut: open part %d file %s size %lld offset %lld book pos %lld\n", part, spart, s.st_size, offset, bpos); +printf("cut: open part %d file %s size %" PRId64 " offset %" PRId64 " book pos %" PRId64 "\n", part, spart, s.st_size, offset, bpos); srcfd = open (spart, O_RDONLY | O_LARGEFILE); if(srcfd < 0) { perror(spart); @@ -4125,7 +4116,7 @@ printf("cut: open part %d file %s size %lld offset %lld book pos %lld\n", part, sdone = offset; while(true) { off64_t until = bpos; -printf("\ncut: reading from %lld to %lld (%lld) want gop %d\n", sdone, until, until - sdone, need_gop); +printf("\ncut: reading from %" PRId64 " to %" PRId64 " (%" PRId64 ") want gop %d\n", sdone, until, until - sdone, need_gop); while(sdone < until) { bool stop; int msg = get_input(&stop); @@ -4150,11 +4141,11 @@ printf("\ncut: reading from %lld to %lld (%lld) want gop %d\n", sdone, until, un int wptr = 0; // FIXME: TEST if(r != BUF_SIZE) printf("****** short read ? %d\n", r); -if(buf[0] != 0x47) printf("cut: buffer not aligned at %lld\n", sdone); +if(buf[0] != 0x47) printf("cut: buffer not aligned at %" PRId64 "\n", sdone); if(need_gop) { int gop = find_gop(buf, r); if(gop >= 0) { - printf("cut: GOP found at %lld offset %d\n", (off64_t)(sdone+gop), gop); + printf("cut: GOP found at %" PRId64 " offset %d\n", (off64_t)(sdone+gop), gop); newsize -= gop; wptr = gop; } else @@ -4179,13 +4170,13 @@ if(buf[0] != 0x47) printf("cut: buffer not aligned at %lld\n", sdone); perror(spart); goto ret_err; } else { -printf("cut: next file -> sdone %lld spos %lld bpos %lld\n", sdone, spos, bpos); +printf("cut: next file -> sdone %" PRId64 " spos %" PRId64 " bpos %" PRId64 "\n", sdone, spos, bpos); offset = 0; bpos -= sdone; goto next_file; } } -printf("cut: current file pos %lld write pos %lld book pos %lld still to read %lld\n", sdone, spos, bpos, sdone - bpos); +printf("cut: current file pos %" PRId64 " write pos %" PRId64 " book pos %" PRId64 " still to read %" PRId64 "\n", sdone, spos, bpos, sdone - bpos); need_gop = 1; offset = bpos + bskip; i++; @@ -4200,7 +4191,7 @@ printf("cut: current file pos %lld write pos %lld book pos %lld still to read %l bskip = books[i].len; } else bpos = size; -printf("cut: next bookmark pos: %lld abs %lld relative next file pos %lld cur file size %lld\n", bpos, bpos - tdone, offset, s.st_size); +printf("cut: next bookmark pos: %" PRId64 " abs %" PRId64 " relative next file pos %" PRId64 " cur file size %" PRId64 "\n", bpos, bpos - tdone, offset, s.st_size); bpos -= tdone; /* all books from 0, converting to 0 + total size skipped */ if(offset >= s.st_size) { offset -= s.st_size; @@ -4216,7 +4207,7 @@ next_file: snprintf(spart, sizeof(spart), "%s.%03d", name, ++part); } tt1 = time(0); -printf("********* total written %lld tooks %ld secs end time %s", spos, tt1-tt, ctime (&tt1)); +printf("********* total written %" PRId64 " tooks %ld secs end time %s", spos, tt1-tt, ctime (&tt1)); save_info(cmovie, minfo, dpart, spos, secsize); retval = 1; @@ -4266,7 +4257,7 @@ static off64_t copy_movie(MI_MOVIE_INFO * minfo, CMovieInfo * cmovie, bool onefi minuteoffset = MINUTEOFFSET; off64_t secsize = minuteoffset/60; //off64_t secsize = len ? size/len/60 : 511040; -printf("copy: len %d minute %lld second %lld\n", len, len ? size/len : 511040*60, secsize); +printf("copy: len %d minute %" PRId64 " second %" PRId64 "\n", len, len ? size/len : 511040*60, secsize); CFrameBuffer * frameBuffer = CFrameBuffer::getInstance(); if (! timescale) @@ -4285,7 +4276,7 @@ printf("copy: len %d minute %lld second %lld\n", len, len ? size/len : 511040*60 books[bcount].pos -= SAFE_GOP; books[bcount].len = (minfo->bookmarks.user[book_nr].length * secsize)/188 * 188; books[bcount].ok = 1; -printf("copy: jump bookmark %d at %lld len %lld\n", bcount, books[bcount].pos, books[bcount].len); +printf("copy: jump bookmark %d at %" PRId64 " len %" PRId64 "\n", bcount, books[bcount].pos, books[bcount].len); newsize += books[bcount].len; bcount++; } @@ -4295,7 +4286,7 @@ printf("copy: jump bookmark %d at %lld len %lld\n", bcount, books[bcount].pos, b return 0; } tt = time(0); -printf("********* %d boormarks, to %s file(s), expected size to copy %lld, start time %s", bcount, onefile ? "one" : "many", newsize, ctime (&tt)); +printf("********* %d boormarks, to %s file(s), expected size to copy %" PRId64 ", start time %s", bcount, onefile ? "one" : "many", newsize, ctime (&tt)); snprintf(npart, sizeof(npart), "%s", name); char * ptr = strstr(npart, ".ts"); if(ptr) @@ -4307,7 +4298,7 @@ printf("********* %d boormarks, to %s file(s), expected size to copy %lld, start goto ret_err; } for(i = 0; i < bcount; i++) { -printf("\ncopy: processing bookmark %d at %lld len %lld\n", i, books[i].pos, books[i].len); +printf("\ncopy: processing bookmark %d at %" PRId64 " len %" PRId64 "\n", i, books[i].pos, books[i].len); off64_t bpos = books[i].pos; off64_t bskip = books[i].len; part = 0; @@ -4323,7 +4314,7 @@ printf("\ncopy: processing bookmark %d at %lld len %lld\n", i, books[i].pos, boo break; } if(sres != 0) { - printf("file for bookmark %d with offset %lld not found\n", i, books[i].pos); + printf("file for bookmark %d with offset %" PRId64 " not found\n", i, books[i].pos); continue; } if(!dst_done || !onefile) { @@ -4341,7 +4332,7 @@ printf("copy: new file %s fd %d\n", dpart, dstfd); need_gop = 1; next_file: stat64(spart, &s); -printf("copy: open part %d file %s size %lld offset %lld\n", part, spart, s.st_size, bpos); +printf("copy: open part %d file %s size %" PRId64 " offset %" PRId64 "\n", part, spart, s.st_size, bpos); srcfd = open (spart, O_RDONLY | O_LARGEFILE); if(srcfd < 0) { printf("failed to open %s\n", spart); @@ -4351,7 +4342,7 @@ printf("copy: open part %d file %s size %lld offset %lld\n", part, spart, s.st_s lseek64 (srcfd, bpos, SEEK_SET); sdone = bpos; off64_t until = bpos + bskip; -printf("copy: read from %lld to %lld read size %d want gop %d\n", bpos, until, BUF_SIZE, need_gop); +printf("copy: read from %" PRId64 " to %" PRId64 " read size %d want gop %d\n", bpos, until, BUF_SIZE, need_gop); while(sdone < until) { size_t toread = (until-sdone) > BUF_SIZE ? BUF_SIZE : until - sdone; bool stop; @@ -4377,11 +4368,11 @@ printf("copy: read from %lld to %lld read size %d want gop %d\n", bpos, until, B int wptr = 0; // FIXME: TEST if(r != BUF_SIZE) printf("****** short read ? %d\n", r); -if(buf[0] != 0x47) printf("copy: buffer not aligned at %lld\n", sdone); +if(buf[0] != 0x47) printf("copy: buffer not aligned at %" PRId64 "\n", sdone); if(need_gop) { int gop = find_gop(buf, r); if(gop >= 0) { - printf("cut: GOP found at %lld offset %d\n", (off64_t)(sdone+gop), gop); + printf("cut: GOP found at %" PRId64 " offset %d\n", (off64_t)(sdone+gop), gop); newsize -= gop; wptr = gop; } else @@ -4410,7 +4401,7 @@ if(buf[0] != 0x47) printf("copy: buffer not aligned at %lld\n", sdone); close(dstfd); goto ret_err; } else { -printf("copy: -> next file, file pos %lld written %lld left %lld\n", sdone, spos, bskip); +printf("copy: -> next file, file pos %" PRId64 " written %" PRId64 " left %" PRId64 "\n", sdone, spos, bskip); bpos = 0; close(srcfd); snprintf(spart, sizeof(spart), "%s.%03d", name, ++part); @@ -4423,14 +4414,14 @@ printf("copy: -> next file, file pos %lld written %lld left %lld\n", sdone, spos close(dstfd); save_info(cmovie, minfo, dpart, spos, secsize); time_t tt1 = time(0); -printf("copy: ********* %s: total written %lld took %ld secs\n", dpart, spos, tt1-tt); +printf("copy: ********* %s: total written %" PRId64 " took %ld secs\n", dpart, spos, tt1-tt); } } /* for all books */ if(onefile) { close(dstfd); save_info(cmovie, minfo, dpart, spos, secsize); time_t tt1 = time(0); -printf("copy: ********* %s: total written %lld took %ld secs\n", dpart, spos, tt1-tt); +printf("copy: ********* %s: total written %" PRId64 " took %ld secs\n", dpart, spos, tt1-tt); } retval = 1; ret_err: diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 188464d89..684d9babd 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -37,9 +37,7 @@ Author: Günther@tuxbox.berlios.org - Revision History: - Date Author Change Description - Nov 2005 Günther initial start + Copyright(C) 2009, 2012 Stefan Seyfried ****************************************************************************/ #ifdef HAVE_CONFIG_H @@ -135,7 +133,7 @@ bool CMovieInfo::convertTs2XmlName(std::string * filename) #define XML_ADD_TAG_LONG(_xml_text_,_tag_name_,_tag_content_){\ _xml_text_ += "\t\t<"_tag_name_">";\ char _tmp_[50];\ - sprintf(_tmp_, "%llu", _tag_content_);\ + sprintf(_tmp_, "%" PRIu64 "", (uint64_t)_tag_content_);\ _xml_text_ += _tmp_;\ _xml_text_ += "\n";} @@ -501,7 +499,7 @@ void CMovieInfo::showMovieInfo(MI_MOVIE_INFO & movie_info) print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_SIZE); print_buffer += ": "; //snprintf(date_char, 12,"%4llu",movie_info.file.Size>>20); - sprintf(date_char, "%llu", movie_info.file.Size >> 20); + sprintf(date_char, "%" PRIu64 "", movie_info.file.Size >> 20); print_buffer += date_char; //print_buffer += "\n"; } @@ -619,9 +617,9 @@ int find_next_char(char to_find, char *text, int start_pos, int end_pos) void strReplace(std::string & orig, const char *fstr, const std::string rstr) { // replace all occurrence of fstr with rstr and, and returns a reference to itself - unsigned int index = 0; - unsigned int fstrlen = strlen(fstr); - int rstrlen = rstr.size(); + size_t index = 0; + size_t fstrlen = strlen(fstr); + size_t rstrlen = rstr.size(); while ((index = orig.find(fstr, index)) != std::string::npos) { orig.replace(index, fstrlen, rstr); diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index e3b50c908..58510e924 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -352,7 +352,7 @@ int CScanTs::handleMsg(neutrino_msg_t msg, neutrino_msg_data_t data) break; case NeutrinoMessages::EVT_SCAN_NUM_TRANSPONDERS: - sprintf(buffer, "%d", data); + sprintf(buffer, "%u", data); paintLine(xpos2, ypos_transponder, w - (8*fw), buffer); total = data; snprintf(str, sizeof(buffer), "scan: %d/%d", done, total); @@ -398,22 +398,22 @@ int CScanTs::handleMsg(neutrino_msg_t msg, neutrino_msg_data_t data) break; case NeutrinoMessages::EVT_SCAN_NUM_CHANNELS: - sprintf(buffer, " = %d", data); + sprintf(buffer, " = %u", data); paintLine(xpos1 + 3 * (6*fw), ypos_service_numbers + mheight, width - 3 * (6*fw) - 10, buffer); break; case NeutrinoMessages::EVT_SCAN_FOUND_TV_CHAN: - sprintf(buffer, "%d", data); + sprintf(buffer, "%u", data); paintLine(xpos1, ypos_service_numbers + mheight, (6*fw), buffer); break; case NeutrinoMessages::EVT_SCAN_FOUND_RADIO_CHAN: - sprintf(buffer, "%d", data); + sprintf(buffer, "%u", data); paintLine(xpos1 + (6*fw), ypos_service_numbers + mheight, (6*fw), buffer); break; case NeutrinoMessages::EVT_SCAN_FOUND_DATA_CHAN: - sprintf(buffer, "%d", data); + sprintf(buffer, "%u", data); paintLine(xpos1 + 2 * (6*fw), ypos_service_numbers + mheight, (6*fw), buffer); break; diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index 274686480..528cfc97d 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -660,7 +660,7 @@ int CScanSetup::showScanMenuLnbSetup() sat_setup->addIntroItems(); satellite_map_t & satmap = fe->getSatellites(); - INFO("satmap size = %d", satmap.size()); + INFO("satmap size = %d", (int)satmap.size()); CMenuWidget *tmp[satmap.size()]; for (sat_iterator_t sit = satmap.begin(); sit != satmap.end(); ++sit) diff --git a/src/gui/zapit_setup.cpp b/src/gui/zapit_setup.cpp index 245af0c4e..db105e7c7 100644 --- a/src/gui/zapit_setup.cpp +++ b/src/gui/zapit_setup.cpp @@ -6,6 +6,8 @@ Homepage: http://dbox.cyberphoria.org/ License: GPL + Copyright (C) 2011-2012 Stefan Seyfried + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or @@ -125,7 +127,7 @@ int CSelectChannelWidget::exec(CMenuTarget* parent, const std::string& actionKey { unsigned int cnr = 0; t_channel_id channel_id = 0; - sscanf(&(actionKey[4]),"%u|%llx", &cnr,&channel_id); + sscanf(&(actionKey[4]),"%u|%" SCNx64 "", &cnr, &channel_id); if (strncmp(actionKey.c_str(), "ZCT:", 4) == 0)//...tv { @@ -161,7 +163,7 @@ void CSelectChannelWidget::InitZapitChannelHelper(CZapitClient::channelsMode mod for(int j = 0; j < (int) channels.size(); j++) { CZapitChannel * channel = channels[j]; char cChannelId[60] = {0}; - snprintf(cChannelId,sizeof(cChannelId),"ZC%c:%d|%llx#",(mode==CZapitClient::MODE_TV)?'T':'R',channel->number,channel->channel_id); + snprintf(cChannelId, sizeof(cChannelId), "ZC%c:%d|%" PRIx64 "#", (mode==CZapitClient::MODE_TV)?'T':'R', channel->number, channel->channel_id); CMenuForwarderNonLocalized * chan_item = new CMenuForwarderNonLocalized(channel->getName().c_str(), true, NULL, this, (std::string(cChannelId) + channel->getName()).c_str(), CRCInput::RC_nokey, NULL, channel->scrambled ?NEUTRINO_ICON_SCRAMBLED:NULL); chan_item->setItemButton(NEUTRINO_ICON_BUTTON_OKAY, true); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 744d2ab71..15711c80e 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1273,14 +1273,14 @@ void CNeutrinoApp::channelsInit(bool bOnly) CBouquet* newBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_NEW), false, true); newBouquet->channelList->SetChannelList(&zapitList); TVallList->Bouquets.push_back(newBouquet); - printf("[neutrino] got %d new TV channels\n", zapitList.size()); fflush(stdout); + printf("[neutrino] got %d new TV channels\n", (int)zapitList.size()); fflush(stdout); } CServiceManager::getInstance()->GetAllRadioChannels(zapitList, CZapitChannel::NEW); if (!zapitList.empty()) { CBouquet* newBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_NEW), false, true); newBouquet->channelList->SetChannelList(&zapitList); RADIOallList->Bouquets.push_back(newBouquet); - printf("[neutrino] got %d new RADIO channels\n", zapitList.size()); fflush(stdout); + printf("[neutrino] got %d new RADIO channels\n", (int)zapitList.size()); fflush(stdout); } } if (g_settings.make_removed_list) { @@ -1289,14 +1289,14 @@ void CNeutrinoApp::channelsInit(bool bOnly) CBouquet* newBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_REMOVED), false, true); newBouquet->channelList->SetChannelList(&zapitList); TVallList->Bouquets.push_back(newBouquet); - printf("[neutrino] got %d removed TV channels\n", zapitList.size()); fflush(stdout); + printf("[neutrino] got %d removed TV channels\n", (int)zapitList.size()); fflush(stdout); } CServiceManager::getInstance()->GetAllRadioChannels(zapitList, CZapitChannel::REMOVED); if (!zapitList.empty()) { CBouquet* newBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_REMOVED), false, true); newBouquet->channelList->SetChannelList(&zapitList); RADIOallList->Bouquets.push_back(newBouquet); - printf("[neutrino] got %d removed RADIO channels\n", zapitList.size()); fflush(stdout); + printf("[neutrino] got %d removed RADIO channels\n", (int)zapitList.size()); fflush(stdout); } } TIMER_STOP("[neutrino] sats took"); @@ -1327,7 +1327,7 @@ void CNeutrinoApp::channelsInit(bool bOnly) hdBouquet->channelList->SetChannelList(&zapitList); hdBouquet->channelList->SortSat(); TVfavList->Bouquets.push_back(hdBouquet); - printf("[neutrino] got %d HD channels\n", zapitList.size()); fflush(stdout); + printf("[neutrino] got %d HD channels\n", (int)zapitList.size()); fflush(stdout); } } TIMER_STOP("[neutrino] tv took"); @@ -1412,7 +1412,7 @@ void CNeutrinoApp::SetChannelMode(int newmode) INFO("newmode %d sort old %d new %d", newmode, sortmode[newmode], g_settings.channellist_sort_mode); if(newmode != LIST_MODE_FAV && sortmode[newmode] != g_settings.channellist_sort_mode && g_settings.channellist_sort_mode < CChannelList::SORT_MAX) { sortmode[newmode] = g_settings.channellist_sort_mode; - INFO("sorting, mode %d, %d bouquets\n", g_settings.channellist_sort_mode, bouquetList->Bouquets.size()); + INFO("sorting, mode %d, %d bouquets\n", g_settings.channellist_sort_mode, (int)bouquetList->Bouquets.size()); for (uint32_t i = 0; i < bouquetList->Bouquets.size(); i++) { if(g_settings.channellist_sort_mode == CChannelList::SORT_ALPHA) bouquetList->Bouquets[i]->channelList->SortAlpha(); @@ -2316,7 +2316,7 @@ _show: int old_b = bouquetList->getActiveBouquetNumber(); //int old_mode = g_settings.channel_mode; int old_mode = GetChannelMode(); - printf("************************* ZAP START: bouquetList %p size %d old_b %d\n", bouquetList, bouquetList->Bouquets.size(), old_b);fflush(stdout); + printf("************************* ZAP START: bouquetList %p size %d old_b %d\n", bouquetList, (int)bouquetList->Bouquets.size(), old_b);fflush(stdout); if(!bouquetList->Bouquets.empty()) { old_num = bouquetList->Bouquets[old_b]->channelList->getSelected(); @@ -2352,7 +2352,7 @@ _repeat: StartSubtitles(mode == mode_tv); } else if(nNewChannel == -3) { // list mode changed - printf("************************* ZAP NEW MODE: bouquetList %p size %d\n", bouquetList, bouquetList->Bouquets.size());fflush(stdout); + printf("************************* ZAP NEW MODE: bouquetList %p size %d\n", bouquetList, (int)bouquetList->Bouquets.size());fflush(stdout); nNewChannel = bouquetList->exec(true); goto _repeat; } @@ -2601,7 +2601,7 @@ _repeat: } else if( msg == NeutrinoMessages::RECORD_STOP) { CTimerd::RecordingStopInfo* recinfo = (CTimerd::RecordingStopInfo*)data; - printf("NeutrinoMessages::RECORD_STOP: eventID %d channel_id %llx\n", recinfo->eventID, recinfo->channel_id); + printf("NeutrinoMessages::RECORD_STOP: eventID %d channel_id %" PRIx64 "\n", recinfo->eventID, recinfo->channel_id); CRecordManager::getInstance()->Stop(recinfo); autoshift = CRecordManager::getInstance()->TimeshiftOnly(); diff --git a/src/nhttpd/tuxboxapi/coolstream/Makefile.am b/src/nhttpd/tuxboxapi/coolstream/Makefile.am index f26f6d934..064cb60bb 100644 --- a/src/nhttpd/tuxboxapi/coolstream/Makefile.am +++ b/src/nhttpd/tuxboxapi/coolstream/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -fno-rtti -fno-exceptions +AM_CPPFLAGS = -fno-rtti -fno-exceptions -D__STDC_FORMAT_MACROS INCLUDES = \ -I$(top_builddir) \ diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 998dcabaa..c61f7e3c1 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -189,7 +189,7 @@ int check_dir(const char * dir) ret = 0; break; //ok default: - fprintf(stderr, "%s Unknow File system type: %i\n" ,dir ,s.f_type); + fprintf(stderr, "%s Unknown filesystem type: 0x%x\n", dir, (int)s.f_type); break; // error } } diff --git a/src/timerd/Makefile.am b/src/timerd/Makefile.am index 76c1954c4..716ce2a95 100644 --- a/src/timerd/Makefile.am +++ b/src/timerd/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -fno-rtti -fno-exceptions +AM_CPPFLAGS = -fno-rtti -fno-exceptions -D__STDC_FORMAT_MACROS INCLUDES = \ -I$(top_builddir) \ diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 917f1e003..583ec2211 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -4,6 +4,8 @@ Copyright (C) 2001 Steffen Hehn 'McClean' Homepage: http://dbox.cyberphoria.org/ + Copyright (C) 2011-2012 Stefan Seyfried + $Id: timermanager.cpp,v 1.86 2006/03/04 09:51:47 zwen Exp $ License: GPL @@ -419,7 +421,7 @@ void CTimerManager::loadEventsFromConfig() { std::vector savedIDs; savedIDs = config.getInt32Vector ("IDS"); - dprintf("%d timer(s) in config\n",savedIDs.size()); + dprintf("%d timer(s) in config\n", (int)savedIDs.size()); for(unsigned int i=0; i < savedIDs.size(); i++) { std::stringstream ostr; @@ -640,7 +642,7 @@ void CTimerManager::saveEventsToConfig() // Sperren !!! CConfigFile config(','); config.clear(); - dprintf("save %d events to config ...\n", events.size()); + dprintf("save %d events to config ...\n", (int)events.size()); CTimerEventMap::iterator pos = events.begin(); for(;pos != events.end();++pos) { @@ -950,7 +952,7 @@ void CTimerEvent::printEvent(void) case CTimerd::TIMER_ZAPTO : dprintf(" Zapto: " PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS - " epg: %s (%llx)\n", + " epg: %s (%" PRIx64 ")\n", static_cast(this)->eventInfo.channel_id, static_cast(this)->epgTitle.c_str(), static_cast(this)->eventInfo.epgID); @@ -959,7 +961,7 @@ void CTimerEvent::printEvent(void) case CTimerd::TIMER_RECORD : dprintf(" Record: " PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS - " epg: %s(%llx) apids: 0x%X\n dir: %s\n", + " epg: %s(%" PRIx64 ") apids: 0x%X\n dir: %s\n", static_cast(this)->eventInfo.channel_id, static_cast(this)->epgTitle.c_str(), static_cast(this)->eventInfo.epgID, diff --git a/src/zapit/include/zapit/types.h b/src/zapit/include/zapit/types.h index 118ea8a2d..10fe5a60a 100644 --- a/src/zapit/include/zapit/types.h +++ b/src/zapit/include/zapit/types.h @@ -47,9 +47,9 @@ typedef uint64_t t_channel_id; #define CREATE_CHANNEL_ID(service_id,original_network_id,transport_stream_id) ((((t_channel_id)transport_stream_id) << 32) | (((t_channel_id)original_network_id) << 16) | (t_channel_id)service_id) #define CREATE_CHANNEL_ID64 (((uint64_t)(satellitePosition+freq*4) << 48) | ((uint64_t) transport_stream_id << 32) | ((uint64_t)original_network_id << 16) | (uint64_t)service_id) -#define PRINTF_CHANNEL_ID_TYPE "%16llx" -#define PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS "%llx" -#define SCANF_CHANNEL_ID_TYPE "%llx" +#define PRINTF_CHANNEL_ID_TYPE "%16" PRIx64 +#define PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS "%" PRIx64 +#define SCANF_CHANNEL_ID_TYPE "%" SCNx64 typedef uint64_t transponder_id_t; #if 0 @@ -65,7 +65,7 @@ typedef uint64_t transponder_id_t; #define SAME_TRANSPONDER(id1, id2) ((id1 >> 16) == (id2 >> 16)) -#define PRINTF_TRANSPONDER_ID_TYPE "%12llx" +#define PRINTF_TRANSPONDER_ID_TYPE "%12" PRIx64 #define TRANSPONDER_ID_NOT_TUNED 0 #define GET_ORIGINAL_NETWORK_ID_FROM_TRANSPONDER_ID(transponder_id) ((t_original_network_id)(transponder_id )) #define GET_TRANSPORT_STREAM_ID_FROM_TRANSPONDER_ID(transponder_id) ((t_transport_stream_id)(transponder_id >> 16)) diff --git a/src/zapit/src/Makefile.am b/src/zapit/src/Makefile.am index b63a0641f..2806c96f3 100644 --- a/src/zapit/src/Makefile.am +++ b/src/zapit/src/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -fno-rtti -fno-exceptions +AM_CPPFLAGS = -fno-rtti -fno-exceptions -D__STDC_FORMAT_MACROS INCLUDES = \ -I$(top_builddir) \ diff --git a/src/zapit/src/bouquets.cpp b/src/zapit/src/bouquets.cpp index f6f40259d..2467a68d9 100644 --- a/src/zapit/src/bouquets.cpp +++ b/src/zapit/src/bouquets.cpp @@ -389,7 +389,7 @@ void CBouquetManager::parseBouquetsXml(const char *fname, bool bUser) newBouquet->sortBouquet(); search = search->xmlNextNode; } - INFO("total: %d bouquets", Bouquets.size()); + INFO("total: %d bouquets", (int)Bouquets.size()); } xmlFreeDoc(parser); } diff --git a/src/zapit/src/capmt.cpp b/src/zapit/src/capmt.cpp index 1514cd184..c5f08f7de 100644 --- a/src/zapit/src/capmt.cpp +++ b/src/zapit/src/capmt.cpp @@ -3,6 +3,7 @@ * thegoodguy * * Copyright (C) 2011-2012 CoolStream International Ltd + * Copyright (C) 2012 Stefan Seyfried * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -187,7 +188,7 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(channel_id); if(channel == NULL) { - printf("CCamManager: channel %llx not found\n", channel_id); + printf("CCamManager: channel %" PRIx64 " not found\n", channel_id); return false; } //INFO("channel %llx [%s] mode %d %s update %d", channel_id, channel->getName().c_str(), mode, start ? "START" : "STOP", force_update); @@ -228,7 +229,7 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start if(cam->getSource() > 0) source = cam->getSource(); - INFO("channel %llx [%s] mode %d %s src %d mask %d -> %d update %d", channel_id, channel->getName().c_str(), + INFO("channel %" PRIx64 " [%s] mode %d %s src %d mask %d -> %d update %d", channel_id, channel->getName().c_str(), mode, start ? "START" : "STOP", source, oldmask, newmask, force_update); //INFO("source %d old mask %d new mask %d force update %s", source, oldmask, newmask, force_update ? "yes" : "no"); if((oldmask != newmask) || force_update) { diff --git a/src/zapit/src/femanager.cpp b/src/zapit/src/femanager.cpp index f8fa390f2..20e8f0b8d 100644 --- a/src/zapit/src/femanager.cpp +++ b/src/zapit/src/femanager.cpp @@ -2,6 +2,7 @@ Neutrino-GUI - DBoxII-Project Copyright (C) 2011 CoolStream International Ltd + Copyright (C) 2012 Stefan Seyfried License: GPLv2 @@ -68,7 +69,7 @@ bool CFEManager::Init() delete fe; } } - INFO("found %d frontends\n", femap.size()); + INFO("found %d frontends\n", (int)femap.size()); if( femap.empty() ) return false; #if 0 @@ -346,7 +347,7 @@ CFrontend * CFEManager::findFrontend(CZapitChannel * channel) for(fe_map_iterator_t it = femap.begin(); it != femap.end(); it++) { CFrontend * fe = it->second; - INFO("Check fe%d: locked %d TP %llx - channel TP %llx", fe->fenumber, fe->Locked(), fe->getTsidOnid(), channel_tid); + INFO("Check fe%d: locked %d TP %" PRIx64 " - channel TP %" PRIx64 "", fe->fenumber, fe->Locked(), fe->getTsidOnid(), channel_tid); if(fe->tuned && fe->sameTsidOnid(channel->getTransponderId())) { same_tid_fe = fe; break; @@ -396,7 +397,7 @@ CFrontend * CFEManager::getLoopFE(CZapitChannel * channel) /* check is there any locked fe, remember fe with same transponder */ for(fe_map_iterator_t it = femap.begin(); it != femap.end(); it++) { CFrontend * fe = it->second; - INFO("Check fe%d: locked %d freq %d TP %llx - channel freq %d TP %llx", fe->fenumber, fe->Locked(), fe->getFrequency(), fe->getTsidOnid(), channel->getFreqId(), channel->getTransponderId()); + INFO("Check fe%d: locked %d freq %d TP %" PRIx64 " - channel freq %d TP %" PRIx64 "", fe->fenumber, fe->Locked(), fe->getFrequency(), fe->getTsidOnid(), channel->getFreqId(), channel->getTransponderId()); #if 0 if(fe->tuned && fe->sameTsidOnid(channel->getTransponderId())) { same_tid_fe = fe; // first with same tp id @@ -432,7 +433,7 @@ CFrontend * CFEManager::getIndependentFE(CZapitChannel * channel) satellite_map_t & satmap = fe->getSatellites(); sat_iterator_t sit = satmap.find(satellitePosition); bool configured = ((sit != satmap.end()) && sit->second.configured); - INFO("Check fe%d: locked %d freq %d TP %llx - channel freq %d TP %llx has sat %d: %s", + INFO("Check fe%d: locked %d freq %d TP %" PRIx64 " - channel freq %d TP %" PRIx64 " has sat %d: %s", fe->fenumber, fe->Locked(), fe->getFrequency(), fe->getTsidOnid(), channel->getFreqId(), channel->getTransponderId(), satellitePosition, configured ? "yes" : "no"); if(!configured) diff --git a/src/zapit/src/frontend.cpp b/src/zapit/src/frontend.cpp index d7a948d45..e137c641f 100644 --- a/src/zapit/src/frontend.cpp +++ b/src/zapit/src/frontend.cpp @@ -256,14 +256,14 @@ void CFrontend::reset(void) void CFrontend::Lock() { usecount++; - INFO("[fe%d] usecount %d tp %llx\n", fenumber, usecount, getTsidOnid()); + INFO("[fe%d] usecount %d tp %" PRIx64 "\n", fenumber, usecount, getTsidOnid()); } void CFrontend::Unlock() { if(usecount > 0) usecount--; - INFO("[fe%d] usecount %d tp %llx\n", fenumber, usecount, getTsidOnid()); + INFO("[fe%d] usecount %d tp %" PRIx64 "\n", fenumber, usecount, getTsidOnid()); } fe_code_rate_t CFrontend::getCFEC() @@ -964,7 +964,7 @@ bool CFrontend::setInput(CZapitChannel * channel, bool nvod) tpI = transponders.find(channel->getTransponderId()); if (tpI == transponders.end()) { - printf("Transponder %llx for channel %llx not found\n", ct, channel->getChannelID()); + printf("Transponder %" PRIx64 " for channel %" PRIx64 " not found\n", ct, channel->getChannelID()); return false; } diff --git a/src/zapit/src/getservices.cpp b/src/zapit/src/getservices.cpp index db97238a1..b879869ba 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -424,7 +424,7 @@ void CServiceManager::ParseChannels(xmlNodePtr node, const t_transport_stream_id have_numbers = true; service_number_map_t::iterator it = channel_numbers->find(number); if(it != channel_numbers->end()) { - printf("[zapit] duplicate channel number %d: %s id %llx freq %d\n", number, + printf("[zapit] duplicate channel number %d: %s id %" PRIx64 " freq %d\n", number, name.c_str(), chid, freq); number = 0; dup_numbers = true; // force save after loading @@ -435,7 +435,7 @@ void CServiceManager::ParseChannels(xmlNodePtr node, const t_transport_stream_id bool ret = AddChannel(channel); //printf("INS CHANNEL %s %x\n", name.c_str(), (int) &ret.first->second); if(ret == false) { - printf("[zapit] duplicate channel %s id %llx freq %d (old %s at %d)\n", + printf("[zapit] duplicate channel %s id %" PRIx64 " freq %d (old %s at %d)\n", name.c_str(), chid, freq, channel->getName().c_str(), channel->getFreqId()); } else { service_count++; @@ -623,7 +623,7 @@ bool CServiceManager::LoadServices(bool only_current) xmlDocPtr parser; static bool satcleared = 0;//clear only once, because menu is static service_count = 0; - printf("[zapit] Loading services, channel size %d ..\n", sizeof(CZapitChannel)); + printf("[zapit] Loading services, channel size %d ..\n", (int)sizeof(CZapitChannel)); frontendType = CFEManager::getInstance()->getLiveFE()->getInfo()->type; if(only_current) @@ -684,13 +684,13 @@ bool CServiceManager::LoadServices(bool only_current) } LoadProviderMap(); - printf("[zapit] %d services loaded (%d)...\n", service_count, allchans.size()); + printf("[zapit] %d services loaded (%d)...\n", service_count, (int)allchans.size()); TIMER_STOP("[zapit] service loading took"); if(zapit_debug) {//FIXME sat_iterator_t sit; for(sit = satellitePositions.begin(); sit != satellitePositions.end(); ++sit) - printf("satelliteName = %s (%d), satellitePosition = %d motor position = %d usals %d\n", sit->second.name.c_str(), sit->second.name.size(), sit->first, sit->second.motor_position, sit->second.use_usals); + printf("satelliteName = %s (%d), satellitePosition = %d motor position = %d usals %d\n", sit->second.name.c_str(), (int)sit->second.name.size(), sit->first, sit->second.motor_position, sit->second.use_usals); } /* reset flag after loading services.xml */ services_changed = false; @@ -759,7 +759,7 @@ void CServiceManager::SaveServices(bool tocopy, bool if_changed) #ifdef SAVE_DEBUG set chans_processed; #endif - printf("CServiceManager::SaveServices: total channels: %d\n", allchans.size()); + printf("CServiceManager::SaveServices: total channels: %d\n", (int)allchans.size()); FILE * fd = fopen(SERVICES_TMP, "w"); if(!fd) { perror(SERVICES_TMP); diff --git a/src/zapit/src/pzapit.cpp b/src/zapit/src/pzapit.cpp index 73e06d5d9..269283171 100644 --- a/src/zapit/src/pzapit.cpp +++ b/src/zapit/src/pzapit.cpp @@ -273,7 +273,7 @@ int main (int argc, char** argv) { if (i < argc - 2) { - sscanf(argv[++i], "%lld", &satmask); + sscanf(argv[++i], "%" SCNd64 "", &satmask); sscanf(argv[++i], "%d", &diseqc[0]); /* diseqc[0] = strlen(argv[i+1]); @@ -347,7 +347,7 @@ int main (int argc, char** argv) { if (i < argc - 1) { - sscanf(argv[++i], "%llx", &zapsid); + sscanf(argv[++i], "%" SCNx64 "", &zapsid); continue; } } @@ -509,7 +509,7 @@ int main (int argc, char** argv) std::vector::const_iterator rI; for ( ii = 0, rI = satelliteList.begin(); rI != satelliteList.end(); ii++, rI++) - printf("%lld : %s %d\n", ii, rI->satName, rI->satPosition); + printf("%" PRId64 " : %s %d\n", ii, rI->satName, rI->satPosition); //std::cout << (1 << ii) << ": " << rI->satName << std::endl; return 0; @@ -577,7 +577,7 @@ int main (int argc, char** argv) if (getchannel) { t_channel_id channelid = zapit.getCurrentServiceID(); - printf("%llx (%s)\n", channelid, (zapit.getChannelName(channelid)).c_str()); + printf("%" PRIx64 " (%s)\n", channelid, (zapit.getChannelName(channelid)).c_str()); return 0; } @@ -587,7 +587,7 @@ int main (int argc, char** argv) if (zapsid > 0) { - printf("Zapping to: %llx (%s) ", zapsid, (zapit.getChannelName(zapsid)).c_str()); + printf("Zapping to: %" PRIx64 " (%s) ", zapsid, (zapit.getChannelName(zapsid)).c_str()); tmp = zapit.zapTo_serviceID(zapsid); if (!tmp) printf("failed"); diff --git a/src/zapit/src/scan.cpp b/src/zapit/src/scan.cpp index 82172882e..ba0137b44 100644 --- a/src/zapit/src/scan.cpp +++ b/src/zapit/src/scan.cpp @@ -3,6 +3,8 @@ * * (C) 2002-2003 Andreas Oberritter * + * (C) 2009, 2001-2012 Stefan Seyfried + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -206,7 +208,7 @@ bool CServiceScan::AddFromNit() } } nittransponders.clear(); - printf("\n\n[scan] found %d additional transponders from nit\n", scantransponders.size()); + printf("\n\n[scan] found %d additional transponders from nit\n", (int)scantransponders.size()); return !scantransponders.empty(); } @@ -297,7 +299,7 @@ _repeat: bouquet_map_t & tmp = bat.getBouquets(); for(bouquet_map_t::iterator it = tmp.begin(); it != tmp.end(); ++it) { bouquet_map[it->first].insert(it->second.begin(), it->second.end()); - printf("########### CServiceScan::ReadNitSdt: bouquet_map [%s] size %d ###########\n", it->first.c_str(), bouquet_map[it->first].size()); + printf("########### CServiceScan::ReadNitSdt: bouquet_map [%s] size %d ###########\n", it->first.c_str(), (int)bouquet_map[it->first].size()); } channel_number_map_t &lcn = bat.getLogicalMap(); logical_map.insert(lcn.begin(), lcn.end()); @@ -316,14 +318,14 @@ _repeat: transponder t2(frontendType, TsidOnid, tI->second.feparams, tI->second.polarization); transponders.insert(transponder_pair_t(TsidOnid, t2)); } - printf("[scan] tpid ready: %llx\n", TsidOnid); + printf("[scan] tpid ready: %" PRIx64 "\n", TsidOnid); } if((flags & SCAN_NIT) && AddFromNit()) goto _repeat; if ((flags & SCAN_LOGICAL_NUMBERS /*(SCAN_NIT|SCAN_LOGICAL_NUMBERS)*/) && !nit_logical_map.empty()) { std::string pname = networkName; - INFO("network [%s] %d logical channels (%d hd)\n", pname.c_str(), nit_logical_map.size(), nit_hd_logical_map.size()); + INFO("network [%s] %d logical channels (%d hd)\n", pname.c_str(), (int)nit_logical_map.size(), (int)nit_hd_logical_map.size()); g_bouquetManager->loadBouquets(true); CServiceManager::getInstance()->ResetChannelNumbers(true, true); CZapitBouquet* bouquet; @@ -375,7 +377,7 @@ _repeat: CZapitBouquet* bouquet; std::string pname = it->first; int bouquetId = g_bouquetManager->existsUBouquet(pname.c_str()); - printf("########### CServiceScan::ReadNitSdt: bouquet [%s] size %d id %d ###########\n", it->first.c_str(), bouquet_map[it->first].size(), bouquetId); + printf("########### CServiceScan::ReadNitSdt: bouquet [%s] size %d id %d ###########\n", it->first.c_str(), (int)bouquet_map[it->first].size(), bouquetId); if (bouquetId == -1) bouquet = g_bouquetManager->addBouquet(pname, true); else diff --git a/src/zapit/src/scanbat.cpp b/src/zapit/src/scanbat.cpp index c02fa0951..bf5b2a26e 100644 --- a/src/zapit/src/scanbat.cpp +++ b/src/zapit/src/scanbat.cpp @@ -162,7 +162,7 @@ bool CBat::Parse() const DescriptorList * dlist = bat->getDescriptors(); DescriptorConstIterator dit; #ifdef DEBUG_BAT - printf("BAT: section %d, %d descriptors\n", bat->getSectionNumber(), dlist->size()); + printf("BAT: section %d, %d descriptors\n", bat->getSectionNumber(), (int)dlist->size()); #endif unsigned int pdsd = 0; for (dit = dlist->begin(); dit != dlist->end(); ++dit) { @@ -220,7 +220,7 @@ bool CBat::Parse() dlist = b->getDescriptors(); #if 1 printf("BAT: bouquet_id %04x tsid %04x onid %04x %d descriptors\n", bouquet_id, b->getTransportStreamId(), - b->getOriginalNetworkId(), dlist->size()); + b->getOriginalNetworkId(), (int)dlist->size()); #endif for (dit = dlist->begin(); dit != dlist->end(); ++dit) { Descriptor * d = *dit; @@ -322,7 +322,7 @@ bool CBat::ParseLogicalChannels(LogicalChannelDescriptor * ld, BouquetAssociatio CZapitChannel * chan = CServiceManager::getInstance()->FindChannel48(channel_id); if(chan) name = chan->getName(); - printf("BAT: logical channel %05d: tsid %04x onid %04x %016llx [%s] visible %d\n", lcn, transport_stream_id, original_network_id, channel_id, name.c_str(), (*it)->getVisibleServiceFlag()); + printf("BAT: logical channel %05d: tsid %04x onid %04x %016" PRIx64 " [%s] visible %d\n", lcn, transport_stream_id, original_network_id, channel_id, name.c_str(), (*it)->getVisibleServiceFlag()); #endif } return true; diff --git a/src/zapit/src/transponder.cpp b/src/zapit/src/transponder.cpp index aa51be576..630af0978 100644 --- a/src/zapit/src/transponder.cpp +++ b/src/zapit/src/transponder.cpp @@ -1,5 +1,6 @@ /* * Copyright (C) 2012 CoolStream International Ltd + * Copyright (C) 2012 Stefan Seyfried * * License: GPLv2 * @@ -112,11 +113,11 @@ void transponder::dump(std::string label) struct dvb_frontend_parameters *dvb_feparams = &feparams.dvb_feparams; if (type == FE_QAM) - printf("%s tp-id %016llx freq %d rate %d fec %d mod %d\n", label.c_str(), + printf("%s tp-id %016" PRIx64 " freq %d rate %d fec %d mod %d\n", label.c_str(), transponder_id, dvb_feparams->frequency, dvb_feparams->u.qam.symbol_rate, dvb_feparams->u.qam.fec_inner, dvb_feparams->u.qam.modulation); else - printf("%s tp-id %016llx freq %d rate %d fec %d pol %d\n", label.c_str(), + printf("%s tp-id %016" PRIx64 " freq %d rate %d fec %d pol %d\n", label.c_str(), transponder_id, dvb_feparams->frequency, dvb_feparams->u.qpsk.symbol_rate, dvb_feparams->u.qpsk.fec_inner, polarization); } diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index a10ce3817..64cd74c13 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -212,7 +212,7 @@ void CZapit::LoadAudioMap() int volume = 0; char s[1000]; while (fgets(s, 1000, audio_config_file)) { - sscanf(s, "%llx %d %d %d %d %d %d", &chan, &apid, &mode, &volume, &subpid, &ttxpid, &ttxpage); + sscanf(s, "%" SCNx64 " %d %d %d %d %d %d", &chan, &apid, &mode, &volume, &subpid, &ttxpid, &ttxpage); audio_map[chan].apid = apid; audio_map[chan].subpid = subpid; audio_map[chan].mode = mode; @@ -231,7 +231,7 @@ void CZapit::SaveAudioMap() return; } for (audio_map_iterator_t audio_map_it = audio_map.begin(); audio_map_it != audio_map.end(); audio_map_it++) { - fprintf(audio_config_file, "%llx %d %d %d %d %d %d\n", (uint64_t) audio_map_it->first, + fprintf(audio_config_file, "%" PRIx64 " %d %d %d %d %d %d\n", (uint64_t) audio_map_it->first, (int) audio_map_it->second.apid, (int) audio_map_it->second.mode, (int) audio_map_it->second.volume, (int) audio_map_it->second.subpid, (int) audio_map_it->second.ttxpid, (int) audio_map_it->second.ttxpage); } @@ -252,7 +252,7 @@ void CZapit::LoadVolumeMap() int volume = 0; char s[1000]; while (fgets(s, 1000, volume_config_file)) { - if (sscanf(s, "%llx %d %d", &chan, &apid, &volume) == 3) + if (sscanf(s, "%" SCNx64 " %d %d", &chan, &apid, &volume) == 3) vol_map.insert(volume_pair_t(chan, pid_pair_t(apid, volume))); } fclose(volume_config_file); @@ -266,7 +266,7 @@ void CZapit::SaveVolumeMap() return; } for (volume_map_iterator_t it = vol_map.begin(); it != vol_map.end(); ++it) - fprintf(volume_config_file, "%llx %d %d\n", (uint64_t) it->first, it->second.first, it->second.second); + fprintf(volume_config_file, "%" PRIx64 " %d %d\n", (uint64_t) it->first, it->second.first, it->second.second); fdatasync(fileno(volume_config_file)); fclose(volume_config_file); @@ -472,7 +472,7 @@ bool CZapit::ZapIt(const t_channel_id channel_id, bool forupdate, bool startplay return false; } - INFO("[zapit] zap to %s (%llx tp %llx)", newchannel->getName().c_str(), newchannel->getChannelID(), newchannel->getTransponderId()); + INFO("[zapit] zap to %s (%" PRIx64 " tp %" PRIx64 ")", newchannel->getName().c_str(), newchannel->getChannelID(), newchannel->getTransponderId()); CFrontend * fe = CFEManager::getInstance()->allocateFE(newchannel); if(fe == NULL) { @@ -557,7 +557,7 @@ bool CZapit::ZapForRecord(const t_channel_id channel_id) printf("zapit_to_record: channel_id " PRINTF_CHANNEL_ID_TYPE " not found", channel_id); return false; } - printf("%s: %s (%llx)\n", __FUNCTION__, newchannel->getName().c_str(), channel_id); + printf("%s: %s (%" PRIx64 ")\n", __FUNCTION__, newchannel->getName().c_str(), channel_id); CFrontend * frontend = CFEManager::getInstance()->allocateFE(newchannel); if(frontend == NULL) { @@ -582,7 +582,7 @@ void CZapit::SetPidVolume(t_channel_id channel_id, int pid, int percent) if (!pid && (channel_id == live_channel_id) && current_channel) pid = current_channel->getAudioPid(); -INFO("############################### channel %llx pid %x map size %d percent %d", channel_id, pid, vol_map.size(), percent); +INFO("############################### channel %" PRIx64 " pid %x map size %d percent %d", channel_id, pid, (int)vol_map.size(), percent); volume_map_range_t pids = vol_map.equal_range(channel_id); for (volume_map_iterator_t it = pids.first; it != pids.second; ++it) { if (it->second.first == pid) { @@ -623,7 +623,7 @@ int CZapit::GetPidVolume(t_channel_id channel_id, int pid, bool ac3) } } } - DBG("channel %llx pid %x map size %d percent %d", channel_id, pid, vol_map.size(), percent); + DBG("channel %" PRIx64 " pid %x map size %d percent %d", channel_id, pid, (int)vol_map.size(), percent); return percent; } @@ -1984,20 +1984,20 @@ unsigned int CZapit::ZapTo(t_channel_id channel_id, bool isSubService) unsigned int result = 0; if (!ZapIt(channel_id)) { - DBG("[zapit] zapit failed, chid %llx\n", channel_id); + DBG("[zapit] zapit failed, chid %" PRIx64 "\n", channel_id); SendEvent((isSubService ? CZapitClient::EVT_ZAP_SUB_FAILED : CZapitClient::EVT_ZAP_FAILED), &channel_id, sizeof(channel_id)); return result; } result |= CZapitClient::ZAP_OK; - DBG("[zapit] zapit OK, chid %llx\n", channel_id); + DBG("[zapit] zapit OK, chid %" PRIx64 "\n", channel_id); if (isSubService) { - DBG("[zapit] isSubService chid %llx\n", channel_id); + DBG("[zapit] isSubService chid %" PRIx64 "\n", channel_id); SendEvent(CZapitClient::EVT_ZAP_SUB_COMPLETE, &channel_id, sizeof(channel_id)); } else if (current_is_nvod) { - DBG("[zapit] NVOD chid %llx\n", channel_id); + DBG("[zapit] NVOD chid %" PRIx64 "\n", channel_id); SendEvent(CZapitClient::EVT_ZAP_COMPLETE_IS_NVOD, &channel_id, sizeof(channel_id)); result |= CZapitClient::ZAP_IS_NVOD; } From c16f636011d3ab15642fc764af0384460f877313 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Tue, 5 Feb 2013 19:08:54 +0100 Subject: [PATCH 86/86] sectionsd: consider the table_id when inserting events Signed-off-by: Jacek Jendrzej Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5db16ee2ffd774d51163f81cdc259dcd885e3d02 Author: Stefan Seyfried Date: 2013-02-05 (Tue, 05 Feb 2013) ------------------ This commit was generated by Migit --- src/eitd/sectionsd.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 3b1e799f6..909378a27 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -5,7 +5,7 @@ * Copyright (C) 2001 by fnbrd (fnbrd@gmx.de) * Homepage: http://dbox2.elxsi.de * - * Copyright (C) 2008, 2009 Stefan Seyfried + * Copyright (C) 2008-2013 Stefan Seyfried * * Copyright (C) 2011-2012 CoolStream International Ltd * @@ -408,9 +408,16 @@ xprintf("addEvent: current %016" PRIx64 " event %016" PRIx64 " running %d messag else { event_id_t x_key = (*x)->uniqueKey(); - /* do we need this check? */ if (x_key == e_key) - continue; + { + /* the present event has a higher table_id than the new one + * => delete and insert the new one */ + if ((*x)->table_id >= e->table_id) + continue; + /* else: keep the old event with the lower table_id */ + unlockEvents(); + return; + } if ((*x)->times.begin()->startzeit >= end_time) continue; /* iterating backwards: if the endtime of the stored events @@ -418,6 +425,14 @@ xprintf("addEvent: current %016" PRIx64 " event %016" PRIx64 " running %d messag * find an identical one => bail out */ if ((*x)->times.begin()->startzeit + (long)(*x)->times.begin()->dauer <= start_time) break; + if ((*x)->table_id < e->table_id) + { + /* don't add the higher table_id */ + dprintf("%s: don't replace 0x%016" PRIx64 ".%02x with 0x%016" PRIx64 ".%02x\n", + __func__, x_key, (*x)->table_id, e_key, e->table_id); + unlockEvents(); + return; + } /* here we have an overlapping event */ dprintf("%s: delete 0x%016" PRIx64 ".%02x time = 0x%016" PRIx64 ".%02x\n", __func__, x_key, (*x)->table_id, e_key, e->table_id);