diff --git a/src/driver/audiodec/ffmpegdec.cpp b/src/driver/audiodec/ffmpegdec.cpp index 31682a851..0ce6e51c0 100644 --- a/src/driver/audiodec/ffmpegdec.cpp +++ b/src/driver/audiodec/ffmpegdec.cpp @@ -223,7 +223,7 @@ CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, int /*OutputFd*/, State* state, Status=DATA_ERR; return Status; } -#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) AVCodecContext *c = avc->streams[best_stream]->codec; #else AVCodecContext *c = avcodec_alloc_context3(codec); @@ -456,7 +456,7 @@ bool CFfmpegDec::SetMetaData(FILE *_in, CAudioMetaData* m, bool save_cover) if (!is_stream) { GetMeta(avc->metadata); for(unsigned int i = 0; i < avc->nb_streams; i++) { -#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) if (avc->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) #else if (avc->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) @@ -477,7 +477,7 @@ bool CFfmpegDec::SetMetaData(FILE *_in, CAudioMetaData* m, bool save_cover) DeInit(); return false; } -#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) if (!codec) codec = avcodec_find_decoder(avc->streams[best_stream]->codec->codec_id); samplerate = avc->streams[best_stream]->codec->sample_rate; @@ -507,7 +507,7 @@ bool CFfmpegDec::SetMetaData(FILE *_in, CAudioMetaData* m, bool save_cover) printf("CFfmpegDec: format %s (%s) duration %ld\n", avc->iformat->name, type_info.c_str(), total_time); for(unsigned int i = 0; i < avc->nb_streams; i++) { -#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) if (avc->streams[i]->codec->bit_rate > 0) bitrate += avc->streams[i]->codec->bit_rate; #else diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 1307e5345..dc1d52fe7 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -1942,7 +1942,7 @@ void CStreamRec::FillMovieInfo(CZapitChannel * /*channel*/, APIDList & /*apid_li for (unsigned i = 0; i < ofcx->nb_streams; i++) { AVStream *st = ofcx->streams[i]; -#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) AVCodecContext * codec = st->codec; #else AVCodecParameters * codec = st->codecpar; @@ -2175,7 +2175,7 @@ bool CStreamRec::Open(CZapitChannel * channel) stream_index = -1; int stid = 0x200; for (unsigned i = 0; i < ifcx->nb_streams; i++) { -#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) AVCodecContext * iccx = ifcx->streams[i]->codec; AVStream *ost = avformat_new_stream(ofcx, iccx->codec); avcodec_copy_context(ost->codec, iccx); @@ -2231,7 +2231,7 @@ void CStreamRec::run() break; if (pkt.stream_index < 0) continue; -#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec; #else AVCodecParameters *codec = ifcx->streams[pkt.stream_index]->codecpar; diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index 4f721645f..d67b782ea 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -852,7 +852,7 @@ bool CStreamStream::Open() av_dict_copy(&ofcx->metadata, ifcx->metadata, 0); int stid = 0x200; for (unsigned i = 0; i < ifcx->nb_streams; i++) { -#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) AVCodecContext * iccx = ifcx->streams[i]->codec; AVStream *ost = avformat_new_stream(ofcx, iccx->codec); avcodec_copy_context(ost->codec, iccx); @@ -925,7 +925,7 @@ void CStreamStream::run() if (pkt.stream_index < 0) continue; -#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec; #else AVCodecParameters *codec = ifcx->streams[pkt.stream_index]->codecpar; diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index e781f3a02..77b69041c 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -298,8 +298,8 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_info_height = 2*OFFSET_INNER_SMALL + 2*g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getHeight(); m_button_height = ::paintButtons(AudioPlayerButtons[0], 4, 0, 0, 0, 0, 0, false, NULL, NULL); - m_listmaxshow = (m_height - m_title_height - OFFSET_INTER - m_header_height - 2*m_button_height - OFFSET_INTER - m_info_height) / (m_item_height); - m_height = m_title_height + OFFSET_INTER + m_header_height + m_listmaxshow*m_item_height + 2*m_button_height + OFFSET_INTER + m_info_height; // recalc height + m_listmaxshow = (m_height - m_title_height - OFFSET_SHADOW - OFFSET_INTER - m_header_height - 2*m_button_height - OFFSET_SHADOW - OFFSET_INTER - m_info_height - OFFSET_SHADOW) / (m_item_height); + m_height = m_title_height + OFFSET_SHADOW + OFFSET_INTER + m_header_height + m_listmaxshow*m_item_height + 2*m_button_height + OFFSET_SHADOW + OFFSET_INTER + m_info_height + OFFSET_SHADOW; // recalc height m_x = getScreenStartX(m_width); if (m_x < DETAILSLINE_WIDTH) @@ -1538,7 +1538,7 @@ void CAudioPlayerGui::hide() if (m_visible) { clearDetailsLine(); - m_frameBuffer->paintBackgroundBoxRel(m_x, m_y, m_width, m_height); + m_frameBuffer->paintBackgroundBoxRel(m_x, m_y, m_width + OFFSET_SHADOW, m_height + OFFSET_SHADOW); m_visible = false; } } @@ -1548,7 +1548,7 @@ void CAudioPlayerGui::paintItem(int pos) if (!m_show_playlist) return; - int ypos = m_y + m_title_height + OFFSET_INTER + m_header_height + pos*m_item_height; + int ypos = m_y + m_title_height + OFFSET_SHADOW + OFFSET_INTER + m_header_height + pos*m_item_height; unsigned int currpos = m_liststart + pos; bool i_selected = currpos == m_selected; @@ -1578,9 +1578,12 @@ void CAudioPlayerGui::paintItem(int pos) std::string tmp = sNr; getFileInfoToDisplay(tmp, m_playlist[currpos]); - char dura[9]; + char dura[9] = {0}; if (m_inetmode) - snprintf(dura, 8, "%ldk", m_playlist[currpos].MetaData.total_time); + { + if (m_playlist[currpos].MetaData.total_time != 0) + snprintf(dura, 8, "%ldk", m_playlist[currpos].MetaData.total_time); + } else snprintf(dura, 8, "%ld:%02ld", m_playlist[currpos].MetaData.total_time / 60, m_playlist[currpos].MetaData.total_time % 60); @@ -1600,7 +1603,8 @@ void CAudioPlayerGui::paintHead() if (!m_show_playlist || m_screensaver) return; - CComponentsHeaderLocalized header(m_x, m_y + m_title_height + OFFSET_INTER, m_width, m_header_height, LOCALE_AUDIOPLAYER_HEAD, NEUTRINO_ICON_AUDIO); + CComponentsHeaderLocalized header(m_x, m_y + m_title_height + OFFSET_SHADOW + OFFSET_INTER, m_width, m_header_height, LOCALE_AUDIOPLAYER_HEAD, NEUTRINO_ICON_AUDIO); + header.enableShadow( CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); header.setCorner(RADIUS_MID, CORNER_TOP); if (m_inetmode) @@ -1626,7 +1630,10 @@ void CAudioPlayerGui::paintFoot() { NEUTRINO_ICON_BUTTON_INFO, LOCALE_PICTUREVIEWER_HEAD } }; - int button_y = m_y + m_height - m_info_height - OFFSET_INTER - 2*m_button_height; + int button_y = m_y + m_height - OFFSET_SHADOW - m_info_height - OFFSET_INTER - OFFSET_SHADOW - 2*m_button_height; + + // shadow + m_frameBuffer->paintBoxRel(m_x + OFFSET_SHADOW, button_y + OFFSET_SHADOW, m_width, 2*m_button_height, COL_SHADOW_PLUS_0, RADIUS_MID, (m_show_playlist ? CORNER_BOTTOM : CORNER_ALL)); m_frameBuffer->paintBoxRel(m_x, button_y, m_width, 2*m_button_height, COL_MENUFOOT_PLUS_0, RADIUS_MID, (m_show_playlist ? CORNER_BOTTOM : CORNER_ALL)); @@ -1694,6 +1701,9 @@ void CAudioPlayerGui::paintTitleBox() m_frameBuffer->paintBackgroundBoxRel(m_x, m_y, m_width, m_title_height); else { + // shadow + m_frameBuffer->paintBoxRel(m_x + OFFSET_SHADOW, m_y + OFFSET_SHADOW, m_width, m_title_height, COL_SHADOW_PLUS_0, RADIUS_MID); + m_frameBuffer->paintBoxRel(m_x, m_y, m_width, m_title_height, COL_MENUHEAD_PLUS_0, RADIUS_MID); m_frameBuffer->paintBoxFrame(m_x, m_y, m_width, m_title_height, OFFSET_INNER_MIN, COL_FRAME_PLUS_0, RADIUS_MID); @@ -1731,13 +1741,13 @@ void CAudioPlayerGui::paintTitleBox() else if (g_settings.audioplayer_display == TITLE_ARTIST) { tmp = m_curr_audiofile.MetaData.title; - tmp += " / "; + tmp += " - "; tmp += m_curr_audiofile.MetaData.artist; } else //if (g_settings.audioplayer_display == ARTIST_TITLE) { tmp = m_curr_audiofile.MetaData.artist; - tmp += " / "; + tmp += " - "; tmp += m_curr_audiofile.MetaData.title; } w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); @@ -1768,12 +1778,12 @@ void CAudioPlayerGui::paint() for (unsigned int count=0; countsetCorner(RADIUS_LARGE); m_infobox->setColorFrame(COL_FRAME_PLUS_0); m_infobox->setColorBody(COL_MENUCONTENTDARK_PLUS_0); + m_infobox->enableShadow(CC_SHADOW_ON, -1, true); m_infobox->forceTextPaint(false); } @@ -2071,7 +2082,7 @@ void CAudioPlayerGui::updateMetaData() paintCover(); } if (CAudioPlayer::getInstance()->hasMetaDataChanged() != 0) - updateLcd = true; + updateLcd = true; //printf("CAudioPlayerGui::updateMetaData: updateLcd %d\n", updateLcd); if (updateLcd) diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 4a2973c67..a9a88987a 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -620,7 +620,7 @@ int CBouquetList::show(bool bShowChannelList) void CBouquetList::hide() { - frameBuffer->paintBackgroundBoxRel(x, y, width, height); + frameBuffer->paintBackgroundBoxRel(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW); CInfoClock::getInstance()->enableInfoClock(!CInfoClock::getInstance()->isBlocked()); } @@ -702,6 +702,7 @@ void CBouquetList::paintHead() { std::string icon(""); CComponentsHeader header(x, y, width, header_height, name, icon, CComponentsHeader::CC_BTN_LEFT | CComponentsHeader::CC_BTN_RIGHT | CComponentsHeader::CC_BTN_MENU); + header.enableShadow( CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); header.paint(CC_SAVE_SCREEN_NO); } @@ -722,18 +723,12 @@ void CBouquetList::paint() frameBuffer->paintBoxRel(x, y + header_height, width, height - header_height - footer_height, COL_MENUCONTENT_PLUS_0); - int numButtons = sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]); + // no buttons in favonly mode + int numButtons = (favonly) ? 0 : sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]); - if (favonly) - { - // show an empty footer - frameBuffer->paintBoxRel(x, y + height - footer_height, width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); - } - else - { - CComponentsFooter footer; - footer.paintButtons(x, y + height - footer_height, width, footer_height, numButtons, CBouquetListButtons); - } + CComponentsFooter footer; + footer.enableShadow(CC_SHADOW_ON, -1, true); + footer.paintButtons(x, y + height - footer_height, width, footer_height, numButtons, CBouquetListButtons); if (!Bouquets.empty()) { @@ -746,6 +741,5 @@ void CBouquetList::paint() int total_pages; int current_page; getScrollBarData(&total_pages, ¤t_page, Bouquets.size(), listmaxshow, selected); - - paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); + paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page, CC_SHADOW_ON); } diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index 5e4c046f3..2e59a630f 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -94,7 +94,7 @@ void CComponentsScrollBar::initVarSbForm(const int& count, const fb_pixel_t& col sb_down_obj = NULL; sb_segments_obj = NULL; - setCorner(RADIUS_MIN, CORNER_ALL); + corner_type = CORNER_NONE; sb_up_icon = frameBuffer->getIconPath(NEUTRINO_ICON_BUTTON_UP) ; sb_down_icon = frameBuffer->getIconPath(NEUTRINO_ICON_BUTTON_DOWN); diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index b5d209dd3..1c4107a65 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -114,6 +114,8 @@ void EpgPlus::Header::paint(const char * Name) this->head = new CComponentsHeader(); this->head->setContextButton(CComponentsHeader::CC_BTN_HELP); this->head->enableClock(true, "%H:%M", "%H %M", true); + this->head->enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); + } if (this->head) @@ -220,6 +222,9 @@ void EpgPlus::TimeLine::paint(time_t _startTime, int pduration) toggleColor = !toggleColor; } + + // shadow + this->frameBuffer->paintBoxRel(this->x + this->width, this->y + OFFSET_SHADOW, OFFSET_SHADOW, this->getUsedHeight(), COL_SHADOW_PLUS_0); } void EpgPlus::TimeLine::paintGrid() @@ -560,7 +565,7 @@ EpgPlus::Footer::Footer(CFrameBuffer * pframeBuffer, int px, int py, int pwidth, this->width = pwidth; this->buttonHeight = pbuttonHeight; - this->buttonY = this->y - OFFSET_INTER - this->buttonHeight; + this->buttonY = this->y - OFFSET_INTER - OFFSET_SHADOW - this->buttonHeight; } EpgPlus::Footer::~Footer() @@ -591,6 +596,7 @@ void EpgPlus::Footer::paintEventDetails(const std::string & description, const s int frame_thickness = 2; // clear the whole footer + this->frameBuffer->paintBoxRel(this->x + OFFSET_SHADOW, yPos + OFFSET_SHADOW, this->width, this->getUsedHeight(), COL_SHADOW_PLUS_0, RADIUS_LARGE); this->frameBuffer->paintBoxRel(this->x, yPos, this->width, this->getUsedHeight(), COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE); this->frameBuffer->paintBoxFrame(this->x, yPos, this->width, this->getUsedHeight(), frame_thickness, COL_FRAME_PLUS_0, RADIUS_LARGE); @@ -619,8 +625,9 @@ struct button_label buttonLabels[] = void EpgPlus::Footer::paintButtons(button_label * pbuttonLabels, int numberOfButtons) { int buttonWidth = (this->width); - CComponentsFooter _footer; - _footer.paintButtons(this->x, this->buttonY, buttonWidth, buttonHeight, numberOfButtons, pbuttonLabels, buttonWidth/numberOfButtons); + CComponentsFooter foot; + foot.enableShadow(CC_SHADOW_ON, -1, true); + foot.paintButtons(this->x, this->buttonY, buttonWidth, buttonHeight, numberOfButtons, pbuttonLabels, buttonWidth/numberOfButtons); } EpgPlus::EpgPlus() @@ -828,10 +835,10 @@ void EpgPlus::init() int footerHeight = Footer::getUsedHeight(); - this->maxNumberOfDisplayableEntries = (this->usableScreenHeight - headerHeight - timeLineHeight - buttonHeight - OFFSET_INTER - footerHeight) / this->entryHeight; + this->maxNumberOfDisplayableEntries = (this->usableScreenHeight - headerHeight - timeLineHeight - buttonHeight - OFFSET_SHADOW - OFFSET_INTER - footerHeight - OFFSET_SHADOW) / this->entryHeight; this->bodyHeight = this->maxNumberOfDisplayableEntries * entryHeight; - this->usableScreenHeight = headerHeight + timeLineHeight + this->bodyHeight + buttonHeight + OFFSET_INTER + footerHeight; // recalc deltaY + this->usableScreenHeight = headerHeight + timeLineHeight + this->bodyHeight + buttonHeight + OFFSET_SHADOW + OFFSET_INTER + footerHeight + OFFSET_SHADOW; // recalc deltaY this->usableScreenX = getScreenStartX(this->usableScreenWidth); if (this->usableScreenX < DETAILSLINE_WIDTH) this->usableScreenX = DETAILSLINE_WIDTH; @@ -846,7 +853,7 @@ void EpgPlus::init() this->timeLineWidth = this->usableScreenWidth; this->footerX = usableScreenX; - this->footerY = this->usableScreenY + this->usableScreenHeight - footerHeight; + this->footerY = this->usableScreenY + this->usableScreenHeight - OFFSET_SHADOW - footerHeight; this->footerWidth = this->usableScreenWidth; this->channelsTableX = this->usableScreenX; @@ -1386,7 +1393,7 @@ void EpgPlus::hide() delete this->header->head; this->header->head = NULL; } - this->frameBuffer->paintBackgroundBoxRel(this->usableScreenX - DETAILSLINE_WIDTH, this->usableScreenY, DETAILSLINE_WIDTH + this->usableScreenWidth, this->usableScreenHeight); + this->frameBuffer->paintBackgroundBoxRel(this->usableScreenX, this->usableScreenY, this->usableScreenWidth + OFFSET_SHADOW, this->usableScreenHeight + OFFSET_SHADOW); } void EpgPlus::paintChannelEntry(int position) @@ -1436,7 +1443,7 @@ void EpgPlus::paint() this->maxNumberOfDisplayableEntries, this->selectedChannelEntry == NULL ? 0 : this->selectedChannelEntry->index); - paintScrollBar(this->sliderX, this->sliderY, this->sliderWidth, this->sliderHeight, total_pages, current_page); + paintScrollBar(this->sliderX, this->sliderY, this->sliderWidth, this->sliderHeight, total_pages, current_page, CC_SHADOW_ON); } // -- EPG+ Menue Handler Class diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 2bcd1094b..76c7d5cdf 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -110,18 +110,17 @@ CEventList::CEventList() m_search_fsk = 1; full_width = width = 0; height = 0; - x = y = 0; - cc_infozone = NULL; + infozone = NULL; infozone_text = ""; item_event_ID = 0; oldIndex = -1; oldEventID = -1; - bgRightBoxPaint = false; + infozone_background = false; header = NULL; pb = NULL; - Bottombox = NULL; + navibar = NULL; } CEventList::~CEventList() @@ -134,8 +133,8 @@ void CEventList::ResetModules() if (header){ delete header; header = NULL; } - if (Bottombox){ - delete Bottombox; Bottombox = NULL; + if (navibar){ + delete navibar; navibar = NULL; } if (pb){ delete pb; pb = NULL; @@ -318,38 +317,33 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna width = full_width; height = frameBuffer->getScreenHeightRel(); - // Calculate iheight (we assume the red button is the largest one?) - struct button_label tmp_button[1] = { { NEUTRINO_ICON_BUTTON_RED, LOCALE_EVENTLISTBAR_RECORDEVENT } }; - iheight = ::paintButtons(0, 0, 0, 1, tmp_button, 0, 0, "", false, COL_MENUFOOT_TEXT, NULL, 0, false); - - // Calculate theight - theight = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->getHeight(); + // Calculate header_height + header_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + footer_height = header_height; const int pic_h = 39; - theight = std::max(theight, pic_h); + header_height = std::max(header_height, pic_h); - fheight1 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->getHeight(); + largefont_height = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->getHeight(); { int h1 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getHeight(); int h2 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getHeight(); - fheight2 = std::max( h1, h2 ); + smallfont_height = std::max(h1, h2); } unit_short_minute = g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); - fheight = fheight1 + fheight2 + OFFSET_INNER_MIN; - fwidth1 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth("DDD, :, ") + 4 * g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getMaxDigitWidth(); - //fwidth2 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth("[ ] ") + 3 * g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getMaxDigitWidth() + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(unit_short_minute); + item_height = smallfont_height + OFFSET_INNER_MIN + largefont_height; - botboxheight = fheight1+2*OFFSET_INNER_MIN; + navibar_height = largefont_height+2*OFFSET_INNER_MIN; - listmaxshow = (height-theight-iheight-botboxheight-0)/fheight; - height = theight+iheight+botboxheight+0+listmaxshow*fheight; // recalc height + listmaxshow = (height - header_height - footer_height - OFFSET_SHADOW - navibar_height)/item_height; + height = header_height + footer_height + OFFSET_SHADOW + navibar_height + listmaxshow*item_height; // recalc height y = getScreenStartY(height); // calculate width of right info_zone infozone_width = full_width - width; // init right info_zone - if ((g_settings.eventlist_additional) && (cc_infozone == NULL)) - cc_infozone = new CComponentsText(x+width+OFFSET_INNER_MID, y+theight, infozone_width-2*OFFSET_INNER_MID, listmaxshow*fheight); + if ((g_settings.eventlist_additional) && (infozone == NULL)) + infozone = new CComponentsText(x+width+OFFSET_INNER_MID, y + header_height, infozone_width-2*OFFSET_INNER_MID, listmaxshow*item_height); int res = menu_return::RETURN_REPAINT; //printf("CEventList::exec: channel_id %llx\n", channel_id); @@ -381,7 +375,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna bool dont_hide = false; paintHead(channel_id, channelname, channelname_prev, channelname_next); paint(channel_id); - showFunctionBar(channel_id); + paintFoot(channel_id); int oldselected = selected; @@ -428,7 +422,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna else paintItem(selected - liststart, channel_id); - showFunctionBar(channel_id); + paintFoot(channel_id); } //sort else if (!showfollow && (msg == (neutrino_msg_t)g_settings.key_channelList_sort)) @@ -486,7 +480,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna timerlist.clear(); g_Timerd->getTimerList (timerlist); paint(evtlist[selected].channelID); - showFunctionBar(evtlist[selected].channelID); + paintFoot(evtlist[selected].channelID); continue; } std::string recDir = g_settings.network_nfs_recordingdir; @@ -541,7 +535,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna timerlist.clear(); g_Timerd->getTimerList (timerlist); paint(used_id); - showFunctionBar(used_id); + paintFoot(used_id); } } else if ( msg == (neutrino_msg_t) g_settings.key_channelList_addremind )//add/remove zapto timer event @@ -553,7 +547,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna timerlist.clear(); g_Timerd->getTimerList (timerlist); paint(evtlist[selected].channelID); - showFunctionBar(evtlist[selected].channelID); + paintFoot(evtlist[selected].channelID); continue; } @@ -565,7 +559,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna timerlist.clear(); g_Timerd->getTimerList (timerlist); paint(evtlist[selected].channelID ); - showFunctionBar(evtlist[selected].channelID ); + paintFoot(evtlist[selected].channelID ); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } else if (msg == (neutrino_msg_t)g_settings.key_channelList_cancel) @@ -576,7 +570,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna paintHead(channel_id, channelname); readEvents(epg_id); paint(channel_id); - showFunctionBar(channel_id); + paintFoot(channel_id); } else { selected = oldselected; if(fader.StartFadeOut()) { @@ -595,7 +589,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna t_channel_id _channel_id = channel_id; getChannelNames(_channel_id, current_channel_name, prev_channel_name, next_channel_name, msg); if(_channel_id){ - bgRightBoxPaint = false; + infozone_background = false; loop = false; dont_hide = true; exec(_channel_id, current_channel_name, prev_channel_name, next_channel_name); @@ -613,9 +607,9 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna paintHead(channel_id, channelname); oldIndex = -1; oldEventID = -1; - bgRightBoxPaint = false; + infozone_background = false; paint(channel_id); - showFunctionBar(channel_id); + paintFoot(channel_id); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } else if (msg == CRCInput::RC_epg) @@ -656,9 +650,9 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna paintHead(channel_id, in_search ? search_head_name : channelname); oldIndex = -1; oldEventID = -1; - bgRightBoxPaint = false; + infozone_background = false; paint(channel_id); - showFunctionBar(channel_id); + paintFoot(channel_id); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } } @@ -667,7 +661,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna { oldIndex = -1; oldEventID = -1; - bgRightBoxPaint = false; + infozone_background = false; in_search = findEvents(channel_id, channelname); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } @@ -691,12 +685,12 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna } } - if (cc_infozone) - delete cc_infozone; - cc_infozone = NULL; + if (infozone) + delete infozone; + infozone = NULL; oldIndex = -1; oldEventID = -1; - bgRightBoxPaint = false; + infozone_background = false; if(!dont_hide){ hide(); @@ -708,7 +702,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna void CEventList::hide() { ResetModules(); - frameBuffer->paintBackgroundBoxRel(x,y, full_width,height); + frameBuffer->paintBackgroundBoxRel(x, y, full_width + OFFSET_SHADOW, height + OFFSET_SHADOW); } CTimerd::CTimerEventTypes CEventList::isScheduled(t_channel_id channel_id, CChannelEvent * event, int * tID) @@ -737,7 +731,7 @@ CTimerd::CTimerEventTypes CEventList::isScheduled(t_channel_id channel_id, CChan void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) { - int ypos = y+ theight + pos*fheight; + int ypos = y + header_height + pos*item_height; unsigned int currpos = liststart + pos; bool i_selected = currpos == selected; @@ -753,27 +747,27 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) i_radius = RADIUS_LARGE; if (i_radius) - frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, fheight, COL_MENUCONTENT_PLUS_0); - frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, fheight, bgcolor, i_radius); + frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, item_height, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, item_height, bgcolor, i_radius); if(currposgetText(CLocaleManager::getWeekday(tmStartZeit)); - datetime1_str += strftime(", %H:%M", tmStartZeit); - datetime1_str += strftime(", %d", tmStartZeit); - datetime1_str += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit)); + datetime_str = g_Locale->getText(CLocaleManager::getWeekday(tmStartZeit)); + datetime_str += strftime(", %H:%M", tmStartZeit); + datetime_str += strftime(", %d", tmStartZeit); + datetime_str += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit)); if ( m_showChannel ) // show the channel if we made a event search only (which could be made through all channels ). { t_channel_id channel = evtlist[currpos].channelID; - datetime1_str += " "; - datetime1_str += CServiceManager::getInstance()->GetServiceName(channel); + datetime_str += " "; + datetime_str += CServiceManager::getInstance()->GetServiceName(channel); } snprintf(tmpstr,sizeof(tmpstr), "[%d %s]", evtlist[currpos].duration / 60, unit_short_minute); @@ -781,10 +775,10 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) } // 1st line - int fwidth1a=g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth(datetime1_str); - fwidth2 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(duration_str); + int datetime_width = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth(datetime_str); + int duration_width = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(duration_str); - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x + OFFSET_INNER_SMALL, ypos + OFFSET_INNER_MIN + fheight2, fwidth1a, datetime1_str, color); + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x + OFFSET_INNER_SMALL, ypos + OFFSET_INNER_MIN + smallfont_height, datetime_width, datetime_str, color); int seit = ( evtlist[currpos].startTime - time(NULL) ) / 60; if ( (seit> 0) && (seit<100) && (!duration_str.empty()) ) @@ -792,9 +786,9 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) char beginnt[100]; snprintf(beginnt, sizeof(beginnt), "%s %d %s", g_Locale->getText(LOCALE_WORD_IN), seit, unit_short_minute); int w = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(beginnt); - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x + width - SCROLLBAR_WIDTH - 2*OFFSET_INNER_MID - fwidth2 - w, ypos + OFFSET_INNER_MIN + fheight2, w, beginnt, color); + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x + width - SCROLLBAR_WIDTH - 2*OFFSET_INNER_MID - duration_width - w, ypos + OFFSET_INNER_MIN + smallfont_height, w, beginnt, color); } - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - fwidth2, ypos + OFFSET_INNER_MIN + fheight2, fwidth2, duration_str, color); + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - duration_width, ypos + OFFSET_INNER_MIN + smallfont_height, duration_width, duration_str, color); // 2nd line // set status icons @@ -811,7 +805,7 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) int iw = 0, ih = 0; if(icontype != 0) { frameBuffer->getIconSize(icontype, &iw, &ih); - frameBuffer->paintIcon(icontype, x + OFFSET_INNER_MID, ypos + OFFSET_INNER_MIN + fheight2, fheight1); + frameBuffer->paintIcon(icontype, x + OFFSET_INNER_MID, ypos + OFFSET_INNER_MIN + smallfont_height, largefont_height); iw += OFFSET_INNER_MID; } @@ -824,15 +818,14 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) { //paint_warning = true; frameBuffer->getIconSize(NEUTRINO_ICON_IMPORTANT, &i2w, &i2h); - frameBuffer->paintIcon(NEUTRINO_ICON_IMPORTANT, x + iw + OFFSET_INNER_MID, ypos + OFFSET_INNER_MIN + fheight2, fheight1); + frameBuffer->paintIcon(NEUTRINO_ICON_IMPORTANT, x + iw + OFFSET_INNER_MID, ypos + OFFSET_INNER_MIN + smallfont_height, largefont_height); iw += i2w + OFFSET_INNER_MID; } // paint 2nd line text - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->RenderString(x + iw + OFFSET_INNER_MID, ypos + fheight, width - iw - 2*OFFSET_INNER_MID, evtlist[currpos].description, color); + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->RenderString(x + iw + OFFSET_INNER_MID, ypos + item_height, width - iw - 2*OFFSET_INNER_MID, evtlist[currpos].description, color); - if (i_radius) - showProgressBar(currpos); + showProgressBar(currpos); } } @@ -858,6 +851,13 @@ void CEventList::paintDescription(int index) else CEitManager::getInstance()->getActualEPGServiceKey(evtlist[index].channelID, &epgData ); + infozone_text = ""; + if (!epgData.info1.empty() && !epgData.info2.empty() && (epgData.info2.find(epgData.info1) != 0)) { + infozone_text += epgData.info1; + infozone_text += "\n"; + infozone_text += epgData.info2; + } + else if(!epgData.info2.empty()){ infozone_text = epgData.info2; } @@ -867,11 +867,12 @@ void CEventList::paintDescription(int index) else infozone_text = g_Locale->getText(LOCALE_EPGLIST_NOEVENTS); - cc_infozone->setText(infozone_text, CTextBox::TOP, g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_EVENT]); - cc_infozone->doPaintBg(false); - cc_infozone->doPaintTextBoxBg(true); - cc_infozone->forceTextPaint(); - cc_infozone->paint(CC_SAVE_SCREEN_NO); + infozone->setText(infozone_text, CTextBox::TOP, g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_EVENT]); + infozone->doPaintBg(false); + infozone->doPaintTextBoxBg(true); + //FIXME infozone->enableShadow(CC_SHADOW_RIGHT, -1, true); + infozone->forceTextPaint(); + infozone->paint(CC_SAVE_SCREEN_NO); } void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, std::string _channelname_prev, std::string _channelname_next) @@ -881,13 +882,15 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s header->getTextObject()->enableTboxSaveScreen(g_settings.theme.menu_Head_gradient);//enable screen save for title text if color gradient is in use header->enableClock(true, "%H:%M", "%H %M", true); header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); - header->setDimensionsAll(x, y, full_width, theight); + header->setDimensionsAll(x, y, full_width, header_height); + header->enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); } //header->getClockObject()->setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT); if (header->isPainted()) header->getChannelLogoObject()->hide(); - header->setChannelLogo(_channel_id,_channelname); + if (g_settings.channellist_show_channellogo) + header->setChannelLogo(_channel_id,_channelname); header->setCaption(_channelname, CCHeaderTypes::CC_TITLE_LEFT); header->paint(CC_SAVE_SCREEN_NO); @@ -896,22 +899,27 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s getChannelNames(_channel_id, _channelname, _channelname_prev, _channelname_next, 0); } - paintBottomBox(_channelname_prev, _channelname_next); + paintNaviBar(_channelname_prev, _channelname_next); } -void CEventList::paintBottomBox(std::string _channelname_prev, std::string _channelname_next) +void CEventList::paintNaviBar(std::string _channelname_prev, std::string _channelname_next) { - int by = y + height - iheight - botboxheight; + int navibar_y = y + height - OFFSET_SHADOW - footer_height - navibar_height; - if (!Bottombox){ - Bottombox = new CNaviBar(x, by, full_width, botboxheight); - Bottombox->setFont(g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]); + if (!navibar) + { + navibar = new CNaviBar(x, navibar_y, full_width, navibar_height); + navibar->setFont(g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]); + //FIXME navibar->enableShadow(CC_SHADOW_RIGHT, -1, true); } - Bottombox->enableArrows(!_channelname_prev.empty(), !_channelname_next.empty()); - Bottombox->setText(_channelname_prev, _channelname_next); + navibar->enableArrows(!_channelname_prev.empty(), !_channelname_next.empty()); + navibar->setText(_channelname_prev, _channelname_next); - Bottombox->paint(false); + navibar->paint(false); + + // shadow + frameBuffer->paintBoxRel(x + full_width, navibar_y + OFFSET_SHADOW, OFFSET_SHADOW, navibar_height, COL_SHADOW_PLUS_0); } void CEventList::showProgressBar(int pos) @@ -926,10 +934,10 @@ void CEventList::showProgressBar(int pos) if (!pb) { - int pbw = 104; - int pbx = x + (full_width - pbw)/2; - int pbh = botboxheight - 12; - int pby = y + height -iheight - botboxheight + (botboxheight - pbh)/2; + int pbw = full_width/10; + int pbx = x + (full_width - pbw)/2; + int pbh = navibar_height - 2*OFFSET_INNER_SMALL; + int pby = y + height - OFFSET_SHADOW - footer_height - navibar_height + (navibar_height - pbh)/2; pb = new CProgressBar(pbx, pby, pbw, pbh); pb->setType(CProgressBar::PB_TIMESCALE); @@ -954,12 +962,13 @@ void CEventList::paint(t_channel_id channel_id) liststart = (selected/listmaxshow)*listmaxshow; // paint background for right box - if (g_settings.eventlist_additional && !bgRightBoxPaint) { - frameBuffer->paintBoxRel(x+width,y+theight,infozone_width,listmaxshow*fheight,COL_MENUCONTENT_PLUS_0); - bgRightBoxPaint = true; + if (g_settings.eventlist_additional && !infozone_background) + { + frameBuffer->paintBoxRel(x + width,y + header_height, infozone_width, item_height*listmaxshow, COL_MENUCONTENT_PLUS_0); + infozone_background = true; } - for(unsigned int count=0;countpaintBoxRel(x + full_width, y + header_height + OFFSET_SHADOW, OFFSET_SHADOW, item_height*listmaxshow, COL_SHADOW_PLUS_0); } -void CEventList::showFunctionBar(t_channel_id channel_id) +void CEventList::paintFoot(t_channel_id channel_id) { - int bx = x; - int bw = full_width; - int bh = iheight; - int by = y + height - bh; - CColorKeyHelper keyhelper; //user_menue.h neutrino_msg_t dummy = CRCInput::RC_nokey; const char * icon = NULL; - struct button_label buttons[5]; + struct button_label buttons[5]; //TODO dbt: add directly into footer object with setButtonLabels() int btn_cnt = 0; int tID = -1; //any value, not NULL @@ -1040,26 +1047,38 @@ void CEventList::showFunctionBar(t_channel_id channel_id) buttons[btn_cnt].locale = LOCALE_EPGMENU_EVENTINFO; btn_cnt++; } - ::paintButtons(bx, by, bw, btn_cnt, buttons, bw, bh); + +#if 0 + buttons[btn_cnt].button = NEUTRINO_ICON_BUTTON_INFO_SMALL; + buttons[btn_cnt].locale = LOCALE_EPGPLUS_HEAD; + btn_cnt++; + + buttons[btn_cnt].button = NEUTRINO_ICON_BUTTON_0; + buttons[btn_cnt].locale = LOCALE_TIMERLIST_NAME; + btn_cnt++; +#endif + + CComponentsFooter footer; + footer.enableShadow(CC_SHADOW_ON, -1, true); + footer.paintButtons(x, y + height - OFFSET_SHADOW - footer_height, full_width, footer_height, btn_cnt, buttons); } int CEventListHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/) { - int res = menu_return::RETURN_EXIT_ALL; - if (parent) { + int res = menu_return::RETURN_EXIT_ALL; + + if (parent) parent->hide(); - } + CEventList *e = new CEventList; CChannelList *channelList = CNeutrinoApp::getInstance()->channelList; - e->exec(CZapit::getInstance()->GetCurrentChannelID(), channelList->getActiveChannelName()); // UTF-8 + e->exec(CZapit::getInstance()->GetCurrentChannelID(), channelList->getActiveChannelName()); delete e; return res; } -/************************************************************************************************/ bool CEventList::findEvents(t_channel_id channel_id, std::string channelname) -/************************************************************************************************/ { bool res = false; int event = 0; @@ -1070,19 +1089,19 @@ bool CEventList::findEvents(t_channel_id channel_id, std::string channelname) m_search_autokeyword = m_search_keyword; } - CEventFinderMenu menu( &event, - &m_search_epg_item, - &m_search_keyword, - &m_search_list, - &m_search_channel_id, - &m_search_bouquet_id, - &m_search_genre, - &m_search_fsk - ); + CEventFinderMenu menu(&event, + &m_search_epg_item, + &m_search_keyword, + &m_search_list, + &m_search_channel_id, + &m_search_bouquet_id, + &m_search_genre, + &m_search_fsk); + hide(); menu.exec(NULL,""); search_head_name = g_Locale->getText(LOCALE_EVENTFINDER_SEARCH); - if(event == 1) + if (event == 1) { res = true; m_showChannel = true; // force the event list to paint the channel name @@ -1183,16 +1202,15 @@ bool CEventList::findEvents(t_channel_id channel_id, std::string channelname) } } - if(event) + if (event) paintHead(0, search_head_name); else paintHead(channel_id, channelname); paint(); - showFunctionBar(channel_id); + paintFoot(channel_id); return(res); } -/************************************************************************************************/ /* class CSearchNotifier : public CChangeObserver { @@ -1208,7 +1226,7 @@ class CSearchNotifier : public CChangeObserver } }; */ -/************************************************************************************************ +/* bool CEventFinderMenuHandler::changeNotify(const neutrino_locale_t OptionName, void *Data) { if(OptionName == ) @@ -1266,36 +1284,29 @@ const CMenuOptionChooser::keyval SEARCH_EPG_OPTIONS[SEARCH_EPG_OPTION_COUNT] = { CEventList::SEARCH_EPG_ALL, LOCALE_EVENTFINDER_SEARCH_ALL_EPG } }; - - -/************************************************************************************************/ -CEventFinderMenu::CEventFinderMenu( int* event, - int* search_epg_item, - std::string* search_keyword, - int* search_list, - t_channel_id* search_channel_id, - t_bouquet_id* search_bouquet_id, - int* search_genre, - int* search_fsk - ) -/************************************************************************************************/ +CEventFinderMenu::CEventFinderMenu(int* event, + int* search_epg_item, + std::string* search_keyword, + int* search_list, + t_channel_id* search_channel_id, + t_bouquet_id* search_bouquet_id, + int* search_genre, + int* search_fsk) { - m_event = event; - m_search_epg_item = search_epg_item; + m_event = event; + m_search_epg_item = search_epg_item; m_search_keyword = search_keyword; - m_search_list = search_list; - m_search_channel_id = search_channel_id; - m_search_bouquet_id = search_bouquet_id; - m_search_genre = search_genre; - m_search_fsk = search_fsk; + m_search_list = search_list; + m_search_channel_id = search_channel_id; + m_search_bouquet_id = search_bouquet_id; + m_search_genre = search_genre; + m_search_fsk = search_fsk; + width = 40; selected = -1; } - -/************************************************************************************************/ int CEventFinderMenu::exec(CMenuTarget* parent, const std::string &actionkey) -/************************************************************************************************/ { int res = menu_return::RETURN_REPAINT; @@ -1383,9 +1394,7 @@ int CEventFinderMenu::exec(CMenuTarget* parent, const std::string &actionkey) return res; } -/************************************************************************************************/ int CEventFinderMenu::showMenu(void) -/************************************************************************************************/ { int res = menu_return::RETURN_REPAINT; m_search_channelname_mf = NULL; @@ -1449,12 +1458,8 @@ int CEventFinderMenu::showMenu(void) return(res); } - -/************************************************************************************************/ bool CEventFinderMenu::changeNotify(const neutrino_locale_t OptionName, void *) -/************************************************************************************************/ { - if (ARE_LOCALES_EQUAL(OptionName, LOCALE_EVENTFINDER_SEARCH_WITHIN_LIST)) { if (*m_search_list == CEventList::SEARCH_LIST_CHANNEL) diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index 55401bff9..e6df12580 100644 --- a/src/gui/eventlist.h +++ b/src/gui/eventlist.h @@ -23,7 +23,6 @@ Boston, MA 02110-1301, USA. */ - #ifndef __EVENTLIST_HPP__ #define __EVENTLIST_HPP__ @@ -43,7 +42,6 @@ class CFramebuffer; class CEventList : public CListHelpers { - // Eventfinder start public: typedef enum { @@ -53,14 +51,16 @@ class CEventList : public CListHelpers SEARCH_EPG_INFO2, SEARCH_EPG_GENRE, SEARCH_EPG_ALL - }SEARCH_EPG; + } SEARCH_EPG; + typedef enum { SEARCH_LIST_NONE, SEARCH_LIST_CHANNEL, SEARCH_LIST_BOUQUET, SEARCH_LIST_ALL - }SEARCH_LIST; + } SEARCH_LIST; + private: int m_search_epg_item; std::string m_search_keyword; @@ -73,10 +73,8 @@ class CEventList : public CListHelpers bool m_showChannel; int oldIndex; event_id_t oldEventID; - bool bgRightBoxPaint; bool findEvents(t_channel_id channel_id, std::string channelname); - // Eventfinder end CFrameBuffer *frameBuffer; CChannelEventList evtlist; @@ -86,36 +84,36 @@ class CEventList : public CListHelpers unsigned int current_event; unsigned int liststart; unsigned int listmaxshow; - int fheight; // Fonthoehe Channellist-Inhalt - int fheight1,fheight2; - int fwidth1,fwidth2; - int theight; // Fonthoehe Channellist-Titel - int iheight; // Height info bar + int item_height; + int largefont_height, smallfont_height; + int header_height; + int footer_height; std::string search_head_name; int full_width, width, infozone_width; - int botboxheight; + int navibar_height; int height; int x; int y; std::string infozone_text; + bool infozone_background; int sort_mode; event_id_t item_event_ID; - CComponentsText *cc_infozone; + CComponentsText *infozone; CComponentsHeader *header; CProgressBar *pb; - CNaviBar *Bottombox; + CNaviBar *navibar; const char * unit_short_minute; void paintItem(unsigned pos, t_channel_id channel_id = 0); void paintDescription(int index); void paint(t_channel_id channel_id = 0); void paintHead(t_channel_id _channel_id, std::string _channelname, std::string _channelname_prev = "", std::string _channelname_next = ""); - void paintBottomBox(std::string _channelname_prev, std::string _channelname_next); + void paintNaviBar(std::string _channelname_prev, std::string _channelname_next); void showProgressBar(int pos); void hide(); - void showFunctionBar(t_channel_id channel_id); + void paintFoot(t_channel_id channel_id); void getChannelNames(t_channel_id &channel_id, std::string ¤t_channel_name, std::string &prev_channel_name, std::string &next_channel_name, neutrino_msg_t msg); int timerPre; @@ -136,7 +134,6 @@ class CEventListHandler : public CMenuTarget { public: int exec( CMenuTarget* parent, const std::string &actionkey); - }; class CEventFinderMenu : public CMenuTarget, CChangeObserver @@ -156,16 +153,16 @@ class CEventFinderMenu : public CMenuTarget, CChangeObserver int selected; int showMenu(void); public: - CEventFinderMenu( int* event, - int* search_epg_item, - std::string* search_keyword, - int* search_list, - t_channel_id* search_channel_id, - t_bouquet_id* search_bouquet_id, - int* search_genre, - int* search_fsk - ); - int exec( CMenuTarget* parent, const std::string &actionkey); + CEventFinderMenu(int* event, + int* search_epg_item, + std::string* search_keyword, + int* search_list, + t_channel_id* search_channel_id, + t_bouquet_id* search_bouquet_id, + int* search_genre, + int* search_fsk); + + int exec( CMenuTarget* parent, const std::string &actionkey); bool changeNotify(const neutrino_locale_t OptionName, void *); }; diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 8bd4b752e..676247dcd 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -278,10 +278,10 @@ void CFileBrowser::fontInit() smskey_width = fnt_foot->getRenderWidth("M") + OFFSET_INNER_MID; liststart = 0; - listmaxshow = std::max(1,(int)(height - header_height - footer_height)/item_height); + listmaxshow = std::max(1,(int)(height - header_height - footer_height - OFFSET_SHADOW)/item_height); //recalc height - height = header_height + listmaxshow * item_height + footer_height; + height = header_height + listmaxshow*item_height + footer_height + OFFSET_SHADOW; y = getScreenStartY(height); } @@ -1173,7 +1173,7 @@ void CFileBrowser::addRecursiveDir(CFileList * re_filelist, std::string rpath, b void CFileBrowser::hide() { - frameBuffer->paintBackgroundBoxRel(x,y, width,height); + frameBuffer->paintBackgroundBoxRel(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW); } void CFileBrowser::paintItem(unsigned int pos) @@ -1357,6 +1357,7 @@ void CFileBrowser::paintHead() i++; CComponentsHeader header(x, y, width, header_height, &l_name[i]); + header.enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); header.paint(CC_SAVE_SCREEN_NO); free(l_name); @@ -1436,12 +1437,16 @@ int CFileBrowser::paintFoot(bool show) return paintButtons(buttons_filelistmode, cnt, 0, 0, 0, 0, 0, false, NULL, NULL); } + int footer_y = y + height - OFFSET_SHADOW - footer_height; int footer_width = width - smskey_width; + // shadow + frameBuffer->paintBoxRel(x + OFFSET_SHADOW, footer_y + OFFSET_SHADOW, width, footer_height, COL_SHADOW_PLUS_0, RADIUS_MID, CORNER_BOTTOM); + if (filelist.empty()) { // show an empty footer - frameBuffer->paintBoxRel(x, y + height - footer_height, width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + frameBuffer->paintBoxRel(x, footer_y, width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); return footer_height; } @@ -1450,9 +1455,9 @@ int CFileBrowser::paintFoot(bool show) CComponentsFooter can't handle button_label_ext */ if (playlistmode) - res = paintButtons(buttons_playlistmode, cnt, x, y + height - footer_height, width, footer_height, footer_width); + res = paintButtons(buttons_playlistmode, cnt, x, footer_y, width, footer_height, footer_width); else - res = paintButtons(buttons_filelistmode, cnt, x, y + height - footer_height, width, footer_height, footer_width); + res = paintButtons(buttons_filelistmode, cnt, x, footer_y, width, footer_height, footer_width); paintSMSKey(); return res; @@ -1461,16 +1466,17 @@ int CFileBrowser::paintFoot(bool show) void CFileBrowser::paintSMSKey() { int smskey_height = fnt_foot->getHeight(); + int smskey_y = y + height - OFFSET_SHADOW - footer_height; //background - frameBuffer->paintBoxRel(x + width - smskey_width, y + height - footer_height, smskey_width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM_RIGHT); + frameBuffer->paintBoxRel(x + width - smskey_width, smskey_y, smskey_width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM_RIGHT); if(m_SMSKeyInput.getOldKey()!=0) { char cKey[2] = {m_SMSKeyInput.getOldKey(), 0}; cKey[0] = toupper(cKey[0]); int len = fnt_foot->getRenderWidth(cKey); - fnt_foot->RenderString(x + width - smskey_width, y + height - footer_height + footer_height/2 + smskey_height/2, len, cKey, COL_MENUHEAD_TEXT); + fnt_foot->RenderString(x + width - smskey_width, smskey_y + footer_height/2 + smskey_height/2, len, cKey, COL_MENUHEAD_TEXT); } } @@ -1487,8 +1493,7 @@ void CFileBrowser::paint() int total_pages; int current_page; getScrollBarData(&total_pages, ¤t_page, filelist.size(), listmaxshow, selected); - - paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); + paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page, CC_SHADOW_ON); } void CFileBrowser::SMSInput(const neutrino_msg_t msg) diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index a1180de3d..0789d781a 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -171,8 +171,8 @@ int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & actionKey) buttons2_height = ::paintButtons(0, 0, 0, PictureViewerButtons2Count, PictureViewerButtons2, 0, 0, "", false, COL_MENUFOOT_TEXT, NULL, 0, false); footer_height = buttons1_height + buttons2_height; - listmaxshow = (height - header_height - footer_height)/item_height; - height = header_height + listmaxshow*item_height + footer_height; // recalc height + listmaxshow = (height - header_height - footer_height - OFFSET_SHADOW)/item_height; + height = header_height + listmaxshow*item_height + footer_height + OFFSET_SHADOW; // recalc height x=getScreenStartX(width); y=getScreenStartY(height); @@ -703,6 +703,7 @@ void CPictureViewerGui::paintItem(int pos) void CPictureViewerGui::paintHead() { CComponentsHeaderLocalized header(x, y, width, header_height, LOCALE_PICTUREVIEWER_HEAD, NEUTRINO_ICON_PICTUREVIEWER, CComponentsHeaderLocalized::CC_BTN_HELP); + header.enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); #ifdef ENABLE_GUI_MOUNT header.setContextButton(NEUTRINO_ICON_BUTTON_MENU); @@ -720,15 +721,20 @@ void CPictureViewerGui::paintFoot() else PictureViewerButtons2[0].locale = LOCALE_PICTUREVIEWER_SORTORDER_DATE; - frameBuffer->paintBoxRel(x, y + (height - footer_height), width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + int footer_y = y + (height - footer_height - OFFSET_SHADOW); + + // shadow + frameBuffer->paintBoxRel(x + OFFSET_SHADOW, footer_y + OFFSET_SHADOW, width, footer_height, COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + + frameBuffer->paintBoxRel(x, footer_y, width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); if (!playlist.empty()) { - ::paintButtons(x, y + (height - footer_height), 0, PictureViewerButtons1Count, PictureViewerButtons1, width); - ::paintButtons(x, y + (height - buttons2_height), 0, PictureViewerButtons2Count, PictureViewerButtons2, width); + ::paintButtons(x, footer_y, width, PictureViewerButtons1Count, PictureViewerButtons1, width, buttons1_height); + ::paintButtons(x, footer_y + buttons1_height, width, PictureViewerButtons2Count, PictureViewerButtons2, width, buttons2_height); } else - ::paintButtons(x, y + (height - footer_height), 0, 1, &(PictureViewerButtons1[1]), width); + ::paintButtons(x, footer_y, width, 1, &(PictureViewerButtons1[1]), width, buttons1_height); } //------------------------------------------------------------------------ @@ -753,8 +759,7 @@ void CPictureViewerGui::paint() int total_pages; int current_page; getScrollBarData(&total_pages, ¤t_page, playlist.size(), listmaxshow, selected); - - paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); + paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page, CC_SHADOW_ON); paintFoot(); paintInfo(); diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index a02596374..b8c3d5878 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -942,7 +942,7 @@ void CUpnpBrowserGui::paintDeviceInfo() topbox.setDimensionsAll(m_x, m_y, m_width, m_topbox_height); topbox.setCorner(RADIUS_LARGE); - topbox.setText(tmp, CTextBox::AUTO_WIDTH); + topbox.setText(tmp, CTextBox::AUTO_WIDTH | CTextBox::CENTER); topbox.paint0(); } @@ -1003,10 +1003,7 @@ void CUpnpBrowserGui::paintDevices() int total_pages; int current_page; getScrollBarData(&total_pages, ¤t_page, m_devices.size(), m_listmaxshow, m_selecteddevice); - paintScrollBar(m_x + m_width - SCROLLBAR_WIDTH, m_item_y, SCROLLBAR_WIDTH, m_item_height*m_listmaxshow, total_pages, current_page); - - //shadow - m_frameBuffer->paintBoxRel(m_x + m_width, m_item_y + OFFSET_SHADOW, OFFSET_SHADOW, m_item_height*m_listmaxshow, COL_SHADOW_PLUS_0); + paintScrollBar(m_x + m_width - SCROLLBAR_WIDTH, m_item_y, SCROLLBAR_WIDTH, m_item_height*m_listmaxshow, total_pages, current_page, CC_SHADOW_ON); // Foot footer.setCorner(RADIUS_LARGE, CORNER_BOTTOM); @@ -1147,7 +1144,7 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) } topbox.setCorner(RADIUS_LARGE); - topbox.setText(tmp, CTextBox::AUTO_WIDTH); + topbox.setText(tmp, CTextBox::AUTO_WIDTH | CTextBox::CENTER); topbox.paint0(); } @@ -1178,7 +1175,7 @@ void CUpnpBrowserGui::paintItems(std::vector *entry, unsigned int sel int total_pages; int current_page; getScrollBarData(&total_pages, ¤t_page, max + offset, m_listmaxshow, selected + offset); - paintScrollBar(m_x + m_width - SCROLLBAR_WIDTH, m_item_y, SCROLLBAR_WIDTH, m_item_height*m_listmaxshow, total_pages, current_page); + paintScrollBar(m_x + m_width - SCROLLBAR_WIDTH, m_item_y, SCROLLBAR_WIDTH, m_item_height*m_listmaxshow, total_pages, current_page, CC_SHADOW_ON); // Foot buttons size_t numbuttons = sizeof(BrowseButtons)/sizeof(BrowseButtons[0]); diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index 68952e8d1..4af749c66 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -81,7 +81,7 @@ void CProgressWindow::Init( signal *statusSignal, if (globalSignal) *globalSignal->connect(mem_fun(*this, &CProgressWindow::showGlobalStatus)); - global_progress = local_progress = percent_progress = 0; + global_progress = local_progress = 0; showFooter(false); @@ -132,16 +132,13 @@ CProgressBar* CProgressWindow::getProgressItem() void CProgressWindow::initStatus(const unsigned int prog, const unsigned int max, const string &statusText, CProgressBar *pBar) { pBar->allowPaint(true); - unsigned int cur_perc = prog*100/(max+1); - if (percent_progress != cur_perc || prog == 0){ - pBar->setValues(prog, (int)max); - if (!statusText.empty() && (cur_statusText != statusText)){ - showStatusMessageUTF(statusText); - cur_statusText = statusText; - } - pBar->paint(false); - percent_progress = cur_perc; + pBar->setValues(prog, (int)max); + if (!statusText.empty() && (cur_statusText != statusText)){ + showStatusMessageUTF(statusText); + cur_statusText = statusText; } + pBar->paint(false); + frameBuffer->blit(); } void CProgressWindow::showStatus(const unsigned int prog, const unsigned int max, const string &statusText) diff --git a/src/gui/widget/progresswindow.h b/src/gui/widget/progresswindow.h index 1be4255a9..da88911f3 100644 --- a/src/gui/widget/progresswindow.h +++ b/src/gui/widget/progresswindow.h @@ -39,7 +39,6 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget unsigned int global_progress; unsigned int local_progress; - unsigned int percent_progress; std::string cur_statusText; int h_height; void Init( sigc::signal *statusSignal,