kdenlivesettingsdialog.cpp 64 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/***************************************************************************
 *   Copyright (C) 2008 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
 *                                                                         *
 *   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 2 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, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
 ***************************************************************************/

20
21
#include "kdenlivesettingsdialog.h"
#include "profilesdialog.h"
22
#include "encodingprofilesdialog.h"
23
#include "project/dialogs/profilewidget.h"
24
#include "utils/KoIconUtils.h"
25
#include "dialogs/profilesdialog.h"
26
#include "kdenlivesettings.h"
27
#include "clipcreationdialog.h"
28
#include "renderer.h"
29

Vincent Pinon's avatar
Vincent Pinon committed
30
31
32
#ifdef USE_V4L
#include "capture/v4lcapture.h"
#endif
33

34
#include "klocalizedstring.h"
35
#include <KMessageBox>
36
#include <KLineEdit>
37
38
39
#include <KService>
#include <KRun>
#include <KOpenWithDialog>
Laurent Montel's avatar
Laurent Montel committed
40
#include "kdenlive_debug.h"
41
42
#include <QDir>
#include <QTimer>
43
#include <QThread>
44

45
46
47
48
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
49

50
#ifdef USE_JOGSHUTTLE
51
52
53
#include "jogshuttle/jogaction.h"
#include "jogshuttle/jogshuttleconfig.h"
#include <linux/input.h>
54
#include <QStandardPaths>
55
#endif
56

57
KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString> &mappable_actions, bool gpuAllowed, QWidget *parent) :
58
    KConfigDialog(parent, QStringLiteral("settings"), KdenliveSettings::self()),
59
60
61
    m_modified(false),
    m_shuttleModified(false),
    m_mappable_actions(mappable_actions)
62
{
63
    KdenliveSettings::setV4l_format(0);
64
65
    QWidget *p1 = new QWidget;
    m_configMisc.setupUi(p1);
66
67
    m_page1 = addPage(p1, i18n("Misc"));
    m_page1->setIcon(KoIconUtils::themedIcon(QStringLiteral("configure")));
68

69
70
    // Hide avformat-novalidate trick, causes crash (bug #2205 and #2206)
    m_configMisc.kcfg_projectloading_avformatnovalidate->setVisible(false);
71

72
    m_configMisc.kcfg_use_exiftool->setEnabled(!QStandardPaths::findExecutable(QStringLiteral("exiftool")).isEmpty());
73

74
75
    QWidget *p8 = new QWidget;
    m_configProject.setupUi(p8);
76
    m_page8 = addPage(p8, i18n("Project Defaults"));
77
78
79
80
81
82
    QVBoxLayout *vbox = new QVBoxLayout;
    m_pw = new ProfileWidget(this);
    vbox->addWidget(m_pw);
    m_configProject.profile_box->setLayout(vbox);
    // Select profile
    m_pw->loadProfile(KdenliveSettings::default_profile().isEmpty() ? KdenliveSettings::current_profile() : KdenliveSettings::default_profile());
83
    connect(m_pw, &ProfileWidget::profileChanged, this, &KdenliveSettingsDialog::slotDialogModified);
84
    m_page8->setIcon(KoIconUtils::themedIcon(QStringLiteral("project-defaults")));
Laurent Montel's avatar
Laurent Montel committed
85
    connect(m_configProject.kcfg_generateproxy, &QAbstractButton::toggled, m_configProject.kcfg_proxyminsize, &QWidget::setEnabled);
86
    m_configProject.kcfg_proxyminsize->setEnabled(KdenliveSettings::generateproxy());
87
88
    m_configProject.projecturl->setMode(KFile::Directory);
    m_configProject.projecturl->setUrl(QUrl::fromLocalFile(KdenliveSettings::defaultprojectfolder()));
Laurent Montel's avatar
Laurent Montel committed
89
    connect(m_configProject.kcfg_generateimageproxy, &QAbstractButton::toggled, m_configProject.kcfg_proxyimageminsize, &QWidget::setEnabled);
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
90
    m_configProject.kcfg_proxyimageminsize->setEnabled(KdenliveSettings::generateimageproxy());
91

92
    QWidget *p3 = new QWidget;
93
    m_configTimeline.setupUi(p3);
94
95
    m_page3 = addPage(p3, i18n("Timeline"));
    m_page3->setIcon(KoIconUtils::themedIcon(QStringLiteral("video-display")));
96
97
98
99

    QWidget *p2 = new QWidget;
    m_configEnv.setupUi(p2);
    m_configEnv.mltpathurl->setMode(KFile::Directory);
100
101
102
103
104
    m_configEnv.mltpathurl->lineEdit()->setObjectName(QStringLiteral("kcfg_mltpath"));
    m_configEnv.rendererpathurl->lineEdit()->setObjectName(QStringLiteral("kcfg_rendererpath"));
    m_configEnv.ffmpegurl->lineEdit()->setObjectName(QStringLiteral("kcfg_ffmpegpath"));
    m_configEnv.ffplayurl->lineEdit()->setObjectName(QStringLiteral("kcfg_ffplaypath"));
    m_configEnv.ffprobeurl->lineEdit()->setObjectName(QStringLiteral("kcfg_ffprobepath"));
105
106
    int maxThreads = QThread::idealThreadCount();
    m_configEnv.kcfg_mltthreads->setMaximum(maxThreads > 2 ? maxThreads : 8);
107
    m_configEnv.tmppathurl->setMode(KFile::Directory);
108
    m_configEnv.tmppathurl->lineEdit()->setObjectName(QStringLiteral("kcfg_currenttmpfolder"));
109
    m_configEnv.capturefolderurl->setMode(KFile::Directory);
110
    m_configEnv.capturefolderurl->lineEdit()->setObjectName(QStringLiteral("kcfg_capturefolder"));
111
    m_configEnv.capturefolderurl->setEnabled(!KdenliveSettings::capturetoprojectfolder());
Laurent Montel's avatar
Laurent Montel committed
112
    connect(m_configEnv.kcfg_capturetoprojectfolder, &QAbstractButton::clicked, this, &KdenliveSettingsDialog::slotEnableCaptureFolder);
113
114
115
116
    // Library folder
    m_configEnv.libraryfolderurl->setMode(KFile::Directory);
    m_configEnv.libraryfolderurl->lineEdit()->setObjectName(QStringLiteral("kcfg_libraryfolder"));
    m_configEnv.libraryfolderurl->setEnabled(!KdenliveSettings::librarytodefaultfolder());
117
    m_configEnv.kcfg_librarytodefaultfolder->setToolTip(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/library"));
Laurent Montel's avatar
Laurent Montel committed
118
    connect(m_configEnv.kcfg_librarytodefaultfolder, &QAbstractButton::clicked, this, &KdenliveSettingsDialog::slotEnableLibraryFolder);
119

120
121
122
    // Mime types
    QStringList mimes = ClipCreationDialog::getExtensions();
    qSort(mimes);
Laurent Montel's avatar
Laurent Montel committed
123
    m_configEnv.supportedmimes->setPlainText(mimes.join(QLatin1Char(' ')));
124

125
126
    m_page2 = addPage(p2, i18n("Environment"));
    m_page2->setIcon(KoIconUtils::themedIcon(QStringLiteral("application-x-executable-script")));
127
128
129

    QWidget *p4 = new QWidget;
    m_configCapture.setupUi(p4);
130
131
    m_configCapture.tabWidget->removeTab(0);
    m_configCapture.tabWidget->removeTab(2);
132
#ifdef USE_V4L
133

134
    // Video 4 Linux device detection
Laurent Montel's avatar
Laurent Montel committed
135
    for (int i = 0; i < 10; ++i) {
Laurent Montel's avatar
Laurent Montel committed
136
        QString path = QStringLiteral("/dev/video") + QString::number(i);
137
        if (QFile::exists(path)) {
138
            QStringList deviceInfo = V4lCaptureHandler::getDeviceName(path);
139
140
141
142
            if (!deviceInfo.isEmpty()) {
                m_configCapture.kcfg_detectedv4ldevices->addItem(deviceInfo.at(0), path);
                m_configCapture.kcfg_detectedv4ldevices->setItemData(m_configCapture.kcfg_detectedv4ldevices->count() - 1, deviceInfo.at(1), Qt::UserRole + 1);
            }
143
144
145
        }
    }
    connect(m_configCapture.kcfg_detectedv4ldevices, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdatev4lDevice()));
146
    connect(m_configCapture.kcfg_v4l_format, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdatev4lCaptureProfile()));
