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: d90b967328
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2011-11-13 (Sun, 13 Nov 2011)
This commit is contained in:
Michael Liebmann
2011-11-13 17:18:33 +00:00
parent 2e46788cd9
commit 4595ea6f41
5 changed files with 35 additions and 10 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 363 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 363 B

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -104,6 +104,7 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl
this->historyMode = phistoryMode; this->historyMode = phistoryMode;
vlist = _vlist; vlist = _vlist;
selected_chid = 0; selected_chid = 0;
this->new_mode_active = false;
footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+6; //initial height value for buttonbar 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); //printf("************ NEW LIST %s : %x\n", name.c_str(), this);fflush(stdout);
} }
@@ -467,6 +468,7 @@ int CChannelList::show()
return res; return res;
} }
this->new_mode_active = 0;
int fw = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth(); 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); 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)); 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); frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MENU, &icol_w, &icol_h);
theight = std::max(theight, 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(); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight();
if (fheight == 0) if (fheight == 0)
fheight = 1; /* avoid crash on invalid font */ fheight = 1; /* avoid crash on invalid font */
@@ -639,7 +647,7 @@ int CChannelList::show()
selected=0; selected=0;
liststart = (selected/listmaxshow)*listmaxshow; liststart = (selected/listmaxshow)*listmaxshow;
paint(); paint();
if(g_settings.channellist_new_zap_mode && SameTP()) { if(this->new_mode_active && SameTP()) {
actzap = true; actzap = true;
zapTo(selected); zapTo(selected);
} }
@@ -648,7 +656,7 @@ int CChannelList::show()
selected=chanlist.size()-1; selected=chanlist.size()-1;
liststart = (selected/listmaxshow)*listmaxshow; liststart = (selected/listmaxshow)*listmaxshow;
paint(); paint();
if(g_settings.channellist_new_zap_mode && SameTP()) { if(this->new_mode_active && SameTP()) {
actzap = true; actzap = true;
zapTo(selected); zapTo(selected);
} }
@@ -677,7 +685,7 @@ int CChannelList::show()
showChannelLogo(); showChannelLogo();
} }
if(g_settings.channellist_new_zap_mode && SameTP()) { if(this->new_mode_active && SameTP()) {
actzap = true; actzap = true;
zapTo(selected); zapTo(selected);
} }
@@ -709,7 +717,7 @@ int CChannelList::show()
showChannelLogo(); showChannelLogo();
} }
if(g_settings.channellist_new_zap_mode && SameTP()) { if(this->new_mode_active && SameTP()) {
actzap = true; actzap = true;
zapTo(selected); zapTo(selected);
} }
@@ -766,6 +774,11 @@ int CChannelList::show()
loop=false; 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)) { else if (CRCInput::isNumeric(msg) && (this->historyMode || g_settings.sms_channel)) {
if (this->historyMode) { //numeric zap if (this->historyMode) { //numeric zap
switch (msg) { switch (msg) {
@@ -898,6 +911,7 @@ int CChannelList::show()
printf("CChannelList:: bouquetList->exec res %d\n", res); printf("CChannelList:: bouquetList->exec res %d\n", res);
} }
CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO);
this->new_mode_active = 0;
if(NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode()) if(NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode())
return -1; return -1;
@@ -1150,11 +1164,11 @@ void CChannelList::zapTo(int pos, bool /* forceStoreToLastChannels */)
if (bouquetList != NULL) { if (bouquetList != NULL) {
CNeutrinoApp::getInstance()->channelList->adjustToChannelID(chan->channel_id); CNeutrinoApp::getInstance()->channelList->adjustToChannelID(chan->channel_id);
} }
if(g_settings.channellist_new_zap_mode) if(this->new_mode_active)
selected_in_new_mode = pos; selected_in_new_mode = pos;
} }
if(!g_settings.channellist_new_zap_mode) { if(!this->new_mode_active) {
selected = pos; selected = pos;
#if 0 #if 0
/* TODO lastChList.store also called in adjustToChannelID, which is called /* 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 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_INFO, &iw1, &ih);
frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MENU, &iw2, &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 // head
frameBuffer->paintBoxRel(x,y, width,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round 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_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 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) { 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 y+theight, timestr_len, timestr, COL_MENUHEAD, 0, true); // UTF-8
timestr_len += 4; 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; 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 g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, width - timestr_len, name, COL_MENUHEAD, 0, true); // UTF-8
} }

View File

@@ -80,6 +80,7 @@ private:
bool displayNext; bool displayNext;
int info_height; int info_height;
bool new_mode_active;
int ChannelList_Rec; int ChannelList_Rec;
void paintDetails(int index); void paintDetails(int index);

View File

@@ -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_epgtext_align_right = configfile.getBool("channellist_epgtext_align_right" , false);
g_settings.channellist_extended = configfile.getBool("channellist_extended" , true); g_settings.channellist_extended = configfile.getBool("channellist_extended" , true);
g_settings.channellist_foot = configfile.getInt32("channellist_foot" , 1);//default next Event 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 //screen configuration
g_settings.screen_xres = configfile.getInt32("screen_xres", 100); g_settings.screen_xres = configfile.getInt32("screen_xres", 100);