streaminfo: add channelname for webtv/radio too; simplify code

Origin commit data
------------------
Commit: da57a16a8b
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-11-06 (Mon, 06 Nov 2017)

Origin message was:
------------------
- streaminfo: add channelname for webtv/radio too; simplify code
This commit is contained in:
vanhofen
2017-11-06 23:08:43 +01:00
parent a3e9933a5e
commit 2306dc57d7

View File

@@ -827,22 +827,22 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
{ {
if (CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webtv || CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webradio) if (CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webtv || CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webradio)
{ {
// url // channel
r.key = "URL"; r.key = g_Locale->getText (LOCALE_TIMERLIST_CHANNEL);
r.val = channel->getUrl();
}
else
{
// file
r.key = g_Locale->getText (LOCALE_MOVIEBROWSER_INFO_FILE);
r.val = mp->GetFile();
}
r.key += ": "; r.key += ": ";
r.val = channel->getName().c_str();
r.col = COL_MENUCONTENT_TEXT; r.col = COL_MENUCONTENT_TEXT;
v.push_back(r); v.push_back(r);
//provider // url
if ((CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webtv) && (channel->pname)) r.key = "URL";
r.key += ": ";
r.val = channel->getUrl();
r.col = COL_MENUCONTENT_TEXT;
v.push_back(r);
// provider
if (channel->pname)
{ {
std::string prov_name = channel->pname; std::string prov_name = channel->pname;
prov_name.erase(std::remove(prov_name.begin(), prov_name.end(), '['), prov_name.end()); prov_name.erase(std::remove(prov_name.begin(), prov_name.end(), '['), prov_name.end());
@@ -853,6 +853,16 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
r.col = COL_MENUCONTENT_TEXT; r.col = COL_MENUCONTENT_TEXT;
v.push_back(r); v.push_back(r);
} }
}
else
{
// file
r.key = g_Locale->getText (LOCALE_MOVIEBROWSER_INFO_FILE);
r.key += ": ";
r.val = mp->GetFile();
r.col = COL_MENUCONTENT_TEXT;
v.push_back(r);
}
scaling = 8000; scaling = 8000;
} }
@@ -865,7 +875,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
r.col = COL_MENUCONTENT_TEXT; r.col = COL_MENUCONTENT_TEXT;
v.push_back(r); v.push_back(r);
//provider // provider
if (channel->pname) if (channel->pname)
{ {
std::string prov_name = channel->pname; std::string prov_name = channel->pname;
@@ -1065,6 +1075,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
snprintf(buf, sizeof(buf), "%llx.png", channel->getChannelID() & 0xFFFFFFFFFFFFULL); snprintf(buf, sizeof(buf), "%llx.png", channel->getChannelID() & 0xFFFFFFFFFFFFULL);
r.val = buf; r.val = buf;
r.col = COL_MENUCONTENT_TEXT; r.col = COL_MENUCONTENT_TEXT;
r.f = g_Font[font_small];
v.push_back(r); v.push_back(r);
} }
} }