Album art fix for [#6370] Album art fails to load on first track
[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 #ifndef SHOW_ALBUM_ART
43 #define SHOW_ALBUM_ART true
44 #endif
45
46 #ifndef ALERT_ON_CLOSE
47 #define ALERT_ON_CLOSE false
48 #endif
49
50
51 struct VlcDirectory {
52     QString name;
53     QString path;
54 };
55 enum Orientation {
56     AUTO_ROTATE = 0,
57     LANDSCAPE,
58     PORTRAIT
59 };
60
61 class AppSettings {
62 public:
63     explicit AppSettings();
64     ~AppSettings();
65     static QString getCurrentKey();
66     static void setCurrentKey(QString key);
67     static QString getCurrentIp();
68     static void setCurrentIp(QString ip);
69     static QStringList getAllAccounts();
70     static VlcDirectory getHomeDirectory();
71     static QList<VlcDirectory>* getFavourites();
72     static bool addFavourite(VlcDirectory dir);
73     static bool deleteFavourite(VlcDirectory dir);
74     static bool setHomeDirectory(VlcDirectory dir);
75     static Orientation setOrientation(Orientation orientation);
76     static Orientation getOrientation();
77     static bool isConnected();
78     static int getStatusPollTimeout();
79     static int getPingTimeout();
80     static int getConnectionTimeout();
81     static int getRetrieveArtTimeout();
82     static int getRetryNetworkTimeout();
83     static bool getShowUnknownFileTypes();
84     static bool getShowAlbumArt();
85     static bool getAlertOnClose();
86
87 };
88
89 #endif // APPSETTINGS_H