2 * Copyright (C) 2015-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
8 #include "UISoundsResource.h"
10 #include "ServiceBroker.h"
11 #include "addons/addoninfo/AddonType.h"
12 #include "guilib/GUIAudioManager.h"
13 #include "settings/Settings.h"
14 #include "settings/SettingsComponent.h"
15 #include "utils/StringUtils.h"
16 #include "utils/URIUtils.h"
22 CUISoundsResource::CUISoundsResource(const AddonInfoPtr
& addonInfo
)
23 : CResource(addonInfo
, AddonType::RESOURCE_UISOUNDS
)
27 bool CUISoundsResource::IsAllowed(const std::string
& file
) const
29 return StringUtils::EqualsNoCase(file
, "sounds.xml")
30 || URIUtils::HasExtension(file
, ".wav");
33 bool CUISoundsResource::IsInUse() const
35 return CServiceBroker::GetSettingsComponent()->GetSettings()->GetString(CSettings::SETTING_LOOKANDFEEL_SOUNDSKIN
) == ID();
38 void CUISoundsResource::OnPostInstall(bool update
, bool modal
)
40 CGUIComponent
* gui
= CServiceBroker::GetGUI();
42 gui
->GetAudioManager().Load();