[Windows] Fix driver version detection of AMD RDNA+ GPU on Windows 10
[xbmc.git] / xbmc / settings / AdvancedSettings.h
blobe9adb76b61d9f9d1de298a36094b334f024c8b25
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 "pictures/PictureScalingAlgorithm.h"
12 #include "settings/lib/ISettingCallback.h"
13 #include "settings/lib/ISettingsHandler.h"
14 #include "utils/SortUtils.h"
16 #include <set>
17 #include <string>
18 #include <utility>
19 #include <vector>
21 class CProfileManager;
22 class CSettingsManager;
23 class CVariant;
24 struct IntegerSettingOption;
26 class TiXmlElement;
27 namespace ADDON
29 class IAddon;
32 class DatabaseSettings
34 public:
35 DatabaseSettings() { Reset(); }
36 void Reset()
38 type.clear();
39 host.clear();
40 port.clear();
41 user.clear();
42 pass.clear();
43 name.clear();
44 key.clear();
45 cert.clear();
46 ca.clear();
47 capath.clear();
48 ciphers.clear();
49 compression = false;
51 std::string type;
52 std::string host;
53 std::string port;
54 std::string user;
55 std::string pass;
56 std::string name;
57 std::string key;
58 std::string cert;
59 std::string ca;
60 std::string capath;
61 std::string ciphers;
62 bool compression;
65 struct TVShowRegexp
67 bool byDate;
68 bool byTitle;
69 std::string regexp;
70 int defaultSeason;
71 TVShowRegexp(bool d, const std::string& r, int s = 1, bool t = false) : regexp(r)
73 byDate = d;
74 defaultSeason = s;
75 byTitle = t;
79 struct RefreshOverride
81 float fpsmin;
82 float fpsmax;
84 float refreshmin;
85 float refreshmax;
87 bool fallback;
91 struct RefreshVideoLatency
93 float refreshmin;
94 float refreshmax;
96 float delay;
97 float hdrextradelay;
100 typedef std::vector<TVShowRegexp> SETTINGS_TVSHOWLIST;
102 class CAdvancedSettings : public ISettingCallback, public ISettingsHandler
104 public:
105 CAdvancedSettings();
107 void OnSettingsLoaded() override;
108 void OnSettingsUnloaded() override;
110 void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
112 void Initialize(CSettingsManager& settingsMgr);
113 void Uninitialize(CSettingsManager& settingsMgr);
114 bool Initialized() const { return m_initialized; }
115 void AddSettingsFile(const std::string &filename);
116 bool Load(const CProfileManager &profileManager);
118 static void GetCustomTVRegexps(TiXmlElement *pRootElement, SETTINGS_TVSHOWLIST& settings);
119 static void GetCustomRegexps(TiXmlElement *pRootElement, std::vector<std::string> &settings);
120 static void GetCustomExtensions(TiXmlElement *pRootElement, std::string& extensions);
122 std::string m_audioDefaultPlayer;
123 float m_audioPlayCountMinimumPercent;
124 bool m_VideoPlayerIgnoreDTSinWAV;
125 float m_limiterHold;
126 float m_limiterRelease;
128 bool m_omlSync = true;
130 float m_videoSubsDelayRange;
131 float m_videoAudioDelayRange;
132 bool m_videoUseTimeSeeking;
133 int m_videoTimeSeekForward;
134 int m_videoTimeSeekBackward;
135 int m_videoTimeSeekForwardBig;
136 int m_videoTimeSeekBackwardBig;
137 int m_videoPercentSeekForward;
138 int m_videoPercentSeekBackward;
139 int m_videoPercentSeekForwardBig;
140 int m_videoPercentSeekBackwardBig;
141 std::vector<int> m_seekSteps;
142 std::string m_videoPPFFmpegPostProc;
143 bool m_videoVDPAUtelecine;
144 bool m_videoVDPAUdeintSkipChromaHD;
145 bool m_musicUseTimeSeeking;
146 int m_musicTimeSeekForward;
147 int m_musicTimeSeekBackward;
148 int m_musicTimeSeekForwardBig;
149 int m_musicTimeSeekBackwardBig;
150 int m_musicPercentSeekForward;
151 int m_musicPercentSeekBackward;
152 int m_musicPercentSeekForwardBig;
153 int m_musicPercentSeekBackwardBig;
154 int m_videoIgnoreSecondsAtStart;
155 float m_videoIgnorePercentAtEnd;
156 float m_audioApplyDrc;
157 unsigned int m_maxPassthroughOffSyncDuration = 10; // when 10 ms off adjust
158 bool m_AllowMultiChannelFloat = false; // Android only switch to be removed in v22
159 bool m_superviseAudioDelay = false; // Android only to correct broken audio firmwares
161 int m_videoVDPAUScaling;
162 float m_videoNonLinStretchRatio;
163 float m_videoAutoScaleMaxFps;
164 std::vector<RefreshOverride> m_videoAdjustRefreshOverrides;
165 std::vector<RefreshVideoLatency> m_videoRefreshLatency;
166 float m_videoDefaultLatency;
167 float m_videoDefaultHdrExtraLatency;
168 int m_videoCaptureUseOcclusionQuery;
169 bool m_DXVACheckCompatibility;
170 bool m_DXVACheckCompatibilityPresent;
171 int m_videoFpsDetect;
172 float m_maxTempo;
173 bool m_videoPreferStereoStream = false;
175 std::string m_videoDefaultPlayer;
176 float m_videoPlayCountMinimumPercent;
178 float m_slideshowBlackBarCompensation;
179 float m_slideshowZoomAmount;
180 float m_slideshowPanAmount;
182 int m_songInfoDuration;
183 int m_logLevel;
184 int m_logLevelHint;
185 std::string m_cddbAddress;
186 bool m_addSourceOnTop; //!< True to put 'add source' buttons on top
188 //airtunes + airplay
189 int m_airTunesPort;
190 int m_airPlayPort;
192 /*! \brief Only used in linux for the udisks and udisks2 providers
193 * defines if kodi should automount media drives
194 * @note if kodi is running standalone (--standalone option) it will
195 * be set to tue
197 bool m_handleMounting;
198 /*! \brief Only used in linux for the udisks and udisks2 providers
199 * defines if kodi should automount optical discs
201 bool m_autoMountOpticalMedia{true};
203 bool m_fullScreenOnMovieStart;
204 std::string m_cachePath;
205 std::string m_videoCleanDateTimeRegExp;
206 std::string m_videoFilenameIdentifierRegExp;
207 std::vector<std::string> m_videoCleanStringRegExps;
208 std::vector<std::string> m_videoExcludeFromListingRegExps;
209 std::vector<std::string> m_allExcludeFromScanRegExps;
210 std::vector<std::string> m_moviesExcludeFromScanRegExps;
211 std::vector<std::string> m_tvshowExcludeFromScanRegExps;
212 std::vector<std::string> m_audioExcludeFromListingRegExps;
213 std::vector<std::string> m_audioExcludeFromScanRegExps;
214 std::vector<std::string> m_pictureExcludeFromListingRegExps;
215 std::vector<std::string> m_videoStackRegExps;
216 std::vector<std::string> m_folderStackRegExps;
217 std::vector<std::string> m_trailerMatchRegExps;
218 SETTINGS_TVSHOWLIST m_tvshowEnumRegExps;
219 std::string m_tvshowMultiPartEnumRegExp;
220 typedef std::vector< std::pair<std::string, std::string> > StringMapping;
221 StringMapping m_pathSubstitutions;
222 int m_remoteDelay; ///< \brief number of remote messages to ignore before repeating
223 bool m_bScanIRServer;
225 bool m_playlistAsFolders;
226 bool m_detectAsUdf;
228 unsigned int m_fanartRes; ///< \brief the maximal resolution to cache fanart at (assumes 16x9)
229 unsigned int m_imageRes; ///< \brief the maximal resolution to cache images at (assumes 16x9)
230 CPictureScalingAlgorithm::Algorithm m_imageScalingAlgorithm;
231 unsigned int
232 m_imageQualityJpeg; ///< \brief the stored jpeg quality the lower the better (default: 4)
234 int m_sambaclienttimeout;
235 std::string m_sambadoscodepage;
236 bool m_sambastatfiles;
238 bool m_bHTTPDirectoryStatFilesize;
240 bool m_bFTPThumbs;
241 bool m_bShoutcastArt;
243 std::string m_musicThumbs;
245 int m_iMusicLibraryRecentlyAddedItems;
246 int m_iMusicLibraryDateAdded;
247 bool m_bMusicLibraryAllItemsOnBottom;
248 bool m_bMusicLibraryCleanOnUpdate;
249 bool m_bMusicLibraryArtistSortOnUpdate;
250 bool m_bMusicLibraryUseISODates;
251 bool m_bMusicLibraryArtistNavigatesToSongs;
252 std::string m_strMusicLibraryAlbumFormat;
253 bool m_prioritiseAPEv2tags;
254 std::string m_musicItemSeparator;
255 std::vector<std::string> m_musicArtistSeparators;
256 std::string m_videoItemSeparator;
257 std::vector<std::string> m_musicTagsFromFileFilters;
259 bool m_bVideoLibraryAllItemsOnBottom;
260 int m_iVideoLibraryRecentlyAddedItems;
261 bool m_bVideoLibraryCleanOnUpdate;
262 bool m_bVideoLibraryUseFastHash;
263 bool m_bVideoLibraryImportWatchedState{true};
264 bool m_bVideoLibraryImportResumePoint{true};
266 bool m_bVideoScannerIgnoreErrors;
267 int m_iVideoLibraryDateAdded;
269 std::set<std::string> m_vecTokens;
271 int m_iEpgUpdateCheckInterval; // seconds
272 int m_iEpgCleanupInterval; // seconds
273 int m_iEpgActiveTagCheckInterval; // seconds
274 int m_iEpgRetryInterruptedUpdateInterval; // seconds
275 int m_iEpgUpdateEmptyTagsInterval; // seconds
276 bool m_bEpgDisplayUpdatePopup;
277 bool m_bEpgDisplayIncrementalUpdatePopup;
279 // EDL Commercial Break
280 bool m_bEdlMergeShortCommBreaks;
281 /*!< @brief If GUI notifications should be shown when reaching the start of commercial breaks */
282 bool m_EdlDisplayCommbreakNotifications;
283 int m_iEdlMaxCommBreakLength; // seconds
284 int m_iEdlMinCommBreakLength; // seconds
285 int m_iEdlMaxCommBreakGap; // seconds
286 int m_iEdlMaxStartGap; // seconds
287 int m_iEdlCommBreakAutowait; // seconds
288 int m_iEdlCommBreakAutowind; // seconds
290 int m_curlconnecttimeout;
291 int m_curllowspeedtime;
292 int m_curlretries;
293 int m_curlKeepAliveInterval; // seconds
294 bool m_curlDisableIPV6;
295 bool m_curlDisableHTTP2;
297 std::string m_caTrustFile;
299 bool m_minimizeToTray; /* win32 only */
300 bool m_fullScreen;
301 bool m_startFullScreen;
302 bool m_showExitButton; /* Ideal for appliances to hide a 'useless' button */
303 bool m_canWindowed;
304 bool m_splashImage;
305 bool m_alwaysOnTop; /* makes xbmc to run always on top .. osx/win32 only .. */
306 int m_playlistRetries;
307 int m_playlistTimeout;
308 bool m_GLRectangleHack;
309 int m_iSkipLoopFilter;
311 bool m_bVirtualShares;
313 std::string m_cpuTempCmd;
314 std::string m_gpuTempCmd;
316 /* PVR/TV related advanced settings */
317 int m_iPVRTimeCorrection; /*!< @brief correct all times (epg tags, timer tags, recording tags) by this amount of minutes. defaults to 0. */
318 int m_iPVRInfoToggleInterval; /*!< @brief if there are more than 1 pvr gui info item available (e.g. multiple recordings active at the same time), use this toggle delay in milliseconds. defaults to 3000. */
319 bool m_bPVRChannelIconsAutoScan; /*!< @brief automatically scan user defined folder for channel icons when loading internal channel groups */
320 bool m_bPVRAutoScanIconsUserSet; /*!< @brief mark channel icons populated by auto scan as "user set" */
321 int m_iPVRNumericChannelSwitchTimeout; /*!< @brief time in msecs after that a channel switch occurs after entering a channel number, if confirmchannelswitch is disabled */
322 int m_iPVRTimeshiftThreshold; /*!< @brief time diff between current playing time and timeshift buffer end, in seconds, before a playing stream is displayed as timeshifting. */
323 bool m_bPVRTimeshiftSimpleOSD; /*!< @brief use simple timeshift OSD (with progress only for the playing event instead of progress for the whole ts buffer). */
324 SortDescription m_PVRDefaultSortOrder; /*!< @brief SortDecription used to store default recording sort type and sort order */
326 DatabaseSettings m_databaseMusic; // advanced music database setup
327 DatabaseSettings m_databaseVideo; // advanced video database setup
328 DatabaseSettings m_databaseTV; // advanced tv database setup
329 DatabaseSettings m_databaseEpg; /*!< advanced EPG database setup */
331 bool m_useLocaleCollation;
333 bool m_guiVisualizeDirtyRegions;
334 int m_guiAlgorithmDirtyRegions;
335 bool m_guiSmartRedraw;
336 int32_t m_guiAnisotropicFiltering{0};
337 bool m_guiFrontToBackRendering{false};
338 bool m_guiGeometryClear{true};
339 unsigned int m_addonPackageFolderSize;
341 bool m_jsonOutputCompact;
342 unsigned int m_jsonTcpPort;
344 bool m_enableMultimediaKeys;
345 std::vector<std::string> m_settingsFiles;
346 void ParseSettingsFile(const std::string &file);
348 float GetLatencyTweak(float refreshrate, bool isHDREnabled);
349 bool m_initialized;
351 void SetDebugMode(bool debug);
353 //! \brief Toggles dirty-region visualization
354 void ToggleDirtyRegionVisualization()
356 m_guiVisualizeDirtyRegions = !m_guiVisualizeDirtyRegions;
359 // runtime settings which cannot be set from advancedsettings.xml
360 std::string m_videoExtensions;
361 std::string m_discStubExtensions;
362 std::string m_subtitlesExtensions;
363 std::string m_musicExtensions;
364 std::string m_pictureExtensions;
366 std::string m_stereoscopicregex_3d;
367 std::string m_stereoscopicregex_sbs;
368 std::string m_stereoscopicregex_tab;
370 bool m_openGlDebugging;
372 std::string m_userAgent;
373 uint32_t m_nfsTimeout;
374 int m_nfsRetries;
376 private:
377 void Initialize();
378 void Clear();
379 void SetExtraArtwork(const TiXmlElement* arttypes, std::vector<std::string>& artworkMap);