Moved timeout constants to appsettings in preparatino for adding to user configuratio...
[vlc-remote] / src / appsettings.h
1 /*   VLC-REMOTE for MAEMO 5
2 *   Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
3 *   This program is free software; you can redistribute it and/or modify
4 *   it under the terms of the GNU General Public License version 2,
5 *   or (at your option) any later version, as published by the Free
6 *   Software Foundation
7 *
8 *   This program is distributed in the hope that it will be useful,
9 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
10 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 *   GNU General Public License for more details
12 *
13 *   You should have received a copy of the GNU General Public
14 *   License along with this program; if not, write to the
15 *   Free Software Foundation, Inc.,
16 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 */
18 #ifndef APPSETTINGS_H
19 #define APPSETTINGS_H
20 #include <QSettings>
21
22 #ifndef STATUS_POLL_TIMEOUT
23 #define STATUS_POLL_TIMEOUT 5000
24 #endif
25 #ifndef PING_TIMEOUT
26 #define PING_TIMEOUT 1000
27 #endif
28 #ifndef CONNECTION_TIMEOUT
29 #define CONNECTION_TIMEOUT 1000
30 #endif
31 #ifndef RETRIEVE_ART_TIMEOUT
32 #define RETRIEVE_ART_TIMEOUT 500
33 #endif
34 #ifndef RETRY_NETWORK_TIMEOUT
35 #define RETRY_NETWORK_TIMEOUT 20000
36 #endif
37
38 #ifndef SHOW_UNKNOWN_FILETYPES
39 #define SHOW_UNKNOWN_FILETYPES false
40 #endif
41
42
43 struct VlcDirectory {
44     QString name;
45     QString path;
46 };
47 enum Orientation {
48     AUTO_ROTATE = 0,
49     LANDSCAPE,
50     PORTRAIT
51 };
52
53 class AppSettings {
54 public:
55     explicit AppSettings();
56     ~AppSettings();
57     static QString getCurrentKey();
58     static QString getCurrentIp();
59     static VlcDirectory getHomeDirectory();
60     static QList<VlcDirectory>* getFavourites();
61     static bool addFavourite(VlcDirectory dir);
62     static bool deleteFavourite(VlcDirectory dir);
63     static bool setHomeDirectory(VlcDirectory dir);
64     static Orientation setOrientation(Orientation orientation);
65     static Orientation getOrientation();
66     static bool isConnected();
67     static int getStatusPollTimeout();
68     static int getPingTimeout();
69     static int getConnectionTimeout();
70     static int getRetrieveArtTimeout();
71     static int getRetryNetworkTimeout();
72     static bool getShowUnknownFileTypes();
73 };
74
75 #endif // APPSETTINGS_H