Krita Source Code Documentation
Loading...
Searching...
No Matches
recorder_config.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2020 Dmitrii Utkin <loentar@gmail.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only
5 */
6
7#include "recorder_config.h"
8
9#include <kis_config.h>
10
11#include <QString>
12#include <QDir>
13
14namespace
15{
16const QString keySnapshotDirectory = "recorder/snapshotdirectory";
17const QString keyCaptureInterval = "recorder/captureinterval";
18const QString keyFormat = "recorder/format";
19const QString keyQuality = "recorder/quality";
20const QString keyCompression = "recorder/compression";
21const QString keyResolution = "recorder/resolution";
22const QString keyThreads = "recorder/threads";
23const QString keyRealTimeCaptureMode = "recorder/realtimecapturemode";
24const QString keyRecordIsolateLayerMode = "recorder/recordisolatelayermode";
25const QString keyRecordAutomatically = "recorder/recordautomatically";
26const QString defaultSnapshotDirectory = QDir::homePath() % QDir::separator() % "KritaRecorder";
27}
28
30 : config(new KisConfig(readOnly))
31{
32}
33
38
39
41{
42 return config->readEntry(keySnapshotDirectory, defaultSnapshotDirectory);
43}
44
46{
47 config->writeEntry(keySnapshotDirectory, value);
48}
49
50
52{
53 return config->readEntry(keyCaptureInterval, 1.);
54}
55
57{
58 config->writeEntry(keyCaptureInterval, value);
59}
60
61
63{
64 return static_cast<RecorderFormat>(config->readEntry(keyFormat, static_cast<int>(RecorderFormat::JPEG)));
65}
66
68{
69 return config->writeEntry(keyFormat, static_cast<int>(value));
70}
71
72
74{
75 return config->readEntry(keyQuality, 80);
76}
77
79{
80 config->writeEntry(keyQuality, value);
81}
82
83
85{
86 return config->readEntry(keyCompression, 1);
87}
88
90{
91 config->writeEntry(keyCompression, value);
92}
93
94
96{
97 return config->readEntry(keyResolution, 0);
98}
99
101{
102 config->writeEntry(keyResolution, value);
103}
104
106{
107 return config->readEntry(keyThreads, 1);
108}
109
111{
112 config->writeEntry(keyThreads, value);
113}
114
116{
117 return config->readEntry(keyRealTimeCaptureMode, false);
118}
120{
121 config->writeEntry(keyRealTimeCaptureMode, value);
122}
123
125{
126 return config->readEntry(keyRecordIsolateLayerMode, false);
127}
128
130{
131 config->writeEntry(keyRecordIsolateLayerMode, value);
132}
133
135{
136 return config->readEntry(keyRecordAutomatically, false);
137}
138
140{
141 config->writeEntry(keyRecordAutomatically, value);
142}
float value(const T *src, size_t ch)
void writeEntry(const QString &name, const T &value)
Definition kis_config.h:779
T readEntry(const QString &name, const T &defaultValue=T())
Definition kis_config.h:789
double captureInterval() const
QString snapshotDirectory() const
void setFormat(RecorderFormat value)
void setRealTimeCaptureMode(bool value)
bool recordIsolateLayerMode() const
RecorderFormat format() const
RecorderConfig(bool readOnly)
int resolution() const
void setRecordAutomatically(bool value)
void setResolution(int value)
KisConfig * config
void setCaptureInterval(double value)
void setSnapshotDirectory(const QString &value)
void setRecordIsolateLayerMode(bool value)
void setCompression(int value)
bool recordAutomatically() const
void setQuality(int value)
bool realTimeCaptureMode() const
int compression() const
void setThreads(int value)
int quality() const
RecorderFormat