From 926cf9ee0d280783b2da44eb175506d935353ee9 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Wed, 25 Apr 2012 21:28:19 +1200 Subject: [PATCH] [AE] volume: remove dynamic range compression support at the app level --- xbmc/Application.cpp | 14 +------------- xbmc/interfaces/http-api/XBMChttp.cpp | 2 -- xbmc/settings/Settings.cpp | 3 --- xbmc/settings/Settings.h | 1 - 4 files changed, 1 insertion(+), 19 deletions(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp index 4ec485e877fbe..3ccfb0a761998 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -5140,8 +5140,6 @@ void CApplication::SetVolume(long iValue, bool isPercentage /* = true */) CVariant data(CVariant::VariantTypeObject); data["volume"] = (int)(((float)(g_settings.m_nVolumeLevel - VOLUME_MINIMUM)) / (VOLUME_MAXIMUM - VOLUME_MINIMUM) * 100.0f + 0.5f); - /* TODO: add once DRC is available - data["drc"] = (int)(((float)(g_settings.m_dynamicRangeCompressionLevel - VOLUME_DRC_MINIMUM)) / (VOLUME_DRC_MAXIMUM - VOLUME_DRC_MINIMUM) * 100.0f + 0.5f);*/ data["muted"] = g_settings.m_bMute; CAnnouncementManager::Announce(Application, "xbmc", "OnVolumeChanged", data); } @@ -5156,29 +5154,19 @@ void CApplication::SetHardwareVolume(long hardwareVolume) // update our settings if (hardwareVolume > VOLUME_MAXIMUM) - { - g_settings.m_dynamicRangeCompressionLevel = hardwareVolume - VOLUME_MAXIMUM; g_settings.m_nVolumeLevel = VOLUME_MAXIMUM; - } else - { - g_settings.m_dynamicRangeCompressionLevel = 0; g_settings.m_nVolumeLevel = hardwareVolume; - } // and tell our player to update the volume if (m_pPlayer) - { m_pPlayer->SetVolume(g_settings.m_nVolumeLevel); - // TODO DRC -// m_pPlayer->SetDynamicRangeCompression(g_settings.m_dynamicRangeCompressionLevel); - } } int CApplication::GetVolume() const { // converts the hardware volume (in mB) to a percentage - return int(((float)(g_settings.m_nVolumeLevel + g_settings.m_dynamicRangeCompressionLevel - VOLUME_MINIMUM)) / (VOLUME_MAXIMUM - VOLUME_MINIMUM)*100.0f + 0.5f); + return int(((float)(g_settings.m_nVolumeLevel - VOLUME_MINIMUM)) / (VOLUME_MAXIMUM - VOLUME_MINIMUM)*100.0f + 0.5f); } int CApplication::GetSubtitleDelay() const diff --git a/xbmc/interfaces/http-api/XBMChttp.cpp b/xbmc/interfaces/http-api/XBMChttp.cpp index 2fbb939b84c3e..fc6e2fcb1cdf9 100644 --- a/xbmc/interfaces/http-api/XBMChttp.cpp +++ b/xbmc/interfaces/http-api/XBMChttp.cpp @@ -2613,8 +2613,6 @@ int CXbmcHttp::xbmcSTSetting(int numParas, CStdString paras[]) tmp.Format("%i",g_settings.m_HttpApiBroadcastLevel); else if (paras[i]=="volumelevel") tmp.Format("%i",g_settings.m_nVolumeLevel); - else if (paras[i]=="dynamicrangecompressionlevel") - tmp.Format("%i",g_settings.m_dynamicRangeCompressionLevel); else if (paras[i]=="systemtimetotalup") tmp.Format("%i",g_settings.m_iSystemTimeTotalUp); else if (paras[i]=="mute") diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp index 1986afc621011..912cb4b0a9a54 100644 --- a/xbmc/settings/Settings.cpp +++ b/xbmc/settings/Settings.cpp @@ -94,7 +94,6 @@ void CSettings::Initialize() m_bAddonForeignFilter = false; m_nVolumeLevel = 0; - m_dynamicRangeCompressionLevel = 0; m_bMute = false; m_fZoomAmount = 1.0f; m_fPixelRatio = 1.0f; @@ -724,7 +723,6 @@ bool CSettings::LoadSettings(const CStdString& strSettingsFile) { XMLUtils::GetBoolean(pElement, "mute", m_bMute); GetInteger(pElement, "volumelevel", m_nVolumeLevel, VOLUME_MAXIMUM, VOLUME_MINIMUM, VOLUME_MAXIMUM); - GetInteger(pElement, "dynamicrangecompression", m_dynamicRangeCompressionLevel, VOLUME_DRC_MINIMUM, VOLUME_DRC_MINIMUM, VOLUME_DRC_MAXIMUM); } LoadCalibration(pRootElement, strSettingsFile); @@ -902,7 +900,6 @@ bool CSettings::SaveSettings(const CStdString& strSettingsFile, CGUISettings *lo if (!pNode) return false; XMLUtils::SetBoolean(pNode, "mute", m_bMute); XMLUtils::SetInt(pNode, "volumelevel", m_nVolumeLevel); - XMLUtils::SetInt(pNode, "dynamicrangecompression", m_dynamicRangeCompressionLevel); SaveCalibration(pRoot); diff --git a/xbmc/settings/Settings.h b/xbmc/settings/Settings.h index 80932ce1d6a13..5b3d64bbd6b4f 100644 --- a/xbmc/settings/Settings.h +++ b/xbmc/settings/Settings.h @@ -219,7 +219,6 @@ class CSettings int m_HttpApiBroadcastPort; int m_HttpApiBroadcastLevel; int m_nVolumeLevel; // measured in milliBels -60dB -> 0dB range. - int m_dynamicRangeCompressionLevel; // measured in milliBels 0dB -> 30dB range. bool m_bMute; int m_iSystemTimeTotalUp; // Uptime in minutes!