From 4595ea6f4154c97c16e7e5c02f8365ec507dcaa6 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sun, 13 Nov 2011 17:18:33 +0000 Subject: [PATCH] Mute-Zap switch channel list (r1840) - Restored the original state with mute button. - Switched off via the channel list menu, default value is the original state. git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1845 e54a6e83-5905-42d5-8d5c-058d10e6a962 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d90b96732811f27cbcc4687c563ac8417a33b0af Author: Michael Liebmann Date: 2011-11-13 (Sun, 13 Nov 2011) --- data/icons/mute_zap_gray.png | Bin 363 -> 1106 bytes data/icons/mute_zap_green.png | Bin 363 -> 1032 bytes src/gui/channellist.cpp | 42 ++++++++++++++++++++++++++-------- src/gui/channellist.h | 1 + src/neutrino.cpp | 2 +- 5 files changed, 35 insertions(+), 10 deletions(-) diff --git a/data/icons/mute_zap_gray.png b/data/icons/mute_zap_gray.png index 0683072e6e8f306e8b3eb9725d297220935165b2..01325a527fccf3798afbff3d4bde6a1e912e9c22 100644 GIT binary patch literal 1106 zcmeAS@N?(olHy`uVBq!ia0vp^20$#q!3-q3mHXZSDaPU;cPEB*=VV?2*~R8Ul0 zSX^9GTvAk0Qe0A6Tv}RET2@k4R$2xGz}*x1zA)ZEzI)YR16)ZEh4 z($><})73Mff5OCx6Q@j_GHu4RS#xI1o;!Q}`t>_NVCPN{0iuCm-@bkO_wPS;?D%mY z20FdgVo10xg+DxTk({u&~CUH*}#}JFtXD|N_777$$FZi)b&|~K{uZe;aXL<^3*<&Vm z@mAi%lr*RJ#~xCHqJCR@a{N3EsXMPr(pEq;sO}>OTv8}JK zhR3>Wz5T{}x?cO@ES-5iON%RO&+JGP=@OnCJURIC)8pskqNdhHCT*|~;%S?CMA#+V zxN@$~-952$1TuF0d9ibAzm8FaMX{NIiBwmNqSBI}s9Eb?wgnn+t#>`eU%6T9k;Vb0 z=F0x*-pt}V<_IiyF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=~`5`f+3?&Wyi|Sq>b02KK$jV)fNegx^?K^*LSR? z%jADvGX}bT=HJxww#GAO>}dGZt2*y`U9aL<^M|+VzgR5Is!~gT;+>j(vo0}w)#~im z*{`L)p1)tWtGD=8dP2V8L=VGBCxvWvr|1^xJTEN`b&&q*fB$ar2|4E7L6TFfTuHEr{o8wVVv-Hnp-^;tYI5zok-H0@)t2caDDSQ61 zm25$!oQ&VDM+O0NxL6caHY9LdK67VJskKzLY4lmO9Z`q1rky(fR*Cu98589?Pk|4= znMIn`oVmy0u5|eP8Rkp{=7Ox&NhcfR!dR3z9A-^XVOh5B%$d00b;Sh}Gjbj#PBOmW oaw#n?-9g%W-^cm|-OKH*+;&Fq{hhZAm_islUHx3vIVCg!04&kPkpKVy literal 363 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaN3?zjj6;1;wg8-ipS06VYk!36u6%~mIi4!JF z$j#1;iim1$Zk;`M_Md-$a?)}F`~qs~YEsftrc9esQdBZS|Ism^UapcLzu^Bcz_96z z&Uv6HXMsm#F#`j)5C}6~x?A@LD0te_#W6(Ua`KE$7KwslHG>0;>de{fGAsrKEywDE zE?EZivGDTLcsu{E4-&D8tJw30k@^1J3qSrhEwVCoa^UOUxFBS~nl+0iE!xH0p{$Xi z^V`$oBY%r>n$~a6kdKp@nX5M~cwiR%P(fjNL!+&4K*8tGhZPt59a(v79Qq_CDE~Hm z!N43Wb%NpH>P?LwxfJ>s7H^pGFjk=5UbnG&_JSE}r@r{b&+{iO^Y$g7rMdd+djB6d zkTr*mWq0rUTgTW9HncSz&=L@AcxCyBiG`s!B$xXI$J9EYw-`KK{an^LB{Ts53?Glv diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 6a78796ee..3d2c357e2 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -104,6 +104,7 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl this->historyMode = phistoryMode; vlist = _vlist; selected_chid = 0; + this->new_mode_active = false; footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+6; //initial height value for buttonbar //printf("************ NEW LIST %s : %x\n", name.c_str(), this);fflush(stdout); } @@ -467,6 +468,7 @@ int CChannelList::show() return res; } + this->new_mode_active = 0; int fw = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth(); width = w_max (((g_settings.channellist_extended)?(frameBuffer->getScreenWidth() / 20 * (fw+6)):(frameBuffer->getScreenWidth() / 20 * (fw+5))), 100); height = h_max ((frameBuffer->getScreenHeight() / 20 * 16), (frameBuffer->getScreenHeight() / 20 * 2)); @@ -487,6 +489,12 @@ int CChannelList::show() frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MENU, &icol_w, &icol_h); theight = std::max(theight, icol_h); + if(g_settings.channellist_new_zap_mode) + { + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE, &icol_w, &icol_h); + theight = std::max(theight, icol_h); + } + fheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight(); if (fheight == 0) fheight = 1; /* avoid crash on invalid font */ @@ -639,7 +647,7 @@ int CChannelList::show() selected=0; liststart = (selected/listmaxshow)*listmaxshow; paint(); - if(g_settings.channellist_new_zap_mode && SameTP()) { + if(this->new_mode_active && SameTP()) { actzap = true; zapTo(selected); } @@ -648,7 +656,7 @@ int CChannelList::show() selected=chanlist.size()-1; liststart = (selected/listmaxshow)*listmaxshow; paint(); - if(g_settings.channellist_new_zap_mode && SameTP()) { + if(this->new_mode_active && SameTP()) { actzap = true; zapTo(selected); } @@ -677,7 +685,7 @@ int CChannelList::show() showChannelLogo(); } - if(g_settings.channellist_new_zap_mode && SameTP()) { + if(this->new_mode_active && SameTP()) { actzap = true; zapTo(selected); } @@ -709,7 +717,7 @@ int CChannelList::show() showChannelLogo(); } - if(g_settings.channellist_new_zap_mode && SameTP()) { + if(this->new_mode_active && SameTP()) { actzap = true; zapTo(selected); } @@ -766,6 +774,11 @@ int CChannelList::show() loop=false; } } + else if (( msg == CRCInput::RC_spkr ) && g_settings.channellist_new_zap_mode ) { + this->new_mode_active = (this->new_mode_active ? 0 : 1); + paintHead(); + showChannelLogo(); + } else if (CRCInput::isNumeric(msg) && (this->historyMode || g_settings.sms_channel)) { if (this->historyMode) { //numeric zap switch (msg) { @@ -898,6 +911,7 @@ int CChannelList::show() printf("CChannelList:: bouquetList->exec res %d\n", res); } CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); + this->new_mode_active = 0; if(NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode()) return -1; @@ -1150,11 +1164,11 @@ void CChannelList::zapTo(int pos, bool /* forceStoreToLastChannels */) if (bouquetList != NULL) { CNeutrinoApp::getInstance()->channelList->adjustToChannelID(chan->channel_id); } - if(g_settings.channellist_new_zap_mode) + if(this->new_mode_active) selected_in_new_mode = pos; } - if(!g_settings.channellist_new_zap_mode) { + if(!this->new_mode_active) { selected = pos; #if 0 /* TODO lastChList.store also called in adjustToChannelID, which is called @@ -2044,22 +2058,32 @@ void CChannelList::paintHead() timestr_len = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(timestr, true); // UTF-8 } - int iw1, iw2, ih = 0; + int iw1, iw2, iw3, ih = 0; frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_INFO, &iw1, &ih); frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MENU, &iw2, &ih); + if (g_settings.channellist_new_zap_mode) + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE, &iw3, &ih); // head frameBuffer->paintBoxRel(x,y, width,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_INFO, x + width - iw1 - 4, y, theight); //y+ 5 ); frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MENU, x + width - iw1 - iw2 - 8, y, theight);//y + 5); // icon for bouquet list button + if (g_settings.channellist_new_zap_mode) + frameBuffer->paintIcon(this->new_mode_active ? + NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE : NEUTRINO_ICON_BUTTON_MUTE_ZAP_INACTIVE, + x + width - iw1 - iw2 - iw3 - 12, y, theight); if (gotTime) { - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + width - iw1 - iw2 - 16 -timestr_len, + int iw3x = (g_settings.channellist_new_zap_mode) ? iw3 : -4; + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + width - iw1 - iw2 - iw3x - 16 -timestr_len, y+theight, timestr_len, timestr, COL_MENUHEAD, 0, true); // UTF-8 timestr_len += 4; } - timestr_len += iw1 + iw2 + 16; + + timestr_len += iw1 + iw2 + 12; + if (g_settings.channellist_new_zap_mode) + timestr_len += iw3 + 4; logo_off = timestr_len + 4; g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, width - timestr_len, name, COL_MENUHEAD, 0, true); // UTF-8 } diff --git a/src/gui/channellist.h b/src/gui/channellist.h index 10f1e6dc5..fb90c5334 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -80,6 +80,7 @@ private: bool displayNext; int info_height; + bool new_mode_active; int ChannelList_Rec; void paintDetails(int index); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 8272de1cb..3832fd033 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -703,7 +703,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.channellist_epgtext_align_right = configfile.getBool("channellist_epgtext_align_right" , false); g_settings.channellist_extended = configfile.getBool("channellist_extended" , true); g_settings.channellist_foot = configfile.getInt32("channellist_foot" , 1);//default next Event - g_settings.channellist_new_zap_mode = configfile.getInt32("channellist_new_zap_mode", 0); + g_settings.channellist_new_zap_mode = configfile.getInt32("channellist_new_zap_mode", 1); //screen configuration g_settings.screen_xres = configfile.getInt32("screen_xres", 100);