only call IPlayerCallback::OnPlayBackSpeedChanged if the speed has actually changed
[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     bool m_logEnableAirtunes;//airtunes spams alot - so make it an option
158     CStdString m_cddbAddress;
159
160     bool m_handleMounting;
161
162     bool m_fullScreenOnMovieStart;
163     bool m_noDVDROM;
164     CStdString m_cachePath;
165     CStdString m_videoCleanDateTimeRegExp;
166     CStdStringArray m_videoCleanStringRegExps;
167     CStdStringArray m_videoExcludeFromListingRegExps;
168     CStdStringArray m_moviesExcludeFromScanRegExps;
169     CStdStringArray m_tvshowExcludeFromScanRegExps;
170     CStdStringArray m_audioExcludeFromListingRegExps;
171     CStdStringArray m_audioExcludeFromScanRegExps;
172     CStdStringArray m_pictureExcludeFromListingRegExps;
173     CStdStringArray m_videoStackRegExps;
174     CStdStringArray m_folderStackRegExps;
175     CStdStringArray m_trailerMatchRegExps;
176     SETTINGS_TVSHOWLIST m_tvshowEnumRegExps;
177     CStdString m_tvshowMultiPartEnumRegExp;
178     typedef std::vector< std::pair<CStdString, CStdString> > StringMapping;
179     StringMapping m_pathSubstitutions;
180     int m_remoteDelay; ///< \brief number of remote messages to ignore before repeating
181     float m_controllerDeadzone;
182
183     bool m_playlistAsFolders;
184     bool m_detectAsUdf;
185
186     int m_thumbSize;
187     int m_fanartHeight;
188     bool m_useDDSFanart;
189
190     int m_sambaclienttimeout;
191     CStdString m_sambadoscodepage;
192     bool m_sambastatfiles;
193
194     bool m_bHTTPDirectoryStatFilesize;
195
196     bool m_bFTPThumbs;
197
198     CStdString m_musicThumbs;
199     CStdString m_dvdThumbs;
200     CStdString m_fanartImages;
201
202     bool m_bMusicLibraryHideAllItems;
203     int m_iMusicLibraryRecentlyAddedItems;
204     bool m_bMusicLibraryAllItemsOnBottom;
205     bool m_bMusicLibraryAlbumsSortByArtistThenYear;
206     CStdString m_strMusicLibraryAlbumFormat;
207     CStdString m_strMusicLibraryAlbumFormatRight;
208     bool m_prioritiseAPEv2tags;
209     CStdString m_musicItemSeparator;
210     CStdString m_videoItemSeparator;
211     std::vector<CStdString> m_musicTagsFromFileFilters;
212
213     bool m_bVideoLibraryHideAllItems;
214     bool m_bVideoLibraryAllItemsOnBottom;
215     int m_iVideoLibraryRecentlyAddedItems;
216     bool m_bVideoLibraryHideRecentlyAddedItems;
217     bool m_bVideoLibraryHideEmptySeries;
218     bool m_bVideoLibraryCleanOnUpdate;
219     bool m_bVideoLibraryExportAutoThumbs;
220     bool m_bVideoLibraryImportWatchedState;
221
222     bool m_bVideoScannerIgnoreErrors;
223
224     std::vector<CStdString> m_vecTokens; // cleaning strings tied to language
225     //TuxBox
226     int m_iTuxBoxStreamtsPort;
227     bool m_bTuxBoxSubMenuSelection;
228     int m_iTuxBoxDefaultSubMenu;
229     int m_iTuxBoxDefaultRootMenu;
230     bool m_bTuxBoxAudioChannelSelection;
231     bool m_bTuxBoxPictureIcon;
232     int m_iTuxBoxEpgRequestTime;
233     int m_iTuxBoxZapWaitTime;
234     bool m_bTuxBoxSendAllAPids;
235     bool m_bTuxBoxZapstream;
236     int m_iTuxBoxZapstreamPort;
237
238     int m_iMythMovieLength;         // minutes
239
240     // EDL Commercial Break
241     bool m_bEdlMergeShortCommBreaks;
242     int m_iEdlMaxCommBreakLength;   // seconds
243     int m_iEdlMinCommBreakLength;   // seconds
244     int m_iEdlMaxCommBreakGap;      // seconds
245     int m_iEdlMaxStartGap;          // seconds
246     int m_iEdlCommBreakAutowait;    // seconds
247     int m_iEdlCommBreakAutowind;    // seconds
248
249     bool m_bFirstLoop;
250     int m_curlconnecttimeout;
251     int m_curllowspeedtime;
252     int m_curlretries;
253     bool m_curlDisableIPV6;
254
255     bool m_fullScreen;
256     bool m_startFullScreen;
257         bool m_showExitButton; /* Ideal for appliances to hide a 'useless' button */
258     bool m_canWindowed;
259     bool m_splashImage;
260     bool m_alwaysOnTop;  /* makes xbmc to run always on top .. osx/win32 only .. */
261     int m_playlistRetries;
262     int m_playlistTimeout;
263     bool m_GLRectangleHack;
264     int m_iSkipLoopFilter;
265     float m_ForcedSwapTime; /* if nonzero, set's the explicit time in ms to allocate for buffer swap */
266
267     bool m_AllowD3D9Ex;
268     bool m_ForceD3D9Ex;
269     bool m_AllowDynamicTextures;
270     unsigned int m_RestrictCapsMask;
271     float m_sleepBeforeFlip; ///< if greather than zero, XBMC waits for raster to be this amount through the frame prior to calling the flip
272     bool m_bVirtualShares;
273
274     float m_karaokeSyncDelayCDG; // seems like different delay is needed for CDG and MP3s
275     float m_karaokeSyncDelayLRC;
276     bool m_karaokeChangeGenreForKaraokeSongs;
277     bool m_karaokeKeepDelay; // store user-changed song delay in the database
278     int m_karaokeStartIndex; // auto-assign numbering start from this value
279     bool m_karaokeAlwaysEmptyOnCdgs; // always have empty background on CDG files
280     bool m_karaokeUseSongSpecificBackground; // use song-specific video or image if available instead of default
281     CStdString m_karaokeDefaultBackgroundType; // empty string or "vis", "image" or "video"
282     CStdString m_karaokeDefaultBackgroundFilePath; // only for "image" or "video" types above
283
284     CStdString m_cpuTempCmd;
285     CStdString m_gpuTempCmd;
286     int m_bgInfoLoaderMaxThreads;
287
288     bool m_measureRefreshrate; //when true the videoreferenceclock will measure the refreshrate when direct3d is used
289                                //otherwise it will use the windows refreshrate
290
291     DatabaseSettings m_databaseMusic; // advanced music database setup
292     DatabaseSettings m_databaseVideo; // advanced video database setup
293
294     bool m_guiVisualizeDirtyRegions;
295     int  m_guiAlgorithmDirtyRegions;
296     int  m_guiDirtyRegionNoFlipTimeout;
297
298     unsigned int m_cacheMemBufferSize;
299
300     bool m_jsonOutputCompact;
301     unsigned int m_jsonTcpPort;
302
303     bool m_enableMultimediaKeys;
304     std::vector<CStdString> m_settingsFiles;
305     void ParseSettingsFile(const CStdString &file);
306 };
307
308 XBMC_GLOBAL(CAdvancedSettings,g_advancedSettings);