yWeb: Synchronize volume/audiomute settings yWeb => GUI

This commit is contained in:
M. Liebmann
2014-02-12 05:45:51 +01:00
parent 63d66538ce
commit 92fce346c0
7 changed files with 37 additions and 4 deletions

View File

@@ -781,12 +781,14 @@ void CControlAPI::VolumeCGI(CyhookHandler *hh)
}
else if (hh->ParamList["1"].compare("mute") == 0)
{
NeutrinoAPI->Zapit->muteAudio(true);
char mute = 1;
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::EVT_SET_MUTE, CEventServer::INITID_HTTPD, (void *)&mute, sizeof(char));
hh->SendOk();
}
else if (hh->ParamList["1"].compare("unmute") == 0)
{
NeutrinoAPI->Zapit->muteAudio(false);
char mute = 0;
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::EVT_SET_MUTE, CEventServer::INITID_HTTPD, (void *)&mute, sizeof(char));
hh->SendOk();
}
else if (hh->ParamList["1"].compare("status") == 0) { // Mute status
@@ -794,7 +796,7 @@ void CControlAPI::VolumeCGI(CyhookHandler *hh)
}
else if(hh->ParamList["1"]!="") { //set volume
char vol = atol( hh->ParamList["1"].c_str() );
NeutrinoAPI->Zapit->setVolume(vol,vol);
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::EVT_SET_VOLUME, CEventServer::INITID_HTTPD, (void *)&vol, sizeof(char));
hh->SendOk();
}
else

View File

@@ -132,6 +132,8 @@ CNeutrinoAPI::CNeutrinoAPI()
EventServer->registerEvent2( NeutrinoMessages::RELOAD_SETUP, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");//reload neutrino conf
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");
EventServer->registerEvent2( NeutrinoMessages::EVT_SET_MUTE, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");
EventServer->registerEvent2( NeutrinoMessages::EVT_SET_VOLUME, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");
}
//-------------------------------------------------------------------------