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  bool encodeFreeSpaceCheck() const;
79  void setEncodeFreeSpaceCheck(bool);
80  bool showConvertClipDialog() const;
81  void setShowConvertClipDialog(bool);
82 
83  bool meltedEnabled() const;
84  void setMeltedEnabled(bool);
85  QStringList meltedServers() const;
86  void setMeltedServers(const QStringList&);
87 
88  QString playerDeinterlacer() const;
89  void setPlayerDeinterlacer(const QString&);
90  QString playerExternal() const;
91  void setPlayerExternal(const QString&);
92  QString playerGamma() const;
93  void setPlayerGamma(const QString&);
94  bool playerGPU() const;
95  void setPlayerGPU(bool);
96  QString playerInterpolation() const;
97  void setPlayerInterpolation(const QString&);
98  bool playerJACK() const;
99  void setPlayerJACK(bool);
100  int playerKeyerMode() const;
101  void setPlayerKeyerMode(int);
102  bool playerMuted() const;
103  void setPlayerMuted(bool);
104  QString playerProfile() const;
105  void setPlayerProfile(const QString&);
106  bool playerProgressive() const;
107  void setPlayerProgressive(bool);
108  bool playerRealtime() const;
109  void setPlayerRealtime(bool);
110  bool playerScrubAudio() const;
111  void setPlayerScrubAudio(bool);
112  int playerVolume() const;
113  void setPlayerVolume(int);
114  float playerZoom() const;
115  void setPlayerZoom(float);
116 
117  QString playlistThumbnails() const;
118  void setPlaylistThumbnails(const QString&);
119 
120  bool timelineShowWaveforms() const;
121  void setTimelineShowWaveforms(bool);
122  bool timelineShowThumbnails() const;
123  void setTimelineShowThumbnails(bool);
124  bool timelineRippleAllTracks() const;
125  void setTimelineRippleAllTracks(bool);
126 
127  QString filterFavorite(const QString& filterName);
128  void setFilterFavorite(const QString& filterName, const QString& value);
129 
130  double audioInDuration() const;
131  void setAudioInDuration(double);
132 
133  double audioOutDuration() const;
134  void setAudioOutDuration(double);
135 
136  double videoInDuration() const;
137  void setVideoInDuration(double);
138 
139  double videoOutDuration() const;
140  void setVideoOutDuration(double);
141 
142  bool loudnessScopeShowMeter(const QString& meter) const;
143  void setLoudnessScopeShowMeter(const QString& meter, bool b);
144 
145  int drawMethod() const;
146  void setDrawMethod(int);
147 
148  bool noUpgrade() const;
149  void setNoUpgrade(bool value);
150 
151  void sync();
152  QString appDataLocation() const;
153  void setAppDataForSession(const QString& location);
154  void setAppDataLocally(const QString& location);
155 
156 signals:
157  void openPathChanged();
158  void savePathChanged();
159  void timelineShowWaveformsChanged();
160  void timelineShowThumbnailsChanged();
161  void timelineRippleAllTracksChanged();
162  void playerGpuChanged();
163  void audioInDurationChanged();
164  void audioOutDurationChanged();
165  void videoInDurationChanged();
166  void videoOutDurationChanged();
167  void playlistThumbnailsChanged();
168  void viewModeChanged();
169 
170 private:
171  QSettings settings;
172  QString m_appDataLocation;
173 };
174 
175 #define Settings ShotcutSettings::singleton()
176 
177 #endif // SETTINGS_H