From 80c84efb7c9e95759305733e9a63a7568a65baae Mon Sep 17 00:00:00 2001 From: striper Date: Fri, 28 Oct 2011 16:39:12 +0000 Subject: [PATCH] - extend colored events to channellist git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1779 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/gui/channellist.cpp | 28 ++++++++++++++++++++-------- src/gui/color.h | 3 ++- src/gui/infoviewer.cpp | 4 ++-- src/gui/osd_setup.cpp | 9 +++++---- src/neutrino.cpp | 6 ++++-- src/system/locals.h | 7 ++++--- src/system/locals_intern.h | 7 ++++--- src/system/setting_helpers.cpp | 5 +++++ src/system/settings.h | 3 ++- 9 files changed, 48 insertions(+), 24 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 699bb514f..acfce9ee6 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1579,6 +1579,15 @@ void CChannelList::quickZap(int key, bool cycle) void CChannelList::paintDetails(int index) { CChannelEvent *p_event = NULL; + + //colored_events init + bool colored_event_C = false; + bool colored_event_N = false; + if (g_settings.colored_events_channellist == 1) + colored_event_C = true; + if (g_settings.colored_events_channellist == 2) + colored_event_N = true; + if (displayNext) { p_event = &chanlist[index]->nextEvent; } else { @@ -1633,7 +1642,7 @@ void CChannelList::paintDetails(int index) text3= text3+ " - "; xstart += g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text3, true); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2* fheight, width - 30- noch_len, text3, COL_MENUCONTENTDARK, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2* fheight, width - 30- noch_len, text3, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); } if (!(text2.empty())) { @@ -1647,14 +1656,15 @@ void CChannelList::paintDetails(int index) if ( pos!=-1 ) text2 = text2.substr( 0, pos ); } - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ xstart, y+ height+ 5+ 2* fheight, width- xstart- 30- noch_len, text2, COL_MENUCONTENTDARK, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ xstart, y+ height+ 5+ 2* fheight, width- xstart- 30- noch_len, text2, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); } - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ fheight, width - 30 - seit_len, text1, COL_MENUCONTENTDARK, 0, true); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString (x+ width- 10- seit_len, y+ height+ 5+ fheight , seit_len, cSeit, COL_MENUCONTENTDARK, 0, true); // UTF-8 - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(x+ width- 10- noch_len, y+ height+ 5+ 2* fheight- 2, noch_len, cNoch, COL_MENUCONTENTDARK, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ fheight, width - 30 - seit_len, text1, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString (x+ width- 10- seit_len, y+ height+ 5+ fheight , seit_len, cSeit, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ width- 10- noch_len, y+ height+ 5+ 2* fheight- 2, noch_len, cNoch, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8 } char buf[128] = {0}; + char cFrom[50] = {0}; // UTF-8 int len = 0; if(g_settings.channellist_foot == 0) { transponder_id_t ct = chanlist[index]->getTransponderId(); @@ -1694,10 +1704,12 @@ void CChannelList::paintDetails(int index) sectionsd_getCurrentNextServiceKey(chanlist[index]->channel_id & 0xFFFFFFFFFFFFULL, CurrentNext); if (!CurrentNext.next_name.empty()) { struct tm *pStartZeit = localtime (& CurrentNext.next_zeit.startzeit); - len = snprintf(buf, sizeof(buf), "%s %02d:%02d ",g_Locale->getText(LOCALE_WORD_FROM),pStartZeit->tm_hour, pStartZeit->tm_min ); - len += snprintf(&buf[len], sizeof(buf) - len, "%s", CurrentNext.next_name.c_str()); + snprintf(cFrom, sizeof(cFrom), "%s %02d:%02d",g_Locale->getText(LOCALE_WORD_FROM),pStartZeit->tm_hour, pStartZeit->tm_min ); + snprintf(buf, sizeof(buf), "%s", CurrentNext.next_name.c_str()); + int from_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(cFrom, true); // UTF-8 - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ 10, y+ height+ 5+ 3*fheight, width - 30, buf, COL_MENUCONTENTDARK, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 3*fheight, width - 30 - from_len, buf, colored_event_N ? COL_COLORED_EVENTS_CHANNELLIST :COL_MENUCONTENTDARK, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ width- 10- from_len, y+ height+ 5+ 3*fheight, from_len, cFrom, colored_event_N ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8 } } } diff --git a/src/gui/color.h b/src/gui/color.h index 064a20a30..7e58324fa 100644 --- a/src/gui/color.h +++ b/src/gui/color.h @@ -33,7 +33,8 @@ #ifndef __color__ #define __color__ -#define COL_MAXFREE 254-8*8 - 1 +#define COL_MAXFREE 254-8*9 - 1 +#define COL_COLORED_EVENTS_CHANNELLIST 254-8*9 #define COL_COLORED_EVENTS_INFOBAR 254-8*8 #define COL_INFOBAR_SHADOW 254-8*7 #define COL_INFOBAR 254-8*6 diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index d035edf57..168d356a2 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1676,9 +1676,9 @@ void CInfoViewer::display_Info(const char *current, const char *next, //colored_events init bool colored_event_C = false; bool colored_event_N = false; - if (g_settings.colored_events == 1) + if (g_settings.colored_events_infobar == 1) colored_event_C = true; - if (g_settings.colored_events == 2) + if (g_settings.colored_events_infobar == 2) colored_event_N = true; if (pb_pos > -1) diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index eedde1e63..4925f6243 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -272,9 +272,9 @@ const CMenuOptionChooser::keyval CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS[CHANNE #define OPTIONS_COLORED_EVENTS_OPTION_COUNT 3 const CMenuOptionChooser::keyval OPTIONS_COLORED_EVENTS_OPTIONS[OPTIONS_COLORED_EVENTS_OPTION_COUNT] = { - { 0, LOCALE_MISCSETTINGS_INFOBAR_COLORED_EVENTS_0 }, //none - { 1, LOCALE_MISCSETTINGS_INFOBAR_COLORED_EVENTS_1 }, //current - { 2, LOCALE_MISCSETTINGS_INFOBAR_COLORED_EVENTS_2 }, //next + { 0, LOCALE_MISCSETTINGS_COLORED_EVENTS_0 }, //none + { 1, LOCALE_MISCSETTINGS_COLORED_EVENTS_1 }, //current + { 2, LOCALE_MISCSETTINGS_COLORED_EVENTS_2 }, //next }; @@ -602,7 +602,7 @@ void COsdSetup::showOsdInfobarSetup(CMenuWidget *menu_infobar) menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SHOW_VAR_HDD, &g_settings.infobar_show_var_hdd, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SHOW_RES, &g_settings.infobar_show_res, INFOBAR_SHOW_RES_MODE_OPTIONS, INFOBAR_SHOW_RES_MODE_OPTION_COUNT, true)); menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SHOW, &g_settings.infobar_show, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); - menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_COLORED_EVENTS, &g_settings.colored_events, OPTIONS_COLORED_EVENTS_OPTIONS, OPTIONS_COLORED_EVENTS_OPTION_COUNT, true)); + menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_COLORED_EVENTS, &g_settings.colored_events_infobar, OPTIONS_COLORED_EVENTS_OPTIONS, OPTIONS_COLORED_EVENTS_OPTION_COUNT, true)); // radiotextNotifier = new CRadiotextNotifier(); // menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_RADIOTEXT, &g_settings.radiotext_enable, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, radiotextNotifier)); } @@ -615,6 +615,7 @@ void COsdSetup::showOsdChanlistSetup(CMenuWidget *menu_chanlist) menu_chanlist->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_CHANNELLIST_EPGTEXT_ALIGN, &g_settings.channellist_epgtext_align_right, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS_COUNT, true)); menu_chanlist->addItem(new CMenuOptionChooser(LOCALE_CHANNELLIST_EXTENDED, &g_settings.channellist_extended, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); menu_chanlist->addItem(new CMenuOptionChooser(LOCALE_CHANNELLIST_FOOT, &g_settings.channellist_foot, CHANNELLIST_FOOT_OPTIONS, CHANNELLIST_FOOT_OPTIONS_COUNT, true)); + menu_chanlist->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_CHANNELLIST_COLORED_EVENTS, &g_settings.colored_events_channellist, OPTIONS_COLORED_EVENTS_OPTIONS, OPTIONS_COLORED_EVENTS_OPTION_COUNT, true)); } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 91cbb9278..d4acef29a 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -555,7 +555,8 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.infobar_Text_green = configfile.getInt32( "infobar_Text_green", 0x64 ); g_settings.infobar_Text_blue = configfile.getInt32( "infobar_Text_blue", 0x64 ); - g_settings.colored_events = configfile.getInt32( "colored_events" , 0 ); + g_settings.colored_events_channellist = configfile.getInt32( "colored_events_channellist" , 0 ); + g_settings.colored_events_infobar = configfile.getInt32( "colored_events_infobar" , 0 ); g_settings.colored_events_alpha = configfile.getInt32( "colored_events_alpha", 0x00 ); g_settings.colored_events_red = configfile.getInt32( "colored_events_red", 95 ); g_settings.colored_events_green = configfile.getInt32( "colored_events_green", 70 ); @@ -1115,7 +1116,8 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32( "infobar_Text_green", g_settings.infobar_Text_green ); configfile.setInt32( "infobar_Text_blue", g_settings.infobar_Text_blue ); - configfile.setInt32( "colored_events", g_settings.colored_events ); + configfile.setInt32( "colored_events_channellist", g_settings.colored_events_channellist ); + configfile.setInt32( "colored_events_infobar", g_settings.colored_events_infobar ); configfile.setInt32( "colored_events_alpha", g_settings.colored_events_alpha ); configfile.setInt32( "colored_events_red", g_settings.colored_events_red ); configfile.setInt32( "colored_events_green", g_settings.colored_events_green ); diff --git a/src/system/locals.h b/src/system/locals.h index cd62edf46..abdea83a4 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -756,7 +756,11 @@ typedef enum LOCALE_MISCSETTINGS_BOOTINFO, LOCALE_MISCSETTINGS_BOOTMENU, LOCALE_MISCSETTINGS_CHANNELLIST, + LOCALE_MISCSETTINGS_CHANNELLIST_COLORED_EVENTS, LOCALE_MISCSETTINGS_CHANNELLIST_EPGTEXT_ALIGN, + LOCALE_MISCSETTINGS_COLORED_EVENTS_0, + LOCALE_MISCSETTINGS_COLORED_EVENTS_1, + LOCALE_MISCSETTINGS_COLORED_EVENTS_2, LOCALE_MISCSETTINGS_DRIVER_BOOT, LOCALE_MISCSETTINGS_ENERGY, LOCALE_MISCSETTINGS_EPG_CACHE, @@ -783,9 +787,6 @@ typedef enum LOCALE_MISCSETTINGS_INFOBAR_CASYSTEM_MINI, LOCALE_MISCSETTINGS_INFOBAR_CASYSTEM_MODE, LOCALE_MISCSETTINGS_INFOBAR_COLORED_EVENTS, - LOCALE_MISCSETTINGS_INFOBAR_COLORED_EVENTS_0, - LOCALE_MISCSETTINGS_INFOBAR_COLORED_EVENTS_1, - LOCALE_MISCSETTINGS_INFOBAR_COLORED_EVENTS_2, LOCALE_MISCSETTINGS_INFOBAR_DISP_0, LOCALE_MISCSETTINGS_INFOBAR_DISP_1, LOCALE_MISCSETTINGS_INFOBAR_DISP_2, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index c1f8b1dfe..9e49f8a42 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -756,7 +756,11 @@ const char * locale_real_names[] = "miscsettings.bootinfo", "miscsettings.bootmenu", "miscsettings.channellist", + "miscsettings.channellist_colored_events", "miscsettings.channellist_epgtext_align", + "miscsettings.colored_events_0", + "miscsettings.colored_events_1", + "miscsettings.colored_events_2", "miscsettings.driver_boot", "miscsettings.energy", "miscsettings.epg_cache", @@ -783,9 +787,6 @@ const char * locale_real_names[] = "miscsettings.infobar_casystem_mini", "miscsettings.infobar_casystem_mode", "miscsettings.infobar_colored_events", - "miscsettings.infobar_colored_events_0", - "miscsettings.infobar_colored_events_1", - "miscsettings.infobar_colored_events_2", "miscsettings.infobar_disp_0", "miscsettings.infobar_disp_1", "miscsettings.infobar_disp_2", diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index adf9c47c7..61747fc4d 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -494,6 +494,11 @@ bool CColorSetupNotifier::changeNotify(const neutrino_locale_t, void *) convertSetupColor2RGB(g_settings.colored_events_red, g_settings.colored_events_green, g_settings.colored_events_blue), 8, convertSetupAlpha2Alpha(g_settings.infobar_alpha) ); + frameBuffer->paletteGenFade(COL_COLORED_EVENTS_CHANNELLIST, + convertSetupColor2RGB(int(g_settings.menu_Content_red*0.6), int(g_settings.menu_Content_green*0.6), int(g_settings.menu_Content_blue*0.6)), + convertSetupColor2RGB(g_settings.colored_events_red, g_settings.colored_events_green, g_settings.colored_events_blue), + 8, convertSetupAlpha2Alpha(g_settings.infobar_alpha) ); + frameBuffer->paletteSet(); return false; } diff --git a/src/system/settings.h b/src/system/settings.h index 7a518ae82..a0ce201bf 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -208,7 +208,8 @@ struct SNeutrinoSettings unsigned char colored_events_red; unsigned char colored_events_green; unsigned char colored_events_blue; - int colored_events; + int colored_events_channellist; + int colored_events_infobar; //network #define NETWORK_NFS_NR_OF_ENTRIES 8