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
54 TVShowRegexp(bool d, const CStdString& r, int s = 1)
62 struct RefreshOverride
74 struct RefreshVideoLatency
82 typedef std::vector<TVShowRegexp> SETTINGS_TVSHOWLIST;
84 class CAdvancedSettings
89 static CAdvancedSettings* getInstance();
92 bool Initialized() { return m_initialized; };
93 void AddSettingsFile(const CStdString &filename);
97 static void GetCustomTVRegexps(TiXmlElement *pRootElement, SETTINGS_TVSHOWLIST& settings);
98 static void GetCustomRegexps(TiXmlElement *pRootElement, CStdStringArray& settings);
99 static void GetCustomRegexpReplacers(TiXmlElement *pRootElement, CStdStringArray& settings);
100 static void GetCustomExtensions(TiXmlElement *pRootElement, CStdString& extensions);
104 CStdString m_audioDefaultPlayer;
105 float m_audioPlayCountMinimumPercent;
106 bool m_dvdplayerIgnoreDTSinWAV;
108 bool m_allowTranscode44100;
109 bool m_audioForceDirectSound;
110 bool m_audioAudiophile;
111 bool m_allChannelStereo;
112 int m_audioSinkBufferDurationMsec;
113 CStdString m_audioTranscodeTo;
115 float m_limiterRelease;
117 float m_videoSubsDelayRange;
118 float m_videoAudioDelayRange;
119 int m_videoSmallStepBackSeconds;
120 int m_videoSmallStepBackTries;
121 int m_videoSmallStepBackDelay;
122 bool m_videoUseTimeSeeking;
123 int m_videoTimeSeekForward;
124 int m_videoTimeSeekBackward;
125 int m_videoTimeSeekForwardBig;
126 int m_videoTimeSeekBackwardBig;
127 int m_videoPercentSeekForward;
128 int m_videoPercentSeekBackward;
129 int m_videoPercentSeekForwardBig;
130 int m_videoPercentSeekBackwardBig;
131 CStdString m_videoPPFFmpegDeint;
132 CStdString m_videoPPFFmpegPostProc;
133 bool m_musicUseTimeSeeking;
134 int m_musicTimeSeekForward;
135 int m_musicTimeSeekBackward;
136 int m_musicTimeSeekForwardBig;
137 int m_musicTimeSeekBackwardBig;
138 int m_musicPercentSeekForward;
139 int m_musicPercentSeekBackward;
140 int m_musicPercentSeekForwardBig;
141 int m_musicPercentSeekBackwardBig;
142 int m_videoBlackBarColour;
143 int m_videoIgnoreSecondsAtStart;
144 float m_videoIgnorePercentAtEnd;
145 CStdString m_audioHost;
146 bool m_audioApplyDrc;
148 bool m_videoVDPAUScaling;
149 float m_videoNonLinStretchRatio;
150 bool m_videoEnableHighQualityHwScalers;
151 float m_videoAutoScaleMaxFps;
152 bool m_videoAllowMpeg4VDPAU;
153 bool m_videoAllowMpeg4VAAPI;
154 std::vector<RefreshOverride> m_videoAdjustRefreshOverrides;
155 std::vector<RefreshVideoLatency> m_videoRefreshLatency;
156 float m_videoDefaultLatency;
157 bool m_videoDisableBackgroundDeinterlace;
158 int m_videoCaptureUseOcclusionQuery;
159 bool m_DXVACheckCompatibility;
160 bool m_DXVACheckCompatibilityPresent;
161 bool m_DXVAForceProcessorRenderer;
162 bool m_DXVANoDeintProcForProgressive;
163 int m_videoFpsDetect;
165 CStdString m_videoDefaultPlayer;
166 CStdString m_videoDefaultDVDPlayer;
167 float m_videoPlayCountMinimumPercent;
169 float m_slideshowBlackBarCompensation;
170 float m_slideshowZoomAmount;
171 float m_slideshowPanAmount;
174 bool m_lcdDimOnScreenSave;
175 int m_lcdScrolldelay;
176 CStdString m_lcdHostName;
178 int m_autoDetectPingTime;
180 int m_songInfoDuration;
181 int m_busyDialogDelay;
184 CStdString m_cddbAddress;
187 bool m_logEnableAirtunes;
191 bool m_handleMounting;
193 bool m_fullScreenOnMovieStart;
194 CStdString m_cachePath;
195 CStdString m_videoCleanDateTimeRegExp;
196 CStdStringArray m_videoCleanStringRegExps;
197 CStdStringArray m_videoExcludeFromListingRegExps;
198 CStdStringArray m_moviesExcludeFromScanRegExps;
199 CStdStringArray m_tvshowExcludeFromScanRegExps;
200 CStdStringArray m_audioExcludeFromListingRegExps;
201 CStdStringArray m_audioExcludeFromScanRegExps;
202 CStdStringArray m_pictureExcludeFromListingRegExps;
203 CStdStringArray m_videoStackRegExps;
204 CStdStringArray m_folderStackRegExps;
205 CStdStringArray m_trailerMatchRegExps;
206 SETTINGS_TVSHOWLIST m_tvshowEnumRegExps;
207 CStdString m_tvshowMultiPartEnumRegExp;
208 typedef std::vector< std::pair<CStdString, CStdString> > StringMapping;
209 StringMapping m_pathSubstitutions;
210 int m_remoteDelay; ///< \brief number of remote messages to ignore before repeating
211 float m_controllerDeadzone;
213 bool m_playlistAsFolders;
216 int m_fanartRes; ///< \brief the maximal resolution to cache fanart at (assumes 16x9)
217 int m_imageRes; ///< \brief the maximal resolution to cache images at (assumes 16x9)
218 /*! \brief the maximal size to cache thumbs at, assuming square
219 Used for actual thumbs (eg bookmark thumbs, picture thumbs) rather than cover art which uses m_imageRes instead
221 unsigned int GetThumbSize() const { return m_imageRes / 2; };
224 int m_sambaclienttimeout;
225 CStdString m_sambadoscodepage;
226 bool m_sambastatfiles;
228 bool m_bHTTPDirectoryStatFilesize;
232 CStdString m_musicThumbs;
233 CStdString m_dvdThumbs;
234 CStdString m_fanartImages;
236 bool m_bMusicLibraryHideAllItems;
237 int m_iMusicLibraryRecentlyAddedItems;
238 bool m_bMusicLibraryAllItemsOnBottom;
239 bool m_bMusicLibraryAlbumsSortByArtistThenYear;
240 CStdString m_strMusicLibraryAlbumFormat;
241 CStdString m_strMusicLibraryAlbumFormatRight;
242 bool m_prioritiseAPEv2tags;
243 CStdString m_musicItemSeparator;
244 CStdString m_videoItemSeparator;
245 std::vector<CStdString> m_musicTagsFromFileFilters;
247 bool m_bVideoLibraryHideAllItems;
248 bool m_bVideoLibraryAllItemsOnBottom;
249 int m_iVideoLibraryRecentlyAddedItems;
250 bool m_bVideoLibraryHideRecentlyAddedItems;
251 bool m_bVideoLibraryHideEmptySeries;
252 bool m_bVideoLibraryCleanOnUpdate;
253 bool m_bVideoLibraryExportAutoThumbs;
254 bool m_bVideoLibraryImportWatchedState;
255 bool m_bVideoLibraryImportResumePoint;
257 bool m_bVideoScannerIgnoreErrors;
258 int m_iVideoLibraryDateAdded;
260 std::vector<CStdString> m_vecTokens; // cleaning strings tied to language
262 int m_iTuxBoxStreamtsPort;
263 bool m_bTuxBoxSubMenuSelection;
264 int m_iTuxBoxDefaultSubMenu;
265 int m_iTuxBoxDefaultRootMenu;
266 bool m_bTuxBoxAudioChannelSelection;
267 bool m_bTuxBoxPictureIcon;
268 int m_iTuxBoxEpgRequestTime;
269 int m_iTuxBoxZapWaitTime;
270 bool m_bTuxBoxSendAllAPids;
271 bool m_bTuxBoxZapstream;
272 int m_iTuxBoxZapstreamPort;
274 int m_iMythMovieLength; // minutes
276 // EDL Commercial Break
277 bool m_bEdlMergeShortCommBreaks;
278 int m_iEdlMaxCommBreakLength; // seconds
279 int m_iEdlMinCommBreakLength; // seconds
280 int m_iEdlMaxCommBreakGap; // seconds
281 int m_iEdlMaxStartGap; // seconds
282 int m_iEdlCommBreakAutowait; // seconds
283 int m_iEdlCommBreakAutowind; // seconds
286 int m_curlconnecttimeout;
287 int m_curllowspeedtime;
289 bool m_curlDisableIPV6;
292 bool m_startFullScreen;
293 bool m_showExitButton; /* Ideal for appliances to hide a 'useless' button */
296 bool m_alwaysOnTop; /* makes xbmc to run always on top .. osx/win32 only .. */
297 int m_playlistRetries;
298 int m_playlistTimeout;
299 bool m_GLRectangleHack;
300 int m_iSkipLoopFilter;
301 float m_ForcedSwapTime; /* if nonzero, set's the explicit time in ms to allocate for buffer swap */
305 bool m_AllowDynamicTextures;
306 unsigned int m_RestrictCapsMask;
307 float m_sleepBeforeFlip; ///< if greather than zero, XBMC waits for raster to be this amount through the frame prior to calling the flip
308 bool m_bVirtualShares;
310 float m_karaokeSyncDelayCDG; // seems like different delay is needed for CDG and MP3s
311 float m_karaokeSyncDelayLRC;
312 bool m_karaokeChangeGenreForKaraokeSongs;
313 bool m_karaokeKeepDelay; // store user-changed song delay in the database
314 int m_karaokeStartIndex; // auto-assign numbering start from this value
315 bool m_karaokeAlwaysEmptyOnCdgs; // always have empty background on CDG files
316 bool m_karaokeUseSongSpecificBackground; // use song-specific video or image if available instead of default
317 CStdString m_karaokeDefaultBackgroundType; // empty string or "vis", "image" or "video"
318 CStdString m_karaokeDefaultBackgroundFilePath; // only for "image" or "video" types above
320 CStdString m_cpuTempCmd;
321 CStdString m_gpuTempCmd;
322 int m_bgInfoLoaderMaxThreads;
324 bool m_measureRefreshrate; //when true the videoreferenceclock will measure the refreshrate when direct3d is used
325 //otherwise it will use the windows refreshrate
327 DatabaseSettings m_databaseMusic; // advanced music database setup
328 DatabaseSettings m_databaseVideo; // advanced video database setup
330 bool m_guiVisualizeDirtyRegions;
331 int m_guiAlgorithmDirtyRegions;
332 int m_guiDirtyRegionNoFlipTimeout;
334 unsigned int m_cacheMemBufferSize;
336 bool m_jsonOutputCompact;
337 unsigned int m_jsonTcpPort;
339 bool m_enableMultimediaKeys;
340 std::vector<CStdString> m_settingsFiles;
341 void ParseSettingsFile(const CStdString &file);
343 float GetDisplayLatency(float refreshrate);
347 XBMC_GLOBAL(CAdvancedSettings,g_advancedSettings);