Laurent Montel's avatar
Laurent Montel committed
147
    connect(m_configCapture.config_v4l, &QAbstractButton::clicked, this, &KdenliveSettingsDialog::slotEditVideo4LinuxProfile);
148
149

    slotUpdatev4lDevice();
150
#endif
151

152
153
    m_page4 = addPage(p4, i18n("Capture"));
    m_page4->setIcon(KoIconUtils::themedIcon(QStringLiteral("media-record")));
154
    m_configCapture.tabWidget->setCurrentIndex(KdenliveSettings::defaultcapture());
Alberto Villa's avatar
Alberto Villa committed
155
#ifdef Q_WS_MAC
156
157
    m_configCapture.tabWidget->setEnabled(false);
    m_configCapture.kcfg_defaultcapture->setEnabled(false);
Alberto Villa's avatar
Alberto Villa committed
158
    m_configCapture.label->setText(i18n("Capture is not yet available on Mac OS X."));
159
#endif
160

161
162
    QWidget *p5 = new QWidget;
    m_configShuttle.setupUi(p5);
163
#ifdef USE_JOGSHUTTLE
164
    m_configShuttle.toolBtnReload->setIcon(KoIconUtils::themedIcon(QStringLiteral("view-refresh")));
Laurent Montel's avatar
Laurent Montel committed
165
    connect(m_configShuttle.kcfg_enableshuttle, &QCheckBox::stateChanged, this, &KdenliveSettingsDialog::slotCheckShuttle);
166
    connect(m_configShuttle.shuttledevicelist, SIGNAL(activated(int)), this, SLOT(slotUpdateShuttleDevice(int)));
Laurent Montel's avatar
Laurent Montel committed
167
    connect(m_configShuttle.toolBtnReload, &QAbstractButton::clicked, this, &KdenliveSettingsDialog::slotReloadShuttleDevices);
168

169
    slotCheckShuttle(KdenliveSettings::enableshuttle());
170
    m_configShuttle.shuttledisabled->hide();
171
172

    // Store the button pointers into an array for easier handling them in the other functions.
173
    // TODO: impl enumerator or live with cut and paste :-)))
174
175
    setupJogshuttleBtns(KdenliveSettings::shuttledevice());
#if 0
176
177
178
179
180
    m_shuttle_buttons.push_back(m_configShuttle.shuttle1);
    m_shuttle_buttons.push_back(m_configShuttle.shuttle2);
    m_shuttle_buttons.push_back(m_configShuttle.shuttle3);
    m_shuttle_buttons.push_back(m_configShuttle.shuttle4);
    m_shuttle_buttons.push_back(m_configShuttle.shuttle5);
181
182
183
184
185
    m_shuttle_buttons.push_back(m_configShuttle.shuttle6);
    m_shuttle_buttons.push_back(m_configShuttle.shuttle7);
    m_shuttle_buttons.push_back(m_configShuttle.shuttle8);
    m_shuttle_buttons.push_back(m_configShuttle.shuttle9);
    m_shuttle_buttons.push_back(m_configShuttle.shuttle10);
186
187
188
189
190
    m_shuttle_buttons.push_back(m_configShuttle.shuttle11);
    m_shuttle_buttons.push_back(m_configShuttle.shuttle12);
    m_shuttle_buttons.push_back(m_configShuttle.shuttle13);
    m_shuttle_buttons.push_back(m_configShuttle.shuttle14);
    m_shuttle_buttons.push_back(m_configShuttle.shuttle15);
191
#endif
192

193
194
195
196
#else /* ! USE_JOGSHUTTLE */
    m_configShuttle.kcfg_enableshuttle->hide();
    m_configShuttle.kcfg_enableshuttle->setDisabled(true);
#endif /* USE_JOGSHUTTLE */
197
198
    m_page5 = addPage(p5, i18n("JogShuttle"));
    m_page5->setIcon(KoIconUtils::themedIcon(QStringLiteral("jog-dial")));
