streaminfo: show techinfo in TS_MODE if channelist is empty

This commit is contained in:
GetAway
2018-11-13 18:04:28 +01:00
parent a6c77ece34
commit 3793c8dfd2
4 changed files with 23 additions and 8 deletions

View File

@@ -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

View File

@@ -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()))
{

View File

@@ -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()))
{

View File

@@ -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;
}