aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Kortstiege <vdrfan@xbmc.org>2012-01-19 00:27:08 -0800
committerMatthias Kortstiege <vdrfan@xbmc.org>2012-01-19 00:27:08 -0800
commit9e4b4f1f1e6868d497fd110c605ac47fe0ca11d6 (patch)
treee11ab0250ea569443c7431eaa2e06104f514ce9c
parent523f7657781550988971df21670476c080460e35 (diff)
parentce57768e9826d0e1f319aa3c3e8794e0ac201e89 (diff)
Merge pull request #476 from energy6/xbmc-restore-volume
Xbmc restore volume
-rw-r--r--xbmc/Application.cpp9
-rw-r--r--xbmc/settings/Settings.cpp4
2 files changed, 12 insertions, 1 deletions
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index 1572e14661..a2c21dec94 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -1211,9 +1211,16 @@ bool CApplication::Initialize()
CLog::Log(LOGINFO, "removing tempfiles");
CUtil::RemoveTempFiles();
- // Show mute symbol
+ // Restore volume
if (g_settings.m_bMute)
+ {
+ SetVolume(g_settings.m_iPreMuteVolumeLevel);
Mute();
+ }
+ else
+ {
+ SetVolume(g_settings.m_nVolumeLevel, false);
+ }
// if the user shutoff the xbox during music scan
// restore the settings
diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp
index ca569558d4..686172e9fb 100644
--- a/xbmc/settings/Settings.cpp
+++ b/xbmc/settings/Settings.cpp
@@ -726,7 +726,9 @@ bool CSettings::LoadSettings(const CStdString& strSettingsFile)
pElement = pRootElement->FirstChildElement("audio");
if (pElement)
{
+ XMLUtils::GetBoolean(pElement, "mute", m_bMute);
GetInteger(pElement, "volumelevel", m_nVolumeLevel, VOLUME_MAXIMUM, VOLUME_MINIMUM, VOLUME_MAXIMUM);
+ GetInteger(pElement, "premutevolumelevel", m_iPreMuteVolumeLevel, 0, 0, 100);
GetInteger(pElement, "dynamicrangecompression", m_dynamicRangeCompressionLevel, VOLUME_DRC_MINIMUM, VOLUME_DRC_MINIMUM, VOLUME_DRC_MAXIMUM);
}
@@ -902,7 +904,9 @@ bool CSettings::SaveSettings(const CStdString& strSettingsFile, CGUISettings *lo
TiXmlElement volumeNode("audio");
pNode = pRoot->InsertEndChild(volumeNode);
if (!pNode) return false;
+ XMLUtils::SetBoolean(pNode, "mute", m_bMute);
XMLUtils::SetInt(pNode, "volumelevel", m_nVolumeLevel);
+ XMLUtils::SetInt(pNode, "premutevolumelevel", m_iPreMuteVolumeLevel);
XMLUtils::SetInt(pNode, "dynamicrangecompression", m_dynamicRangeCompressionLevel);
SaveCalibration(pRoot);