-
Notifications
You must be signed in to change notification settings - Fork 29
/
settings.hpp
373 lines (322 loc) · 8.72 KB
/
settings.hpp
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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
/***************************************************************************
//
// softProjector - an open source media projection software
// Copyright (C) 2017 Vladislav Kobzar
//
// 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 version 3 of the License.
//
// 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_HPP
#define SETTINGS_HPP
#include <QtSql>
#include <QPixmap>
#include "spfunctions.hpp"
void saveIndividualSettings(QSqlQuery &sq, QString sId, int tId, QString name, const QVariant &value);
void updateIndividualSettings(QSqlQuery &sq, QString sId, int tId, QString name, const QVariant &value);
enum HorizontalAlignment
{
A_TOP,
A_MIDDLE,
A_BOTTOM
};
enum VerticalAlignment
{
A_LEFT,
A_CENTER,
A_RIGHT
};
enum TransitionType
{
TR_NONE,
TR_FADE,
TR_FADE_OUT,
TR_MOVE_RIGHT,
TR_MOVE_LEFT,
TR_MOVE_UP,
TR_MOVE_DOWN,
TR_COMMON
};
enum EffectType
{
E_NONE,
E_SHADOW,
E_BLURRED_SHADDOW,
E_COMMON
};
enum BackgroundType
{
B_NONE,
B_SOLID_COLOR,
B_PICTURE,
B_VIDEO,
B_VIDEO_PLAYBACK,
B_COMMON
};
enum ScreenPosition
{
TOP_OF_SCREEN,
BOTTOM_OF_SCREEN
};
enum SongEndingType
{
SE_STAR,
SE_DASH,
SE_CIRCLE,
SE_SMALL_DOT,
SE_BIG_DOT,
SE_SMALL_BOX,
SE_BIG_BOX,
SE_COPYRIGHT
};
class TextSettingsBase
{
public:
TextSettingsBase();
QString id;
int themeId;
// if to update bool handles
bool isChangedTextFont, isChangedTextColor, isChangedTextShadowColor;
bool isChangedAlingV, isChangedAlingH, isChangesTranType, isChangedEffectType;
bool isChangedBackType, isChangedBackColor, isChangedBackPix, isChangedBackVid;
bool isChangedScreenUse, isChangedScreenPos, isChangedSameDisp2, isChangedSameDisp3, isChangedSameDisp4;
//Text
QFont textFont;
QColor textColor;
QColor textShadowColor;
int textAlignmentV;
// 0 - Top, 1 - Middle, 3 - Bottom
int textAlignmentH;
// 0 - Left, 1 - Center, 3 - Right
//Effects
int transitionType;
// -1 - Common, 0 - None, 1 - Fade, 2 - Fade out->in,
// 3 - Move Right, 4 - Move Left, 5 - Move Up, 6 - Move Down
int effectsType;
// -1 - Common, 0 - None, 1 - Shadow, 2 - Blurred Shadow
//Background
int backgroundType;
// -1 - Common, 0 - Solid Color, 1 - Picture, 2 - Video
QColor backgroundColor;
QString backgroundName;
QPixmap backgroundPix; //TODO: Rename to backgroundPix
QString backgroundVideoPath;
// older implementation, Use it for now
bool useShadow;
bool useFading;
bool useBlurShadow;
bool useBackground;
bool useDisp1settings;
bool useDisp2settings;
bool useDisp3settings;
bool useDisp4settings;
// added Dynamic background
bool announcementAddBKColorToText;
QColor announcementTextRecBKColor;
QColor announcementTextGenBKColor;
//Layout
int screenUse;
int screenPosition;
// 0 - Top of Screen, 1 - Bottom of Screen
bool useSameForDisp2;
bool useSameForDisp3;
bool useSameForDisp4;
void saveBase();
void saveBase(QSqlQuery &sq);
void updateBase();
void updateBase(QSqlQuery &sq);
void loadBase();
void loadBase(QSqlQuery &sq);
void setBaseChangeHandles();
void resetBaseChangeHandles();
};
class TextSettings : public TextSettingsBase
{
public:
TextSettings();
//Text
bool isNotCommonFont;
bool isNotCommonColor;
//Layout
bool isNotCommonLayout;
// Change Handles
bool isChangedNotFont, isChangedNotColor, isChangedNotLayout;
void saveMain();
void saveMain(QSqlQuery &sq);
void updateMain();
void updateMain(QSqlQuery &sq);
void loadMain();
void loadMain(QSqlQuery &sq);
void setMainChangeHandles();
void resetMainChangeHandles();
};
class BibleVersionSettings
{
public:
BibleVersionSettings();
QString primaryBible;
QString secondaryBible;
QString trinaryBible;
QString operatorBible;
bool settingsChanged;
};
class BibleSettings : public TextSettings
{
public:
BibleSettings();
QFont captionFont;
bool isNotSameFont;
QColor captionColor;
bool isNotSameColor;
QColor captionShadowColor;
int captionAlignment;
int captionPosition;
bool useAbbriviation;
// Change Handles
bool isChangedCapFont, isChangedCapColor, isChangedCapShadColor, isChangedNotSameFont;
bool isChangedNotSameColor, isChangedCapAlign, isChangedCapPos, isChangedUseAbbriv;
// Dynamic Background Behind Text
bool bibleAddBKColorToText;
QColor bibleTextRecBKColor;
QColor bibleTextGenBKColor;
void save();
void save(QSqlQuery &sq);
void update();
void update(QSqlQuery &sq);
void load();
void load(QSqlQuery &sq);
void setChangeHandes();
void resetChangeHandles();
BibleVersionSettings versions;
};
class SongSettings : public TextSettings
{
public:
SongSettings();
// Stanza Details
bool showStanzaTitle;
bool showSongKey;
bool showSongNumber;
bool showSongEnding;
// Info
QFont infoFont;
QColor infoColor;
QColor infoShadowColor;
bool isNotSameInfoFont;
bool isNotSameInfoColor;
int infoAling; // 0 = Top, 1 = Bottom
//Ending
QFont endingFont;
QColor endingColor;
QColor endingShadowColor;
bool isNotSameEndingFont;
bool isNotSameEndingColor;
int endingType; // 0 = ***, 1 = ---, 2 = °°°, 3 = •••, 4 = ●●●, 5 = ▪▪▪, 6 = ■■■, 7 = for song copyright info
int endingPosition;
// Change Handles
bool isChangedShowTitle, isChangedShowKey, isChangedShowNum, isChangedShowEnding;
bool isChangedInfoFont, isChangedInfoColor, isChangedInfoShadColor, isChangedNotSameInfoFont;
bool isChangedNotSameInfoColor, isChangedInfoAlign, isChangedEndingFont, isChangedEndingColor;
bool isChangedEndingShadColor, isChangedNotSameEndingFont, isChangedNotSameEndingColor;
bool isChangedEndingType, isChangedEndingPosition;
// Dynamic Background Behind Text
bool songAddBKColorToText;
QColor songTextRecBKColor;
QColor songTextGenBKColor;
void save();
void save(QSqlQuery &sq);
void update();
void update(QSqlQuery &sq);
void load();
void load(QSqlQuery &sq);
void setChangeHandes();
void resetChangeHandles();
};
class DisplayControlsSettings
{
public:
DisplayControlsSettings();
int buttonSize;
int alignmentV;
int alignmentH;
qreal opacity;
};
class GeneralSettings
{ // To store General Program Settings
public:
GeneralSettings();
bool displayIsOnTop;
bool useDarkTheme;
int displayScreen; // stores primary display screen location
int displayScreen2; // stores secondary display screen location
int displayScreen3; // stores Tertiary display screen location
int displayScreen4; // stores Quaternary display screen location
DisplayControlsSettings displayControls;
int currentThemeId;
bool displayOnStartUp;
bool settingsChangedAll;
bool settingsChangedMulti;
bool settingsChangedSingle;
};
class DisplaySettings
{ // to store display settings for concurrent projection
public:
bool useBackground;
QString backgroundPath;
QFont textFont;
QColor textColor;
int textAlignmentV;
int textAlignmentH;
};
class SpSettings
{ // stores main window settings, none user modifiable
public:
SpSettings();
QByteArray spSplitter;
QByteArray bibleHiddenSplitter;
QByteArray bibleShowSplitter;
QByteArray songSplitter;
bool isWindowMaximized;
QString uiTranslation;
};
class SlideShowSettings
{
public:
SlideShowSettings();
bool expandSmall;
int fitType;
bool resize;
int boundType;
int boundWidth;
bool settingsChanged;
int transitionType;
};
class Settings
{
public:
Settings();
GeneralSettings general;
SpSettings spMain;
BibleVersionSettings bibleSets;
BibleVersionSettings bibleSets2;
BibleVersionSettings bibleSets3;
BibleVersionSettings bibleSets4;
SlideShowSettings slideSets;
bool isSpClosing;
public slots:
void loadSettings();
void saveSettings();
void saveNewSettings();
private slots:
QByteArray textToByt(QString text);
};
#endif // SETTINGS_HPP