diff --git a/data/locale/nederlands.locale b/data/locale/nederlands.locale index 6450a1866..dcd277284 100644 --- a/data/locale/nederlands.locale +++ b/data/locale/nederlands.locale @@ -2201,9 +2201,9 @@ timing.infobar_movieplayer Infobalk (film modus) timing.infobar_radio Infobalk (radio modus) timing.menu Menu timing.numericzap Numeriek Zap -timing.volumebar Volume balk timing.popup_messages Popup messages timing.static_messages Interactive messages +timing.volumebar Volume balk tmdb.read_data Zoeken TMDB data... unicable.lnb Invoer Unicable unicable.qrg Unicable Frequentie diff --git a/data/locale/slovak.locale b/data/locale/slovak.locale index 194fb3a84..1eb61286d 100644 --- a/data/locale/slovak.locale +++ b/data/locale/slovak.locale @@ -2402,9 +2402,9 @@ timing.infobar_movieplayer Stavový riadok (filmový mód) timing.infobar_radio Stavový riadok (rádio mód) timing.menu Ponuka timing.numericzap Prepínanie číslami -timing.volumebar Ukazateľ hlasitosti timing.popup_messages Popup messages timing.static_messages Interactive messages +timing.volumebar Ukazateľ hlasitosti tmdb.api_key TMDb API kľúč tmdb.enabled TMDb podpora tmdb.read_data Vyhľadávanie údajov TMDB... diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 3efb2da8b..a1ae03b04 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -636,9 +636,9 @@ void CComponentsForm::ScrollPage(int direction, bool do_paint) int target_page_id = (int)page_count - 1; int target_page = (int)cur_page; - if (direction == SCROLL_P_DOWN) + if (direction == SCROLL_P_UP) target_page = target_page+1 > target_page_id ? 0 : target_page+1; - else if (direction == SCROLL_P_UP) + else if (direction == SCROLL_P_DOWN) target_page = target_page-1 < 0 ? target_page_id : target_page-1; if (do_paint) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 21e58ed7f..585d27700 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -286,9 +286,9 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna fheight2 = std::max( h1, h2 ); } unit_short_minute = g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); - fheight = fheight1 + fheight2 + 2; + 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); + //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); listmaxshow = (height-theight-iheight-0)/fheight; height = theight+iheight+0+listmaxshow*fheight; // recalc height @@ -710,7 +710,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+0 + pos*fheight; + int ypos = y+ theight + pos*fheight; unsigned int currpos = liststart + pos; bool i_selected = currpos == selected; @@ -755,18 +755,19 @@ 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); - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x+5, ypos+ fheight1+3, fwidth1a, datetime1_str, color); + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x + OFFSET_INNER_SMALL, ypos + OFFSET_INNER_MIN + fheight2, fwidth1a, datetime1_str, color); int seit = ( evtlist[currpos].startTime - time(NULL) ) / 60; if ( (seit> 0) && (seit<100) && (!duration_str.empty()) ) { 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) + 10; - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x+width-fwidth2-5- 20- w, ypos+ fheight1+3, w, beginnt, color); + int w = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(beginnt); + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x + width - 15 - 2*OFFSET_INNER_MID - fwidth2 - w, ypos + OFFSET_INNER_MIN + fheight2, w, beginnt, color); } - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x+width-fwidth2-5- 20, ypos+ fheight1+3, fwidth2, duration_str, color); + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x + width - 15 - OFFSET_INNER_MID - fwidth2, ypos + OFFSET_INNER_MIN + fheight2, fwidth2, duration_str, color); // 2nd line // set status icons @@ -780,28 +781,28 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) if (timerID > 0 && CRecordManager::getInstance()->CheckRecordingId_if_Timeshift(timerID)) icontype = NEUTRINO_ICON_AUTO_SHIFT; } - int iw = 0, ih; + int iw = 0, ih = 0; if(icontype != 0) { frameBuffer->getIconSize(icontype, &iw, &ih); - frameBuffer->paintIcon(icontype, x+5, ypos + fheight1+3 - (fheight1 - ih)/2, fheight1); + frameBuffer->paintIcon(icontype, x + OFFSET_INNER_MID, ypos + OFFSET_INNER_MIN + fheight2, fheight1); + iw += OFFSET_INNER_MID; } // detecting timer conflict and set start position of event text depending of possible painted icon bool conflict = HasTimerConflicts(evtlist[currpos].startTime, evtlist[currpos].duration, &item_event_ID); - int i2w = 0, i2h; //printf ("etype %d , conflicts %d -> %s, conflict event_ID %d -> current event_ID %d\n", etype, conflict, evtlist[currpos].description.c_str(), item_event_ID, evtlist[currpos].eventID); - //TODO: solution for zapto timer events + int i2w = 0, i2h = 0; if (conflict && item_event_ID != evtlist[currpos].eventID) { //paint_warning = true; frameBuffer->getIconSize(NEUTRINO_ICON_IMPORTANT, &i2w, &i2h); - frameBuffer->paintIcon(NEUTRINO_ICON_IMPORTANT, x+iw+7, ypos + fheight1+3 - (fheight1 - i2h)/2, fheight1); - iw += i2w+4; + frameBuffer->paintIcon(NEUTRINO_ICON_IMPORTANT, x + iw + OFFSET_INNER_MID, ypos + OFFSET_INNER_MIN + fheight2, fheight1); + iw += i2w + OFFSET_INNER_MID; } // paint 2nd line text - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->RenderString(x+10+iw, ypos+ fheight, width- 25- 20 -iw, evtlist[currpos].description, color); + 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); } } diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 843dc9e88..122c68042 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -270,6 +270,9 @@ CMovieBrowser::~CMovieBrowser() if (m_movieCover) delete m_movieCover; + + if (m_header) + delete m_header; m_header = NULL; } void CMovieBrowser::clearListLines() @@ -337,6 +340,7 @@ void CMovieBrowser::init(void) m_pcInfo1 = NULL; m_pcInfo2 = NULL; m_pcFilter = NULL; + m_header = NULL; m_windowFocus = MB_FOCUS_BROWSER; m_textTitle = g_Locale->getText(LOCALE_MOVIEBROWSER_HEAD); @@ -1166,10 +1170,11 @@ int CMovieBrowser::exec(const char* path) void CMovieBrowser::hide(void) { //TRACE("[mb]->%s\n", __func__); - if (m_channelLogo) - { - delete m_channelLogo; - m_channelLogo = NULL; + if (m_channelLogo){ + delete m_channelLogo; m_channelLogo = NULL; + } + if (m_header) { + delete m_header; m_header = NULL; } old_EpgId = 0; framebuffer->paintBackground(); @@ -1410,7 +1415,7 @@ void CMovieBrowser::refreshChannelLogo(void) int x = m_cBoxFrame.iX + m_cBoxFrameTitleRel.iX + m_cBoxFrameTitleRel.iWidth - m_channelLogo->getWidth() - OFFSET_INNER_MID; int y = m_cBoxFrame.iY + m_cBoxFrameTitleRel.iY + (m_cBoxFrameTitleRel.iHeight - m_channelLogo->getHeight())/2; - m_channelLogo->setXPos(x - pb_hdd_offset); + m_channelLogo->setXPos(x - pb_hdd_offset - m_header->getContextBtnObject()->getWidth()); m_channelLogo->setYPos(y); m_channelLogo->hide(); m_channelLogo->paint(); @@ -1640,7 +1645,7 @@ void CMovieBrowser::info_hdd_level(bool paint_hdd) tmp_blocks_percent_used = blocks_percent_used; const short pbw = 100; const short border = m_cBoxFrameTitleRel.iHeight/4; - CProgressBar pb(m_cBoxFrame.iX+ m_cBoxFrameFootRel.iWidth - pbw - border, m_cBoxFrame.iY+m_cBoxFrameTitleRel.iY + border, pbw, m_cBoxFrameTitleRel.iHeight/2); + CProgressBar pb(m_cBoxFrame.iX+ m_cBoxFrameFootRel.iWidth - m_header->getContextBtnObject()->getWidth() - pbw - border, m_cBoxFrame.iY+m_cBoxFrameTitleRel.iY + border, pbw, m_cBoxFrameTitleRel.iHeight/2); pb.setType(CProgressBar::PB_REDRIGHT); pb.setValues(blocks_percent_used, 100); pb.paint(false); @@ -1927,9 +1932,11 @@ void CMovieBrowser::refreshTitle(void) int w = m_cBoxFrameTitleRel.iWidth; int h = m_cBoxFrameTitleRel.iHeight; - CComponentsHeader header(x, y, w, h, title.c_str(), icon); - header.paint(CC_SAVE_SCREEN_NO); - newHeader = header.isPainted(); + if (!m_header){ + m_header = new CComponentsHeader(x, y, w, h, title.c_str(), icon, CComponentsHeader::CC_BTN_HELP); + } + m_header->paint(CC_SAVE_SCREEN_NO); + newHeader = m_header->isPainted(); info_hdd_level(true); } diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index e26c64903..22b982a87 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -164,6 +164,7 @@ class CMovieBrowser : public CMenuTarget CBox m_cBoxFrameFootRel; CBox m_cBoxFrameTitleRel; + CComponentsHeader *m_header; CComponentsDetailLine *m_detailsLine; CComponentsChannelLogo *m_channelLogo; CComponentsPicture *m_movieCover; diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 0478efa0b..c28921b90 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -78,7 +78,6 @@ //NI InfoIcons #include -extern CInfoIcons *InfoIcons; extern cVideo * videoDecoder; extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */ @@ -87,6 +86,8 @@ extern CVolume* g_volume; #define TIMESHIFT_SECONDS 3 #define ISO_MOUNT_POINT "/media/iso" +#define MUTE true +#define NO_MUTE false CMoviePlayerGui* CMoviePlayerGui::instance_mp = NULL; CMoviePlayerGui* CMoviePlayerGui::instance_bg = NULL; @@ -208,6 +209,8 @@ void CMoviePlayerGui::Init(void) blockedFromPlugin = false; m_screensaver = false; m_idletime = time(NULL); + m_mode = CTimeOSD::MODE_HIDE; + m_restore = false; } void CMoviePlayerGui::cutNeutrino() @@ -478,11 +481,33 @@ void CMoviePlayerGui::ClearQueue() milist.clear(); } -void CMoviePlayerGui::EnableClockAndMute(bool enable) + +void CMoviePlayerGui::enableOsdElements(bool mute) { - CAudioMute::getInstance()->enableMuteIcon(enable); - CInfoClock::getInstance()->enableInfoClock(enable); - InfoIcons->enableInfoIcons(enable); //NI InfoIcons + if (mute) + CAudioMute::getInstance()->enableMuteIcon(true); + + CInfoClock::getInstance()->enableInfoClock(true); + CInfoIcons::getInstance()->enableInfoIcons(true); //NI InfoIcons + + if (m_restore) { + FileTime.setMode(m_mode); + FileTime.update(position, duration); + } +} + +void CMoviePlayerGui::disableOsdElements(bool mute) +{ + if (mute) + CAudioMute::getInstance()->enableMuteIcon(false); + + CInfoClock::getInstance()->enableInfoClock(false); + CInfoIcons::getInstance()->enableInfoIcons(false); //NI InfoIcons + + m_mode = FileTime.getMode(); + m_restore = FileTime.IsVisible(); + if (m_restore) + FileTime.kill(); } void CMoviePlayerGui::makeFilename() @@ -586,7 +611,7 @@ bool CMoviePlayerGui::SelectFile() } #endif else if (isMovieBrowser) { - EnableClockAndMute(false); + disableOsdElements(MUTE); if (moviebrowser->exec(Path_local.c_str())) { Path_local = moviebrowser->getCurrentDir(); CFile *file = NULL; @@ -606,9 +631,9 @@ bool CMoviePlayerGui::SelectFile() ret = prepareFile(&p_movie_info->file); } else menu_ret = moviebrowser->getMenuRet(); - EnableClockAndMute(true); + enableOsdElements(MUTE); } else { // filebrowser - EnableClockAndMute(false); + disableOsdElements(MUTE); while (ret == false && filebrowser->exec(Path_local.c_str()) == true) { Path_local = filebrowser->getCurrentDir(); CFile *file = NULL; @@ -630,7 +655,7 @@ bool CMoviePlayerGui::SelectFile() } } menu_ret = filebrowser->getMenuRet(); - EnableClockAndMute(true); + enableOsdElements(MUTE); } g_settings.network_nfs_moviedir = Path_local; @@ -1235,7 +1260,7 @@ bool CMoviePlayerGui::PlayFileStart(void) if (is_file_player) selectAutoLang(); - EnableClockAndMute(true); + enableOsdElements(MUTE); return res; } @@ -1436,7 +1461,7 @@ void CMoviePlayerGui::PlayFileLoop(void) if (timeshift == TSHIFT_MODE_OFF) callInfoViewer(); } else if (!filelist.empty()) { - EnableClockAndMute(false); + disableOsdElements(MUTE); CFileBrowser *playlist = new CFileBrowser(); CFile *pfile = NULL; pfile = &(*filelist_it); @@ -1459,7 +1484,7 @@ void CMoviePlayerGui::PlayFileLoop(void) filelist_it = filelist.begin() + selected; } delete playlist; - EnableClockAndMute(true); + enableOsdElements(MUTE); } } else if (msg == (neutrino_msg_t) g_settings.mpkey_pause) { if (playstate == CMoviePlayerGui::PAUSE) { @@ -1560,15 +1585,12 @@ void CMoviePlayerGui::PlayFileLoop(void) SetPosition(1000 * (hh * 3600 + mm * 60 + ss), true); } else if (msg == CRCInput::RC_help) { + disableOsdElements(NO_MUTE); showHelp(); + enableOsdElements(NO_MUTE); } else if (msg == CRCInput::RC_info) { if (fromInfoviewer) { - CTimeOSD::mode m_mode = FileTime.getMode(); - bool restore = FileTime.IsVisible(); - if (restore) - FileTime.kill(); - CInfoClock::getInstance()->enableInfoClock(false); - InfoIcons->enableInfoIcons(false); //NI InfoIcons + disableOsdElements(NO_MUTE); #ifdef ENABLE_LUA if (isLuaPlay && haveLuaInfoFunc) { int xres = 0, yres = 0, aspectRatio = 0, framerate = -1; @@ -1587,12 +1609,7 @@ void CMoviePlayerGui::PlayFileLoop(void) } #endif fromInfoviewer = false; - CInfoClock::getInstance()->enableInfoClock(true); - InfoIcons->enableInfoIcons(true); //NI InfoIcons - if (restore) { - FileTime.setMode(m_mode); - FileTime.update(position, duration); - } + enableOsdElements(NO_MUTE); } else callInfoViewer(); @@ -2205,21 +2222,9 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/) } } } else if (msg == NeutrinoMessages::SHOW_EPG && p_movie_info) { - CTimeOSD::mode m_mode = FileTime.getMode(); - bool restore = FileTime.IsVisible(); - if (restore) - FileTime.kill(); - CInfoClock::getInstance()->enableInfoClock(false); - InfoIcons->enableInfoIcons(false); //NI InfoIcons - + disableOsdElements(NO_MUTE); g_EpgData->show_mp(p_movie_info, position, duration); - - CInfoClock::getInstance()->enableInfoClock(true); - InfoIcons->enableInfoIcons(true); //NI InfoIcons - if (restore) { - FileTime.setMode(m_mode); - FileTime.update(position, duration); - } + enableOsdElements(NO_MUTE); } return; } diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index 7efc3ca1e..8dfc5b801 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -189,6 +189,9 @@ class CMoviePlayerGui : public CMenuTarget static CMoviePlayerGui* instance_mp; static CMoviePlayerGui* instance_bg; + CTimeOSD::mode m_mode; + bool m_restore; + void Init(void); void PlayFile(); bool PlayFileStart(); @@ -221,7 +224,8 @@ class CMoviePlayerGui : public CMenuTarget void Cleanup(); void ClearFlags(); void ClearQueue(); - void EnableClockAndMute(bool enable); + void enableOsdElements(bool mute); + void disableOsdElements(bool mute); static void *ShowStartHint(void *arg); static void* bgPlayThread(void *arg); static bool sortStreamList(livestream_info_t info1, livestream_info_t info2);