199

200
201
    QWidget *p6 = new QWidget;
    m_configSdl.setupUi(p6);
202
    m_configSdl.reload_blackmagic->setIcon(KoIconUtils::themedIcon(QStringLiteral("view-refresh")));
Laurent Montel's avatar
Laurent Montel committed
203
    connect(m_configSdl.reload_blackmagic, &QAbstractButton::clicked, this, &KdenliveSettingsDialog::slotReloadBlackMagic);
204

205
206
    //m_configSdl.kcfg_openglmonitors->setHidden(true);

207
208
    m_page6 = addPage(p6, i18n("Playback"));
    m_page6->setIcon(KoIconUtils::themedIcon(QStringLiteral("media-playback-start")));
209

210
211
    QWidget *p7 = new QWidget;
    m_configTranscode.setupUi(p7);
212
213
214
    m_page7 = addPage(p7, i18n("Transcode"));
    m_page7->setIcon(KoIconUtils::themedIcon(QStringLiteral("edit-copy")));

Laurent Montel's avatar
Laurent Montel committed
215
216
217
218
    connect(m_configTranscode.button_add, &QAbstractButton::clicked, this, &KdenliveSettingsDialog::slotAddTranscode);
    connect(m_configTranscode.button_delete, &QAbstractButton::clicked, this, &KdenliveSettingsDialog::slotDeleteTranscode);
    connect(m_configTranscode.profiles_list, &QListWidget::itemChanged, this, &KdenliveSettingsDialog::slotDialogModified);
    connect(m_configTranscode.profiles_list, &QListWidget::currentRowChanged, this, &KdenliveSettingsDialog::slotSetTranscodeProfile);
219

Laurent Montel's avatar
Laurent Montel committed
220
221
222
223
224
    connect(m_configTranscode.profile_name, &QLineEdit::textChanged, this, &KdenliveSettingsDialog::slotEnableTranscodeUpdate);
    connect(m_configTranscode.profile_description, &QLineEdit::textChanged, this, &KdenliveSettingsDialog::slotEnableTranscodeUpdate);
    connect(m_configTranscode.profile_extension, &QLineEdit::textChanged, this, &KdenliveSettingsDialog::slotEnableTranscodeUpdate);
    connect(m_configTranscode.profile_parameters, &QPlainTextEdit::textChanged, this, &KdenliveSettingsDialog::slotEnableTranscodeUpdate);
    connect(m_configTranscode.profile_audioonly, &QCheckBox::stateChanged, this, &KdenliveSettingsDialog::slotEnableTranscodeUpdate);
225

Laurent Montel's avatar
Laurent Montel committed
226
    connect(m_configTranscode.button_update, &QAbstractButton::pressed, this, &KdenliveSettingsDialog::slotUpdateTranscodingProfile);
227

228
    m_configTranscode.profile_parameters->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 5);
Alberto Villa's avatar
Alberto Villa committed
229

Laurent Montel's avatar
Laurent Montel committed
230
231
    connect(m_configEnv.kp_image, &QAbstractButton::clicked, this, &KdenliveSettingsDialog::slotEditImageApplication);
    connect(m_configEnv.kp_audio, &QAbstractButton::clicked, this, &KdenliveSettingsDialog::slotEditAudioApplication);
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
232

233
    loadEncodingProfiles();
234

235
    connect(m_configSdl.kcfg_audio_driver, SIGNAL(currentIndexChanged(int)), this, SLOT(slotCheckAlsaDriver()));
236
    connect(m_configSdl.kcfg_audio_backend, SIGNAL(currentIndexChanged(int)), this, SLOT(slotCheckAudioBackend()));
237
    initDevices();
238
    connect(m_configCapture.kcfg_grab_capture_type, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateGrabRegionStatus()));
239

240
    slotUpdateGrabRegionStatus();
241
    loadTranscodeProfiles();
242

243
244
    //HACK: check dvgrab version, because only dvgrab >= 3.3 supports
    //   --timestamp option without bug
245

246
    if (KdenliveSettings::dvgrab_path().isEmpty() || !QFile::exists(KdenliveSettings::dvgrab_path())) {
247
        QString dvgrabpath = QStandardPaths::findExecutable(QStringLiteral("dvgrab"));
248
        KdenliveSettings::setDvgrab_path(dvgrabpath);
249
    }
250

251
    // decklink profile
252
253
    QAction *act = new QAction(KoIconUtils::themedIcon(QStringLiteral("configure")), i18n("Configure profiles"), this);
    act->setData(4);
Laurent Montel's avatar
Laurent Montel committed
254
    connect(act, &QAction::triggered, this, &KdenliveSettingsDialog::slotManageEncodingProfile);
255
    m_configCapture.decklink_manageprofile->setDefaultAction(act);
256
    m_configCapture.decklink_showprofileinfo->setIcon(KoIconUtils::themedIcon(QStringLiteral("help-about")));
257
258
259
260
    m_configCapture.decklink_parameters->setVisible(false);
    m_configCapture.decklink_parameters->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 4);
    m_configCapture.decklink_parameters->setPlainText(KdenliveSettings::decklink_parameters());
    connect(m_configCapture.kcfg_decklink_profile, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateDecklinkProfile()));
Laurent Montel's avatar
Laurent Montel committed
261
    connect(m_configCapture.decklink_showprofileinfo, &QAbstractButton::clicked, m_configCapture.decklink_parameters, &QWidget::setVisible);
262

263
    // ffmpeg profile
264
    m_configCapture.v4l_showprofileinfo->setIcon(KoIconUtils::themedIcon(QStringLiteral("help-about")));
265
266
267
    m_configCapture.v4l_parameters->setVisible(false);
    m_configCapture.v4l_parameters->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 4);
    m_configCapture.v4l_parameters->setPlainText(KdenliveSettings::v4l_parameters());
268
269
270

    act = new QAction(KoIconUtils::themedIcon(QStringLiteral("configure")), i18n("Configure profiles"), this);
    act->setData(2);
Laurent Montel's avatar
Laurent Montel committed
271
    connect(act, &QAction::triggered, this, &KdenliveSettingsDialog::slotManageEncodingProfile);
