nhttpd::controlapi.cpp:execute more comands on/off only once (fix doubleclick)

Origin commit data
------------------
Branch: ni/coolstream
Commit: 9e3567dc09
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2012-10-22 (Mon, 22 Oct 2012)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2012-10-22 14:00:01 +02:00
parent f803f92af4
commit b0b4b885ed

View File

@@ -425,13 +425,21 @@ void CControlAPI::StandbyCGI(CyhookHandler *hh)
{
if (hh->ParamList["1"] == "on") // standby mode on
{
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::STANDBY_ON, CEventServer::INITID_HTTPD);
hh->SendOk();
if(CNeutrinoApp::getInstance()->getMode() == 4){
hh->WriteLn("standby is already on");
}else {
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::STANDBY_ON, CEventServer::INITID_HTTPD);
hh->SendOk();
}
}
else if (hh->ParamList["1"] == "off")// standby mode off
{
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::STANDBY_OFF, CEventServer::INITID_HTTPD);
hh->SendOk();
if(CNeutrinoApp::getInstance()->getMode() != 4){
hh->WriteLn("standby is already off");
}else {
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::STANDBY_OFF, CEventServer::INITID_HTTPD);
hh->SendOk();
}
}
else
hh->SendError();
@@ -448,12 +456,29 @@ void CControlAPI::RCCGI(CyhookHandler *hh)
{
if (!(hh->ParamList.empty()))
{
if (hh->ParamList["1"] == "lock") // lock remote control
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::LOCK_RC, CEventServer::INITID_HTTPD);
else if (hh->ParamList["1"] == "unlock")// unlock remote control
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::UNLOCK_RC, CEventServer::INITID_HTTPD);
else
static bool on_off = false;
if (hh->ParamList["1"] == "lock"){ // lock remote control
if(!on_off){
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::LOCK_RC, CEventServer::INITID_HTTPD);
on_off = true;
}else{
hh->WriteLn("remote is already locked");
return;
}
}
else if (hh->ParamList["1"] == "unlock"){// unlock remote control
if(on_off){
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::UNLOCK_RC, CEventServer::INITID_HTTPD);
on_off = false;
}else{
hh->WriteLn("remote is already unlocked");
return;
}
}
else{
hh->SendError();
}
}
hh->SendOk();
}
@@ -1472,16 +1497,25 @@ void CControlAPI::ZaptoCGI(CyhookHandler *hh)
SendAllCurrentVAPid(hh);
else if (hh->ParamList["1"] == "stopplayback")
{
NeutrinoAPI->Zapit->stopPlayBack();
NeutrinoAPI->Sectionsd->setPauseScanning(true);
hh->SendOk();
if(!NeutrinoAPI->Zapit->isPlayBackActive()){
hh->WriteLn("playback is already off");
}else{
NeutrinoAPI->Zapit->stopPlayBack();
NeutrinoAPI->Sectionsd->setPauseScanning(true);
hh->SendOk();
}
}
else if (hh->ParamList["1"] == "startplayback")
{
NeutrinoAPI->Zapit->startPlayBack();
NeutrinoAPI->Sectionsd->setPauseScanning(false);
dprintf("start playback requested..\n");
hh->SendOk();
if(NeutrinoAPI->Zapit->isPlayBackActive()){
hh->WriteLn("playback is already on");
}else{
NeutrinoAPI->Zapit->startPlayBack();
NeutrinoAPI->Sectionsd->setPauseScanning(false);
dprintf("start playback requested..\n");
hh->SendOk();
}
}
else if (hh->ParamList["1"] == "statusplayback")
hh->Write((char *) (NeutrinoAPI->Zapit->isPlayBackActive() ? "1" : "0"));