[cosmetic] AddVideoAsset function cleanup
[xbmc.git] / xbmc / video / dialogs / GUIDialogAudioSettings.h
blobd07b694e68f86515bc0954d3552db58a474bab79
1 /*
2 * Copyright (C) 2005-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.
7 */
9 #pragma once
11 #include "cores/VideoPlayer/Interface/StreamInfo.h"
12 #include "settings/dialogs/GUIDialogSettingsManualBase.h"
14 #include <string>
15 #include <utility>
16 #include <vector>
18 enum class IPlayerAudioCaps;
19 class CVariant;
20 struct IntegerSettingOption;
22 class CGUIDialogAudioSettings : public CGUIDialogSettingsManualBase
24 public:
25 CGUIDialogAudioSettings();
26 ~CGUIDialogAudioSettings() override;
28 // specialization of CGUIWindow
29 void FrameMove() override;
31 static std::string FormatDelay(float value, float interval);
32 static std::string FormatDecibel(float value);
33 static std::string FormatPercentAsDecibel(float value);
35 protected:
36 // implementations of ISettingCallback
37 void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
38 void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override;
40 // specialization of CGUIDialogSettingsBase
41 bool AllowResettingSettings() const override { return false; }
42 bool Save() override;
43 void SetupView() override;
45 // specialization of CGUIDialogSettingsManualBase
46 void InitializeSettings() override;
48 bool SupportsAudioFeature(IPlayerAudioCaps feature);
50 void AddAudioStreams(const std::shared_ptr<CSettingGroup>& group, const std::string& settingId);
52 static bool IsPlayingPassthrough(const std::string& condition,
53 const std::string& value,
54 const std::shared_ptr<const CSetting>& setting,
55 void* data);
57 static void AudioStreamsOptionFiller(const std::shared_ptr<const CSetting>& setting,
58 std::vector<IntegerSettingOption>& list,
59 int& current,
60 void* data);
62 static std::string SettingFormatterDelay(
63 const std::shared_ptr<const CSettingControlSlider>& control,
64 const CVariant& value,
65 const CVariant& minimum,
66 const CVariant& step,
67 const CVariant& maximum);
68 static std::string SettingFormatterPercentAsDecibel(
69 const std::shared_ptr<const CSettingControlSlider>& control,
70 const CVariant& value,
71 const CVariant& minimum,
72 const CVariant& step,
73 const CVariant& maximum);
75 float m_volume;
76 int m_audioStream;
77 bool m_passthrough = false;
79 std::vector<IPlayerAudioCaps> m_audioCaps;
81 private:
82 static std::string FormatFlags(StreamFlags flags);