272
    m_configCapture.v4l_manageprofile->setDefaultAction(act);
273
    connect(m_configCapture.kcfg_v4l_profile, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateV4lProfile()));
Laurent Montel's avatar
Laurent Montel committed
274
    connect(m_configCapture.v4l_showprofileinfo, &QAbstractButton::clicked, m_configCapture.v4l_parameters, &QWidget::setVisible);
275

276
    // screen grab profile
277
    m_configCapture.grab_showprofileinfo->setIcon(KoIconUtils::themedIcon(QStringLiteral("help-about")));
278
279
280
    m_configCapture.grab_parameters->setVisible(false);
    m_configCapture.grab_parameters->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 4);
    m_configCapture.grab_parameters->setPlainText(KdenliveSettings::grab_parameters());
281
282
    act = new QAction(KoIconUtils::themedIcon(QStringLiteral("configure")), i18n("Configure profiles"), this);
    act->setData(3);
Laurent Montel's avatar
Laurent Montel committed
283
    connect(act, &QAction::triggered, this, &KdenliveSettingsDialog::slotManageEncodingProfile);
284
    m_configCapture.grab_manageprofile->setDefaultAction(act);
285
    connect(m_configCapture.kcfg_grab_profile, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateGrabProfile()));
Laurent Montel's avatar
Laurent Montel committed
286
    connect(m_configCapture.grab_showprofileinfo, &QAbstractButton::clicked, m_configCapture.grab_parameters, &QWidget::setVisible);
Alberto Villa's avatar
Alberto Villa committed
287

288
    // Timeline preview
289
290
    act = new QAction(KoIconUtils::themedIcon(QStringLiteral("configure")), i18n("Configure profiles"), this);
    act->setData(1);
Laurent Montel's avatar
Laurent Montel committed
291
    connect(act, &QAction::triggered, this, &KdenliveSettingsDialog::slotManageEncodingProfile);
292
293
    m_configProject.preview_manageprofile->setDefaultAction(act);
    connect(m_configProject.kcfg_preview_profile, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdatePreviewProfile()));
Laurent Montel's avatar
Laurent Montel committed
294
    connect(m_configProject.preview_showprofileinfo, &QAbstractButton::clicked, m_configProject.previewparams, &QWidget::setVisible);
295
296
297
298
299
300
301
302
    m_configProject.previewparams->setVisible(false);
    m_configProject.previewparams->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 3);
    m_configProject.previewparams->setPlainText(KdenliveSettings::previewparams());
    m_configProject.preview_showprofileinfo->setIcon(KoIconUtils::themedIcon(QStringLiteral("help-about")));
    m_configProject.preview_showprofileinfo->setToolTip(i18n("Show default timeline preview parameters"));
    m_configProject.preview_manageprofile->setIcon(KoIconUtils::themedIcon(QStringLiteral("configure")));
    m_configProject.preview_manageprofile->setToolTip(i18n("Manage timeline preview profiles"));
    m_configProject.kcfg_preview_profile->setToolTip(i18n("Select default timeline preview profile"));
303

304
    // proxy profile stuff
305
    m_configProject.proxy_showprofileinfo->setIcon(KoIconUtils::themedIcon(QStringLiteral("help-about")));
306
    m_configProject.proxy_showprofileinfo->setToolTip(i18n("Show default profile parameters"));
307
    m_configProject.proxy_manageprofile->setIcon(KoIconUtils::themedIcon(QStringLiteral("configure")));
308
309
    m_configProject.proxy_manageprofile->setToolTip(i18n("Manage proxy profiles"));
    m_configProject.kcfg_proxy_profile->setToolTip(i18n("Select default proxy profile"));
310
    m_configProject.proxyparams->setVisible(false);
311
    m_configProject.proxyparams->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 3);
312
    m_configProject.proxyparams->setPlainText(KdenliveSettings::proxyparams());
313
314
315

    act = new QAction(KoIconUtils::themedIcon(QStringLiteral("configure")), i18n("Configure profiles"), this);
    act->setData(0);
Laurent Montel's avatar
Laurent Montel committed
316
    connect(act, &QAction::triggered, this, &KdenliveSettingsDialog::slotManageEncodingProfile);
317
318
    m_configProject.proxy_manageprofile->setDefaultAction(act);

Laurent Montel's avatar
Laurent Montel committed
319
    connect(m_configProject.proxy_showprofileinfo, &QAbstractButton::clicked, m_configProject.proxyparams, &QWidget::setVisible);
320
321
322
323
    connect(m_configProject.kcfg_proxy_profile, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateProxyProfile()));

    slotUpdateProxyProfile(-1);
    slotUpdateV4lProfile(-1);
324
    slotUpdateGrabProfile(-1);
325
    slotUpdateDecklinkProfile(-1);
326

327
328
    // enable GPU accel only if Movit is found
    m_configSdl.kcfg_gpu_accel->setEnabled(gpuAllowed);
329
    m_configSdl.kcfg_gpu_accel->setToolTip(i18n("GPU processing needs MLT compiled with Movit and Rtaudio modules"));
Alberto Villa's avatar
Alberto Villa committed
330

331
332
333
    Render::getBlackMagicDeviceList(m_configCapture.kcfg_decklink_capturedevice);
    if (!Render::getBlackMagicOutputDeviceList(m_configSdl.kcfg_blackmagic_output_device)) {
        // No blackmagic card found
334
        m_configSdl.kcfg_external_display->setEnabled(false);
335
    }
336

