forked from mltframework/shotcut
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.h
307 lines (285 loc) · 11.6 KB
/
settings.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
/*
* Copyright (c) 2013-2022 Meltytech, LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SETTINGS_H
#define SETTINGS_H
#include <QObject>
#include <QSettings>
#include <QStringList>
#include <QByteArray>
#include <QThread>
class ShotcutSettings : public QObject
{
Q_OBJECT
Q_PROPERTY(bool timelineDragScrub READ timelineDragScrub WRITE setTimelineDragScrub NOTIFY
timelineDragScrubChanged)
Q_PROPERTY(bool timelineShowWaveforms READ timelineShowWaveforms WRITE setTimelineShowWaveforms
NOTIFY timelineShowWaveformsChanged)
Q_PROPERTY(bool timelineShowThumbnails READ timelineShowThumbnails WRITE setTimelineShowThumbnails
NOTIFY timelineShowThumbnailsChanged)
Q_PROPERTY(bool timelineRipple READ timelineRipple WRITE setTimelineRipple NOTIFY
timelineRippleChanged)
Q_PROPERTY(bool timelineRippleAllTracks READ timelineRippleAllTracks WRITE
setTimelineRippleAllTracks NOTIFY timelineRippleAllTracksChanged)
Q_PROPERTY(bool timelineRippleMarkers READ timelineRippleMarkers WRITE setTimelineRippleMarkers
NOTIFY timelineRippleMarkersChanged)
Q_PROPERTY(bool timelineSnap READ timelineSnap WRITE setTimelineSnap NOTIFY timelineSnapChanged)
Q_PROPERTY(bool timelineCenterPlayhead READ timelineCenterPlayhead WRITE setTimelineCenterPlayhead
NOTIFY timelineCenterPlayheadChanged)
Q_PROPERTY(bool timelineScrollZoom READ timelineScrollZoom WRITE setTimelineScrollZoom NOTIFY
timelineScrollZoomChanged)
Q_PROPERTY(bool timelineFramebufferWaveform READ timelineFramebufferWaveform WRITE
setTimelineFramebufferWaveform NOTIFY timelineFramebufferWaveformChanged)
Q_PROPERTY(QString openPath READ openPath WRITE setOpenPath NOTIFY openPathChanged)
Q_PROPERTY(QString savePath READ savePath WRITE setSavePath NOTIFY savePathChanged)
Q_PROPERTY(QString playlistThumbnails READ playlistThumbnails WRITE setPlaylistThumbnails NOTIFY
playlistThumbnailsChanged)
Q_PROPERTY(QString viewMode READ viewMode WRITE setViewMode NOTIFY viewModeChanged)
Q_PROPERTY(int playerAudioChannels READ playerAudioChannels NOTIFY playerAudioChannelsChanged)
Q_PROPERTY(bool playerGPU READ playerGPU NOTIFY playerGpuChanged)
Q_PROPERTY(double audioInDuration READ audioInDuration WRITE setAudioInDuration NOTIFY
audioInDurationChanged)
Q_PROPERTY(double audioOutDuration READ audioOutDuration WRITE setAudioOutDuration NOTIFY
audioOutDurationChanged)
Q_PROPERTY(double videoInDuration READ videoInDuration WRITE setVideoInDuration NOTIFY
videoInDurationChanged)
Q_PROPERTY(double videoOutDuration READ videoOutDuration WRITE setVideoOutDuration NOTIFY
videoOutDurationChanged)
Q_PROPERTY(bool smallIcons READ smallIcons WRITE setSmallIcons NOTIFY smallIconsChanged)
Q_PROPERTY(bool askOutputFilter READ askOutputFilter WRITE setAskOutputFilter NOTIFY
askOutputFilterChanged)
public:
static ShotcutSettings &singleton();
explicit ShotcutSettings() : QObject() {}
explicit ShotcutSettings(const QString &appDataLocation);
void log();
// general
QString language() const;
void setLanguage(const QString &);
double imageDuration() const;
void setImageDuration(double);
QString openPath() const;
void setOpenPath(const QString &);
QString savePath() const;
void setSavePath(const QString &);
QStringList recent() const;
void setRecent(const QStringList &);
QString theme() const;
void setTheme(const QString &);
QThread::Priority jobPriority() const;
void setJobPriority(const QString &);
bool showTitleBars() const;
void setShowTitleBars(bool);
bool showToolBar() const;
void setShowToolBar(bool);
bool textUnderIcons() const;
void setTextUnderIcons(bool);
bool smallIcons() const;
void setSmallIcons(bool);
QByteArray windowGeometry() const;
void setWindowGeometry(const QByteArray &);
QByteArray windowGeometryDefault() const;
void setWindowGeometryDefault(const QByteArray &);
QByteArray windowState() const;
void setWindowState(const QByteArray &);
QByteArray windowStateDefault() const;
void setWindowStateDefault(const QByteArray &);
QString viewMode() const;
void setViewMode(const QString &viewMode);
QString exportFrameSuffix() const;
void setExportFrameSuffix(const QString &suffix);
bool convertAdvanced() const;
void setConvertAdvanced(bool);
// encode
QString encodePath() const;
void setEncodePath(const QString &);
bool encodeFreeSpaceCheck() const;
void setEncodeFreeSpaceCheck(bool);
bool encodeUseHardware() const;
void setEncodeUseHardware(bool);
QStringList encodeHardware() const;
void setEncodeHardware(const QStringList &);
bool encodeAdvanced() const;
void setEncodeAdvanced(bool);
bool showConvertClipDialog() const;
void setShowConvertClipDialog(bool);
bool encodeParallelProcessing() const;
void setEncodeParallelProcessing(bool);
// player
int playerAudioChannels() const;
void setPlayerAudioChannels(int);
QString playerDeinterlacer() const;
void setPlayerDeinterlacer(const QString &);
QString playerExternal() const;
void setPlayerExternal(const QString &);
QString playerGamma() const;
void setPlayerGamma(const QString &);
bool playerGPU() const;
void setPlayerGPU(bool);
bool playerWarnGPU() const;
QString playerInterpolation() const;
void setPlayerInterpolation(const QString &);
bool playerJACK() const;
void setPlayerJACK(bool);
int playerKeyerMode() const;
void setPlayerKeyerMode(int);
bool playerMuted() const;
void setPlayerMuted(bool);
QString playerProfile() const;
void setPlayerProfile(const QString &);
bool playerProgressive() const;
void setPlayerProgressive(bool);
bool playerRealtime() const;
void setPlayerRealtime(bool);
bool playerScrubAudio() const;
void setPlayerScrubAudio(bool);
int playerVolume() const;
void setPlayerVolume(int);
float playerZoom() const;
void setPlayerZoom(float);
int playerPreviewScale() const;
void setPlayerPreviewScale(int);
int playerVideoDelayMs() const;
void setPlayerVideoDelayMs(int);
// playlist
QString playlistThumbnails() const;
void setPlaylistThumbnails(const QString &);
bool playlistAutoplay() const;
void setPlaylistAutoplay(bool);
// timeline
bool timelineDragScrub() const;
void setTimelineDragScrub(bool);
bool timelineShowWaveforms() const;
void setTimelineShowWaveforms(bool);
bool timelineShowThumbnails() const;
void setTimelineShowThumbnails(bool);
bool timelineRipple() const;
void setTimelineRipple(bool);
bool timelineRippleAllTracks() const;
void setTimelineRippleAllTracks(bool);
bool timelineRippleMarkers() const;
void setTimelineRippleMarkers(bool);
bool timelineSnap() const;
void setTimelineSnap(bool);
bool timelineCenterPlayhead() const;
void setTimelineCenterPlayhead(bool);
int timelineTrackHeight() const;
void setTimelineTrackHeight(int);
bool timelineScrollZoom() const;
void setTimelineScrollZoom(bool);
bool timelineFramebufferWaveform() const;
void setTimelineFramebufferWaveform(bool);
int audioReferenceTrack() const;
void setAudioReferenceTrack(int);
double audioReferenceSpeedRange() const;
void setAudioReferenceSpeedRange(double);
// filter
QString filterFavorite(const QString &filterName);
void setFilterFavorite(const QString &filterName, const QString &value);
double audioInDuration() const;
void setAudioInDuration(double);
double audioOutDuration() const;
void setAudioOutDuration(double);
double videoInDuration() const;
void setVideoInDuration(double);
double videoOutDuration() const;
void setVideoOutDuration(double);
bool askOutputFilter() const;
void setAskOutputFilter(bool);
// scope
bool loudnessScopeShowMeter(const QString &meter) const;
void setLoudnessScopeShowMeter(const QString &meter, bool b);
// Markers
void setMarkerColor(const QColor &color);
QColor markerColor() const;
void setMarkersShowColumn(const QString &column, bool b);
bool markersShowColumn(const QString &column) const;
void setMarkerSort(int column, Qt::SortOrder order);
int getMarkerSortColumn();
Qt::SortOrder getMarkerSortOrder();
// general continued
int drawMethod() const;
void setDrawMethod(int);
bool noUpgrade() const;
void setNoUpgrade(bool value);
bool checkUpgradeAutomatic();
void setCheckUpgradeAutomatic(bool b);
bool askUpgradeAutomatic();
void setAskUpgradeAutomatic(bool b);
void sync();
QString appDataLocation() const;
static void setAppDataForSession(const QString &location);
void setAppDataLocally(const QString &location);
// layout
QStringList layouts() const;
bool setLayout(const QString &name, const QByteArray &geometry, const QByteArray &state);
QByteArray layoutGeometry(const QString &name);
QByteArray layoutState(const QString &name);
bool removeLayout(const QString &name);
int layoutMode() const;
void setLayoutMode(int mode = 0);
// general continued
bool clearRecent() const;
void setClearRecent(bool);
QString projectsFolder() const;
void setProjectsFolder(const QString &path);
QString audioInput() const;
void setAudioInput(const QString &name);
QString videoInput() const;
void setVideoInput(const QString &name);
QString glaxnimatePath() const;
void setGlaxnimatePath(const QString &path);
bool exportRangeMarkers() const;
void setExportRangeMarkers(bool);
// proxy
bool proxyEnabled() const;
void setProxyEnabled(bool);
QString proxyFolder() const;
void setProxyFolder(const QString &path);
bool proxyUseProjectFolder() const;
void setProxyUseProjectFolder(bool);
bool proxyUseHardware() const;
void setProxyUseHardware(bool);
int undoLimit() const;
signals:
void openPathChanged();
void savePathChanged();
void timelineDragScrubChanged();
void timelineShowWaveformsChanged();
void timelineShowThumbnailsChanged();
void timelineRippleChanged();
void timelineRippleAllTracksChanged();
void timelineRippleMarkersChanged();
void timelineSnapChanged();
void timelineCenterPlayheadChanged();
void timelineScrollZoomChanged();
void timelineFramebufferWaveformChanged();
void playerAudioChannelsChanged(int);
void playerGpuChanged();
void audioInDurationChanged();
void audioOutDurationChanged();
void videoInDurationChanged();
void videoOutDurationChanged();
void playlistThumbnailsChanged();
void viewModeChanged();
void smallIconsChanged();
void askOutputFilterChanged();
private:
QSettings settings;
QString m_appDataLocation;
};
#define Settings ShotcutSettings::singleton()
#endif // SETTINGS_H