move external volume control to internal volume/mute handler

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
TangoCash
2018-10-19 19:39:36 +02:00
committed by Thilo Graf
parent 2b0b867e2e
commit b35c344c11
3 changed files with 24 additions and 43 deletions

View File

@@ -1219,7 +1219,8 @@ void CNeutrinoApp::saveSetup(const char * fname)
configfile.setInt32( "hdmi_cec_standby", g_settings.hdmi_cec_standby );
configfile.setInt32( "hdmi_cec_volume", g_settings.hdmi_cec_volume );
configfile.setInt32( "current_volume", g_settings.current_volume );
if (!g_settings.hdmi_cec_volume)
configfile.setInt32( "current_volume", g_settings.current_volume );
configfile.setInt32( "current_volume_step", g_settings.current_volume_step );
configfile.setInt32( "start_volume", g_settings.start_volume );
configfile.setInt32("audio_volume_percent_ac3", g_settings.audio_volume_percent_ac3);
@@ -2845,13 +2846,6 @@ void CNeutrinoApp::RealRun()
showInfo();
break;
case SNeutrinoSettings::VOLUME:
#if HAVE_ARM_HARDWARE
if (g_settings.hdmi_cec_volume)
{
(msg == (neutrino_msg_t) g_settings.key_volumeup || msg == CRCInput::RC_right) ? hdmi_cec::getInstance()->vol_up() : hdmi_cec::getInstance()->vol_down();
}
else
#endif
g_volume->setVolume(msg);
break;
default: /* SNeutrinoSettings::ZAP */
@@ -2959,13 +2953,6 @@ void CNeutrinoApp::RealRun()
showInfo();
break;
case SNeutrinoSettings::VOLUME:
#if HAVE_ARM_HARDWARE
if (g_settings.hdmi_cec_volume)
{
(msg == (neutrino_msg_t) g_settings.key_volumeup || msg == CRCInput::RC_right) ? hdmi_cec::getInstance()->vol_up() : hdmi_cec::getInstance()->vol_down();
}
else
#endif
g_volume->setVolume(msg);
break;
default: /* SNeutrinoSettings::ZAP */
@@ -3466,13 +3453,6 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
}
else if ((msg == CRCInput::RC_plus) || (msg == CRCInput::RC_minus))
{
#if HAVE_ARM_HARDWARE
if (g_settings.hdmi_cec_volume)
{
(msg == (neutrino_msg_t) g_settings.key_volumeup || msg == CRCInput::RC_right) ? hdmi_cec::getInstance()->vol_up() : hdmi_cec::getInstance()->vol_down();
}
else
#endif
g_volume->setVolume(msg);
return messages_return::handled;
@@ -3484,37 +3464,16 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
}
else {
//mute
#if HAVE_ARM_HARDWARE
if (g_settings.hdmi_cec_volume)
{
hdmi_cec::getInstance()->toggle_mute();
}
else
#endif
g_audioMute->AudioMute(!current_muted, true);
}
return messages_return::handled;
}
else if( msg == CRCInput::RC_mute_on ) {
#if HAVE_ARM_HARDWARE
if (g_settings.hdmi_cec_volume)
{
hdmi_cec::getInstance()->toggle_mute();
}
else
#endif
g_audioMute->AudioMute(true, true);
return messages_return::handled;
}
else if( msg == CRCInput::RC_mute_off ) {
#if HAVE_ARM_HARDWARE
if (g_settings.hdmi_cec_volume)
{
hdmi_cec::getInstance()->toggle_mute();
}
else
#endif
g_audioMute->AudioMute(false, true);
return messages_return::handled;