337
    if (!KdenliveSettings::dvgrab_path().isEmpty()) {
Vincent Pinon's avatar
Vincent Pinon committed
338
        double dvgrabVersion = 0;
339
340
        QProcess *versionCheck = new QProcess;
        versionCheck->setProcessChannelMode(QProcess::MergedChannels);
341
        versionCheck->start(QStringLiteral("dvgrab"), QStringList() << QStringLiteral("--version"));
342
343
        if (versionCheck->waitForFinished()) {
            QString version = QString(versionCheck->readAll()).simplified();
Laurent Montel's avatar
Laurent Montel committed
344
            if (version.contains(QLatin1Char(' '))) {
345
                version = version.section(QLatin1Char(' '), -1);
346
            }
347
348
            dvgrabVersion = version.toDouble();

Laurent Montel's avatar
Laurent Montel committed
349
            //qCDebug(KDENLIVE_LOG) << "// FOUND DVGRAB VERSION: " << dvgrabVersion;
350
        }
351
        delete versionCheck;
352
353
354
355
356
        if (dvgrabVersion < 3.3) {
            KdenliveSettings::setFirewiretimestamp(false);
            m_configCapture.kcfg_firewiretimestamp->setEnabled(false);
        }
        m_configCapture.dvgrab_info->setText(i18n("dvgrab version %1 at %2", dvgrabVersion, KdenliveSettings::dvgrab_path()));
357
358
359
    } else {
        m_configCapture.dvgrab_info->setText(i18n("<strong><em>dvgrab</em> utility not found, please install it for firewire capture</strong>"));
    }
360
361
}

Laurent Montel's avatar
Laurent Montel committed
362
void KdenliveSettingsDialog::setupJogshuttleBtns(const QString &device)
363
{
364
365
    QList<KComboBox *> list;
    QList<QLabel *> list1;
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398

    list << m_configShuttle.shuttle1;
    list << m_configShuttle.shuttle2;
    list << m_configShuttle.shuttle3;
    list << m_configShuttle.shuttle4;
    list << m_configShuttle.shuttle5;
    list << m_configShuttle.shuttle6;
    list << m_configShuttle.shuttle7;
    list << m_configShuttle.shuttle8;
    list << m_configShuttle.shuttle9;
    list << m_configShuttle.shuttle10;
    list << m_configShuttle.shuttle11;
    list << m_configShuttle.shuttle12;
    list << m_configShuttle.shuttle13;
    list << m_configShuttle.shuttle14;
    list << m_configShuttle.shuttle15;

    list1 << m_configShuttle.label_2; // #1
    list1 << m_configShuttle.label_4; // #2
    list1 << m_configShuttle.label_3; // #3
    list1 << m_configShuttle.label_7; // #4
    list1 << m_configShuttle.label_5; // #5
    list1 << m_configShuttle.label_6; // #6
    list1 << m_configShuttle.label_8; // #7
    list1 << m_configShuttle.label_9; // #8
    list1 << m_configShuttle.label_10; // #9
    list1 << m_configShuttle.label_11; // #10
    list1 << m_configShuttle.label_12; // #11
    list1 << m_configShuttle.label_13; // #12
    list1 << m_configShuttle.label_14; // #13
    list1 << m_configShuttle.label_15; // #14
    list1 << m_configShuttle.label_16; // #15

399
    for (int i = 0; i < list.count(); ++i) {
400
401
402
        list[i]->hide();
        list1[i]->hide();
    }
403
#ifdef USE_JOGSHUTTLE
404
405
406
    if (!m_configShuttle.kcfg_enableshuttle->isChecked()) {
        return;
    }
407
408
    int keysCount = JogShuttle::keysCount(device);

409
    for (int i = 0; i < keysCount; ++i) {
410
411
412
413
414
415
416
417
418
        m_shuttle_buttons.push_back(list[i]);
        list[i]->show();
        list1[i]->show();
    }

    // populate the buttons with the current configuration. The items are sorted
    // according to the user-selected language, so they do not appear in random order.
    QMap<QString, QString> mappable_actions(m_mappable_actions);
    QList<QString> action_names = mappable_actions.keys();
419
    QList<QString>::Iterator iter = action_names.begin();
Laurent Montel's avatar
Laurent Montel committed
420
    //qCDebug(KDENLIVE_LOG) << "::::::::::::::::";
421
    while (iter != action_names.end()) {
Laurent Montel's avatar
Laurent Montel committed
422
        //qCDebug(KDENLIVE_LOG) << *iter;
423
424
425
        ++iter;
    }

Laurent Montel's avatar
Laurent Montel committed
426
    //qCDebug(KDENLIVE_LOG) << "::::::::::::::::";
427

428
    qSort(action_names);
429
430
    iter = action_names.begin();
    while (iter != action_names.end()) {
Laurent Montel's avatar
Laurent Montel committed
431
        //qCDebug(KDENLIVE_LOG) << *iter;
432
433
        ++iter;
    }
Laurent Montel's avatar
Laurent Montel committed
434
    //qCDebug(KDENLIVE_LOG) << "::::::::::::::::";
435
436
437
438
439

    // Here we need to compute the action_id -> index-in-action_names. We iterate over the
    // action_names, as the sorting may depend on the user-language.
    QStringList actions_map = JogShuttleConfig::actionMap(KdenliveSettings::shuttlebuttons());
    QMap<QString, int> action_pos;
440
    foreach (const QString &action_id, actions_map) {
441
442
443
444
445
446
447
448
449
450
        // This loop find out at what index is the string that would map to the action_id.
        for (int i = 0; i < action_names.size(); ++i) {
            if (mappable_actions[action_names.at(i)] == action_id) {
                action_pos[action_id] = i;
                break;
            }
        }
    }

    int i = 0;
451
    foreach (KComboBox *button, m_shuttle_buttons) {
452
453
454
        button->addItems(action_names);
        connect(button, SIGNAL(activated(int)), this, SLOT(slotShuttleModified()));
        ++i;
455
        if (i < actions_map.size()) {
456
            button->setCurrentIndex(action_pos[actions_map[i]]);
457
        }
458
    }
459
#endif
460
461
}

462
463
KdenliveSettingsDialog::~KdenliveSettingsDialog() {}

464
void KdenliveSettingsDialog::slotUpdateGrabRegionStatus()
465
{
466
    m_configCapture.region_group->setHidden(m_configCapture.kcfg_grab_capture_type->currentIndex() != 1);
467
}
468

469
470
471
472
473
void KdenliveSettingsDialog::slotEnableCaptureFolder()
{
    m_configEnv.capturefolderurl->setEnabled(!m_configEnv.kcfg_capturetoprojectfolder->isChecked());
}

474
475
476
477
478
void KdenliveSettingsDialog::slotEnableLibraryFolder()
{
    m_configEnv.libraryfolderurl->setEnabled(!m_configEnv.kcfg_librarytodefaultfolder->isChecked());
}

