2 * Copyright (C) 2017-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.
9 #include "DiscSettings.h"
12 #include "dialogs/GUIDialogKaiToast.h"
13 #include "lib/Setting.h"
14 #include "messaging/helpers/DialogOKHelper.h"
15 #include "utils/Variant.h"
16 #include "utils/log.h"
20 #include <libbluray/bluray-version.h>
21 #include <libbluray/bluray.h>
23 using namespace KODI::MESSAGING
;
25 CDiscSettings
& CDiscSettings::GetInstance()
27 static CDiscSettings sDiscSettings
;
31 void CDiscSettings::OnSettingChanged(const std::shared_ptr
<const CSetting
>& setting
)
33 #if (BLURAY_VERSION >= BLURAY_VERSION_CODE(1,0,1))
37 const std::string
&settingId
= setting
->GetId();
39 if (settingId
== CSettings::SETTING_DISC_PLAYBACK
)
41 int mode
= std::static_pointer_cast
<const CSettingInt
>(setting
)->GetValue();
42 if (mode
== BD_PLAYBACK_DISC_MENU
)
44 bool bdjWorking
= false;
45 BLURAY
* bd
= bd_init();
46 const BLURAY_DISC_INFO
* info
= bd_get_disc_info(bd
);
48 if (!info
->libjvm_detected
)
49 CLog::Log(LOGDEBUG
, "DiscSettings - Could not load the java vm.");
50 else if (!info
->bdj_handled
)
51 CLog::Log(LOGDEBUG
, "DiscSettings - Could not load the libbluray.jar.");
58 HELPERS::ShowOKDialogText(CVariant
{ 29803 }, CVariant
{ 29804 });