3 * Copyright (C) 2005-2008 Team XBMC
6 * This Program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
11 * This Program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with XBMC; see the file COPYING. If not, write to
18 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 * http://www.gnu.org/copyleft/gpl.html
24 #include "utils/StdString.h"
25 #include "utils/GlobalsHandling.h"
29 class DatabaseSettings
45 TVShowRegexp(bool d, const CStdString& r, int s = 1)
53 struct RefreshOverride
65 struct RefreshVideoLatency
73 typedef std::vector<TVShowRegexp> SETTINGS_TVSHOWLIST;
75 class CAdvancedSettings
80 static CAdvancedSettings* getInstance();
83 void AddSettingsFile(const CStdString &filename);
87 static void GetCustomTVRegexps(TiXmlElement *pRootElement, SETTINGS_TVSHOWLIST& settings);
88 static void GetCustomRegexps(TiXmlElement *pRootElement, CStdStringArray& settings);
89 static void GetCustomRegexpReplacers(TiXmlElement *pRootElement, CStdStringArray& settings);
90 static void GetCustomExtensions(TiXmlElement *pRootElement, CStdString& extensions);
94 CStdString m_audioDefaultPlayer;
95 float m_audioPlayCountMinimumPercent;
96 bool m_dvdplayerIgnoreDTSinWAV;
98 float m_limiterRelease;
100 float m_videoSubsDelayRange;
101 float m_videoAudioDelayRange;
102 int m_videoSmallStepBackSeconds;
103 int m_videoSmallStepBackTries;
104 int m_videoSmallStepBackDelay;
105 bool m_videoUseTimeSeeking;
106 int m_videoTimeSeekForward;
107 int m_videoTimeSeekBackward;
108 int m_videoTimeSeekForwardBig;
109 int m_videoTimeSeekBackwardBig;
110 int m_videoPercentSeekForward;
111 int m_videoPercentSeekBackward;
112 int m_videoPercentSeekForwardBig;
113 int m_videoPercentSeekBackwardBig;
114 CStdString m_videoPPFFmpegDeint;
115 CStdString m_videoPPFFmpegPostProc;
116 bool m_musicUseTimeSeeking;
117 int m_musicTimeSeekForward;
118 int m_musicTimeSeekBackward;
119 int m_musicTimeSeekForwardBig;
120 int m_musicTimeSeekBackwardBig;
121 int m_musicPercentSeekForward;
122 int m_musicPercentSeekBackward;
123 int m_musicPercentSeekForwardBig;
124 int m_musicPercentSeekBackwardBig;
126 int m_videoBlackBarColour;
127 int m_videoIgnoreSecondsAtStart;
128 float m_videoIgnorePercentAtEnd;
129 CStdString m_audioHost;
130 bool m_audioApplyDrc;
132 bool m_videoVDPAUScaling;
133 float m_videoNonLinStretchRatio;
134 bool m_videoEnableHighQualityHwScalers;
135 float m_videoAutoScaleMaxFps;
136 bool m_videoAllowMpeg4VDPAU;
137 bool m_videoAllowMpeg4VAAPI;
138 std::vector<RefreshOverride> m_videoAdjustRefreshOverrides;
139 std::vector<RefreshVideoLatency> m_videoRefreshLatency;
140 float m_videoDefaultLatency;
141 bool m_videoDisableBackgroundDeinterlace;
142 int m_videoCaptureUseOcclusionQuery;
143 bool m_DXVACheckCompatibility;
144 bool m_DXVACheckCompatibilityPresent;
145 bool m_DXVAForceProcessorRenderer;
146 bool m_DXVANoDeintProcForProgressive;
147 int m_videoFpsDetect;
149 CStdString m_videoDefaultPlayer;
150 CStdString m_videoDefaultDVDPlayer;
151 float m_videoPlayCountMinimumPercent;
153 float m_slideshowBlackBarCompensation;
154 float m_slideshowZoomAmount;
155 float m_slideshowPanAmount;
158 bool m_lcdDimOnScreenSave;
159 int m_lcdScrolldelay;
160 CStdString m_lcdHostName;
162 int m_autoDetectPingTime;
164 int m_songInfoDuration;
165 int m_busyDialogDelay;
168 CStdString m_cddbAddress;
171 bool m_logEnableAirtunes;
175 bool m_handleMounting;
177 bool m_fullScreenOnMovieStart;
178 CStdString m_cachePath;
179 CStdString m_videoCleanDateTimeRegExp;
180 CStdStringArray m_videoCleanStringRegExps;
181 CStdStringArray m_videoExcludeFromListingRegExps;
182 CStdStringArray m_moviesExcludeFromScanRegExps;
183 CStdStringArray m_tvshowExcludeFromScanRegExps;
184 CStdStringArray m_audioExcludeFromListingRegExps;
185 CStdStringArray m_audioExcludeFromScanRegExps;
186 CStdStringArray m_pictureExcludeFromListingRegExps;
187 CStdStringArray m_videoStackRegExps;
188 CStdStringArray m_folderStackRegExps;
189 CStdStringArray m_trailerMatchRegExps;
190 SETTINGS_TVSHOWLIST m_tvshowEnumRegExps;
191 CStdString m_tvshowMultiPartEnumRegExp;
192 typedef std::vector< std::pair<CStdString, CStdString> > StringMapping;
193 StringMapping m_pathSubstitutions;
194 int m_remoteDelay; ///< \brief number of remote messages to ignore before repeating
195 float m_controllerDeadzone;
197 bool m_playlistAsFolders;
204 int m_sambaclienttimeout;
205 CStdString m_sambadoscodepage;
206 bool m_sambastatfiles;
208 bool m_bHTTPDirectoryStatFilesize;
212 CStdString m_musicThumbs;
213 CStdString m_dvdThumbs;
214 CStdString m_fanartImages;
216 bool m_bMusicLibraryHideAllItems;
217 int m_iMusicLibraryRecentlyAddedItems;
218 bool m_bMusicLibraryAllItemsOnBottom;
219 bool m_bMusicLibraryAlbumsSortByArtistThenYear;
220 CStdString m_strMusicLibraryAlbumFormat;
221 CStdString m_strMusicLibraryAlbumFormatRight;
222 bool m_prioritiseAPEv2tags;
223 CStdString m_musicItemSeparator;
224 CStdString m_videoItemSeparator;
225 std::vector<CStdString> m_musicTagsFromFileFilters;
227 bool m_bVideoLibraryHideAllItems;
228 bool m_bVideoLibraryAllItemsOnBottom;
229 int m_iVideoLibraryRecentlyAddedItems;
230 bool m_bVideoLibraryHideRecentlyAddedItems;
231 bool m_bVideoLibraryHideEmptySeries;
232 bool m_bVideoLibraryCleanOnUpdate;
233 bool m_bVideoLibraryExportAutoThumbs;
234 bool m_bVideoLibraryImportWatchedState;
236 bool m_bVideoScannerIgnoreErrors;
238 std::vector<CStdString> m_vecTokens; // cleaning strings tied to language
240 int m_iTuxBoxStreamtsPort;
241 bool m_bTuxBoxSubMenuSelection;
242 int m_iTuxBoxDefaultSubMenu;
243 int m_iTuxBoxDefaultRootMenu;
244 bool m_bTuxBoxAudioChannelSelection;
245 bool m_bTuxBoxPictureIcon;
246 int m_iTuxBoxEpgRequestTime;
247 int m_iTuxBoxZapWaitTime;
248 bool m_bTuxBoxSendAllAPids;
249 bool m_bTuxBoxZapstream;
250 int m_iTuxBoxZapstreamPort;
252 int m_iMythMovieLength; // minutes
254 // EDL Commercial Break
255 bool m_bEdlMergeShortCommBreaks;
256 int m_iEdlMaxCommBreakLength; // seconds
257 int m_iEdlMinCommBreakLength; // seconds
258 int m_iEdlMaxCommBreakGap; // seconds
259 int m_iEdlMaxStartGap; // seconds
260 int m_iEdlCommBreakAutowait; // seconds
261 int m_iEdlCommBreakAutowind; // seconds
264 int m_curlconnecttimeout;
265 int m_curllowspeedtime;
267 bool m_curlDisableIPV6;
270 bool m_startFullScreen;
271 bool m_showExitButton; /* Ideal for appliances to hide a 'useless' button */
274 bool m_alwaysOnTop; /* makes xbmc to run always on top .. osx/win32 only .. */
275 int m_playlistRetries;
276 int m_playlistTimeout;
277 bool m_GLRectangleHack;
278 int m_iSkipLoopFilter;
279 float m_ForcedSwapTime; /* if nonzero, set's the explicit time in ms to allocate for buffer swap */
283 bool m_AllowDynamicTextures;
284 unsigned int m_RestrictCapsMask;
285 float m_sleepBeforeFlip; ///< if greather than zero, XBMC waits for raster to be this amount through the frame prior to calling the flip
286 bool m_bVirtualShares;
288 float m_karaokeSyncDelayCDG; // seems like different delay is needed for CDG and MP3s
289 float m_karaokeSyncDelayLRC;
290 bool m_karaokeChangeGenreForKaraokeSongs;
291 bool m_karaokeKeepDelay; // store user-changed song delay in the database
292 int m_karaokeStartIndex; // auto-assign numbering start from this value
293 bool m_karaokeAlwaysEmptyOnCdgs; // always have empty background on CDG files
294 bool m_karaokeUseSongSpecificBackground; // use song-specific video or image if available instead of default
295 CStdString m_karaokeDefaultBackgroundType; // empty string or "vis", "image" or "video"
296 CStdString m_karaokeDefaultBackgroundFilePath; // only for "image" or "video" types above
298 CStdString m_cpuTempCmd;
299 CStdString m_gpuTempCmd;
300 int m_bgInfoLoaderMaxThreads;
302 bool m_measureRefreshrate; //when true the videoreferenceclock will measure the refreshrate when direct3d is used
303 //otherwise it will use the windows refreshrate
305 DatabaseSettings m_databaseMusic; // advanced music database setup
306 DatabaseSettings m_databaseVideo; // advanced video database setup
308 bool m_guiVisualizeDirtyRegions;
309 int m_guiAlgorithmDirtyRegions;
310 int m_guiDirtyRegionNoFlipTimeout;
312 unsigned int m_cacheMemBufferSize;
314 bool m_jsonOutputCompact;
315 unsigned int m_jsonTcpPort;
317 bool m_enableMultimediaKeys;
318 std::vector<CStdString> m_settingsFiles;
319 void ParseSettingsFile(const CStdString &file);
321 float GetDisplayLatency(float refreshrate);
324 XBMC_GLOBAL(CAdvancedSettings,g_advancedSettings);