479
480
void KdenliveSettingsDialog::initDevices()
{
481
482
    // Fill audio drivers
    m_configSdl.kcfg_audio_driver->addItem(i18n("Automatic"), QString());
483
#ifndef Q_WS_MAC
484
485
    m_configSdl.kcfg_audio_driver->addItem(i18n("OSS"), "dsp");
    m_configSdl.kcfg_audio_driver->addItem(i18n("ALSA"), "alsa");
486
    m_configSdl.kcfg_audio_driver->addItem(i18n("PulseAudio"), "pulse");
487
488
489
    m_configSdl.kcfg_audio_driver->addItem(i18n("OSS with DMA access"), "dma");
    m_configSdl.kcfg_audio_driver->addItem(i18n("Esound daemon"), "esd");
    m_configSdl.kcfg_audio_driver->addItem(i18n("ARTS daemon"), "artsc");
490
#endif
491

492
    if (!KdenliveSettings::audiodrivername().isEmpty())
493
        for (int i = 1; i < m_configSdl.kcfg_audio_driver->count(); ++i) {
494
495
496
497
498
            if (m_configSdl.kcfg_audio_driver->itemData(i).toString() == KdenliveSettings::audiodrivername()) {
                m_configSdl.kcfg_audio_driver->setCurrentIndex(i);
                KdenliveSettings::setAudio_driver((uint) i);
            }
        }
499

500
    // Fill the list of audio playback / recording devices
501
    m_configSdl.kcfg_audio_device->addItem(i18n("Default"), QString());
502
    m_configCapture.kcfg_v4l_alsadevice->addItem(i18n("Default"), "default");
503
    if (!QStandardPaths::findExecutable(QStringLiteral("aplay")).isEmpty()) {
504
        m_readProcess.setOutputChannelMode(KProcess::OnlyStdoutChannel);
505
        m_readProcess.setProgram(QStringLiteral("aplay"), QStringList() << QStringLiteral("-l"));
Laurent Montel's avatar
Laurent Montel committed
506
        connect(&m_readProcess, &KProcess::readyReadStandardOutput, this, &KdenliveSettingsDialog::slotReadAudioDevices);
507
508
509
        m_readProcess.execute(5000);
    } else {
        // If aplay is not installed on the system, parse the /proc/asound/pcm file
510
        QFile file(QStringLiteral("/proc/asound/pcm"));
511
        if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
512
            QTextStream stream(&file);
513
            QString line = stream.readLine();
514
            QString deviceId;
515
            while (!line.isNull()) {
516
                if (line.contains(QStringLiteral("playback"))) {
Laurent Montel's avatar
Laurent Montel committed
517
                    deviceId = line.section(QLatin1Char(':'), 0, 0);
518
                    m_configSdl.kcfg_audio_device->addItem(line.section(QLatin1Char(':'), 1, 1), "plughw:" + QString::number(deviceId.section(QLatin1Char('-'), 0, 0).toInt()) + QLatin1Char(',') + QString::number(deviceId.section(QLatin1Char('-'), 1, 1).toInt()));
519
                }
520
                if (line.contains(QStringLiteral("capture"))) {
Laurent Montel's avatar
Laurent Montel committed
521
                    deviceId = line.section(QLatin1Char(':'), 0, 0);
522
                    m_configCapture.kcfg_v4l_alsadevice->addItem(line.section(QLatin1Char(':'), 1, 1).simplified(), "hw:" + QString::number(deviceId.section(QLatin1Char('-'), 0, 0).toInt()) + QLatin1Char(',') + QString::number(deviceId.section(QLatin1Char('-'), 1, 1).toInt()));
523
                }
524
                line = stream.readLine();
525
            }
526
            file.close();
527
528
529
        } else {
            qCDebug(KDENLIVE_LOG) << " / / / /CANNOT READ PCM";
        }
530
    }
531

532
533
    // Add pulseaudio capture option
    m_configCapture.kcfg_v4l_alsadevice->addItem(i18n("PulseAudio"), "pulse");
534

535
536
    if (!KdenliveSettings::audiodevicename().isEmpty()) {
        // Select correct alsa device
537
538
539
        int ix = m_configSdl.kcfg_audio_device->findData(KdenliveSettings::audiodevicename());
        m_configSdl.kcfg_audio_device->setCurrentIndex(ix);
        KdenliveSettings::setAudio_device(ix);
540
    }
Alberto Villa's avatar
Alberto Villa committed
541

542
543
544
545
546
547
548
    if (!KdenliveSettings::v4l_alsadevicename().isEmpty()) {
        // Select correct alsa device
        int ix = m_configCapture.kcfg_v4l_alsadevice->findData(KdenliveSettings::v4l_alsadevicename());
        m_configCapture.kcfg_v4l_alsadevice->setCurrentIndex(ix);
        KdenliveSettings::setV4l_alsadevice(ix);
    }

549
550
551
552
553
554
555
556
    m_configSdl.kcfg_audio_backend->addItem(i18n("SDL"), "sdl_audio");
    m_configSdl.kcfg_audio_backend->addItem(i18n("RtAudio"), "rtaudio");

    if (!KdenliveSettings::audiobackend().isEmpty()) {
        int ix = m_configSdl.kcfg_audio_backend->findData(KdenliveSettings::audiobackend());
        m_configSdl.kcfg_audio_backend->setCurrentIndex(ix);
        KdenliveSettings::setAudio_backend(ix);
    }
557
    m_configSdl.group_sdl->setEnabled(KdenliveSettings::audiobackend() == QLatin1String("sdl_audio"));
558

559
    loadCurrentV4lProfileInfo();
560
561
}

