diff options
-rw-r--r-- | xbmc/input/ButtonTranslator.cpp | 1 | ||||
-rw-r--r-- | xbmc/input/Key.h | 1 | ||||
-rw-r--r-- | xbmc/video/PlayerController.cpp | 19 |
3 files changed, 20 insertions, 1 deletions
diff --git a/xbmc/input/ButtonTranslator.cpp b/xbmc/input/ButtonTranslator.cpp index 521d76b4af..0d503fb4fd 100644 --- a/xbmc/input/ButtonTranslator.cpp +++ b/xbmc/input/ButtonTranslator.cpp @@ -229,6 +229,7 @@ static const ActionMapping actions[] = {"decreasepar" , ACTION_DECREASE_PAR}, {"volampup" , ACTION_VOLAMP_UP}, {"volampdown" , ACTION_VOLAMP_DOWN}, + {"volumeamplification", ACTION_VOLAMP}, {"createbookmark" , ACTION_CREATE_BOOKMARK}, {"createepisodebookmark" , ACTION_CREATE_EPISODE_BOOKMARK}, {"settingsreset" , ACTION_SETTINGS_RESET}, diff --git a/xbmc/input/Key.h b/xbmc/input/Key.h index 1b28d93467..9ebc68ab02 100644 --- a/xbmc/input/Key.h +++ b/xbmc/input/Key.h @@ -203,6 +203,7 @@ #define ACTION_VOLUME_UP 88 #define ACTION_VOLUME_DOWN 89 +#define ACTION_VOLAMP 90 #define ACTION_MUTE 91 #define ACTION_NAV_BACK 92 #define ACTION_VOLAMP_UP 93 diff --git a/xbmc/video/PlayerController.cpp b/xbmc/video/PlayerController.cpp index 38630d7165..c6bca46821 100644 --- a/xbmc/video/PlayerController.cpp +++ b/xbmc/video/PlayerController.cpp @@ -392,6 +392,16 @@ bool CPlayerController::OnAction(const CAction &action) return true; } + case ACTION_VOLAMP: + { + float sliderMax = VOLUME_DRC_MAXIMUM / 100.0f; + float sliderMin = VOLUME_DRC_MINIMUM / 100.0f; + ShowSlider(action.GetID(), 660, + CMediaSettings::Get().GetCurrentVideoSettings().m_VolumeAmplification, + sliderMin, 1.0f, sliderMax, true); + return true; + } + default: break; } @@ -421,7 +431,9 @@ void CPlayerController::OnSliderChange(void *data, CGUISliderControl *slider) std::string strValue = StringUtils::Format("%1.2f",slider->GetFloatValue()); slider->SetTextValue(strValue); } - else if (m_sliderAction == ACTION_VOLAMP_UP || m_sliderAction == ACTION_VOLAMP_DOWN) + else if (m_sliderAction == ACTION_VOLAMP_UP || + m_sliderAction == ACTION_VOLAMP_DOWN || + m_sliderAction == ACTION_VOLAMP) slider->SetTextValue(CGUIDialogAudioSubtitleSettings::FormatDecibel(slider->GetFloatValue())); else slider->SetTextValue(CGUIDialogAudioSubtitleSettings::FormatDelay(slider->GetFloatValue(), 0.025f)); @@ -438,5 +450,10 @@ void CPlayerController::OnSliderChange(void *data, CGUISliderControl *slider) CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleDelay = slider->GetFloatValue(); g_application.m_pPlayer->SetSubTitleDelay(CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleDelay); } + else if (m_sliderAction == ACTION_VOLAMP) + { + CMediaSettings::Get().GetCurrentVideoSettings().m_VolumeAmplification = slider->GetFloatValue(); + g_application.m_pPlayer->SetDynamicRangeCompression((long)(CMediaSettings::Get().GetCurrentVideoSettings().m_VolumeAmplification * 100)); + } } } |