Merge pull request #473 from Montellese/onplaybackspeedchanged
[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 struct DatabaseSettings
30 {
31   CStdString type;
32   CStdString host;
33   CStdString port;
34   CStdString user;
35   CStdString pass;
36   CStdString name;
37 };
38
39 struct TVShowRegexp
40 {
41   bool byDate;
42   CStdString regexp;
43   TVShowRegexp(bool d, const CStdString& r)
44   {
45     byDate = d;
46     regexp = r;
47   }
48 };
49
50 struct RefreshOverride
51 {
52   float fpsmin;
53   float fpsmax;
54
55   float refreshmin;
56   float refreshmax;
57
58   bool  fallback;
59 };
60
61 typedef std::vector<TVShowRegexp> SETTINGS_TVSHOWLIST;
62
63 class CAdvancedSettings
64 {
65   public:
66     CAdvancedSettings();
67
68     static CAdvancedSettings* getInstance();
69
70     void Initialize();
71     void AddSettingsFile(const CStdString &filename);
72     bool Load();
73     void Clear();
74
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);
79
80     int m_audioHeadRoom;
81     float m_ac3Gain;
82     CStdString m_audioDefaultPlayer;
83     float m_audioPlayCountMinimumPercent;
84     bool m_dvdplayerIgnoreDTSinWAV;
85     float m_limiterHold;
86     float m_limiterRelease;
87
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;
113     int m_musicResample;
114     int m_videoBlackBarColour;
115     int m_videoIgnoreSecondsAtStart;
116     float m_videoIgnorePercentAtEnd;
117     CStdString m_audioHost;
118     bool m_audioApplyDrc;
119
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;
131
132     CStdString m_videoDefaultPlayer;
133     CStdString m_videoDefaultDVDPlayer;
134     float m_videoPlayCountMinimumPercent;
135
136     float m_slideshowBlackBarCompensation;
137     float m_slideshowZoomAmount;
138     float m_slideshowPanAmount;
139
140     int m_lcdRows;
141     int m_lcdColumns;
142     int m_lcdAddress1;
143     int m_lcdAddress2;
144     int m_lcdAddress3;
145     int m_lcdAddress4;
146     bool m_lcdHeartbeat;
147     bool m_lcdDimOnScreenSave;
148     int m_lcdScrolldelay;
149     CStdString m_lcdHostName;
150
151     int m_autoDetectPingTime;
152
153     int m_songInfoDuration;
154     int m_busyDialogDelay;
155     int m_logLevel;
156     int m_logLevelHint;
157     CStdString m_cddbAddress;
158     
159     //airtunes + airplay
160     bool m_logEnableAirtunes;
161     int m_airTunesPort;
162     int m_airPlayPort;    
163
164     bool m_handleMounting;
165
166     bool m_fullScreenOnMovieStart;
167     bool m_noDVDROM;
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;
186
187     bool m_playlistAsFolders;
188     bool m_detectAsUdf;
189
190     int m_thumbSize;
191     int m_fanartHeight;
192     bool m_useDDSFanart;
193
194     int m_sambaclienttimeout;
195     CStdString m_sambadoscodepage;
196     bool m_sambastatfiles;
197
198     bool m_bHTTPDirectoryStatFilesize;
199
200     bool m_bFTPThumbs;
201
202     CStdString m_musicThumbs;
203     CStdString m_dvdThumbs;
204     CStdString m_fanartImages;
205
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;
216
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;
225
226     bool m_bVideoScannerIgnoreErrors;
227
228     std::vector<CStdString> m_vecTokens; // cleaning strings tied to language
229     //TuxBox
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;
241
242     int m_iMythMovieLength;         // minutes
243
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
252
253     bool m_bFirstLoop;
254     int m_curlconnecttimeout;
255     int m_curllowspeedtime;
256     int m_curlretries;
257     bool m_curlDisableIPV6;
258
259     bool m_fullScreen;
260     bool m_startFullScreen;
261         bool m_showExitButton; /* Ideal for appliances to hide a 'useless' button */
262     bool m_canWindowed;
263     bool m_splashImage;
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 */
270
271     bool m_AllowD3D9Ex;
272     bool m_ForceD3D9Ex;
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;
277
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
287
288     CStdString m_cpuTempCmd;
289     CStdString m_gpuTempCmd;
290     int m_bgInfoLoaderMaxThreads;
291
292     bool m_measureRefreshrate; //when true the videoreferenceclock will measure the refreshrate when direct3d is used
293                                //otherwise it will use the windows refreshrate
294
295     DatabaseSettings m_databaseMusic; // advanced music database setup
296     DatabaseSettings m_databaseVideo; // advanced video database setup
297
298     bool m_guiVisualizeDirtyRegions;
299     int  m_guiAlgorithmDirtyRegions;
300     int  m_guiDirtyRegionNoFlipTimeout;
301
302     unsigned int m_cacheMemBufferSize;
303
304     bool m_jsonOutputCompact;
305     unsigned int m_jsonTcpPort;
306
307     bool m_enableMultimediaKeys;
308     std::vector<CStdString> m_settingsFiles;
309     void ParseSettingsFile(const CStdString &file);
310 };
311
312 XBMC_GLOBAL(CAdvancedSettings,g_advancedSettings);