From b567c33f35bb2f24a6b433fa76bd5ef4f14b07b1 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 2 Apr 2015 21:05:51 +0200 Subject: [PATCH] nhttpd: fix switch tv<>radio in standby mode Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0a97efe317c27f4e05746cfd82fd2b073ef01ceb Author: Jacek Jendrzej Date: 2015-04-02 (Thu, 02 Apr 2015) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- .../tuxboxapi/coolstream/controlapi.cpp | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index 97657d516..1781cc762 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -332,17 +332,27 @@ void CControlAPI::SetModeCGI(CyhookHandler *hh) if (hh->ParamList["1"] == "radio") // switch to radio mode { - int mode = NeutrinoMessages::mode_radio; - NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::CHANGEMODE, CEventServer::INITID_HTTPD, (void *)&mode,sizeof(int)); - sleep(1); - NeutrinoAPI->UpdateBouquets(); + if(CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_standby){ + int mode = NeutrinoMessages::mode_radio; + NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::CHANGEMODE, CEventServer::INITID_HTTPD, (void *)&mode,sizeof(int)); + sleep(1); + NeutrinoAPI->UpdateBouquets(); + }else{ + extern CRemoteControl * g_RemoteControl; + g_RemoteControl->radioMode(); + } } else if (hh->ParamList["1"] == "tv") // switch to tv mode { - int mode = NeutrinoMessages::mode_tv; - NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::CHANGEMODE, CEventServer::INITID_HTTPD, (void *)&mode,sizeof(int)); - sleep(1); - NeutrinoAPI->UpdateBouquets(); + if(CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_standby){ + int mode = NeutrinoMessages::mode_tv; + NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::CHANGEMODE, CEventServer::INITID_HTTPD, (void *)&mode,sizeof(int)); + sleep(1); + NeutrinoAPI->UpdateBouquets(); + }else{ + extern CRemoteControl * g_RemoteControl; + g_RemoteControl->tvMode(); + } } else if (hh->ParamList["record"] == "start") // start record mode {