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