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 struct DatabaseSettings
43 TVShowRegexp(bool d, const CStdString& r)
50 struct RefreshOverride
61 typedef std::vector<TVShowRegexp> SETTINGS_TVSHOWLIST;
63 class CAdvancedSettings
68 static CAdvancedSettings* getInstance();
71 void AddSettingsFile(const CStdString &filename);
75 static void GetCustomTVRegexps(TiXmlElement *pRootElement, SETTINGS_TVSHOWLIST& settings);
76 static void GetCustomRegexps(TiXmlElement *pRootElement, CStdStringArray& settings);
77 static void GetCustomRegexpReplacers(TiXmlElement *pRootElement, CStdStringArray& settings);
78 static void GetCustomExtensions(TiXmlElement *pRootElement, CStdString& extensions);
82 CStdString m_audioDefaultPlayer;
83 float m_audioPlayCountMinimumPercent;
84 bool m_dvdplayerIgnoreDTSinWAV;
86 float m_limiterRelease;
88 float m_videoSubsDelayRange;
89 float m_videoAudioDelayRange;
90 int m_videoSmallStepBackSeconds;
91 int m_videoSmallStepBackTries;
92 int m_videoSmallStepBackDelay;
93 bool m_videoUseTimeSeeking;
94 int m_videoTimeSeekForward;
95 int m_videoTimeSeekBackward;
96 int m_videoTimeSeekForwardBig;
97 int m_videoTimeSeekBackwardBig;
98 int m_videoPercentSeekForward;
99 int m_videoPercentSeekBackward;
100 int m_videoPercentSeekForwardBig;
101 int m_videoPercentSeekBackwardBig;
102 CStdString m_videoPPFFmpegDeint;
103 CStdString m_videoPPFFmpegPostProc;
104 bool m_musicUseTimeSeeking;
105 int m_musicTimeSeekForward;
106 int m_musicTimeSeekBackward;
107 int m_musicTimeSeekForwardBig;
108 int m_musicTimeSeekBackwardBig;
109 int m_musicPercentSeekForward;
110 int m_musicPercentSeekBackward;
111 int m_musicPercentSeekForwardBig;
112 int m_musicPercentSeekBackwardBig;
114 int m_videoBlackBarColour;
115 int m_videoIgnoreSecondsAtStart;
116 float m_videoIgnorePercentAtEnd;
117 CStdString m_audioHost;
118 bool m_audioApplyDrc;
120 bool m_videoVDPAUScaling;
121 float m_videoNonLinStretchRatio;
122 bool m_videoEnableHighQualityHwScalers;
123 float m_videoAutoScaleMaxFps;
124 bool m_videoAllowMpeg4VDPAU;
125 std::vector<RefreshOverride> m_videoAdjustRefreshOverrides;
126 bool m_videoDisableBackgroundDeinterlace;
127 int m_videoCaptureUseOcclusionQuery;
128 bool m_DXVACheckCompatibility;
129 bool m_DXVACheckCompatibilityPresent;
130 bool m_DXVAForceProcessorRenderer;
132 CStdString m_videoDefaultPlayer;
133 CStdString m_videoDefaultDVDPlayer;
134 float m_videoPlayCountMinimumPercent;
136 float m_slideshowBlackBarCompensation;
137 float m_slideshowZoomAmount;
138 float m_slideshowPanAmount;
147 bool m_lcdDimOnScreenSave;
148 int m_lcdScrolldelay;
149 CStdString m_lcdHostName;
151 int m_autoDetectPingTime;
153 int m_songInfoDuration;
154 int m_busyDialogDelay;
157 CStdString m_cddbAddress;
160 bool m_logEnableAirtunes;
164 bool m_handleMounting;
166 bool m_fullScreenOnMovieStart;
168 CStdString m_cachePath;
169 CStdString m_videoCleanDateTimeRegExp;
170 CStdStringArray m_videoCleanStringRegExps;
171 CStdStringArray m_videoExcludeFromListingRegExps;
172 CStdStringArray m_moviesExcludeFromScanRegExps;
173 CStdStringArray m_tvshowExcludeFromScanRegExps;
174 CStdStringArray m_audioExcludeFromListingRegExps;
175 CStdStringArray m_audioExcludeFromScanRegExps;
176 CStdStringArray m_pictureExcludeFromListingRegExps;
177 CStdStringArray m_videoStackRegExps;
178 CStdStringArray m_folderStackRegExps;
179 CStdStringArray m_trailerMatchRegExps;
180 SETTINGS_TVSHOWLIST m_tvshowEnumRegExps;
181 CStdString m_tvshowMultiPartEnumRegExp;
182 typedef std::vector< std::pair<CStdString, CStdString> > StringMapping;
183 StringMapping m_pathSubstitutions;
184 int m_remoteDelay; ///< \brief number of remote messages to ignore before repeating
185 float m_controllerDeadzone;
187 bool m_playlistAsFolders;
194 int m_sambaclienttimeout;
195 CStdString m_sambadoscodepage;
196 bool m_sambastatfiles;
198 bool m_bHTTPDirectoryStatFilesize;
202 CStdString m_musicThumbs;
203 CStdString m_dvdThumbs;
204 CStdString m_fanartImages;
206 bool m_bMusicLibraryHideAllItems;
207 int m_iMusicLibraryRecentlyAddedItems;
208 bool m_bMusicLibraryAllItemsOnBottom;
209 bool m_bMusicLibraryAlbumsSortByArtistThenYear;
210 CStdString m_strMusicLibraryAlbumFormat;
211 CStdString m_strMusicLibraryAlbumFormatRight;
212 bool m_prioritiseAPEv2tags;
213 CStdString m_musicItemSeparator;
214 CStdString m_videoItemSeparator;
215 std::vector<CStdString> m_musicTagsFromFileFilters;
217 bool m_bVideoLibraryHideAllItems;
218 bool m_bVideoLibraryAllItemsOnBottom;
219 int m_iVideoLibraryRecentlyAddedItems;
220 bool m_bVideoLibraryHideRecentlyAddedItems;
221 bool m_bVideoLibraryHideEmptySeries;
222 bool m_bVideoLibraryCleanOnUpdate;
223 bool m_bVideoLibraryExportAutoThumbs;
224 bool m_bVideoLibraryImportWatchedState;
226 bool m_bVideoScannerIgnoreErrors;
228 std::vector<CStdString> m_vecTokens; // cleaning strings tied to language
230 int m_iTuxBoxStreamtsPort;
231 bool m_bTuxBoxSubMenuSelection;
232 int m_iTuxBoxDefaultSubMenu;
233 int m_iTuxBoxDefaultRootMenu;
234 bool m_bTuxBoxAudioChannelSelection;
235 bool m_bTuxBoxPictureIcon;
236 int m_iTuxBoxEpgRequestTime;
237 int m_iTuxBoxZapWaitTime;
238 bool m_bTuxBoxSendAllAPids;
239 bool m_bTuxBoxZapstream;
240 int m_iTuxBoxZapstreamPort;
242 int m_iMythMovieLength; // minutes
244 // EDL Commercial Break
245 bool m_bEdlMergeShortCommBreaks;
246 int m_iEdlMaxCommBreakLength; // seconds
247 int m_iEdlMinCommBreakLength; // seconds
248 int m_iEdlMaxCommBreakGap; // seconds
249 int m_iEdlMaxStartGap; // seconds
250 int m_iEdlCommBreakAutowait; // seconds
251 int m_iEdlCommBreakAutowind; // seconds
254 int m_curlconnecttimeout;
255 int m_curllowspeedtime;
257 bool m_curlDisableIPV6;
260 bool m_startFullScreen;
261 bool m_showExitButton; /* Ideal for appliances to hide a 'useless' button */
264 bool m_alwaysOnTop; /* makes xbmc to run always on top .. osx/win32 only .. */
265 int m_playlistRetries;
266 int m_playlistTimeout;
267 bool m_GLRectangleHack;
268 int m_iSkipLoopFilter;
269 float m_ForcedSwapTime; /* if nonzero, set's the explicit time in ms to allocate for buffer swap */
273 bool m_AllowDynamicTextures;
274 unsigned int m_RestrictCapsMask;
275 float m_sleepBeforeFlip; ///< if greather than zero, XBMC waits for raster to be this amount through the frame prior to calling the flip
276 bool m_bVirtualShares;
278 float m_karaokeSyncDelayCDG; // seems like different delay is needed for CDG and MP3s
279 float m_karaokeSyncDelayLRC;
280 bool m_karaokeChangeGenreForKaraokeSongs;
281 bool m_karaokeKeepDelay; // store user-changed song delay in the database
282 int m_karaokeStartIndex; // auto-assign numbering start from this value
283 bool m_karaokeAlwaysEmptyOnCdgs; // always have empty background on CDG files
284 bool m_karaokeUseSongSpecificBackground; // use song-specific video or image if available instead of default
285 CStdString m_karaokeDefaultBackgroundType; // empty string or "vis", "image" or "video"
286 CStdString m_karaokeDefaultBackgroundFilePath; // only for "image" or "video" types above
288 CStdString m_cpuTempCmd;
289 CStdString m_gpuTempCmd;
290 int m_bgInfoLoaderMaxThreads;
292 bool m_measureRefreshrate; //when true the videoreferenceclock will measure the refreshrate when direct3d is used
293 //otherwise it will use the windows refreshrate
295 DatabaseSettings m_databaseMusic; // advanced music database setup
296 DatabaseSettings m_databaseVideo; // advanced video database setup
298 bool m_guiVisualizeDirtyRegions;
299 int m_guiAlgorithmDirtyRegions;
300 int m_guiDirtyRegionNoFlipTimeout;
302 unsigned int m_cacheMemBufferSize;
304 bool m_jsonOutputCompact;
305 unsigned int m_jsonTcpPort;
307 bool m_enableMultimediaKeys;
308 std::vector<CStdString> m_settingsFiles;
309 void ParseSettingsFile(const CStdString &file);
312 XBMC_GLOBAL(CAdvancedSettings,g_advancedSettings);