Merge pull request #1129 from jmarshallnz/remove_smb_auth_details_in_add_source
[vuplus_xbmc] / xbmc / settings / AdvancedSettings.h
1 #pragma once
2 /*
3  *      Copyright (C) 2005-2008 Team XBMC
4  *      http://xbmc.org
5  *
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)
9  *  any later version.
10  *
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.
15  *
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
20  *
21  */
22
23 #include <vector>
24 #include "utils/StdString.h"
25 #include "utils/GlobalsHandling.h"
26
27 class TiXmlElement;
28
29 class DatabaseSettings
30 {
31 public:
32   void Reset()
33   {
34     type.clear();
35     host.clear();
36     port.clear();
37     user.clear();
38     pass.clear();
39     name.clear();
40   };
41   CStdString type;
42   CStdString host;
43   CStdString port;
44   CStdString user;
45   CStdString pass;
46   CStdString name;
47 };
48
49 struct TVShowRegexp
50 {
51   bool byDate;
52   CStdString regexp;
53   int defaultSeason;
54   TVShowRegexp(bool d, const CStdString& r, int s = 1)
55   {
56     byDate = d;
57     regexp = r;
58     defaultSeason = s;
59   }
60 };
61
62 struct RefreshOverride
63 {
64   float fpsmin;
65   float fpsmax;
66
67   float refreshmin;
68   float refreshmax;
69
70   bool  fallback;
71 };
72
73
74 struct RefreshVideoLatency
75 {
76   float refreshmin;
77   float refreshmax;
78
79   float delay;
80 };
81
82 typedef std::vector<TVShowRegexp> SETTINGS_TVSHOWLIST;
83
84 class CAdvancedSettings
85 {
86   public:
87     CAdvancedSettings();
88
89     static CAdvancedSettings* getInstance();
90
91     void Initialize();
92     bool Initialized() { return m_initialized; };
93     void AddSettingsFile(const CStdString &filename);
94     bool Load();
95     void Clear();
96
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);
101
102     int m_audioHeadRoom;
103     float m_ac3Gain;
104     CStdString m_audioDefaultPlayer;
105     float m_audioPlayCountMinimumPercent;
106     bool m_dvdplayerIgnoreDTSinWAV;
107     int m_audioResample;
108     bool m_allowTranscode44100;
109     bool m_audioForceDirectSound;
110     bool m_audioAudiophile;
111     bool m_allChannelStereo;
112     int m_audioSinkBufferDurationMsec;
113     CStdString m_audioTranscodeTo;
114     float m_limiterHold;
115     float m_limiterRelease;
116
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;
147
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;
164
165     CStdString m_videoDefaultPlayer;
166     CStdString m_videoDefaultDVDPlayer;
167     float m_videoPlayCountMinimumPercent;
168
169     float m_slideshowBlackBarCompensation;
170     float m_slideshowZoomAmount;
171     float m_slideshowPanAmount;
172
173     bool m_lcdHeartbeat;
174     bool m_lcdDimOnScreenSave;
175     int m_lcdScrolldelay;
176     CStdString m_lcdHostName;
177
178     int m_autoDetectPingTime;
179
180     int m_songInfoDuration;
181     int m_busyDialogDelay;
182     int m_logLevel;
183     int m_logLevelHint;
184     CStdString m_cddbAddress;
185     
186     //airtunes + airplay
187     bool m_logEnableAirtunes;
188     int m_airTunesPort;
189     int m_airPlayPort;    
190
191     bool m_handleMounting;
192
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;
212
213     bool m_playlistAsFolders;
214     bool m_detectAsUdf;
215
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
220      */
221     unsigned int GetThumbSize() const { return m_imageRes / 2; };
222     bool m_useDDSFanart;
223
224     int m_sambaclienttimeout;
225     CStdString m_sambadoscodepage;
226     bool m_sambastatfiles;
227
228     bool m_bHTTPDirectoryStatFilesize;
229
230     bool m_bFTPThumbs;
231
232     CStdString m_musicThumbs;
233     CStdString m_dvdThumbs;
234     CStdString m_fanartImages;
235
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;
246
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;
256
257     bool m_bVideoScannerIgnoreErrors;
258     int m_iVideoLibraryDateAdded;
259
260     std::vector<CStdString> m_vecTokens; // cleaning strings tied to language
261     //TuxBox
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;
273
274     int m_iMythMovieLength;         // minutes
275
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
284
285     bool m_bFirstLoop;
286     int m_curlconnecttimeout;
287     int m_curllowspeedtime;
288     int m_curlretries;
289     bool m_curlDisableIPV6;
290
291     bool m_fullScreen;
292     bool m_startFullScreen;
293         bool m_showExitButton; /* Ideal for appliances to hide a 'useless' button */
294     bool m_canWindowed;
295     bool m_splashImage;
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 */
302
303     bool m_AllowD3D9Ex;
304     bool m_ForceD3D9Ex;
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;
309
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
319
320     CStdString m_cpuTempCmd;
321     CStdString m_gpuTempCmd;
322     int m_bgInfoLoaderMaxThreads;
323
324     bool m_measureRefreshrate; //when true the videoreferenceclock will measure the refreshrate when direct3d is used
325                                //otherwise it will use the windows refreshrate
326
327     DatabaseSettings m_databaseMusic; // advanced music database setup
328     DatabaseSettings m_databaseVideo; // advanced video database setup
329
330     bool m_guiVisualizeDirtyRegions;
331     int  m_guiAlgorithmDirtyRegions;
332     int  m_guiDirtyRegionNoFlipTimeout;
333
334     unsigned int m_cacheMemBufferSize;
335
336     bool m_jsonOutputCompact;
337     unsigned int m_jsonTcpPort;
338
339     bool m_enableMultimediaKeys;
340     std::vector<CStdString> m_settingsFiles;
341     void ParseSettingsFile(const CStdString &file);
342
343     float GetDisplayLatency(float refreshrate);
344     bool m_initialized;
345 };
346
347 XBMC_GLOBAL(CAdvancedSettings,g_advancedSettings);