From 6a821fe2a58ce9419de501ab2cb378084d9aa1a2 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 27 Jan 2014 21:10:41 +0100 Subject: [PATCH 1/6] - CLuaInstance::MenuAddItem: add 'next' and 'cancel' items --- src/gui/luainstance.cpp | 4 ++++ src/gui/widget/menue.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index ed83ca2b3..fe32b75a6 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -886,6 +886,10 @@ int CLuaInstance::MenuAddItem(lua_State *L) std::string type; tableLookup(L, "type", type); if (type == "back") { m->m->addItem(GenericMenuBack); + } else if (type == "next") { + m->m->addItem(GenericMenuNext); + } else if (type == "cancel") { + m->m->addItem(GenericMenuCancel); } else if (type == "separator") { m->m->addItem(GenericMenuSeparator); } else if (type == "separatorline") { diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index d80d446c3..c6e9c234e 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -650,6 +650,7 @@ class CMenuSelectorTarget : public CMenuTarget extern CMenuSeparator * const GenericMenuSeparator; extern CMenuSeparator * const GenericMenuSeparatorLine; extern CMenuForwarder * const GenericMenuBack; +extern CMenuForwarder * const GenericMenuNext; extern CMenuForwarder * const GenericMenuCancel; #endif From 9855a220befd8a2cf77ef65af781b5b2ae2a08ab Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 28 Jan 2014 10:29:28 +0100 Subject: [PATCH 2/6] webif standby -add option CEC standby off (dont use TV off) --- src/driver/rcinput.cpp | 8 ++++-- src/neutrino.cpp | 8 +++++- src/neutrinoMessages.h | 3 ++- .../tuxboxapi/coolstream/controlapi.cpp | 25 +++++++++++++------ .../tuxboxapi/coolstream/neutrinoapi.cpp | 3 ++- 5 files changed, 35 insertions(+), 12 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 5d24f69c6..b1b2d895f 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -857,8 +857,12 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 *msg = NeutrinoMessages::RELOAD_SETUP; *data = 0; break; - case NeutrinoMessages::EVT_HDMI_CEC_ON: - *msg = NeutrinoMessages::EVT_HDMI_CEC_ON; + case NeutrinoMessages::EVT_HDMI_CEC_VIEW_ON: + *msg = NeutrinoMessages::EVT_HDMI_CEC_VIEW_ON; + *data = 0; + break; + case NeutrinoMessages::EVT_HDMI_CEC_STANDBY: + *msg = NeutrinoMessages::EVT_HDMI_CEC_STANDBY; *data = 0; break; default: diff --git a/src/neutrino.cpp b/src/neutrino.cpp index fdfa4ea33..72e369df9 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3035,12 +3035,18 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) // ShowHint(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_EXTRA_ZAPIT_SDT_CHANGED), // CMessageBox::mbrBack,CMessageBox::mbBack, NEUTRINO_ICON_INFO); } - else if (msg == NeutrinoMessages::EVT_HDMI_CEC_ON) { + else if (msg == NeutrinoMessages::EVT_HDMI_CEC_VIEW_ON) { if(g_settings.hdmi_cec_view_on) videoDecoder->SetCECAutoView(g_settings.hdmi_cec_view_on); return messages_return::handled; } + else if (msg == NeutrinoMessages::EVT_HDMI_CEC_STANDBY) { + if(g_settings.hdmi_cec_standby) + videoDecoder->SetCECAutoStandby(g_settings.hdmi_cec_standby); + + return messages_return::handled; + } if ((msg >= CRCInput::RC_WithData) && (msg < CRCInput::RC_WithData + 0x10000000)) delete [] (unsigned char*) data; diff --git a/src/neutrinoMessages.h b/src/neutrinoMessages.h index 28c60dd58..51a1b2cab 100644 --- a/src/neutrinoMessages.h +++ b/src/neutrinoMessages.h @@ -152,7 +152,8 @@ struct NeutrinoMessages { EVT_EIT_COMPLETE = CRCInput::RC_WithData + 24, /* data: (t_channel_id *) */ EVT_BACK_ZAP_COMPLETE = CRCInput::RC_WithData + 25, /* data: (t_channel_id *) */ - EVT_HDMI_CEC_ON = CRCInput::RC_WithData + 26 + EVT_HDMI_CEC_VIEW_ON = CRCInput::RC_WithData + 26, + EVT_HDMI_CEC_STANDBY = CRCInput::RC_WithData + 27 }; enum { diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index e843696df..c1e23697c 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -430,30 +430,41 @@ void CControlAPI::StandbyCGI(CyhookHandler *hh) CEC_HDMI_off = true; } } - //dont use CEC with standbyoff --- use: control/standby?off&cec=off - if(g_settings.hdmi_cec_view_on && CEC_HDMI_off){ - videoDecoder->SetCECAutoView(0); - } if (hh->ParamList["1"] == "on") // standby mode on { + //dont use CEC with standbyoff (TV off) --- use: control/standby?off&cec=off + if(g_settings.hdmi_cec_standby && CEC_HDMI_off){ + videoDecoder->SetCECAutoStandby(0); + } + if(CNeutrinoApp::getInstance()->getMode() != 4) NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::STANDBY_ON, CEventServer::INITID_HTTPD); hh->SendOk(); + + if(g_settings.hdmi_cec_standby && CEC_HDMI_off){//dont use CEC with standbyoff (TV off) + NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::EVT_HDMI_CEC_STANDBY, CEventServer::INITID_HTTPD); + } } else if (hh->ParamList["1"] == "off")// standby mode off { + //dont use CEC with with view on (TV on) --- use: control/standby?off&cec=off + if(g_settings.hdmi_cec_view_on && CEC_HDMI_off){ + videoDecoder->SetCECAutoView(0); + } + NeutrinoAPI->Zapit->setStandby(false); if(CNeutrinoApp::getInstance()->getMode() == 4) NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::STANDBY_OFF, CEventServer::INITID_HTTPD); hh->SendOk(); + + if(g_settings.hdmi_cec_view_on && CEC_HDMI_off){//dont use CEC with view on (TV on) + NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::EVT_HDMI_CEC_VIEW_ON, CEventServer::INITID_HTTPD); + } } else hh->SendError(); - if(g_settings.hdmi_cec_view_on && CEC_HDMI_off){//dont use CEC with standbyoff - NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::EVT_HDMI_CEC_ON, CEventServer::INITID_HTTPD); - } } else if(CNeutrinoApp::getInstance()->getMode() == 4)//mode_standby = 4 diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp index dd571c050..4f285b586 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp @@ -130,7 +130,8 @@ CNeutrinoAPI::CNeutrinoAPI() EventServer->registerEvent2( NeutrinoMessages::LOCK_RC, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); EventServer->registerEvent2( NeutrinoMessages::UNLOCK_RC, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); EventServer->registerEvent2( NeutrinoMessages::RELOAD_SETUP, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");//reload neutrino conf - EventServer->registerEvent2( NeutrinoMessages::EVT_HDMI_CEC_ON, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); + EventServer->registerEvent2( NeutrinoMessages::EVT_HDMI_CEC_VIEW_ON, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); + EventServer->registerEvent2( NeutrinoMessages::EVT_HDMI_CEC_STANDBY, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); } //------------------------------------------------------------------------- From da2738cd9e80e2403c66da841e0696edcf63e05a Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Mon, 27 Jan 2014 18:33:38 +0100 Subject: [PATCH 3/6] CLuaMenuForwarder: Fix error msg --- src/gui/luainstance.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index fe32b75a6..03d014a65 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -734,7 +734,7 @@ int CLuaMenuForwarder::exec(CMenuTarget* /*parent*/, const std::string & /*actio lua_pushstring(L, luaId.c_str()); int status = lua_pcall(L, 1 /* one arg */, 1 /* one result */, 0); if (status) { - fprintf(stderr, "[CLuaInstance::%s] error in script: %s\n", __func__, lua_tostring(L, -1)); + fprintf(stderr, "[CLuaMenuForwarder::%s] error in script: %s\n", __func__, lua_tostring(L, -1)); ShowMsg2UTF("Lua script error:", lua_tostring(L, -1), CMsgBox::mbrBack, CMsgBox::mbBack); } if (lua_isnumber(L, -1)) From 65859318d01e0244be6ac957219599bae46fd59a Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Tue, 28 Jan 2014 12:54:07 +0100 Subject: [PATCH 4/6] Fix display volumebar when channellist is visible --- src/gui/volumebar.cpp | 4 +++- src/neutrino.cpp | 3 +++ src/neutrino.h | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gui/volumebar.cpp b/src/gui/volumebar.cpp index db88a3cbc..74abf4373 100644 --- a/src/gui/volumebar.cpp +++ b/src/gui/volumebar.cpp @@ -124,7 +124,9 @@ void CVolumeBar::initVolumeBarPosition() if (( neutrino->getMode() != CNeutrinoApp::mode_scart ) && ( neutrino->getMode() != CNeutrinoApp::mode_audio) && ( neutrino->getMode() != CNeutrinoApp::mode_pic)) { if ((neutrino->isMuted()) && (!g_settings.mode_clock)) x_corr = mute_dx + h_spacer; - if (g_settings.mode_clock) + if (CNeutrinoApp::getInstance()->getChannellistIsVisible() == true) + y += std::max(39, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()) + v_spacer; + else if (g_settings.mode_clock) y = clock_y + clock_height + v_spacer + SHADOW_OFFSET; } x = sw - width - x_corr; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 72e369df9..6ef1f9349 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -221,6 +221,7 @@ CNeutrinoApp::CNeutrinoApp() current_muted = 0; recordingstatus = 0; g_channel_list_changed = false; + channellist_visible = false; } /*------------------------------------------------------------------------------------- @@ -2365,6 +2366,7 @@ int CNeutrinoApp::showChannelList(const neutrino_msg_t _msg, bool from_menu) { neutrino_msg_t msg = _msg; InfoClock->enableInfoClock(false); + channellist_visible = true; StopSubtitles(); @@ -2448,6 +2450,7 @@ _repeat: goto _show; } + channellist_visible = false; if (!from_menu) InfoClock->enableInfoClock(true); diff --git a/src/neutrino.h b/src/neutrino.h index 9bbe88c7f..67a26d02a 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -103,6 +103,7 @@ private: int radiosort[LIST_MODE_LAST]; CMoviePluginChangeExec *MoviePluginChanger; + bool channellist_visible; void SDT_ReloadChannels(); void setupNetwork( bool force= false ); @@ -211,6 +212,7 @@ public: void stopDaemonsForFlash(); int showChannelList(const neutrino_msg_t msg, bool from_menu = false); CPersonalizeGui & getPersonalizeGui() { return personalize; } + bool getChannellistIsVisible() { return channellist_visible; } }; #endif From 02cb09ce7ed0fdb0388a4235409690dc5779a7f8 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 28 Jan 2014 16:10:19 +0400 Subject: [PATCH 5/6] neutrino.cpp: add zapTo(), reuse common code for zap without wait --- src/neutrino.cpp | 40 ++++++++++++++++------------------------ src/neutrino.h | 1 + 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 6ef1f9349..62fbf6acd 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2003,15 +2003,6 @@ void CNeutrinoApp::quickZap(int msg) int res; StopSubtitles(); - printf("CNeutrinoApp::quickZap haveFreeFrontend %d\n", CFEManager::getInstance()->haveFreeFrontend()); -#if 0 - if(!CFEManager::getInstance()->haveFreeFrontend()) - { - res = channelList->numericZap(g_settings.key_zaphistory); - StartSubtitles(res < 0); - return; - } -#endif bool ret; if(!bouquetList->Bouquets.empty()) ret = bouquetList->Bouquets[bouquetList->getActiveBouquetNumber()]->channelList->quickZap(msg, g_settings.zap_cycle); @@ -2457,6 +2448,17 @@ _repeat: return ((nNewChannel >= 0) ? menu_return::RETURN_EXIT_ALL : menu_return::RETURN_REPAINT); } +void CNeutrinoApp::zapTo(t_channel_id channel_id) +{ + bool recordingStatus = CRecordManager::getInstance()->RecordingStatus(channel_id); + if (!recordingStatus || (recordingStatus && CRecordManager::getInstance()->TimeshiftOnly()) || + (recordingStatus && channelList->SameTP(channel_id))) { + + dvbsub_stop(); + g_Zapit->zapTo_serviceID_NOWAIT(channel_id); + } +} + int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) { int res = 0; @@ -2751,14 +2753,10 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) //zap to rec channel in standby-mode if(mode == mode_standby){ CTimerd::RecordingInfo * eventinfo = (CTimerd::RecordingInfo *) data; - bool recordingStatus = CRecordManager::getInstance()->RecordingStatus(eventinfo->channel_id); t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); - if( !recordingStatus && (eventinfo->channel_id != live_channel_id) && channelList->SameTP(eventinfo->channel_id) && !(SAME_TRANSPONDER(live_channel_id, eventinfo->channel_id)) ){ - dvbsub_stop(); - t_channel_id channel_id=eventinfo->channel_id; - g_Zapit->zapTo_serviceID_NOWAIT(channel_id); - } + if((eventinfo->channel_id != live_channel_id) && !(SAME_TRANSPONDER(live_channel_id, eventinfo->channel_id))) + zapTo(eventinfo->channel_id); } if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) { @@ -2788,8 +2786,8 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) else if( msg == NeutrinoMessages::ZAPTO) { CTimerd::EventInfo * eventinfo = (CTimerd::EventInfo *) data; if (eventinfo->channel_id != CZapit::getInstance()->GetCurrentChannelID()){ - if( (recordingstatus == 0) || (recordingstatus && CRecordManager::getInstance()->TimeshiftOnly()) || (recordingstatus && CFEManager::getInstance()->haveFreeFrontend()) || - (recordingstatus && channelList->SameTP(eventinfo->channel_id)) ) { + if( (recordingstatus == 0) || (recordingstatus && CRecordManager::getInstance()->TimeshiftOnly()) || + (recordingstatus && channelList->SameTP(eventinfo->channel_id)) ) { bool isTVMode = CServiceManager::getInstance()->IsChannelTVChannel(eventinfo->channel_id); dvbsub_stop(); @@ -2839,13 +2837,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) if( g_settings.recording_zap_on_announce && (mode != mode_standby) && (eventinfo->channel_id != CZapit::getInstance()->GetCurrentChannelID())) { CRecordManager::getInstance()->StopAutoRecord(); - bool recordingStatus = CRecordManager::getInstance()->RecordingStatus(); - if ( !recordingStatus || (recordingStatus && CRecordManager::getInstance()->TimeshiftOnly()) || (recordingStatus && CFEManager::getInstance()->haveFreeFrontend()) || - (recordingStatus && channelList->SameTP(eventinfo->channel_id)) ){ - dvbsub_stop(); - t_channel_id channel_id=eventinfo->channel_id; - g_Zapit->zapTo_serviceID_NOWAIT(channel_id); - } + zapTo(eventinfo->channel_id); } if(( mode != mode_scart ) && ( mode != mode_standby ) && g_settings.recording_startstop_msg) { std::string name = g_Locale->getText(LOCALE_RECORDTIMER_ANNOUNCE); diff --git a/src/neutrino.h b/src/neutrino.h index 67a26d02a..821468789 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -213,6 +213,7 @@ public: int showChannelList(const neutrino_msg_t msg, bool from_menu = false); CPersonalizeGui & getPersonalizeGui() { return personalize; } bool getChannellistIsVisible() { return channellist_visible; } + void zapTo(t_channel_id channel_id); }; #endif From 828f9e58564fa62e273ea053b22860306e581ddf Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 28 Jan 2014 16:16:35 +0400 Subject: [PATCH 6/6] gui/cam_menu.cpp: handle CA_MESSAGE_MSG_CHANNEL_CHANGE msg --- src/gui/cam_menu.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/gui/cam_menu.cpp b/src/gui/cam_menu.cpp index d0dc13e7f..94224436c 100644 --- a/src/gui/cam_menu.cpp +++ b/src/gui/cam_menu.cpp @@ -435,6 +435,19 @@ int CCAMMenuHandler::handleCamMsg (const neutrino_msg_t msg, neutrino_msg_data_t } else if(MsgId == CA_MESSAGE_MSG_MMI_TEXT) { printf("CCAMMenuHandler::handleCamMsg: text\n"); + } + else if(MsgId == CA_MESSAGE_MSG_CHANNEL_CHANGE) { + if (!(Msg.Flags & CA_MESSAGE_HAS_PARAM1_LONG)) + return -1; + + t_channel_id chid = Msg.Msg.ParamLong[0]; + printf("CCAMMenuHandler::handleCamMsg: CA_MESSAGE_MSG_CHANNEL_CHANGE: %" PRIx64 "\n", chid); + CZapitChannel * channel = CServiceManager::getInstance()->FindChannel48(chid); + if (!channel) { + printf("CCAMMenuHandler::handleCamMsg: channel %" PRIx64 "not found\n", chid); + return -1; + } + CNeutrinoApp::getInstance()->zapTo(channel->getChannelID()); } else ret = -1; //printf("CCAMMenuHandler::handleCamMsg: return %d\n", ret);