Merge branch 'dvbsi++' of coolstreamtech.de:cst-public-gui-neutrino into dvbsi++

Origin commit data
------------------
Branch: ni/coolstream
Commit: defe6a99bd
Author: [CST] Focus <focus.cst@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:
[CST] Focus
2012-10-22 18:05:51 +04:00
4 changed files with 61 additions and 20 deletions

View File

@@ -38,6 +38,7 @@
#include <gui/widget/stringinput.h> #include <gui/widget/stringinput.h>
const std::string CRCLock::NO_USER_INPUT = "noUserInput"; const std::string CRCLock::NO_USER_INPUT = "noUserInput";
bool CRCLock::locked = false;
// -- Menue Handler Interface // -- Menue Handler Interface
// -- Infinite Loop to lock remote control (until release lock key pressed) // -- Infinite Loop to lock remote control (until release lock key pressed)
@@ -45,6 +46,9 @@ const std::string CRCLock::NO_USER_INPUT = "noUserInput";
int CRCLock::exec(CMenuTarget* parent, const std::string &actionKey) int CRCLock::exec(CMenuTarget* parent, const std::string &actionKey)
{ {
if(locked)
return menu_return::RETURN_EXIT_ALL;
if (parent) if (parent)
parent->hide(); parent->hide();
@@ -55,7 +59,9 @@ int CRCLock::exec(CMenuTarget* parent, const std::string &actionKey)
return menu_return::RETURN_EXIT_ALL; return menu_return::RETURN_EXIT_ALL;
// -- Lockup Box // -- Lockup Box
locked = true;
lockBox(); lockBox();
locked = false;
ShowLocalizedMessage(LOCALE_RCLOCK_TITLE, LOCALE_RCLOCK_UNLOCKMSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO,450, no_input ? 5 : -1); ShowLocalizedMessage(LOCALE_RCLOCK_TITLE, LOCALE_RCLOCK_UNLOCKMSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO,450, no_input ? 5 : -1);
return menu_return::RETURN_EXIT_ALL; return menu_return::RETURN_EXIT_ALL;

View File

@@ -36,12 +36,13 @@
// //
class CRCLock: public CMenuTarget class CRCLock: public CMenuTarget
{ {
private:
void lockBox();
public: public:
static const std::string NO_USER_INPUT; static const std::string NO_USER_INPUT;
int exec(CMenuTarget* parent, const std::string & actionKey); int exec(CMenuTarget* parent, const std::string & actionKey);
void lockBox(); static bool locked;
}; };
#endif #endif

View File

@@ -3197,6 +3197,9 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby )
if(mode == mode_radio && g_Radiotext) if(mode == mode_radio && g_Radiotext)
g_Radiotext->radiotext_stop(); g_Radiotext->radiotext_stop();
lastMode = mode;
mode = mode_standby;
if(!fromDeepStandby && !CRecordManager::getInstance()->RecordingStatus()) { if(!fromDeepStandby && !CRecordManager::getInstance()->RecordingStatus()) {
g_Zapit->setStandby(true); g_Zapit->setStandby(true);
} else { } else {
@@ -3232,8 +3235,6 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby )
if(!CRecordManager::getInstance()->RecordingStatus()) if(!CRecordManager::getInstance()->RecordingStatus())
cpuFreq->SetCpuFreq(g_settings.standby_cpufreq * 1000 * 1000); cpuFreq->SetCpuFreq(g_settings.standby_cpufreq * 1000 * 1000);
lastMode = mode;
mode = mode_standby;
//fan speed //fan speed
if (g_info.has_fan) { if (g_info.has_fan) {
int fspeed = 1; int fspeed = 1;

View File

@@ -37,6 +37,8 @@
#include "gui/plugins.h"//for relodplugins #include "gui/plugins.h"//for relodplugins
#include <neutrino.h> #include <neutrino.h>
#include <driver/screenshot.h> #include <driver/screenshot.h>
#include "gui/rc_lock.h"
// yhttpd // yhttpd
#include "yhttpd.h" #include "yhttpd.h"
#include "ytypes_globals.h" #include "ytypes_globals.h"
@@ -425,13 +427,21 @@ void CControlAPI::StandbyCGI(CyhookHandler *hh)
{ {
if (hh->ParamList["1"] == "on") // standby mode on if (hh->ParamList["1"] == "on") // standby mode on
{ {
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::STANDBY_ON, CEventServer::INITID_HTTPD); if(CNeutrinoApp::getInstance()->getMode() == 4){
hh->SendOk(); 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 else if (hh->ParamList["1"] == "off")// standby mode off
{ {
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::STANDBY_OFF, CEventServer::INITID_HTTPD); if(CNeutrinoApp::getInstance()->getMode() != 4){
hh->SendOk(); hh->WriteLn("standby is already off");
}else {
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::STANDBY_OFF, CEventServer::INITID_HTTPD);
hh->SendOk();
}
} }
else else
hh->SendError(); hh->SendError();
@@ -448,12 +458,26 @@ void CControlAPI::RCCGI(CyhookHandler *hh)
{ {
if (!(hh->ParamList.empty())) if (!(hh->ParamList.empty()))
{ {
if (hh->ParamList["1"] == "lock") // lock remote control if (hh->ParamList["1"] == "lock"){ // lock remote control
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::LOCK_RC, CEventServer::INITID_HTTPD); if(!CRCLock::locked){
else if (hh->ParamList["1"] == "unlock")// unlock remote control NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::LOCK_RC, CEventServer::INITID_HTTPD);
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::UNLOCK_RC, CEventServer::INITID_HTTPD); }else{
else hh->WriteLn("remote is already locked");
return;
}
}
else if (hh->ParamList["1"] == "unlock"){// unlock remote control
if(CRCLock::locked){
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::UNLOCK_RC, CEventServer::INITID_HTTPD);
}else{
hh->WriteLn("remote is already unlocked");
return;
}
}
else{
hh->SendError(); hh->SendError();
}
} }
hh->SendOk(); hh->SendOk();
} }
@@ -1472,16 +1496,25 @@ void CControlAPI::ZaptoCGI(CyhookHandler *hh)
SendAllCurrentVAPid(hh); SendAllCurrentVAPid(hh);
else if (hh->ParamList["1"] == "stopplayback") else if (hh->ParamList["1"] == "stopplayback")
{ {
NeutrinoAPI->Zapit->stopPlayBack(); if(!NeutrinoAPI->Zapit->isPlayBackActive()){
NeutrinoAPI->Sectionsd->setPauseScanning(true); hh->WriteLn("playback is already off");
hh->SendOk(); }else{
NeutrinoAPI->Zapit->stopPlayBack();
NeutrinoAPI->Sectionsd->setPauseScanning(true);
hh->SendOk();
}
} }
else if (hh->ParamList["1"] == "startplayback") else if (hh->ParamList["1"] == "startplayback")
{ {
NeutrinoAPI->Zapit->startPlayBack(); if(NeutrinoAPI->Zapit->isPlayBackActive()){
NeutrinoAPI->Sectionsd->setPauseScanning(false); hh->WriteLn("playback is already on");
dprintf("start playback requested..\n"); }else{
hh->SendOk(); NeutrinoAPI->Zapit->startPlayBack();
NeutrinoAPI->Sectionsd->setPauseScanning(false);
dprintf("start playback requested..\n");
hh->SendOk();
}
} }
else if (hh->ParamList["1"] == "statusplayback") else if (hh->ParamList["1"] == "statusplayback")
hh->Write((char *) (NeutrinoAPI->Zapit->isPlayBackActive() ? "1" : "0")); hh->Write((char *) (NeutrinoAPI->Zapit->isPlayBackActive() ? "1" : "0"));