diff options
-rw-r--r-- | xbmc/Application.cpp | 9 | ||||
-rw-r--r-- | xbmc/settings/Settings.cpp | 4 |
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); |