Merge pull request #704 from Quentangle/default_season_attribute
[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   CStdString type;
33   CStdString host;
34   CStdString port;
35   CStdString user;
36   CStdString pass;
37   CStdString name;
38 };
39
40 struct TVShowRegexp
41 {
42   bool byDate;
43   CStdString regexp;
44   int defaultSeason;
45   TVShowRegexp(bool d, const CStdString& r, int s = 1)
46   {
47     byDate = d;
48     regexp = r;
49     defaultSeason = s;
50   }
51 };
52
53 struct RefreshOverride
54 {
55   float fpsmin;
56   float fpsmax;
57
58   float refreshmin;
59   float refreshmax;
60
61   bool  fallback;
62 };
63
64
65 struct RefreshVideoLatency
66 {
67   float refreshmin;
68   float refreshmax;
69
70   float delay;
71 };
72
73 typedef std::vector<TVShowRegexp> SETTINGS_TVSHOWLIST;
74
75 class CAdvancedSettings
76 {
77   public:
78     CAdvancedSettings();
79
80     static CAdvancedSettings* getInstance();
81
82     void Initialize();
83     void AddSettingsFile(const CStdString &filename);
84     bool Load();
85     void Clear();
86
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);
91
92     int m_audioHeadRoom;
93     float m_ac3Gain;
94     CStdString m_audioDefaultPlayer;
95     float m_audioPlayCountMinimumPercent;
96     bool m_dvdplayerIgnoreDTSinWAV;
97     float m_limiterHold;
98     float m_limiterRelease;
99
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;
125     int m_musicResample;
126     int m_videoBlackBarColour;
127     int m_videoIgnoreSecondsAtStart;
128     float m_videoIgnorePercentAtEnd;
129     CStdString m_audioHost;
130     bool m_audioApplyDrc;
131
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;
148
149     CStdString m_videoDefaultPlayer;
150     CStdString m_videoDefaultDVDPlayer;
151     float m_videoPlayCountMinimumPercent;
152
153     float m_slideshowBlackBarCompensation;
154     float m_slideshowZoomAmount;
155     float m_slideshowPanAmount;
156
157     bool m_lcdHeartbeat;
158     bool m_lcdDimOnScreenSave;
159     int m_lcdScrolldelay;
160     CStdString m_lcdHostName;
161
162     int m_autoDetectPingTime;
163
164     int m_songInfoDuration;
165     int m_busyDialogDelay;
166     int m_logLevel;
167     int m_logLevelHint;
168     CStdString m_cddbAddress;
169     
170     //airtunes + airplay
171     bool m_logEnableAirtunes;
172     int m_airTunesPort;
173     int m_airPlayPort;    
174
175     bool m_handleMounting;
176
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;
196
197     bool m_playlistAsFolders;
198     bool m_detectAsUdf;
199
200     int m_thumbSize;
201     int m_fanartHeight;
202     bool m_useDDSFanart;
203
204     int m_sambaclienttimeout;
205     CStdString m_sambadoscodepage;
206     bool m_sambastatfiles;
207
208     bool m_bHTTPDirectoryStatFilesize;
209
210     bool m_bFTPThumbs;
211
212     CStdString m_musicThumbs;
213     CStdString m_dvdThumbs;
214     CStdString m_fanartImages;
215
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;
226
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;
235
236     bool m_bVideoScannerIgnoreErrors;
237
238     std::vector<CStdString> m_vecTokens; // cleaning strings tied to language
239     //TuxBox
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;
251
252     int m_iMythMovieLength;         // minutes
253
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
262
263     bool m_bFirstLoop;
264     int m_curlconnecttimeout;
265     int m_curllowspeedtime;
266     int m_curlretries;
267     bool m_curlDisableIPV6;
268
269     bool m_fullScreen;
270     bool m_startFullScreen;
271         bool m_showExitButton; /* Ideal for appliances to hide a 'useless' button */
272     bool m_canWindowed;
273     bool m_splashImage;
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 */
280
281     bool m_AllowD3D9Ex;
282     bool m_ForceD3D9Ex;
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;
287
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
297
298     CStdString m_cpuTempCmd;
299     CStdString m_gpuTempCmd;
300     int m_bgInfoLoaderMaxThreads;
301
302     bool m_measureRefreshrate; //when true the videoreferenceclock will measure the refreshrate when direct3d is used
303                                //otherwise it will use the windows refreshrate
304
305     DatabaseSettings m_databaseMusic; // advanced music database setup
306     DatabaseSettings m_databaseVideo; // advanced video database setup
307
308     bool m_guiVisualizeDirtyRegions;
309     int  m_guiAlgorithmDirtyRegions;
310     int  m_guiDirtyRegionNoFlipTimeout;
311
312     unsigned int m_cacheMemBufferSize;
313
314     bool m_jsonOutputCompact;
315     unsigned int m_jsonTcpPort;
316
317     bool m_enableMultimediaKeys;
318     std::vector<CStdString> m_settingsFiles;
319     void ParseSettingsFile(const CStdString &file);
320
321     float GetDisplayLatency(float refreshrate);
322 };
323
324 XBMC_GLOBAL(CAdvancedSettings,g_advancedSettings);