- infoviewer: better integration of 58858b0391

Signed-off-by: Thilo Graf <dbt@novatux.de>

commit was: - infoviewer: show corresponding icon in webtv/webradio mode
This commit is contained in:
svenhoefer
2021-09-18 01:23:45 +02:00
committed by Thilo Graf
parent 58858b0391
commit 7b304aa04f

View File

@@ -1617,18 +1617,22 @@ void CInfoViewer::showSNR ()
{
if (!is_visible)
return;
int renderFlag = ((g_settings.theme.infobar_gradient_top) ? Font::FULLBG : 0) | Font::IS_UTF8;
/* right now, infobar_show_channellogo == 3 is the trigger for signal bars etc.
TODO: decouple this */
if (!fileplay && !IS_WEBCHAN(current_channel_id) && ( g_settings.infobar_show_channellogo == 3 || g_settings.infobar_show_channellogo == 5 || g_settings.infobar_show_channellogo == 6 )) {
if (g_settings.infobar_show_channellogo == 3 || g_settings.infobar_show_channellogo == 5 || g_settings.infobar_show_channellogo == 6)
{
if (!IS_WEBCHAN(current_channel_id) && !fileplay)
{
int y_freq = 2 * g_SignalFont->getHeight();
if (!g_settings.infobar_sat_display)
y_freq -= g_SignalFont->getHeight() / 2; //half line up to center freq vertically
int y_numbox = numbox->getYPos();
if ((newfreq && chanready) || SDT_freq_update) {
if ((newfreq && chanready) || SDT_freq_update)
{
char freq[22];
newfreq = false;
std::string polarisation = "";
if (CFrontend::isSat(CFEManager::getInstance()->getLiveFE()->getCurrentDeliverySystem()))
@@ -1646,7 +1650,8 @@ void CInfoViewer::showSNR ()
g_SignalFont->RenderString(BoxStartX + numbox_offset + ((numbox_maxtxtwidth - freqWidth) / 2), y_numbox + y_freq - 3, freqWidth, freq, SDT_freq_update ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT, 0, renderFlag);
SDT_freq_update = false;
}
if (sigbox == NULL){
if (sigbox == NULL)
{
int sigbox_offset = OFFSET_INNER_MID;
sigbox = new CSignalBox(BoxStartX + sigbox_offset, y_numbox + ChanHeight / 2, ChanWidth - 2 * sigbox_offset, ChanHeight / 2, NULL, true, NULL, "S", "Q");
sigbox->setItemName("SIGBOX");
@@ -1660,8 +1665,7 @@ void CInfoViewer::showSNR ()
sigbox->setFrontEnd(CFEManager::getInstance()->getLiveFE());
sigbox->paint(CC_SAVE_SCREEN_NO);
}
// TODO: better integration
else if (IS_WEBCHAN(current_channel_id) && ( g_settings.infobar_show_channellogo == 3 || g_settings.infobar_show_channellogo == 5 || g_settings.infobar_show_channellogo == 6 ))
else if (IS_WEBCHAN(current_channel_id))
{
const char *icon = NULL;
int mode = CNeutrinoApp::getInstance()->getMode();
@@ -1674,15 +1678,19 @@ void CInfoViewer::showSNR ()
icon = NEUTRINO_ICON_HINT_WEBRADIO;
break;
default: // NeutrinoMode not set yet
icon = NEUTRINO_ICON_PLAY;
//icon = NEUTRINO_ICON_PLAY;
break;
}
if (icon)
{
int icon_w = 0, icon_h = 0;
frameBuffer->getIconSize(icon, &icon_w, &icon_h);
int icon_x = BoxStartX + ChanWidth / 2 - icon_w / 2;
int icon_y = BoxStartY + g_SignalFont->getHeight() + (ChanHeight - g_SignalFont->getHeight()) / 2 - icon_h / 2;
frameBuffer->paintIcon(icon, icon_x, icon_y);
}
}
}
if (showButtonBar)
infoViewerBB->showSysfsHdd();
}