From 3793c8dfd284f9e396587d438cc07a2dd8ec7581 Mon Sep 17 00:00:00 2001 From: GetAway Date: Tue, 13 Nov 2018 18:04:28 +0100 Subject: [PATCH] streaminfo: show techinfo in TS_MODE if channelist is empty --- src/gui/info_menue.cpp | 3 ++- src/gui/streaminfo1.cpp | 13 ++++++++++--- src/gui/streaminfo2.cpp | 13 ++++++++++--- src/gui/user_menue.cpp | 2 +- 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/gui/info_menue.cpp b/src/gui/info_menue.cpp index b0b9ed563..8cdf853b4 100644 --- a/src/gui/info_menue.cpp +++ b/src/gui/info_menue.cpp @@ -90,7 +90,8 @@ int CInfoMenu::showMenu() mf->setHint(NEUTRINO_ICON_HINT_DBOXINFO, LOCALE_MENU_HINT_DBOXINFO); info->addItem(mf); - mf = new CMenuForwarder(LOCALE_STREAMINFO_HEAD, !CNeutrinoApp::getInstance()->channelList->isEmpty(), NULL, &streaminfo, NULL, CRCInput::RC_yellow); + bool _mode_ts = (CNeutrinoApp::getInstance()->getMode() == NeutrinoModes::mode_ts); + mf = new CMenuForwarder(LOCALE_STREAMINFO_HEAD, _mode_ts || !CNeutrinoApp::getInstance()->channelList->isEmpty(), NULL, &streaminfo, NULL, CRCInput::RC_yellow); mf->setHint(NEUTRINO_ICON_HINT_STREAMINFO, LOCALE_MENU_HINT_STREAMINFO); info->addItem(mf); #if 0 diff --git a/src/gui/streaminfo1.cpp b/src/gui/streaminfo1.cpp index 07b4374b3..ec0350fb2 100644 --- a/src/gui/streaminfo1.cpp +++ b/src/gui/streaminfo1.cpp @@ -517,6 +517,8 @@ void CStreamInfo2::paint (int /*mode*/) void CStreamInfo2::paint_techinfo(int xpos, int ypos) { char buf[100]; + bool has_vpid = false; + bool is_webchan = false; int xres = 0, yres = 0, aspectRatio = 0, framerate = -1; // paint labels int spaceoffset = 0,i = 0; @@ -528,7 +530,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) frameBuffer->paintBoxRel (0, ypos, box_width, box_h, COL_MENUCONTENT_PLUS_0); CZapitChannel * channel = CZapit::getInstance()->GetCurrentChannel(); - if(!channel) + if(!channel && !mp) return; int array[]= {g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_RESOLUTION)), @@ -549,9 +551,14 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) average_bitrate_offset = spaceoffset; int box_width2 = box_width-(spaceoffset+xpos); + if (channel) + { + has_vpid = channel->getVideoPid(); + is_webchan = IS_WEBCHAN(channel->getChannelID()); + } int _mode = CNeutrinoApp::getInstance()->getMode(); - if ((channel->getVideoPid() || - (IS_WEBCHAN(channel->getChannelID()) && _mode == NeutrinoModes::mode_webtv) || + if ((has_vpid || + (is_webchan && _mode == NeutrinoModes::mode_webtv) || _mode == NeutrinoModes::mode_ts) && !(videoDecoder->getBlank())) { diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index 53ad19eda..7eb9a3a66 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -820,6 +820,8 @@ struct row { void CStreamInfo2::paint_techinfo(int xpos, int ypos) { char buf[100]; + bool has_vpid = false; + bool is_webchan = false; int xres = 0, yres = 0, aspectRatio = 0, framerate = -1, i = 0; // paint labels int ypos1 = ypos; @@ -830,7 +832,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) frameBuffer->paintBoxRel (0, ypos, box_width, box_h, COL_MENUCONTENT_PLUS_0); CZapitChannel * channel = CZapit::getInstance()->GetCurrentChannel(); - if (!channel) + if (!channel && !mp) return; ypos += iheight; @@ -946,9 +948,14 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) } + if (channel) + { + has_vpid = channel->getVideoPid(); + is_webchan = IS_WEBCHAN(channel->getChannelID()); + } int _mode = CNeutrinoApp::getInstance()->getMode(); - if ((channel->getVideoPid() || - (IS_WEBCHAN(channel->getChannelID()) && _mode == NeutrinoModes::mode_webtv) || + if ((has_vpid || + (is_webchan && _mode == NeutrinoModes::mode_webtv) || _mode == NeutrinoModes::mode_ts) && !(videoDecoder->getBlank())) { diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index 3d0ebea6a..cd21b2892 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -331,7 +331,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) case SNeutrinoSettings::ITEM_TECHINFO: { keyhelper.get(&key,&icon,CRCInput::RC_blue); - menu_item = new CMenuDForwarder(LOCALE_EPGMENU_STREAMINFO, !neutrino->channelList->isEmpty(), NULL, new CStreamInfo2, "-1", key, icon ); + menu_item = new CMenuDForwarder(LOCALE_EPGMENU_STREAMINFO, _mode_ts || !neutrino->channelList->isEmpty(), NULL, new CStreamInfo2, "-1", key, icon ); menu_item->setHint(NEUTRINO_ICON_HINT_STREAMINFO, LOCALE_MENU_HINT_STREAMINFO); break; }