diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index c0b4df985..d3b51f91f 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1461,7 +1461,7 @@ void CChannelList::virtual_zap_mode(bool up) break; } } - g_InfoViewer->clearVirtualZapMode(); + g_InfoViewer->resetSwitchMode(); //disable virtual_zap_mode if (doZap) { if(g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR] == 0) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index f1eeddc74..0b43be313 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -142,7 +142,7 @@ void CInfoViewer::Init() showButtonBar = false; //gotTime = g_Sectionsd->getIsTimeSet (); gotTime = timeset; - virtual_zap_mode = false; + zap_mode = IV_MODE_DEFAULT; newfreq = true; chanready = 1; fileplay = 0; @@ -431,7 +431,7 @@ void CInfoViewer::paintBody() { int h_body = InfoHeightY - header_height + (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0); - if(virtual_zap_mode) + if(zap_mode) h_body -= (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0); if (body == NULL) @@ -440,8 +440,8 @@ void CInfoViewer::paintBody() body->setDimensionsAll(ChanInfoX, ChanNameY + header_height, BoxEndX-ChanInfoX, h_body); //set corner and shadow modes, consider virtual zap mode - body->setCorner(RADIUS_LARGE, virtual_zap_mode ? CORNER_BOTTOM : CORNER_NONE); - body->enableShadow(virtual_zap_mode ? CC_SHADOW_ON : CC_SHADOW_RIGHT); + body->setCorner(RADIUS_LARGE, (zap_mode) ? CORNER_BOTTOM : CORNER_NONE); + body->enableShadow(zap_mode ? CC_SHADOW_ON : CC_SHADOW_RIGHT); body->setColorBody(g_settings.theme.infobar_gradient_body ? COL_MENUHEAD_PLUS_0 : COL_INFOBAR_PLUS_0); body->enableColBodyGradient(g_settings.theme.infobar_gradient_body, COL_INFOBAR_PLUS_0, g_settings.theme.infobar_gradient_body_direction); @@ -702,7 +702,7 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap ChannelName = Channel; bool new_chan = false; - if (virtual_zap_mode) { + if (zap_mode & IV_MODE_VIRTUAL_ZAP) { if (g_RemoteControl->current_channel_id != new_channel_id) { col_NumBoxText = COL_MENUHEAD_TEXT; } @@ -895,7 +895,7 @@ void CInfoViewer::setInfobarTimeout(int timeout_ext) void CInfoViewer::loop(bool show_dot) { bool hideIt = true; - virtual_zap_mode = false; + resetSwitchMode(); //no virtual zap //bool fadeOut = false; timeoutEnd=0;; setInfobarTimeout(); @@ -950,7 +950,7 @@ void CInfoViewer::loop(bool show_dot) //infoViewerBB->showIcon_CA_Status(0); infoViewerBB->showIcon_Resolution(); } else if ((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) && ((msg == CRCInput::RC_right) || (msg == CRCInput::RC_left ))) { - virtual_zap_mode = true; + setSwitchMode(IV_MODE_VIRTUAL_ZAP); res = messages_return::cancel_all; hideIt = true; } else if ((msg == NeutrinoMessages::EVT_RECORDMODE) && @@ -1029,7 +1029,7 @@ void CInfoViewer::loop(bool show_dot) g_RCInput->killTimer (sec_timer_id); fader.StopFade(); - if (virtual_zap_mode) { + if (zap_mode & IV_MODE_VIRTUAL_ZAP) { /* if bouquet cycle set, do virtual over current bouquet */ if (/*g_settings.zap_cycle && */ /* (bouquetList != NULL) && */ !(bouquetList->Bouquets.empty())) bouquetList->Bouquets[bouquetList->getActiveBouquetNumber()]->channelList->virtual_zap_mode(msg == CRCInput::RC_right); @@ -1444,7 +1444,7 @@ int CInfoViewer::handleMsg (const neutrino_msg_t msg, neutrino_msg_data_t data) void CInfoViewer::sendNoEpg(const t_channel_id for_channel_id) { - if (!virtual_zap_mode) { + if (!zap_mode/* & IV_MODE_DEFAULT*/) { char *p = new char[sizeof(t_channel_id)]; memcpy(p, &for_channel_id, sizeof(t_channel_id)); g_RCInput->postMsg (NeutrinoMessages::EVT_NOEPG_YET, (const neutrino_msg_data_t) p, false); @@ -1968,7 +1968,7 @@ void CInfoViewer::showInfoFile() //paint info, don't save background, if already painted, global hide is also done by killTitle() bool save_bg = !infobar_txt->isPainted(); - if (new_text || virtual_zap_mode) + if (new_text || (zap_mode & IV_MODE_VIRTUAL_ZAP)) infobar_txt->paint(save_bg); } diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index a7300a7d6..6fe7044a9 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -57,6 +57,7 @@ class CInfoViewer bool gotTime; bool recordModeActive; + #ifndef SKIP_CA_STATUS bool CA_Status; #endif @@ -110,6 +111,7 @@ class CInfoViewer bool casysChange; bool channellogoChange; uint32_t lcdUpdateTimer; + int zap_mode; void paintBackground(int col_Numbox); void paintHead(); @@ -147,7 +149,7 @@ class CInfoViewer public: bool chanready; bool is_visible; - bool virtual_zap_mode; + char aspectRatio; uint32_t sec_timer_id; @@ -178,7 +180,27 @@ class CInfoViewer //void Set_CA_Status(int Status); int handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data); - void clearVirtualZapMode() {virtual_zap_mode = false;} + + enum{ + IV_MODE_DEFAULT = 0, + IV_MODE_VIRTUAL_ZAP = 1, + IV_MODE_NUMBER_ZAP = 2 + };/*iv_switch_mode_t*/ + /**sets mode for infoviewer. + * @param[in] mode + * @li IV_MODE_DEFAULT + * @li IV_MODE_VIRTUAL_ZAP means the virtual zap mode, user is typing keys for virtual channel switch + * @li IV_MODE_NUMBER_ZAP means number mode, user is typing number keys into screen + * @return + * void + * @see + * resetSwitchMode() + * getSwitchMode() + */ + void setSwitchMode(const int& mode) {zap_mode = mode;} + int getSwitchMode() {return zap_mode;} + void resetSwitchMode() {setSwitchMode(IV_MODE_DEFAULT);} + void changePB(); void ResetPB(); void showSNR(); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index d5f39d074..1dd14710d 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2135,6 +2135,7 @@ void CNeutrinoApp::quickZap(int msg) void CNeutrinoApp::numericZap(int msg) { StopSubtitles(); + g_InfoViewer->setSwitchMode(CInfoViewer::IV_MODE_NUMBER_ZAP); int res = channelList->numericZap( msg ); StartSubtitles(res < 0); if (res >= 0 && CRCInput::isNumeric(msg)) { @@ -2771,7 +2772,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) } /* ================================== KEYS ================================================ */ - if( msg == CRCInput::RC_ok || (!g_InfoViewer->virtual_zap_mode && (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites))) { + if( msg == CRCInput::RC_ok || (!g_InfoViewer->getSwitchMode() && (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites))) { if( (mode == mode_tv) || (mode == mode_radio) || (mode == mode_ts) || (mode == mode_webtv)) { showChannelList(msg); return messages_return::handled;