From c04dcc2e7d834218ef2d4194331e383402495ae1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 10 Apr 2024 20:07:22 +0200 Subject: Adding upstream version 2:20.4+dfsg. Signed-off-by: Daniel Baumann --- xbmc/video/dialogs/GUIDialogSubtitleSettings.h | 70 ++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 xbmc/video/dialogs/GUIDialogSubtitleSettings.h (limited to 'xbmc/video/dialogs/GUIDialogSubtitleSettings.h') diff --git a/xbmc/video/dialogs/GUIDialogSubtitleSettings.h b/xbmc/video/dialogs/GUIDialogSubtitleSettings.h new file mode 100644 index 0000000..65216ed --- /dev/null +++ b/xbmc/video/dialogs/GUIDialogSubtitleSettings.h @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2005-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#include "cores/VideoPlayer/Interface/StreamInfo.h" +#include "settings/dialogs/GUIDialogSettingsManualBase.h" + +#include +#include +#include + +class CVariant; +struct IntegerSettingOption; + +class CGUIDialogSubtitleSettings : public CGUIDialogSettingsManualBase +{ +public: + CGUIDialogSubtitleSettings(); + ~CGUIDialogSubtitleSettings() override; + bool OnMessage(CGUIMessage& message) override; + + // specialization of CGUIWindow + void FrameMove() override; + + static std::string BrowseForSubtitle(); + +protected: + // implementations of ISettingCallback + void OnSettingChanged(const std::shared_ptr& setting) override; + void OnSettingAction(const std::shared_ptr& setting) override; + + // specialization of CGUIDialogSettingsBase + bool AllowResettingSettings() const override { return false; } + bool Save() override; + void SetupView() override; + + // specialization of CGUIDialogSettingsManualBase + void InitializeSettings() override; + +private: + bool SupportsSubtitleFeature(int feature); + + void AddSubtitleStreams(const std::shared_ptr& group, + const std::string& settingId); + + int m_subtitleStream; + bool m_subtitleVisible; + std::shared_ptr m_subtitleStreamSetting; + + std::vector m_subtitleCapabilities; + static std::string FormatFlags(StreamFlags flags); + + static void SubtitleStreamsOptionFiller(const std::shared_ptr& setting, + std::vector& list, + int& current, + void* data); + + static std::string SettingFormatterDelay( + const std::shared_ptr& control, + const CVariant& value, + const CVariant& minimum, + const CVariant& step, + const CVariant& maximum); +}; -- cgit v1.2.3