CuteLogger
Fast and simple logging solution for Qt based applications
settings.h
1 /*
2  * Copyright (c) 2013-2017 Meltytech, LLC
3  * Author: Dan Dennedy <dan@dennedy.org>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef SETTINGS_H
20 #define SETTINGS_H
21 
22 #include <QObject>
23 #include <QSettings>
24 #include <QStringList>
25 #include <QByteArray>
26 
27 class ShotcutSettings : public QObject
28 {
29  Q_OBJECT
30  Q_PROPERTY(bool timelineShowWaveforms READ timelineShowWaveforms WRITE setTimelineShowWaveforms NOTIFY timelineShowWaveformsChanged)
31  Q_PROPERTY(bool timelineShowThumbnails READ timelineShowThumbnails WRITE setTimelineShowThumbnails NOTIFY timelineShowThumbnailsChanged)
32  Q_PROPERTY(bool timelineRippleAllTracks READ timelineRippleAllTracks WRITE setTimelineRippleAllTracks NOTIFY timelineRippleAllTracksChanged)
33  Q_PROPERTY(QString openPath READ openPath WRITE setOpenPath NOTIFY openPathChanged)
34  Q_PROPERTY(QString savePath READ savePath WRITE setSavePath NOTIFY savePathChanged)
35  Q_PROPERTY(QString playlistThumbnails READ playlistThumbnails WRITE setPlaylistThumbnails NOTIFY playlistThumbnailsChanged)
36  Q_PROPERTY(QString viewMode READ viewMode WRITE setViewMode NOTIFY viewModeChanged)
37  Q_PROPERTY(bool playerGPU READ playerGPU NOTIFY playerGpuChanged)
38  Q_PROPERTY(double audioInDuration READ audioInDuration WRITE setAudioInDuration NOTIFY audioInDurationChanged)
39  Q_PROPERTY(double audioOutDuration READ audioOutDuration WRITE setAudioOutDuration NOTIFY audioOutDurationChanged)
40  Q_PROPERTY(double videoInDuration READ videoInDuration WRITE setVideoInDuration NOTIFY videoInDurationChanged)
41  Q_PROPERTY(double videoOutDuration READ videoOutDuration WRITE setVideoOutDuration NOTIFY videoOutDurationChanged)
42 
43 
44 public:
45  static ShotcutSettings& singleton();
46  explicit ShotcutSettings() : QObject() {}
47  explicit ShotcutSettings(const QString& appDataLocation);
48 
49  QString language() const;
50  void setLanguage(const QString&);
51  double imageDuration() const;
52  void setImageDuration(double);
53  QString openPath() const;
54  void setOpenPath(const QString&);
55  QString savePath() const;
56  void setSavePath(const QString&);
57  QStringList recent() const;
58  void setRecent(const QStringList&);
59  QString theme() const;
60  void setTheme(const QString&);
61  bool showTitleBars() const;
62  void setShowTitleBars(bool);
63  bool showToolBar() const;
64  void setShowToolBar(bool);
65  QByteArray windowGeometry() const;
66  void setWindowGeometry(const QByteArray&);
67  QByteArray windowGeometryDefault() const;
68  void setWindowGeometryDefault(const QByteArray&);
69  QByteArray windowState() const;
70  void setWindowState(const QByteArray&);
71  QByteArray windowStateDefault() const;
72  void setWindowStateDefault(const QByteArray&);
73  QString viewMode() const;
74  void setViewMode(const QString& viewMode);
75 
76  QString encodePath() const;
77  void setEncodePath(const QString&);
78 
79  bool meltedEnabled() const;
80  void setMeltedEnabled(bool);
81  QStringList meltedServers() const;
82  void setMeltedServers(const QStringList&);
83 
84  QString playerDeinterlacer() const;
85  void setPlayerDeinterlacer(const QString&);
86  QString playerExternal() const;
87  void setPlayerExternal(const QString&);
88  QString playerGamma() const;
89  void setPlayerGamma(const QString&);
90  bool playerGPU() const;
91  void setPlayerGPU(bool);
92  QString playerInterpolation() const;
93  void setPlayerInterpolation(const QString&);
94  bool playerJACK() const;
95  void setPlayerJACK(bool);
96  int playerKeyerMode() const;
97  void setPlayerKeyerMode(int);
98  bool playerMuted() const;
99  void setPlayerMuted(bool);
100  QString playerProfile() const;
101  void setPlayerProfile(const QString&);
102  bool playerProgressive() const;
103  void setPlayerProgressive(bool);
104  bool playerRealtime() const;
105  void setPlayerRealtime(bool);
106  bool playerScrubAudio() const;
107  void setPlayerScrubAudio(bool);
108  int playerVolume() const;
109  void setPlayerVolume(int);
110  float playerZoom() const;
111  void setPlayerZoom(float);
112 
113  QString playlistThumbnails() const;
114  void setPlaylistThumbnails(const QString&);
115 
116  bool timelineShowWaveforms() const;
117  void setTimelineShowWaveforms(bool);
118  bool timelineShowThumbnails() const;
119  void setTimelineShowThumbnails(bool);
120  bool timelineRippleAllTracks() const;
121  void setTimelineRippleAllTracks(bool);
122 
123  QString filterFavorite(const QString& filterName);
124  void setFilterFavorite(const QString& filterName, const QString& value);
125 
126  double audioInDuration() const;
127  void setAudioInDuration(double);
128 
129  double audioOutDuration() const;
130  void setAudioOutDuration(double);
131 
132  double videoInDuration() const;
133  void setVideoInDuration(double);
134 
135  double videoOutDuration() const;
136  void setVideoOutDuration(double);
137 
138  bool loudnessScopeShowMeter(const QString& meter) const;
139  void setLoudnessScopeShowMeter(const QString& meter, bool b);
140 
141  int drawMethod() const;
142  void setDrawMethod(int);
143 
144  bool noUpgrade() const;
145  void setNoUpgrade(bool value);
146 
147  void sync();
148  QString appDataLocation() const;
149  void setAppDataForSession(const QString& location);
150  void setAppDataLocally(const QString& location);
151 
152 signals:
153  void openPathChanged();
154  void savePathChanged();
155  void timelineShowWaveformsChanged();
156  void timelineShowThumbnailsChanged();
157  void timelineRippleAllTracksChanged();
158  void playerGpuChanged();
159  void audioInDurationChanged();
160  void audioOutDurationChanged();
161  void videoInDurationChanged();
162  void videoOutDurationChanged();
163  void playlistThumbnailsChanged();
164  void viewModeChanged();
165 
166 private:
167  QSettings settings;
168  QString m_appDataLocation;
169 };
170 
171 #define Settings ShotcutSettings::singleton()
172 
173 #endif // SETTINGS_H