From e73cf4aa5251041beac535b82d017c4c0372d806 Mon Sep 17 00:00:00 2001 From: satbaby Date: Thu, 26 May 2011 15:35:22 +0000 Subject: [PATCH] -add Logo+Kanalnummer/Signalbalken option git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1494 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/infoviewer.cpp | 24 ++++++++++++------------ src/gui/infoviewer.h | 2 +- src/gui/osd_setup.cpp | 5 +++-- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 7 files changed, 20 insertions(+), 15 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 949532a37..a410fcf78 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -756,6 +756,7 @@ miscsettings.infobar_disp_2 Logo/Kanalnummer miscsettings.infobar_disp_3 Logo+Kanalname/Signalbalken miscsettings.infobar_disp_4 Logo+Kanalname/Kanalnummer miscsettings.infobar_disp_5 Logo/Signalbalken +miscsettings.infobar_disp_6 Logo+Kanalnummer/Signalbalken miscsettings.infobar_disp_log Logo miscsettings.infobar_logo_hdd_dir Logo Verz. miscsettings.infobar_sat_display Kabel-/Satellitenanbieter diff --git a/data/locale/english.locale b/data/locale/english.locale index c3ba2bad4..30861b043 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -756,6 +756,7 @@ miscsettings.infobar_disp_2 Logo 2 miscsettings.infobar_disp_3 Logo 3 miscsettings.infobar_disp_4 Logo 4 miscsettings.infobar_disp_5 Logo 5 +miscsettings.infobar_disp_6 Logo 6 miscsettings.infobar_disp_log Logo miscsettings.infobar_logo_hdd_dir Logo dir miscsettings.infobar_sat_display Satellite display on infobar diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 2434de685..49facc37a 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -187,7 +187,7 @@ void CInfoViewer::start () 25; InfoHeightY_Info = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+ 5; - if ( g_settings.infobar_show_channellogo != 3 && g_settings.infobar_show_channellogo != 5 ) /* 3 & 5 is "default" with sigscales etc. */ + if ( g_settings.infobar_show_channellogo != 3 && g_settings.infobar_show_channellogo != 5 && g_settings.infobar_show_channellogo != 6) /* 3 & 5 & 6 is "default" with sigscales etc. */ { ChanWidth = 4 * g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->getRenderWidth(widest_number) + 10; ChanHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->getHeight() * 9 / 8; @@ -658,7 +658,10 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con bool logo_ok = false; if (ChanNum) /* !fileplay */ { - ChannelLogoMode = showChannelLogo(channel_id); // get logo mode, paint channel logo if adjusted + char strChanNum[10]; + snprintf (strChanNum, sizeof(strChanNum), "%d", ChanNum); + const int channel_number_width =(g_settings.infobar_show_channellogo == 6) ? 5 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth (strChanNum) : 0; + ChannelLogoMode = showChannelLogo(channel_id,channel_number_width); // get logo mode, paint channel logo if adjusted logo_ok = ( g_settings.infobar_show_channellogo != 0 && ChannelLogoMode != 0); fprintf(stderr, "after showchannellogo, mode = %d ret = %d logo_ok = %d\n",g_settings.infobar_show_channellogo, ChannelLogoMode, logo_ok); @@ -694,9 +697,6 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con ChanNumYPos += 10; } - char strChanNum[10]; - snprintf (strChanNum, sizeof(strChanNum), "%d", ChanNum); - /* TODO: the logic will get much easier once we decouple channellogo and signal bars */ if ((!logo_ok && g_settings.infobar_show_channellogo < 2) || g_settings.infobar_show_channellogo == 2 || g_settings.infobar_show_channellogo == 4) // no logo in numberbox { @@ -706,7 +706,7 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con BoxStartX + (ChanWidth - tmpwidth) / 2, ChanNumYPos, ChanWidth, strChanNum, col_NumBoxText); } - if (ChannelLogoMode == 1 || ( g_settings.infobar_show_channellogo == 3 && !logo_ok)) /* channel number besides channel name */ + if (ChannelLogoMode == 1 || ( g_settings.infobar_show_channellogo == 3 && !logo_ok) || g_settings.infobar_show_channellogo == 6 ) /* channel number besides channel name */ { ChanNumWidth = 5 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth (strChanNum); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString( @@ -715,7 +715,7 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con } } - if (g_settings.infobar_show_channellogo != 5 || !logo_ok) { + if (g_settings.infobar_show_channellogo < 5 || !logo_ok) { if (ChannelLogoMode != 2) { g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString( ChanNameX + 10 + ChanNumWidth, ChanNameY + time_height, @@ -1293,7 +1293,7 @@ void CInfoViewer::showSNR () /* right now, infobar_show_channellogo == 3 is the trigger for signal bars etc. TODO: decouple this */ - if ((! fileplay && g_settings.infobar_show_channellogo == 3) || (! fileplay && g_settings.infobar_show_channellogo == 5)) { + if (! fileplay && ( g_settings.infobar_show_channellogo == 3 || g_settings.infobar_show_channellogo == 5 || g_settings.infobar_show_channellogo == 6 )) { int chanH = g_SignalFont->getHeight(); int freqStartY = BoxStartY + 2 * chanH - 3; if (newfreq && chanready) { @@ -1784,7 +1784,7 @@ returns mode of painted channel logo, 2 = in place of channel name 3 = beside channel name *******************************************************************************/ -int CInfoViewer::showChannelLogo(const t_channel_id logo_channel_id) +int CInfoViewer::showChannelLogo(const t_channel_id logo_channel_id, const int channel_number_width) { if (!g_settings.infobar_show_channellogo) // show logo only if configured return 0; @@ -1828,7 +1828,7 @@ int CInfoViewer::showChannelLogo(const t_channel_id logo_channel_id) logo_y = y_mid - logo_h / 2; res = 1; } - else if (g_settings.infobar_show_channellogo == 2 || g_settings.infobar_show_channellogo == 5) // paint logo in place of channel name + else if (g_settings.infobar_show_channellogo == 2 || g_settings.infobar_show_channellogo == 5 || g_settings.infobar_show_channellogo == 6) // paint logo in place of channel name { // check logo dimensions resize_logo(&logo_w, &logo_h, chan_w, time_height); @@ -1836,14 +1836,14 @@ int CInfoViewer::showChannelLogo(const t_channel_id logo_channel_id) // this is too ugly... ChannelName = ""; // calculate logo position y_mid = ChanNameY + time_height / 2; - logo_x = start_x + 10; + logo_x = start_x + 10 + channel_number_width;; logo_y = y_mid - logo_h / 2; if (g_settings.infobar_show_channellogo == 2) res = 2; else res = 5; } - else if (g_settings.infobar_show_channellogo == 3 || g_settings.infobar_show_channellogo == 4) // paint logo beside channel name + else if (g_settings.infobar_show_channellogo == 3 || g_settings.infobar_show_channellogo == 4) // paint logo beside channel name { // check logo dimensions int Logo_max_width = chan_w - logo_w - 10; diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index b0df444a3..5e5b4b395 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -139,7 +139,7 @@ class CInfoViewer void showFailure(); void showMotorMoving(int duration); void showLcdPercentOver(); - int showChannelLogo(const t_channel_id logo_channel_id); + int showChannelLogo(const t_channel_id logo_channel_id, const int channel_number_width); void showSNR(); void showInfoFile(); void loop(int fadeValue, bool show_dot ,bool fadeIn); diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index b48fb401d..f30acb08c 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -547,7 +547,7 @@ void COsdSetup::showOsdTimeoutSetup(CMenuWidget* menu_timeout) menu_timeout->addItem(new CMenuForwarder(LOCALE_OPTIONS_DEFAULT, true, NULL, this, "osd.def", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED)); } -#define LOCALE_MISCSETTINGS_INFOBAR_DISP_OPTIONS_COUNT 6 +#define LOCALE_MISCSETTINGS_INFOBAR_DISP_OPTIONS_COUNT 7 const CMenuOptionChooser::keyval LOCALE_MISCSETTINGS_INFOBAR_DISP_OPTIONS[LOCALE_MISCSETTINGS_INFOBAR_DISP_OPTIONS_COUNT]= { { 0 , LOCALE_MISCSETTINGS_INFOBAR_DISP_0 }, @@ -555,7 +555,8 @@ const CMenuOptionChooser::keyval LOCALE_MISCSETTINGS_INFOBAR_DISP_OPTIONS[LOCAL { 2 , LOCALE_MISCSETTINGS_INFOBAR_DISP_2 }, { 3 , LOCALE_MISCSETTINGS_INFOBAR_DISP_3 }, { 4 , LOCALE_MISCSETTINGS_INFOBAR_DISP_4 }, - { 5 , LOCALE_MISCSETTINGS_INFOBAR_DISP_5 } + { 5 , LOCALE_MISCSETTINGS_INFOBAR_DISP_5 }, + { 6 , LOCALE_MISCSETTINGS_INFOBAR_DISP_6 } }; //infobar diff --git a/src/system/locals.h b/src/system/locals.h index 332a0a1af..6b6b15b9c 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -783,6 +783,7 @@ typedef enum LOCALE_MISCSETTINGS_INFOBAR_DISP_3, LOCALE_MISCSETTINGS_INFOBAR_DISP_4, LOCALE_MISCSETTINGS_INFOBAR_DISP_5, + LOCALE_MISCSETTINGS_INFOBAR_DISP_6, LOCALE_MISCSETTINGS_INFOBAR_DISP_LOG, LOCALE_MISCSETTINGS_INFOBAR_LOGO_HDD_DIR, LOCALE_MISCSETTINGS_INFOBAR_SAT_DISPLAY, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index af0004fe1..fceffbf05 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -783,6 +783,7 @@ const char * locale_real_names[] = "miscsettings.infobar_disp_3", "miscsettings.infobar_disp_4", "miscsettings.infobar_disp_5", + "miscsettings.infobar_disp_6", "miscsettings.infobar_disp_log", "miscsettings.infobar_logo_hdd_dir", "miscsettings.infobar_sat_display",