mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-01 09:51:13 +02:00
yWeb: Synchronize volume/audiomute settings yWeb => GUI
Origin commit data
------------------
Branch: ni/coolstream
Commit: 92fce346c0
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2014-02-12 (Wed, 12 Feb 2014)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -865,6 +865,14 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6
|
||||
*msg = NeutrinoMessages::EVT_HDMI_CEC_STANDBY;
|
||||
*data = 0;
|
||||
break;
|
||||
case NeutrinoMessages::EVT_SET_MUTE :
|
||||
*msg = NeutrinoMessages::EVT_SET_MUTE;
|
||||
*data = *(char*) p;
|
||||
break;
|
||||
case NeutrinoMessages::EVT_SET_VOLUME :
|
||||
*msg = NeutrinoMessages::EVT_SET_VOLUME;
|
||||
*data = *(char*) p;
|
||||
break;
|
||||
default:
|
||||
printf("[neutrino] event INITID_HTTPD - unknown eventID 0x%x\n", emsg.eventID );
|
||||
}
|
||||
|
@@ -74,6 +74,15 @@ void CVolume::setvol(int vol)
|
||||
CZapit::getInstance()->SetVolume(vol);
|
||||
}
|
||||
|
||||
void CVolume::setVolumeExt(int vol)
|
||||
{
|
||||
g_settings.current_volume = vol;
|
||||
CZapit::getInstance()->SetVolume(vol);
|
||||
CVFD::getInstance()->showVolume(vol);
|
||||
if (CNeutrinoApp::getInstance()->isMuted() && vol > 0)
|
||||
CAudioMute::getInstance()->AudioMute(false, true);
|
||||
}
|
||||
|
||||
void CVolume::setVolume(const neutrino_msg_t key)
|
||||
{
|
||||
neutrino_msg_t msg = key;
|
||||
|
@@ -48,6 +48,7 @@ class CVolume : public CChangeObserver
|
||||
|
||||
void setvol(int vol);
|
||||
void setVolume(const neutrino_msg_t key);
|
||||
void setVolumeExt(int vol);
|
||||
|
||||
void SetCurrentPid(int pid) { apid = pid; }
|
||||
void SetCurrentChannel(t_channel_id id) { channel_id = id; }
|
||||
|
@@ -3045,6 +3045,14 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
|
||||
|
||||
return messages_return::handled;
|
||||
}
|
||||
else if (msg == NeutrinoMessages::EVT_SET_MUTE) {
|
||||
g_audioMute->AudioMute((int)data, true);
|
||||
return messages_return::handled;
|
||||
}
|
||||
else if (msg == NeutrinoMessages::EVT_SET_VOLUME) {
|
||||
g_volume->setVolumeExt((int)data);
|
||||
return messages_return::handled;
|
||||
}
|
||||
if ((msg >= CRCInput::RC_WithData) && (msg < CRCInput::RC_WithData + 0x10000000))
|
||||
delete [] (unsigned char*) data;
|
||||
|
||||
|
@@ -153,7 +153,10 @@ struct NeutrinoMessages {
|
||||
EVT_BACK_ZAP_COMPLETE = CRCInput::RC_WithData + 25, /* data: (t_channel_id *) */
|
||||
|
||||
EVT_HDMI_CEC_VIEW_ON = CRCInput::RC_WithData + 26,
|
||||
EVT_HDMI_CEC_STANDBY = CRCInput::RC_WithData + 27
|
||||
EVT_HDMI_CEC_STANDBY = CRCInput::RC_WithData + 27,
|
||||
|
||||
EVT_SET_MUTE = CRCInput::RC_WithData + 28,
|
||||
EVT_SET_VOLUME = CRCInput::RC_WithData + 29
|
||||
};
|
||||
enum
|
||||
{
|
||||
|
@@ -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
|
||||
|
@@ -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");
|
||||
}
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
|
Reference in New Issue
Block a user