562
563
void KdenliveSettingsDialog::slotReadAudioDevices()
{
564
    QString result = QString(m_readProcess.readAllStandardOutput());
Laurent Montel's avatar
Laurent Montel committed
565
566
    //qCDebug(KDENLIVE_LOG) << "// / / / / / READING APLAY: ";
    //qCDebug(KDENLIVE_LOG) << result;
567
568
    const QStringList lines = result.split('\n');
    for (const QString &data : lines) {
Laurent Montel's avatar
Laurent Montel committed
569
        ////qCDebug(KDENLIVE_LOG) << "// READING LINE: " << data;
570
        if (!data.startsWith(' ') && data.count(':') > 1) {
Laurent Montel's avatar
Laurent Montel committed
571
572
            QString card = data.section(QLatin1Char(':'), 0, 0).section(QLatin1Char(' '), -1);
            QString device = data.section(QLatin1Char(':'), 1, 1).section(QLatin1Char(' '), -1);
573
574
            m_configSdl.kcfg_audio_device->addItem(data.section(QLatin1Char(':'), -1).simplified(), "plughw:" + card + QLatin1Char(',') + device);
            m_configCapture.kcfg_v4l_alsadevice->addItem(data.section(QLatin1Char(':'), -1).simplified(), "hw:" + card + QLatin1Char(',') + device);
575
        }
576
577
578
    }
}

579
580
void KdenliveSettingsDialog::showPage(int page, int option)
{
581
582
    switch (page) {
    case 1:
583
        setCurrentPage(m_page1);
584
585
        break;
    case 2:
586
        setCurrentPage(m_page2);
587
588
        break;
    case 3:
589
        setCurrentPage(m_page3);
590
591
        break;
    case 4:
592
        setCurrentPage(m_page4);
593
594
595
        m_configCapture.tabWidget->setCurrentIndex(option);
        break;
    case 5:
596
        setCurrentPage(m_page5);
597
        break;
598
599
600
601
602
603
604
605
    case 6:
        setCurrentPage(m_page6);
        break;
    case 7:
        setCurrentPage(m_page7);
        break;
    default:
        setCurrentPage(m_page1);
606
607
    }
}
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
608

609
610
void KdenliveSettingsDialog::slotEditAudioApplication()
{
611
    KService::Ptr service;
612
    QPointer<KOpenWithDialog> dlg = new KOpenWithDialog(QList<QUrl>(), i18n("Select default audio editor"), m_configEnv.kcfg_defaultaudioapp->text(), this);
613
614
    if (dlg->exec() == QDialog::Accepted) {
        service = dlg->service();
615
        m_configEnv.kcfg_defaultaudioapp->setText(KRun::binaryName(service->exec(), false));
616
    }
617

618
    delete dlg;
619
620
}

621
622
void KdenliveSettingsDialog::slotEditImageApplication()
{
623
    QPointer<KOpenWithDialog> dlg = new KOpenWithDialog(QList<QUrl>(), i18n("Select default image editor"), m_configEnv.kcfg_defaultimageapp->text(), this);
624
    if (dlg->exec() == QDialog::Accepted) {
Laurent Montel's avatar
Laurent Montel committed
625
        KService::Ptr service = dlg->service();
626
        m_configEnv.kcfg_defaultimageapp->setText(KRun::binaryName(service->exec(), false));
627
    }
628
    delete dlg;
629
630
}

631
632
void KdenliveSettingsDialog::slotCheckShuttle(int state)
{
633
#ifdef USE_JOGSHUTTLE
634
    m_configShuttle.config_group->setEnabled(state);
635
    m_configShuttle.shuttledevicelist->clear();
636

637
638
    QStringList devNames = KdenliveSettings::shuttledevicenames();
    QStringList devPaths = KdenliveSettings::shuttledevicepaths();
639

640
641
642
    if (devNames.count() != devPaths.count()) {
        return;
    }
643
    for (int i = 0; i < devNames.count(); ++i) {
644
        m_configShuttle.shuttledevicelist->addItem(
645
646
647
648
            devNames.at(i), devPaths.at(i));
    }
    if (state) {
        setupJogshuttleBtns(m_configShuttle.shuttledevicelist->itemData(m_configShuttle.shuttledevicelist->currentIndex()).toString());
649
    }
650
#endif /* USE_JOGSHUTTLE */
651
652
}

653
654
void KdenliveSettingsDialog::slotUpdateShuttleDevice(int ix)
{
655
#ifdef USE_JOGSHUTTLE
656
657
    QString device = m_configShuttle.shuttledevicelist->itemData(ix).toString();
    //KdenliveSettings::setShuttledevice(device);
658
    setupJogshuttleBtns(device);
659
    m_configShuttle.kcfg_shuttledevice->setText(device);
660
#endif /* USE_JOGSHUTTLE */
661
}
662

663
664
665
void KdenliveSettingsDialog::updateWidgets()
{
    // Revert widgets to last saved state (for example when user pressed "Cancel")
Laurent Montel's avatar
Laurent Montel committed
666
    // //qCDebug(KDENLIVE_LOG) << "// // // KCONFIG Revert called";
667
#ifdef USE_JOGSHUTTLE
668
669
    // revert jog shuttle device
    if (m_configShuttle.shuttledevicelist->count() > 0) {
670
671
672
673
674
675
        for (int i = 0; i < m_configShuttle.shuttledevicelist->count(); ++i) {
            if (m_configShuttle.shuttledevicelist->itemData(i) == KdenliveSettings::shuttledevice()) {
                m_configShuttle.shuttledevicelist->setCurrentIndex(i);
                break;
            }
        }
676
    }
677

678
679
680
681
682
    // Revert jog shuttle buttons
    QList<QString> action_names = m_mappable_actions.keys();
    qSort(action_names);
    QStringList actions_map = JogShuttleConfig::actionMap(KdenliveSettings::shuttlebuttons());
    QMap<QString, int> action_pos;
683
    foreach (const QString &action_id, actions_map) {
684
685
686
687
688
689
690
        // This loop find out at what index is the string that would map to the action_id.
        for (int i = 0; i < action_names.size(); ++i) {
            if (m_mappable_actions[action_names[i]] == action_id) {
                action_pos[action_id] = i;
                break;
            }
        }
691
692
    }
    int i = 0;
693
    foreach (KComboBox *button, m_shuttle_buttons) {
694
        ++i;
695
        if (i < actions_map.size()) {
696
            button->setCurrentIndex(action_pos[actions_map[i]]);
697
        }
698
    }
699
#endif /* USE_JOGSHUTTLE */
700
}
701

