diff --git a/configure.ac b/configure.ac index f402e6aa2..1e4d3f493 100644 --- a/configure.ac +++ b/configure.ac @@ -276,7 +276,7 @@ fi fi # hack to define a short filename also for out-of-tree build -if test `dirname $0` = `pwd`; then +if test `dirname $0` = `pwd` || test "$0" = ./configure; then HWLIB_CFLAGS="$HWLIB_CFLAGS "'-D__file__=__FILE__' HWLIB_CFLAGS="$HWLIB_CFLAGS "'-D__path_file__=__FILE__' else diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index c76350a70..9122d4a37 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1932,7 +1932,7 @@ moviebrowser.short_rating Vote moviebrowser.short_recorddate Datum moviebrowser.short_serie Serie moviebrowser.short_size Größe -moviebrowser.short_spacer +moviebrowser.short_spacer moviebrowser.short_title Titel moviebrowser.start_head Film starten von Position: moviebrowser.start_record_start Aufnahmestart diff --git a/data/locale/english.locale b/data/locale/english.locale index 710f75668..6df3cfad2 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1932,7 +1932,7 @@ moviebrowser.short_rating Vote moviebrowser.short_recorddate Date moviebrowser.short_serie Serie moviebrowser.short_size MB -moviebrowser.short_spacer +moviebrowser.short_spacer moviebrowser.short_title Title moviebrowser.start_head Start movie from: moviebrowser.start_record_start Movie start diff --git a/lib/libdvbsub/Makefile.am b/lib/libdvbsub/Makefile.am index 6ac627d08..aa9082181 100644 --- a/lib/libdvbsub/Makefile.am +++ b/lib/libdvbsub/Makefile.am @@ -4,6 +4,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src \ -I$(top_srcdir)/src/zapit/include \ @AVFORMAT_CFLAGS@ \ + @SIGC_CFLAGS@ \ @HWLIB_CFLAGS@ AM_CPPFLAGS += -fno-rtti -fno-exceptions diff --git a/lib/libtuxtxt/Makefile.am b/lib/libtuxtxt/Makefile.am index f40d16044..f3dc7d972 100644 --- a/lib/libtuxtxt/Makefile.am +++ b/lib/libtuxtxt/Makefile.am @@ -6,6 +6,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src \ -I$(top_srcdir)/src/zapit/include \ $(FREETYPE_CFLAGS) \ + @SIGC_CFLAGS@ \ @HWLIB_CFLAGS@ AM_CPPFLAGS += -fno-rtti -fno-exceptions diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 398af9c8a..d642b051a 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -64,6 +64,37 @@ #include #include +extern "C" { +#include +} + +class CStreamRec : public CRecordInstance, OpenThreads::Thread +{ + private: + AVFormatContext *ifcx; + AVFormatContext *ofcx; + AVBitStreamFilterContext *bsfc; + bool stopped; + bool interrupt; + time_t time_started; + int stream_index; + + void GetPids(CZapitChannel * channel); + void FillMovieInfo(CZapitChannel * channel, APIDList & apid_list); + bool Start(); + + void Close(); + bool Open(CZapitChannel * channel); + void run(); + void WriteHeader(uint32_t duration); + public: + CStreamRec(const CTimerd::RecordingInfo * const eventinfo, std::string &dir, bool timeshift = false, bool stream_vtxt_pid = false, bool stream_pmt_pid = false, bool stream_subtitle_pids = false); + ~CStreamRec(); + record_error_msg_t Record(); + bool Stop(bool remove_event = true); + static int Interrupt(void * data); +}; + /* TODO: * nextRecording / pending recordings - needs testing * check/fix askUserOnTimerConflict gui/timerlist.cpp -> getOverlappingTimers lib/timerdclient/timerdclient.cpp @@ -2249,7 +2280,7 @@ void CStreamRec::run() continue; AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec; - if (bsfc && codec->codec_id == CODEC_ID_H264) { + if (bsfc && codec->codec_id == AV_CODEC_ID_H264) { AVPacket newpkt = pkt; if (av_bitstream_filter_filter(bsfc, codec, NULL, &newpkt.data, &newpkt.size, pkt.data, pkt.size, pkt.flags & AV_PKT_FLAG_KEY) >= 0) { diff --git a/src/driver/record.h b/src/driver/record.h index 8a9c2e3f6..da7d26898 100644 --- a/src/driver/record.h +++ b/src/driver/record.h @@ -42,9 +42,11 @@ #include #include +#if 0 extern "C" { #include } +#endif #define REC_MAX_APIDS 10 #define FILENAMEBUFFERSIZE 1024 @@ -249,6 +251,7 @@ class CRecordManager : public CMenuTarget /*, public CChangeObserver*/ #endif }; +#if 0 class CStreamRec : public CRecordInstance, OpenThreads::Thread { private: @@ -275,5 +278,6 @@ class CStreamRec : public CRecordInstance, OpenThreads::Thread bool Stop(bool remove_event = true); static int Interrupt(void * data); }; +#endif #endif diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index 056516230..da17be491 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -911,7 +911,7 @@ void CStreamStream::run() continue; AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec; - if (bsfc && codec->codec_id == CODEC_ID_H264 ) { + if (bsfc && codec->codec_id == AV_CODEC_ID_H264 ) { AVPacket newpkt = pkt; if (av_bitstream_filter_filter(bsfc, codec, NULL, &newpkt.data, &newpkt.size, pkt.data, pkt.size, pkt.flags & AV_PKT_FLAG_KEY) >= 0) { diff --git a/src/gui/color.cpp b/src/gui/color.cpp index 56382340d..cbc0873e0 100644 --- a/src/gui/color.cpp +++ b/src/gui/color.cpp @@ -233,8 +233,8 @@ void getItemColors(fb_pixel_t &t, fb_pixel_t &b, bool selected, bool marked, boo { if (selected && marked) { - t = COL_MENUCONTENTSELECTED_TEXT_PLUS_2; - b = COL_MENUCONTENTSELECTED_PLUS_2; + t = COL_MENUCONTENTSELECTED_TEXT; + b = COL_MENUCONTENTSELECTED_PLUS_0; return; } diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index d8b7d033f..925f7f9f5 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -279,7 +279,7 @@ void CMovieBrowser::clearListLines() m_browserListLines.Icon.clear(); m_browserListLines.marked.clear(); - for (int i = 0; i < 2; i++) + for (int i = 0; i < 3; i++) { m_recordListLines.lineArray[i].clear(); m_playListLines.lineArray[i].clear(); @@ -545,21 +545,29 @@ void CMovieBrowser::initRows(void) { //TRACE("[mb]->%s\n", __func__); + /* + The "last played" / "last recorded" windows have only half the width, so + multiply the relative width with 2 and add 1 percent for safety to date row. + This addition is just usefull for l a r g e font settings. + */ + /***** Last Play List **************/ - m_settings.lastPlayRowNr = 2; + m_settings.lastPlayRowNr = 3; m_settings.lastPlayRow[0] = MB_INFO_TITLE; - m_settings.lastPlayRow[1] = MB_INFO_PREVPLAYDATE; - /* the "last played" / "last recorded" windows have only half the width, so - multiply the relative width with 2 */ - m_settings.lastPlayRowWidth[1] = m_defaultRowWidth[m_settings.lastPlayRow[1]] * 2 + 1; - m_settings.lastPlayRowWidth[0] = 100 - m_settings.lastPlayRowWidth[1]; + m_settings.lastPlayRow[1] = MB_INFO_SPACER; + m_settings.lastPlayRow[2] = MB_INFO_PREVPLAYDATE; + m_settings.lastPlayRowWidth[2] = m_defaultRowWidth[m_settings.lastPlayRow[2]] * 2 + 1; + m_settings.lastPlayRowWidth[1] = m_defaultRowWidth[m_settings.lastPlayRow[1]] * 2; + m_settings.lastPlayRowWidth[0] = 100 - m_settings.lastPlayRowWidth[1] - m_settings.lastPlayRowWidth[2]; /***** Last Record List **************/ - m_settings.lastRecordRowNr = 2; + m_settings.lastRecordRowNr = 3; m_settings.lastRecordRow[0] = MB_INFO_TITLE; - m_settings.lastRecordRow[1] = MB_INFO_RECORDDATE; - m_settings.lastRecordRowWidth[1] = m_defaultRowWidth[m_settings.lastRecordRow[1]] * 2 + 1; - m_settings.lastRecordRowWidth[0] = 100 - m_settings.lastRecordRowWidth[1]; + m_settings.lastRecordRow[1] = MB_INFO_SPACER; + m_settings.lastRecordRow[2] = MB_INFO_RECORDDATE; + m_settings.lastRecordRowWidth[2] = m_defaultRowWidth[m_settings.lastRecordRow[2]] * 2 + 1; + m_settings.lastRecordRowWidth[1] = m_defaultRowWidth[m_settings.lastRecordRow[1]] * 2; + m_settings.lastRecordRowWidth[0] = 100 - m_settings.lastRecordRowWidth[1] - m_settings.lastRecordRowWidth[2]; } void CMovieBrowser::defaultSettings(MB_SETTINGS* /*settings*/) @@ -1177,21 +1185,22 @@ int CMovieBrowser::paint(void) //CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, g_Locale->getText(LOCALE_MOVIEBROWSER_HEAD)); - Font* font = g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_LIST]; //NI + Font* font = g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_LIST]; m_movieSelectionHandler = NULL; + m_pcBrowser = new CListFrame(&m_browserListLines, font, CListFrame::SCROLL | CListFrame::HEADER_LINE, &m_cBoxFrameBrowserList, NULL, - g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_HEAD]); //NI + g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_HEAD]); m_pcLastPlay = new CListFrame(&m_playListLines, font, CListFrame::SCROLL | CListFrame::HEADER_LINE | CListFrame::TITLE, &m_cBoxFrameLastPlayList, g_Locale->getText(LOCALE_MOVIEBROWSER_HEAD_PLAYLIST), - g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_HEAD]); //NI + g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_HEAD]); m_pcLastRecord = new CListFrame(&m_recordListLines, font, CListFrame::SCROLL | CListFrame::HEADER_LINE | CListFrame::TITLE, &m_cBoxFrameLastRecordList, g_Locale->getText(LOCALE_MOVIEBROWSER_HEAD_RECORDLIST), - g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_HEAD]); //NI + g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_HEAD]); m_pcFilter = new CListFrame(&m_FilterLines, font, CListFrame::SCROLL | CListFrame::TITLE, &m_cBoxFrameFilter, g_Locale->getText(LOCALE_MOVIEBROWSER_HEAD_FILTER), - g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_HEAD]); //NI - m_pcInfo = new CTextBox(" ", g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_INFO], CTextBox::TOP | CTextBox::SCROLL, &m_cBoxFrameInfo); //NI + g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_HEAD]); + m_pcInfo = new CTextBox(" ", g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_INFO], CTextBox::TOP | CTextBox::SCROLL, &m_cBoxFrameInfo); if (m_pcBrowser == NULL || m_pcLastPlay == NULL || @@ -1434,7 +1443,7 @@ void CMovieBrowser::refreshMovieInfo(void) } if (pic) flogo_w = pic->getWidth(); - m_pcInfo->setText(&m_movieSelectionHandler->epgInfo2, m_cBoxFrameInfo.iWidth - flogo_w - 24); + m_pcInfo->setText(&m_movieSelectionHandler->epgInfo2, m_cBoxFrameInfo.iWidth - flogo_w - (flogo_w ? 24 : 0)); if (pic) pic->paint(CC_SAVE_SCREEN_NO); @@ -3544,7 +3553,7 @@ bool CMovieBrowser::getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM ite *item_string = str_tmp; break; case MB_INFO_LENGTH: // = 18, - snprintf(str_tmp, sizeof(str_tmp),"%dh %dm", movie_info.length/60, movie_info.length%60); + snprintf(str_tmp, sizeof(str_tmp),"%dh %02dm", movie_info.length/60, movie_info.length%60); *item_string = str_tmp; break; case MB_INFO_SIZE: // = 19, diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index 844f5910f..b78953d36 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -68,10 +68,6 @@ #define MAX_BROWSER_FRAME_HEIGHT 80 // void strReplace(std::string& orig, const char* fstr, const std::string &rstr); - - - - #define MB_MAX_ROWS LF_MAX_ROWS #define MB_MAX_DIRS NETWORK_NFS_NR_OF_ENTRIES /* MB_SETTINGS to be stored in g_settings anytime ....*/ @@ -95,22 +91,24 @@ typedef struct int browser_serie_mode; int serie_auto_create; + /* these variables are used for the listframes */ int browserFrameHeight; int browserRowNr; - MB_INFO_ITEM browserRowItem[MB_MAX_ROWS];//MB_INFO_ITEM + MB_INFO_ITEM browserRowItem[MB_MAX_ROWS]; int browserRowWidth[MB_MAX_ROWS]; // to be added to config later int lastPlayMaxItems; int lastPlayRowNr; - MB_INFO_ITEM lastPlayRow[2]; - int lastPlayRowWidth[2]; + MB_INFO_ITEM lastPlayRow[3]; + int lastPlayRowWidth[3]; int lastRecordMaxItems; int lastRecordRowNr; - MB_INFO_ITEM lastRecordRow[2]; - int lastRecordRowWidth[2]; + MB_INFO_ITEM lastRecordRow[3]; + int lastRecordRowWidth[3]; + int ytmode; int ytorderby; int ytresults; diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 7bd71f3d6..76ea4fb46 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -159,7 +159,6 @@ const SNeutrinoSettings::FONT_TYPES menu_font_sizes[] = }; size_t menu_font_items = sizeof(menu_font_sizes)/sizeof(menu_font_sizes[0]); -//NI const SNeutrinoSettings::FONT_TYPES moviebrowser_font_sizes[] = { SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_HEAD, @@ -182,7 +181,7 @@ font_sizes_groups font_sizes_groups[] = {LOCALE_FONTMENU_EVENTLIST , eventlist_font_items , eventlist_font_sizes , "fontsize.deve", LOCALE_MENU_HINT_EVENTLIST_FONTS }, {LOCALE_FONTMENU_EPG , epg_font_items , epg_font_sizes , "fontsize.depg", LOCALE_MENU_HINT_EPG_FONTS }, {LOCALE_FONTMENU_INFOBAR , infobar_font_items , infobar_font_sizes , "fontsize.dinf", LOCALE_MENU_HINT_INFOBAR_FONTS }, - {LOCALE_FONTMENU_MOVIEBROWSER,moviebrowser_font_items,moviebrowser_font_sizes,"fontsize.dmbr", LOCALE_MENU_HINT_MOVIEBROWSER_FONTS }, //NI + {LOCALE_FONTMENU_MOVIEBROWSER,moviebrowser_font_items,moviebrowser_font_sizes,"fontsize.dmbr", LOCALE_MENU_HINT_MOVIEBROWSER_FONTS }, {LOCALE_FONTMENU_OTHER , other_font_items , other_font_sizes , "fontsize.doth", LOCALE_MENU_HINT_OTHER_FONTS } }; #define FONT_GROUP_COUNT (sizeof(font_sizes_groups)/sizeof(font_sizes_groups[0])) @@ -214,9 +213,9 @@ font_sizes_struct neutrino_font[SNeutrinoSettings::FONT_TYPE_COUNT] = {LOCALE_FONTSIZE_INFOBAR_ECMINFO , 15, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, //NI {LOCALE_FONTSIZE_FILEBROWSER_ITEM , 16, CNeutrinoFonts::FONT_STYLE_BOLD , 1}, {LOCALE_FONTSIZE_MENU_HINT , 16, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, - {LOCALE_FONTSIZE_MOVIEBROWSER_HEAD , 15, CNeutrinoFonts::FONT_STYLE_REGULAR, 2}, //NI - {LOCALE_FONTSIZE_MOVIEBROWSER_LIST , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, //NI - {LOCALE_FONTSIZE_MOVIEBROWSER_INFO , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, //NI + {LOCALE_FONTSIZE_MOVIEBROWSER_HEAD , 15, CNeutrinoFonts::FONT_STYLE_REGULAR, 2}, + {LOCALE_FONTSIZE_MOVIEBROWSER_LIST , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, + {LOCALE_FONTSIZE_MOVIEBROWSER_INFO , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, {LOCALE_FONTSIZE_SUBTITLES , 25, CNeutrinoFonts::FONT_STYLE_BOLD , 0} }; diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 868ffe544..546979fcd 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -296,7 +296,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) if(actionKey == "add_ip") { std::string remoteip; CIPInput remotebox_NetworkIP(LOCALE_REMOTEBOX_IP , &remoteip); - if (remotebox_NetworkIP.exec(NULL,"") == true) { + if ((remotebox_NetworkIP.exec(NULL,"") == true) && (!remoteip.empty())) { remboxmenu->addItem(new CMenuForwarder(remoteip, true, NULL, this, "cha_ip")); remotebox_NetworkIP.hide(); changed = true; @@ -394,22 +394,37 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) } else if ((strcmp(key, "fetch_remotetimer") == 0) && localChanExists(timerlist[selected].channel_id)) { + int pre,post; + Timer->getRecordingSafety(pre,post); + std::string remotebox_ip = timerlist[selected].remotebox_ip; + std::string eventID = to_string((int)timerlist[selected].eventID); + + int res = Timer->addRecordTimerEvent(timerlist[selected].channel_id, timerlist[selected].alarmTime + pre, + timerlist[selected].stopTime - post, 0, 0, timerlist[selected].announceTime, + TIMERD_APIDS_CONF, true, timerlist[selected].announceTime > time(NULL),"",false); + + if (res == -1) + { + bool forceAdd = askUserOnTimerConflict(timerlist[selected].announceTime,timerlist[selected].stopTime); + + if (forceAdd) + { + res = Timer->addRecordTimerEvent(timerlist[selected].channel_id, timerlist[selected].alarmTime + pre, + timerlist[selected].stopTime - post, 0, 0, timerlist[selected].announceTime, + TIMERD_APIDS_CONF, true, timerlist[selected].announceTime > time(NULL),"",true); + } + } + CHTTPTool httpTool; std::string r_url; r_url = "http://"; - r_url += timerlist[selected].remotebox_ip; + r_url += remotebox_ip; r_url += "/control/timer?action=remove"; - r_url += "&id=" + to_string((int)timerlist[selected].eventID); + r_url += "&id=" + eventID; //printf("[remotetimer] url:%s\n",r_url.c_str()); + if (res > 0) r_url = httpTool.downloadString(r_url); //printf("[remotetimer] status:%s\n",r_url.c_str()); - if (r_url=="ok") { - int pre,post; - Timer->getRecordingSafety(pre,post); - Timer->addRecordTimerEvent(timerlist[selected].channel_id, timerlist[selected].alarmTime + pre, - timerlist[selected].stopTime - post, 0, 0, timerlist[selected].announceTime, - TIMERD_APIDS_CONF, true, timerlist[selected].announceTime > time(NULL)); - } } else if (strcmp(key, "del_remotetimer") == 0) { @@ -619,12 +634,6 @@ void CTimerList::updateEvents(void) void CTimerList::select_remotebox_ip() { - if (g_settings.timer_remotebox_ip.size() == 1) { - std::list::iterator it = g_settings.timer_remotebox_ip.begin(); - strncpy(timerlist[selected].remotebox_ip,it->c_str(),sizeof(timerlist[selected].remotebox_ip)); - timerlist[selected].remotebox_ip[sizeof(timerlist[selected].remotebox_ip) - 1] = 0; - } - int select = 0; CMenuWidget *m = new CMenuWidget(LOCALE_REMOTEBOX_HEAD, NEUTRINO_ICON_TIMER); CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select); @@ -638,12 +647,18 @@ void CTimerList::select_remotebox_ip() std::list::iterator it = g_settings.timer_remotebox_ip.begin(); std::advance(it,select); + if (askUserOnRemoteTimerConflict(timerlist[selected].announceTime, timerlist[selected].stopTime, (char*) it->c_str())) + { strncpy(timerlist[selected].remotebox_ip,it->c_str(),sizeof(timerlist[selected].remotebox_ip)); timerlist[selected].remotebox_ip[sizeof(timerlist[selected].remotebox_ip) - 1] = 0; + } } bool CTimerList::remoteChanExists(t_channel_id channel_id) { + if (strcmp(timerlist[selected].remotebox_ip,"") == 0) + return false; + CHTTPTool httpTool; std::string r_url; r_url = "http://"; @@ -1655,6 +1670,72 @@ int CTimerList::newTimer() return ret; } +bool CTimerList::askUserOnRemoteTimerConflict(time_t announceTime, time_t stopTime, char * remotebox_ip) +{ + CTimerd::TimerList overlappingTimers; + int pre,post; + Timer->getRecordingSafety(pre,post); + + for (CTimerd::TimerList::iterator it = timerlist.begin(); + it != timerlist.end();++it) + { + + if (strcmp(it->remotebox_ip,remotebox_ip) == 0) { + + if(it->stopTime != 0 && stopTime != 0) + { + // Check if both timers have start and end. In this case do not show conflict, if endtime is the same than the starttime of the following timer + if ((stopTime+post > it->alarmTime) && (announceTime-pre < it->stopTime)) + { + overlappingTimers.push_back(*it); + } + } + else + { + if (!((stopTime < it->announceTime) || (announceTime > it->stopTime))) + { + overlappingTimers.push_back(*it); + } + } + } + } + + std::string timerbuf = g_Locale->getText(LOCALE_TIMERLIST_OVERLAPPING_TIMER); + timerbuf += "\n"; + for (CTimerd::TimerList::iterator it = overlappingTimers.begin(); + it != overlappingTimers.end(); ++it) + { + timerbuf += CTimerList::convertTimerType2String(it->eventType); + timerbuf += " ("; + timerbuf += CTimerList::convertChannelId2String(it->channel_id); // UTF-8 + if (it->epgID != 0) + { + CEPGData epgdata; + if (CEitManager::getInstance()->getEPGid(it->epgID, it->epg_starttime, &epgdata)) + { + timerbuf += ":"; + timerbuf += epgdata.title; + } + else if (strlen(it->epgTitle)!=0) + { + timerbuf += ":"; + timerbuf += it->epgTitle; + } + } + timerbuf += "):\n"; + + struct tm *annTime = localtime(&(it->announceTime)); + timerbuf += strftime("%d.%m. %H:%M\n",annTime); + + struct tm *sTime = localtime(&(it->stopTime)); + timerbuf += strftime("%d.%m. %H:%M\n",sTime); + } + if (overlappingTimers.size() > 0) + return (ShowMsg(LOCALE_MESSAGEBOX_INFO,timerbuf,CMessageBox::mbrNo,CMessageBox::mbNo|CMessageBox::mbYes) == CMessageBox::mbrYes); + else + return true; +} + bool askUserOnTimerConflict(time_t announceTime, time_t stopTime, t_channel_id channel_id) { //NI diff --git a/src/gui/timerlist.h b/src/gui/timerlist.h index 3ed0af33c..7a633cb7f 100644 --- a/src/gui/timerlist.h +++ b/src/gui/timerlist.h @@ -95,6 +95,7 @@ class CTimerList : public CMenuTarget, public CListHelpers bool changed; int bselected; CMenuWidget *remboxmenu; + bool askUserOnRemoteTimerConflict(time_t announceTime, time_t stopTime, char * remotebox_ip); public: CTimerList(); diff --git a/src/gui/update_ext.cpp b/src/gui/update_ext.cpp index c946c89b5..3e6246d36 100644 --- a/src/gui/update_ext.cpp +++ b/src/gui/update_ext.cpp @@ -324,7 +324,7 @@ bool CExtUpdate::applySettings() fd2 = -1; int tmpCount = 0; while (fd2 < 0) { - fd2 = open(mtdBlockFileName.c_str(), O_WRONLY); + fd2 = open(mtdBlockFileName.c_str(), O_WRONLY, 00644); tmpCount++; if (tmpCount > 3) break; @@ -375,7 +375,7 @@ bool CExtUpdate::applySettings() if (fd1 < 0) return ErrorReset(RESET_UNLOAD | DELETE_MTDBUF, "cannot read mtdBlock"); fsize = mtdRamSize; - fd2 = open(imgFilename.c_str(), O_WRONLY | O_CREAT); + fd2 = open(imgFilename.c_str(), O_WRONLY | O_CREAT, 00644); if (fd2 < 0) return ErrorReset(RESET_UNLOAD | CLOSE_FD1 | DELETE_MTDBUF, "cannot open image file: ", imgFilename); while(fsize > 0) { diff --git a/src/gui/widget/listframe.cpp b/src/gui/widget/listframe.cpp index a2dee004a..15018c984 100644 --- a/src/gui/widget/listframe.cpp +++ b/src/gui/widget/listframe.cpp @@ -368,21 +368,27 @@ void CListFrame::refreshScroll(void) if( frameBuffer == NULL) return; if(!(m_nMode & SCROLL)) return; - if (m_nNrOfPages > 1) - { - frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY, - m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, COL_SCROLLBAR_PASSIVE_PLUS_0); - unsigned int marker_size = m_cFrameScrollRel.iHeight / m_nNrOfPages; - frameBuffer->paintBoxRel(m_cFrameScrollRel.iX + SCROLL_MARKER_BORDER+m_cFrame.iX, - m_cFrameScrollRel.iY + m_nCurrentPage * marker_size +m_cFrame.iY, - m_cFrameScrollRel.iWidth - (2*SCROLL_MARKER_BORDER), - marker_size, COL_SCROLLBAR_ACTIVE_PLUS_0); - } - else + /* + FIXME: Find right conditions. + So long let's paint scrollbar background in every case + to avoid transparent spaces in scrollbar corners. + */ + if (1) { frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY, m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, COL_MENUCONTENT_PLUS_0); } + + if (m_nNrOfPages > 1) + { + frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY, + m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, COL_SCROLLBAR_PASSIVE_PLUS_0, RADIUS_MIN); + unsigned int marker_size = (m_cFrameScrollRel.iHeight - 2*SCROLL_MARKER_BORDER) / m_nNrOfPages; + frameBuffer->paintBoxRel(m_cFrameScrollRel.iX + SCROLL_MARKER_BORDER+m_cFrame.iX, + m_cFrameScrollRel.iY + SCROLL_MARKER_BORDER + m_nCurrentPage * marker_size +m_cFrame.iY, + m_cFrameScrollRel.iWidth - (2*SCROLL_MARKER_BORDER), + marker_size, COL_SCROLLBAR_ACTIVE_PLUS_0, RADIUS_MIN); + } } int CListFrame::paintListIcon(int x, int y, int line) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 93358b8e4..a4f719240 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -296,9 +296,9 @@ void CTextBox::initFramesRel(void) if(m_nMode & SCROLL) { m_cFrameScrollRel.iX = m_cFrame.iWidth - SCROLL_FRAME_WIDTH; - m_cFrameScrollRel.iY = m_cFrameTextRel.iY; + m_cFrameScrollRel.iY = m_cFrameTextRel.iY + m_nBgRadius; m_cFrameScrollRel.iWidth = SCROLL_FRAME_WIDTH; - m_cFrameScrollRel.iHeight = m_cFrameTextRel.iHeight; + m_cFrameScrollRel.iHeight = m_cFrameTextRel.iHeight - 2*m_nBgRadius; } else { @@ -494,25 +494,44 @@ void CTextBox::refreshScroll(void) if( frameBuffer == NULL) return; + /* + FIXME: Find right conditions. + So long let's paint scrollbar background in every case + to avoid transparent spaces in scrollbar corners. + */ + if (1) + { + /* + Why we paint scrollbar background seperately? + So we have to reduce roundings from the left side of background. + */ + int BgRadiusType = CORNER_NONE; + if (m_nBgRadiusType == CORNER_ALL) + BgRadiusType = CORNER_RIGHT; + else if (m_nBgRadiusType == CORNER_TOP) + BgRadiusType = CORNER_TOP_RIGHT; + else if (m_nBgRadiusType == CORNER_BOTTOM) + BgRadiusType = CORNER_BOTTOM_RIGHT; + + frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrame.iY, + m_cFrameScrollRel.iWidth, m_cFrame.iHeight, + m_textBackgroundColor, m_nBgRadius, BgRadiusType); + } + if (m_nNrOfPages > 1) { frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY, m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, - COL_SCROLLBAR_PASSIVE_PLUS_0); - unsigned int marker_size = m_cFrameScrollRel.iHeight / m_nNrOfPages; - frameBuffer->paintBoxRel(m_cFrameScrollRel.iX + SCROLL_MARKER_BORDER+m_cFrame.iX, - m_cFrameScrollRel.iY + m_nCurrentPage * marker_size+m_cFrame.iY, + COL_SCROLLBAR_PASSIVE_PLUS_0, RADIUS_MIN); + unsigned int marker_size = (m_cFrameScrollRel.iHeight - 2*SCROLL_MARKER_BORDER) / m_nNrOfPages; + frameBuffer->paintBoxRel(m_cFrameScrollRel.iX + SCROLL_MARKER_BORDER + m_cFrame.iX, + m_cFrameScrollRel.iY + SCROLL_MARKER_BORDER + m_nCurrentPage * marker_size + m_cFrame.iY, m_cFrameScrollRel.iWidth - 2*SCROLL_MARKER_BORDER, - marker_size, COL_SCROLLBAR_ACTIVE_PLUS_0); + marker_size, COL_SCROLLBAR_ACTIVE_PLUS_0, RADIUS_MIN); m_has_scrolled = true; } else - { - frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY, - m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, - m_textBackgroundColor); m_has_scrolled = false; - } } //evaluate comparsion between old and current properties WITHOUT text contents, return true if found changes @@ -570,6 +589,12 @@ void CTextBox::refreshText(void) int dx = m_old_cText != m_cText || m_nNrOfPages>1 ? m_cFrameTextRel.iWidth : m_nMaxTextWidth; int dy = m_cFrameTextRel.iHeight; + //avoid artefacts in transparent cornes + /* + This happens, when text width is smaller then the radius width. + */ + dx = std::max(dx, 2*m_nBgRadius); + //find changes bool has_changed = hasChanged(&ax, &ay, &dx, &dy); @@ -604,10 +629,23 @@ void CTextBox::refreshText(void) bool allow_paint_bg = (m_old_cText != m_cText || has_changed || m_has_scrolled); if (m_nPaintBackground && !m_SaveScreen){ clearScreenBuffer(); - if (allow_paint_bg){ + if (allow_paint_bg) + { + /* + Why we paint scrollbar background seperately? + So we have to reduce roundings from the right side of background. + */ + int BgRadiusType = CORNER_NONE; + if (m_nBgRadiusType == CORNER_ALL) + BgRadiusType = CORNER_LEFT; + else if (m_nBgRadiusType == CORNER_TOP) + BgRadiusType = CORNER_TOP_LEFT; + else if (m_nBgRadiusType == CORNER_BOTTOM) + BgRadiusType = CORNER_BOTTOM_LEFT; + //TRACE("[CTextBox] %s paint bg %d\r\n", __FUNCTION__, __LINE__); //paint full background only on new text, otherwise paint required background - frameBuffer->paintBoxRel(ax, ay, dx, dy, m_textBackgroundColor, m_nBgRadius, m_nBgRadiusType); + frameBuffer->paintBoxRel(ax, ay, dx, dy, m_textBackgroundColor, m_nBgRadius, BgRadiusType); } } else{ diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 26d2bbab5..417bfe6d3 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -48,6 +48,7 @@ #include "debug.h" #include #include +#include #include #include using namespace std; @@ -1259,6 +1260,7 @@ std::vector split(const std::string &s, char delim) return vec; } +#if __cplusplus < 201103L std::string to_string(int i) { std::stringstream s; @@ -1300,6 +1302,7 @@ std::string to_string(unsigned long long i) s << i; return s.str(); } +#endif /** * C++ version 0.4 std::string style "itoa": diff --git a/src/system/helpers.h b/src/system/helpers.h index 0508aeb26..373d82d64 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -119,12 +119,17 @@ class CFileHelpers uint32_t GetWidth4FB_HW_ACC(const uint32_t _x, const uint32_t _w, const bool max=true); +#if __cplusplus < 201103L std::string to_string(int); std::string to_string(unsigned int); std::string to_string(long); std::string to_string(unsigned long); std::string to_string(long long); std::string to_string(unsigned long long); +#else +/* hack... */ +#define to_string(x) std::to_string(x) +#endif std::string itoa(int value, int base); diff --git a/src/system/settings.h b/src/system/settings.h index 6648cd3e5..8aa4e54d4 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -683,9 +683,9 @@ struct SNeutrinoSettings FONT_TYPE_INFOBAR_ECMINFO, //NI FONT_TYPE_FILEBROWSER_ITEM, FONT_TYPE_MENU_HINT, - FONT_TYPE_MOVIEBROWSER_HEAD, //NI - FONT_TYPE_MOVIEBROWSER_LIST, //NI - FONT_TYPE_MOVIEBROWSER_INFO, //NI + FONT_TYPE_MOVIEBROWSER_HEAD, + FONT_TYPE_MOVIEBROWSER_LIST, + FONT_TYPE_MOVIEBROWSER_INFO, FONT_TYPE_SUBTITLES, FONT_TYPE_COUNT }; diff --git a/src/zapit/src/Makefile.am b/src/zapit/src/Makefile.am index a1dac17bc..0130f3a8a 100644 --- a/src/zapit/src/Makefile.am +++ b/src/zapit/src/Makefile.am @@ -11,6 +11,7 @@ AM_CPPFLAGS += \ -I$(top_srcdir)/lib/libeventserver \ -I$(top_srcdir)/lib/xmltree \ @FREETYPE_CFLAGS@ \ + @SIGC_CFLAGS@ \ @HWLIB_CFLAGS@ noinst_LIBRARIES = libzapit.a