702
703
704
705
706
707
708
709
710
void KdenliveSettingsDialog::accept()
{
    if (m_pw->selectedProfile().isEmpty()) {
        KMessageBox::error(this, i18n("Please select a video profile"));
        return;
    }
    KConfigDialog::accept();
}

711
712
void KdenliveSettingsDialog::updateSettings()
{
713
    // Save changes to settings (for example when user pressed "Apply" or "Ok")
Laurent Montel's avatar
Laurent Montel committed
714
    // //qCDebug(KDENLIVE_LOG) << "// // // KCONFIG UPDATE called";
715
716
717
718
    if (m_pw->selectedProfile().isEmpty()) {
        KMessageBox::error(this, i18n("Please select a video profile"));
        return;
    }
719
    KdenliveSettings::setDefault_profile(m_pw->selectedProfile());
720
721

    bool resetProfile = false;
722
    bool updateCapturePath = false;
723
    bool updateLibrary = false;
Alberto Villa's avatar
Alberto Villa committed
724

725
    /*if (m_configShuttle.shuttledevicelist->count() > 0) {
726
727
    QString device = m_configShuttle.shuttledevicelist->itemData(m_configShuttle.shuttledevicelist->currentIndex()).toString();
    if (device != KdenliveSettings::shuttledevice()) KdenliveSettings::setShuttledevice(device);
728
    }*/
729

730
    // Capture default folder
731
732
733
734
735
    if (m_configEnv.kcfg_capturetoprojectfolder->isChecked() != KdenliveSettings::capturetoprojectfolder()) {
        KdenliveSettings::setCapturetoprojectfolder(m_configEnv.kcfg_capturetoprojectfolder->isChecked());
        updateCapturePath = true;
    }

736
737
    if (m_configProject.projecturl->url().toLocalFile() != KdenliveSettings::defaultprojectfolder()) {
        KdenliveSettings::setDefaultprojectfolder(m_configProject.projecturl->url().toLocalFile());
738
739
    }

740
741
    if (m_configEnv.capturefolderurl->url().toLocalFile() != KdenliveSettings::capturefolder()) {
        KdenliveSettings::setCapturefolder(m_configEnv.capturefolderurl->url().toLocalFile());
742
        updateCapturePath = true;
743
744
    }

745
746
747
748
749
750
    // Library default folder
    if (m_configEnv.kcfg_librarytodefaultfolder->isChecked() != KdenliveSettings::librarytodefaultfolder()) {
        KdenliveSettings::setLibrarytodefaultfolder(m_configEnv.kcfg_librarytodefaultfolder->isChecked());
        updateLibrary = true;
    }

751
752
    if (m_configEnv.libraryfolderurl->url().toLocalFile() != KdenliveSettings::libraryfolder()) {
        KdenliveSettings::setLibraryfolder(m_configEnv.libraryfolderurl->url().toLocalFile());
753
754
755
756
757
        if (!KdenliveSettings::librarytodefaultfolder()) {
            updateLibrary = true;
        }
    }

758
759
760
761
762
763
764
765
766
767
    if (m_configCapture.kcfg_dvgrabfilename->text() != KdenliveSettings::dvgrabfilename()) {
        KdenliveSettings::setDvgrabfilename(m_configCapture.kcfg_dvgrabfilename->text());
        updateCapturePath = true;
    }

    if ((uint) m_configCapture.kcfg_firewireformat->currentIndex() != KdenliveSettings::firewireformat()) {
        KdenliveSettings::setFirewireformat(m_configCapture.kcfg_firewireformat->currentIndex());
        updateCapturePath = true;
    }

768
769
770
771
    if ((uint) m_configCapture.kcfg_v4l_format->currentIndex() != KdenliveSettings::v4l_format()) {
        saveCurrentV4lProfile();
        KdenliveSettings::setV4l_format(0);
    }
772

773
774
775
776
777
    // Check if screengrab is fullscreen
    if ((uint) m_configCapture.kcfg_grab_capture_type->currentIndex() != KdenliveSettings::grab_capture_type()) {
        KdenliveSettings::setGrab_capture_type(m_configCapture.kcfg_grab_capture_type->currentIndex());
        emit updateFullScreenGrab();
    }
Alberto Villa's avatar
Alberto Villa committed
778

779
    // Check encoding profiles
780
    // FFmpeg
781
    QString data = m_configCapture.kcfg_v4l_profile->itemData(m_configCapture.kcfg_v4l_profile->currentIndex()).toString();
782
783
784
    if (!data.isEmpty() && (data.section(QLatin1Char(';'), 0, 0) != KdenliveSettings::v4l_parameters() || data.section(QLatin1Char(';'), 1, 1) != KdenliveSettings::v4l_extension())) {
        KdenliveSettings::setV4l_parameters(data.section(QLatin1Char(';'), 0, 0));
        KdenliveSettings::setV4l_extension(data.section(QLatin1Char(';'), 1, 1));
785
    }
786
787
    // screengrab
    data = m_configCapture.kcfg_grab_profile->itemData(m_configCapture.kcfg_grab_profile->currentIndex()).toString();
788
789
790
    if (!data.isEmpty() && (data.section(QLatin1Char(';'), 0, 0) != KdenliveSettings::grab_parameters() || data.section(QLatin1Char(';'), 1, 1) != KdenliveSettings::grab_extension())) {
        KdenliveSettings::setGrab_parameters(data.section(QLatin1Char(';'), 0, 0));
        KdenliveSettings::setGrab_extension(data.section(QLatin1Char(';'), 1, 1));
791
    }
792

793
    // decklink
794
    data = m_configCapture.kcfg_decklink_profile->itemData(m_configCapture.kcfg_decklink_profile->currentIndex()).toString();
795
796
797
    if (!data.isEmpty() && (data.section(QLatin1Char(';'), 0, 0) != KdenliveSettings::decklink_parameters() || data.section(QLatin1Char(';'), 1, 1) != KdenliveSettings::decklink_extension())) {
        KdenliveSettings::setDecklink_parameters(data.section(QLatin1Char(';'), 0, 0));
        KdenliveSettings::setDecklink_extension(data.section(QLatin1Char(';'), 1, 1));
798
    }
799
    // proxies
800
    data = m_configProject.kcfg_proxy_profile->itemData(m_configProject.kcfg_proxy_profile