kdenlivesettingsdialog.cpp 75.9 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
#include "kdenlivesettingsdialog.h"
Nicolas Carion's avatar
Nicolas Carion committed
21
#include "clipcreationdialog.h"
Nicolas Carion's avatar
linting  
Nicolas Carion committed
22
#include "core.h"
23
#include "dialogs/profilesdialog.h"
Nicolas Carion's avatar
Nicolas Carion committed
24
#include "encodingprofilesdialog.h"
25
#include "kdenlivesettings.h"
26 27 28
#include "mainwindow.h"
#include "timeline2/view/timelinewidget.h"
#include "timeline2/view/timelinecontroller.h"
Nicolas Carion's avatar
linting  
Nicolas Carion committed
29
#include "profiles/profilemodel.hpp"
30
#include "profiles/profilerepository.hpp"
Nicolas Carion's avatar
Nicolas Carion committed
31 32
#include "profilesdialog.h"
#include "project/dialogs/profilewidget.h"
33
#include "wizard.h"
34

Vincent Pinon's avatar
Vincent Pinon committed
35 36 37
#ifdef USE_V4L
#include "capture/v4lcapture.h"
#endif
38

Nicolas Carion's avatar
Nicolas Carion committed
39
#include "kdenlive_debug.h"
40
#include "klocalizedstring.h"
41
#include <KIO/DesktopExecParser>
42
#include <KLineEdit>
Nicolas Carion's avatar
Nicolas Carion committed
43
#include <KMessageBox>
44
#include <KOpenWithDialog>
Nicolas Carion's avatar
Nicolas Carion committed
45
#include <KService>
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
46
#include <QAction>
47
#include <QDir>
Akhil K Gangadharan's avatar
Akhil K Gangadharan committed
48 49
#include <QGuiApplication>
#include <QScreen>
50 51 52
#include <QSize>
#include <QThread>
#include <QTimer>
Nicolas Carion's avatar
Nicolas Carion committed
53 54
#include <cstdio>
#include <cstdlib>
Nicolas Carion's avatar
Nicolas Carion committed
55
#include <fcntl.h>
56
#include <unistd.h>
57

58
#ifdef USE_JOGSHUTTLE
59 60
#include "jogshuttle/jogaction.h"
#include "jogshuttle/jogshuttleconfig.h"
61
#include <QStandardPaths>
Nicolas Carion's avatar
Nicolas Carion committed
62
#include <linux/input.h>
63
#endif
64

Nicolas Carion's avatar
Nicolas Carion committed
65
KdenliveSettingsDialog::KdenliveSettingsDialog(QMap<QString, QString> mappable_actions, bool gpuAllowed, QWidget *parent)
66 67 68
    : KConfigDialog(parent, QStringLiteral("settings"), KdenliveSettings::self())
    , m_modified(false)
    , m_shuttleModified(false)
Nicolas Carion's avatar
Nicolas Carion committed
69
    , m_mappable_actions(std::move(mappable_actions))
70
{
71
    KdenliveSettings::setV4l_format(0);
72 73
    QWidget *p1 = new QWidget;
    m_configMisc.setupUi(p1);
74
    m_page1 = addPage(p1, i18n("Misc"));
75
    m_page1->setIcon(QIcon::fromTheme(QStringLiteral("configure")));
76

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

79 80
    QWidget *p8 = new QWidget;
    m_configProject.setupUi(p8);
81
    m_page8 = addPage(p8, i18n("Project Defaults"));
Nicolas Carion's avatar
Nicolas Carion committed
82
    auto *vbox = new QVBoxLayout;
83 84 85
    m_pw = new ProfileWidget(this);
    vbox->addWidget(m_pw);
    m_configProject.profile_box->setLayout(vbox);
86
    m_configProject.profile_box->setTitle(i18n("Select the default profile (preset)"));
87
    // Select profile
88
    m_pw->loadProfile(KdenliveSettings::default_profile().isEmpty() ? pCore->getCurrentProfile()->path() : KdenliveSettings::default_profile());
89
    connect(m_pw, &ProfileWidget::profileChanged, this, &KdenliveSettingsDialog::slotDialogModified);
90
    m_page8->setIcon(QIcon::fromTheme(QStringLiteral("project-defaults")));
91 92
    m_configProject.projecturl->setMode(KFile::Directory);
    m_configProject.projecturl->setUrl(QUrl::fromLocalFile(KdenliveSettings::defaultprojectfolder()));
Vincent Pinon's avatar
Vincent Pinon committed
93
    connect(m_configProject.kcfg_videotracks, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, [this]() {
94 95 96 97
        if (m_configProject.kcfg_videotracks->value() + m_configProject.kcfg_audiotracks->value() <= 0) {
            m_configProject.kcfg_videotracks->setValue(1);
        }
    });
Vincent Pinon's avatar
Vincent Pinon committed
98
    connect(m_configProject.kcfg_audiotracks, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, [this] () {
99 100 101 102
        if (m_configProject.kcfg_videotracks->value() + m_configProject.kcfg_audiotracks->value() <= 0) {
            m_configProject.kcfg_audiotracks->setValue(1);
        }
    });
103 104 105

    QWidget *p9 = new QWidget;
    m_configProxy.setupUi(p9);
106
    KPageWidgetItem *page9 = addPage(p9, i18n("Proxy Clips"));
107 108 109 110 111 112
    page9->setIcon(QIcon::fromTheme(QStringLiteral("zoom-out")));
    connect(m_configProxy.kcfg_generateproxy, &QAbstractButton::toggled, m_configProxy.kcfg_proxyminsize, &QWidget::setEnabled);
    m_configProxy.kcfg_proxyminsize->setEnabled(KdenliveSettings::generateproxy());
    connect(m_configProxy.kcfg_generateimageproxy, &QAbstractButton::toggled, m_configProxy.kcfg_proxyimageminsize, &QWidget::setEnabled);
    m_configProxy.kcfg_proxyimageminsize->setEnabled(KdenliveSettings::generateimageproxy());
    loadExternalProxyProfiles();
113

114
    QWidget *p3 = new QWidget;
115
    m_configTimeline.setupUi(p3);
116
    m_page3 = addPage(p3, i18n("Timeline"));
117
    m_page3->setIcon(QIcon::fromTheme(QStringLiteral("video-display")));
118 119 120 121

    QWidget *p2 = new QWidget;
    m_configEnv.setupUi(p2);
    m_configEnv.mltpathurl->setMode(KFile::Directory);
122 123 124 125 126
    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"));
127
    m_configEnv.tmppathurl->setMode(KFile::Directory);
128
    m_configEnv.tmppathurl->lineEdit()->setObjectName(QStringLiteral("kcfg_currenttmpfolder"));
129
    m_configEnv.capturefolderurl->setMode(KFile::Directory);
130
    m_configEnv.capturefolderurl->lineEdit()->setObjectName(QStringLiteral("kcfg_capturefolder"));
131
    m_configEnv.capturefolderurl->setEnabled(!KdenliveSettings::capturetoprojectfolder());
Laurent Montel's avatar
Laurent Montel committed
132
    connect(m_configEnv.kcfg_capturetoprojectfolder, &QAbstractButton::clicked, this, &KdenliveSettingsDialog::slotEnableCaptureFolder);
133 134 135 136
    // Library folder
    m_configEnv.libraryfolderurl->setMode(KFile::Directory);
    m_configEnv.libraryfolderurl->lineEdit()->setObjectName(QStringLiteral("kcfg_libraryfolder"));
    m_configEnv.libraryfolderurl->setEnabled(!KdenliveSettings::librarytodefaultfolder());
137
    m_configEnv.libraryfolderurl->setPlaceholderText(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/library"));
138
    m_configEnv.kcfg_librarytodefaultfolder->setToolTip(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/library"));
Laurent Montel's avatar
Laurent Montel committed
139
    connect(m_configEnv.kcfg_librarytodefaultfolder, &QAbstractButton::clicked, this, &KdenliveSettingsDialog::slotEnableLibraryFolder);
140

141 142 143 144 145 146 147 148
    // Script rendering folder
    m_configEnv.videofolderurl->setMode(KFile::Directory);
    m_configEnv.videofolderurl->lineEdit()->setObjectName(QStringLiteral("kcfg_videofolder"));
    m_configEnv.videofolderurl->setEnabled(!KdenliveSettings::videotodefaultfolder());
    m_configEnv.videofolderurl->setPlaceholderText(QStandardPaths::writableLocation(QStandardPaths::MoviesLocation));
    m_configEnv.kcfg_videotodefaultfolder->setToolTip(QStandardPaths::writableLocation(QStandardPaths::MoviesLocation));
    connect(m_configEnv.kcfg_videotodefaultfolder, &QAbstractButton::clicked, this, &KdenliveSettingsDialog::slotEnableVideoFolder);

149 150
    // Mime types
    QStringList mimes = ClipCreationDialog::getExtensions();
151
    std::sort(mimes.begin(), mimes.end());
Laurent Montel's avatar
Laurent Montel committed
152
    m_configEnv.supportedmimes->setPlainText(mimes.join(QLatin1Char(' ')));
153

154
    m_page2 = addPage(p2, i18n("Environment"));
155
    m_page2->setIcon(QIcon::fromTheme(QStringLiteral("application-x-executable-script")));
156

157 158 159 160 161
    QWidget *p10 = new QWidget;
    m_configColors.setupUi(p10);
    m_page10 = addPage(p10, i18n("Colors"));
    m_page10->setIcon(QIcon::fromTheme(QStringLiteral("color-management")));
    
162 163
    QWidget *p4 = new QWidget;
    m_configCapture.setupUi(p4);
164
    // Remove ffmpeg tab, unused
165
    m_configCapture.tabWidget->removeTab(0);
166 167 168
    m_configCapture.label->setVisible(false);
    m_configCapture.kcfg_defaultcapture->setVisible(false);
    //m_configCapture.tabWidget->removeTab(2);
169
#ifdef USE_V4L
170

171
    // Video 4 Linux device detection
Laurent Montel's avatar
Laurent Montel committed
172
    for (int i = 0; i < 10; ++i) {
Laurent Montel's avatar
Laurent Montel committed
173
        QString path = QStringLiteral("/dev/video") + QString::number(i);
174
        if (QFile::exists(path)) {
175
            QStringList deviceInfo = V4lCaptureHandler::getDeviceName(path);
176 177 178 179
            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);
            }
180 181
        }
    }
182
    connect(m_configCapture.kcfg_detectedv4ldevices, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
Nicolas Carion's avatar
Nicolas Carion committed
183
            &KdenliveSettingsDialog::slotUpdatev4lDevice);
184
    connect(m_configCapture.kcfg_v4l_format, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
Nicolas Carion's avatar
Nicolas Carion committed
185
            &KdenliveSettingsDialog::slotUpdatev4lCaptureProfile);
Laurent Montel's avatar
Laurent Montel committed
186
    connect(m_configCapture.config_v4l, &QAbstractButton::clicked, this, &KdenliveSettingsDialog::slotEditVideo4LinuxProfile);
187 188

    slotUpdatev4lDevice();
189
#endif
190

191
    m_page4 = addPage(p4, i18n("Capture"));
192
    m_page4->setIcon(QIcon::fromTheme(QStringLiteral("media-record")));
193
    m_configCapture.tabWidget->setCurrentIndex(KdenliveSettings::defaultcapture());
Alberto Villa's avatar
Alberto Villa committed
194
#ifdef Q_WS_MAC
195 196
    m_configCapture.tabWidget->setEnabled(false);
    m_configCapture.kcfg_defaultcapture->setEnabled(false);
Alberto Villa's avatar
Alberto Villa committed
197
    m_configCapture.label->setText(i18n("Capture is not yet available on Mac OS X."));
198
#endif
199

200 201
    QWidget *p5 = new QWidget;
    m_configShuttle.setupUi(p5);
202
#ifdef USE_JOGSHUTTLE
203
    m_configShuttle.toolBtnReload->setIcon(QIcon::fromTheme(QStringLiteral("view-refresh")));
Laurent Montel's avatar
Laurent Montel committed
204
    connect(m_configShuttle.kcfg_enableshuttle, &QCheckBox::stateChanged, this, &KdenliveSettingsDialog::slotCheckShuttle);
205
    connect(m_configShuttle.shuttledevicelist, SIGNAL(activated(int)), this, SLOT(slotUpdateShuttleDevice(int)));
Laurent Montel's avatar
Laurent Montel committed
206
    connect(m_configShuttle.toolBtnReload, &QAbstractButton::clicked, this, &KdenliveSettingsDialog::slotReloadShuttleDevices);
207

Nicolas Carion's avatar
Nicolas Carion committed
208
    slotCheckShuttle(static_cast<int>(KdenliveSettings::enableshuttle()));
209
    m_configShuttle.shuttledisabled->hide();
210 211

    // Store the button pointers into an array for easier handling them in the other functions.
212
    // TODO: impl enumerator or live with cut and paste :-)))
213 214
    setupJogshuttleBtns(KdenliveSettings::shuttledevice());
#if 0
215 216 217 218 219
    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);
220 221 222 223 224
    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);
225 226 227 228 229
    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);
230
#endif
231

Nicolas Carion's avatar
Nicolas Carion committed
232
#else  /* ! USE_JOGSHUTTLE */
233 234 235
    m_configShuttle.kcfg_enableshuttle->hide();
    m_configShuttle.kcfg_enableshuttle->setDisabled(true);
#endif /* USE_JOGSHUTTLE */
236
    m_page5 = addPage(p5, i18n("JogShuttle"));
237
    m_page5->setIcon(QIcon::fromTheme(QStringLiteral("dialog-input-devices")));
238

239 240
    QWidget *p6 = new QWidget;
    m_configSdl.setupUi(p6);
241
    m_configSdl.reload_blackmagic->setIcon(QIcon::fromTheme(QStringLiteral("view-refresh")));
Laurent Montel's avatar
Laurent Montel committed
242
    connect(m_configSdl.reload_blackmagic, &QAbstractButton::clicked, this, &KdenliveSettingsDialog::slotReloadBlackMagic);
243

Nicolas Carion's avatar
Nicolas Carion committed
244
    // m_configSdl.kcfg_openglmonitors->setHidden(true);
245

246
    m_page6 = addPage(p6, i18n("Playback"));
247
    m_page6->setIcon(QIcon::fromTheme(QStringLiteral("media-playback-start")));
248

249 250
    QWidget *p7 = new QWidget;
    m_configTranscode.setupUi(p7);
251
    m_page7 = addPage(p7, i18n("Transcode"));
252
    m_page7->setIcon(QIcon::fromTheme(QStringLiteral("edit-copy")));
253

Laurent Montel's avatar
Laurent Montel committed
254 255 256 257
    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);
258

Laurent Montel's avatar
Laurent Montel committed
259 260 261 262 263
    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);
264

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

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

Laurent Montel's avatar
Laurent Montel committed
269 270
    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
271

272
    loadEncodingProfiles();
273

274
    connect(m_configSdl.kcfg_audio_driver, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
Nicolas Carion's avatar
Nicolas Carion committed
275
            &KdenliveSettingsDialog::slotCheckAlsaDriver);
276
    connect(m_configSdl.kcfg_audio_backend, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
Nicolas Carion's avatar
Nicolas Carion committed
277
            &KdenliveSettingsDialog::slotCheckAudioBackend);
278
    initDevices();
279
    connect(m_configCapture.kcfg_grab_capture_type, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
Nicolas Carion's avatar
Nicolas Carion committed
280
            &KdenliveSettingsDialog::slotUpdateGrabRegionStatus);
281

282
    slotUpdateGrabRegionStatus();
283
    loadTranscodeProfiles();
284

285
    // decklink profile
286
    QAction *act = new QAction(QIcon::fromTheme(QStringLiteral("configure")), i18n("Configure profiles"), this);
287
    act->setData(4);
Laurent Montel's avatar
Laurent Montel committed
288
    connect(act, &QAction::triggered, this, &KdenliveSettingsDialog::slotManageEncodingProfile);
289
    m_configCapture.decklink_manageprofile->setDefaultAction(act);
290
    m_configCapture.decklink_showprofileinfo->setIcon(QIcon::fromTheme(QStringLiteral("help-about")));
291 292 293
    m_configCapture.decklink_parameters->setVisible(false);
    m_configCapture.decklink_parameters->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 4);
    m_configCapture.decklink_parameters->setPlainText(KdenliveSettings::decklink_parameters());
294
    connect(m_configCapture.kcfg_decklink_profile, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
Nicolas Carion's avatar
Nicolas Carion committed
295
            &KdenliveSettingsDialog::slotUpdateDecklinkProfile);
Laurent Montel's avatar
Laurent Montel committed
296
    connect(m_configCapture.decklink_showprofileinfo, &QAbstractButton::clicked, m_configCapture.decklink_parameters, &QWidget::setVisible);
297

298
    // ffmpeg profile
299
    m_configCapture.v4l_showprofileinfo->setIcon(QIcon::fromTheme(QStringLiteral("help-about")));
300 301 302
    m_configCapture.v4l_parameters->setVisible(false);
    m_configCapture.v4l_parameters->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 4);
    m_configCapture.v4l_parameters->setPlainText(KdenliveSettings::v4l_parameters());
303

304
    act = new QAction(QIcon::fromTheme(QStringLiteral("configure")), i18n("Configure profiles"), this);
305
    act->setData(2);
Laurent Montel's avatar
Laurent Montel committed
306
    connect(act, &QAction::triggered, this, &KdenliveSettingsDialog::slotManageEncodingProfile);
307
    m_configCapture.v4l_manageprofile->setDefaultAction(act);
308
    connect(m_configCapture.kcfg_v4l_profile, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
Nicolas Carion's avatar
Nicolas Carion committed
309
            &KdenliveSettingsDialog::slotUpdateV4lProfile);
Laurent Montel's avatar
Laurent Montel committed
310
    connect(m_configCapture.v4l_showprofileinfo, &QAbstractButton::clicked, m_configCapture.v4l_parameters, &QWidget::setVisible);
311

312
    // screen grab profile
313
    m_configCapture.grab_showprofileinfo->setIcon(QIcon::fromTheme(QStringLiteral("help-about")));
314 315 316
    m_configCapture.grab_parameters->setVisible(false);
    m_configCapture.grab_parameters->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 4);
    m_configCapture.grab_parameters->setPlainText(KdenliveSettings::grab_parameters());
317
    act = new QAction(QIcon::fromTheme(QStringLiteral("configure")), i18n("Configure profiles"), this);
318
    act->setData(3);
Laurent Montel's avatar
Laurent Montel committed
319
    connect(act, &QAction::triggered, this, &KdenliveSettingsDialog::slotManageEncodingProfile);
320
    m_configCapture.grab_manageprofile->setDefaultAction(act);
321
    connect(m_configCapture.kcfg_grab_profile, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
Nicolas Carion's avatar
Nicolas Carion committed
322
            &KdenliveSettingsDialog::slotUpdateGrabProfile);
Laurent Montel's avatar
Laurent Montel committed
323
    connect(m_configCapture.grab_showprofileinfo, &QAbstractButton::clicked, m_configCapture.grab_parameters, &QWidget::setVisible);
Alberto Villa's avatar
Alberto Villa committed
324

325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346
    // audio capture channels
    m_configCapture.audiocapturechannels->clear();
    m_configCapture.audiocapturechannels->addItem(i18n("Mono (1 channel)"), 1);
    m_configCapture.audiocapturechannels->addItem(i18n("Stereo (2 channels)"), 2);

    int channelsIndex = m_configCapture.audiocapturechannels->findData(KdenliveSettings::audiocapturechannels());
    m_configCapture.audiocapturechannels->setCurrentIndex(qMax(channelsIndex, 0));
    connect(m_configCapture.audiocapturechannels, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
            &KdenliveSettingsDialog::slotUpdateAudioCaptureChannels);

    // audio capture sample rate
    m_configCapture.audiocapturesamplerate->clear();
    m_configCapture.audiocapturesamplerate->addItem(i18n("44100 Hz"), 44100);
    m_configCapture.audiocapturesamplerate->addItem(i18n("48000 Hz"), 48000);

    int sampleRateIndex = m_configCapture.audiocapturesamplerate->findData(KdenliveSettings::audiocapturesamplerate());
    m_configCapture.audiocapturesamplerate->setCurrentIndex(qMax(sampleRateIndex, 0));
    connect(m_configCapture.audiocapturesamplerate, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
            &KdenliveSettingsDialog::slotUpdateAudioCaptureSampleRate);

    m_configCapture.labelNoAudioDevices->setVisible(false);

347
    // Timeline preview
348
    act = new QAction(QIcon::fromTheme(QStringLiteral("configure")), i18n("Configure profiles"), this);
349
    act->setData(1);
Laurent Montel's avatar
Laurent Montel committed
350
    connect(act, &QAction::triggered, this, &KdenliveSettingsDialog::slotManageEncodingProfile);
351
    m_configProject.preview_manageprofile->setDefaultAction(act);
352
    connect(m_configProject.kcfg_preview_profile, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
Nicolas Carion's avatar
Nicolas Carion committed
353
            &KdenliveSettingsDialog::slotUpdatePreviewProfile);
Laurent Montel's avatar
Laurent Montel committed
354
    connect(m_configProject.preview_showprofileinfo, &QAbstractButton::clicked, m_configProject.previewparams, &QWidget::setVisible);
355 356 357
    m_configProject.previewparams->setVisible(false);
    m_configProject.previewparams->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 3);
    m_configProject.previewparams->setPlainText(KdenliveSettings::previewparams());
358
    m_configProject.preview_showprofileinfo->setIcon(QIcon::fromTheme(QStringLiteral("help-about")));
359
    m_configProject.preview_showprofileinfo->setToolTip(i18n("Show default timeline preview parameters"));
360
    m_configProject.preview_manageprofile->setIcon(QIcon::fromTheme(QStringLiteral("configure")));
361 362
    m_configProject.preview_manageprofile->setToolTip(i18n("Manage timeline preview profiles"));
    m_configProject.kcfg_preview_profile->setToolTip(i18n("Select default timeline preview profile"));
363

364
    // proxy profile stuff
365 366 367 368 369 370 371 372
    m_configProxy.proxy_showprofileinfo->setIcon(QIcon::fromTheme(QStringLiteral("help-about")));
    m_configProxy.proxy_showprofileinfo->setToolTip(i18n("Show default profile parameters"));
    m_configProxy.proxy_manageprofile->setIcon(QIcon::fromTheme(QStringLiteral("configure")));
    m_configProxy.proxy_manageprofile->setToolTip(i18n("Manage proxy profiles"));
    m_configProxy.kcfg_proxy_profile->setToolTip(i18n("Select default proxy profile"));
    m_configProxy.proxyparams->setVisible(false);
    m_configProxy.proxyparams->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 3);
    m_configProxy.proxyparams->setPlainText(KdenliveSettings::proxyparams());
373

374
    act = new QAction(QIcon::fromTheme(QStringLiteral("configure")), i18n("Configure profiles"), this);
375
    act->setData(0);
Laurent Montel's avatar
Laurent Montel committed
376
    connect(act, &QAction::triggered, this, &KdenliveSettingsDialog::slotManageEncodingProfile);
377
    m_configProxy.proxy_manageprofile->setDefaultAction(act);
378

379
    connect(m_configProxy.proxy_showprofileinfo, &QAbstractButton::clicked, m_configProxy.proxyparams, &QWidget::setVisible);
380
    connect(m_configProxy.kcfg_proxy_profile, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
Nicolas Carion's avatar
Nicolas Carion committed
381
            &KdenliveSettingsDialog::slotUpdateProxyProfile);
382 383 384

    slotUpdateProxyProfile(-1);
    slotUpdateV4lProfile(-1);
385
    slotUpdateGrabProfile(-1);
386
    slotUpdateDecklinkProfile(-1);
387

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

392 393
    getBlackMagicDeviceList(m_configCapture.kcfg_decklink_capturedevice);
    if (!getBlackMagicOutputDeviceList(m_configSdl.kcfg_blackmagic_output_device)) {
394
        // No blackmagic card found
395
        m_configSdl.kcfg_external_display->setEnabled(false);
396
    }
397 398
    
    initAudioRecDevice();
Akhil K Gangadharan's avatar
Akhil K Gangadharan committed
399

400
    // Config dialog size
Akhil K Gangadharan's avatar
Akhil K Gangadharan committed
401 402 403 404
    KSharedConfigPtr config = KSharedConfig::openConfig();
    KConfigGroup settingsGroup(config, "settings");
    QSize optimalSize;

405 406
    if (!settingsGroup.exists() || !settingsGroup.hasKey("dialogSize")) {
        const QSize screenSize = (QGuiApplication::primaryScreen()->availableSize() * 0.9);
Akhil K Gangadharan's avatar
Akhil K Gangadharan committed
407 408
        const QSize targetSize = QSize(1024, 700);
        optimalSize = targetSize.boundedTo(screenSize);
409 410
    } else {
        optimalSize = settingsGroup.readEntry("dialogSize", QVariant(size())).toSize();
Akhil K Gangadharan's avatar
Akhil K Gangadharan committed
411 412
    }
    resize(optimalSize);
413 414
}

415
// static
416
bool KdenliveSettingsDialog::getBlackMagicDeviceList(QComboBox *devicelist, bool force)
417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442
{
    if (!force && !KdenliveSettings::decklink_device_found()) {
        return false;
    }
    Mlt::Profile profile;
    Mlt::Producer bm(profile, "decklink");
    int found_devices = 0;
    if (bm.is_valid()) {
        bm.set("list_devices", 1);
        found_devices = bm.get_int("devices");
    } else {
        KdenliveSettings::setDecklink_device_found(false);
    }
    if (found_devices <= 0) {
        devicelist->setEnabled(false);
        return false;
    }
    KdenliveSettings::setDecklink_device_found(true);
    for (int i = 0; i < found_devices; ++i) {
        char *tmp = qstrdup(QStringLiteral("device.%1").arg(i).toUtf8().constData());
        devicelist->addItem(bm.get(tmp));
        delete[] tmp;
    }
    return true;
}

443 444 445 446
// static
bool KdenliveSettingsDialog::initAudioRecDevice()
{
    QStringList audioDevices = pCore->getAudioCaptureDevices();
447 448 449 450

    //show a hint to the user to know what to check for in case the device list are empty (common issue)
    m_configCapture.labelNoAudioDevices->setVisible(audioDevices.empty());

451
    m_configCapture.kcfg_defaultaudiocapture->addItems(audioDevices);
Vincent Pinon's avatar
Vincent Pinon committed
452
    connect(m_configCapture.kcfg_defaultaudiocapture, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [&]() {
453 454 455 456 457 458 459 460 461 462 463 464
        QString currentDevice = m_configCapture.kcfg_defaultaudiocapture->currentText();
        KdenliveSettings::setDefaultaudiocapture(currentDevice);
    });
    QString selectedDevice = KdenliveSettings::defaultaudiocapture();
    int selectedIndex = m_configCapture.kcfg_defaultaudiocapture->findText(selectedDevice);
    if (!selectedDevice.isEmpty() && selectedIndex > -1) {
        m_configCapture.kcfg_defaultaudiocapture->setCurrentIndex(selectedIndex);
    }
    return true;
}

bool KdenliveSettingsDialog::getBlackMagicOutputDeviceList(QComboBox *devicelist, bool force)
465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491
{
    if (!force && !KdenliveSettings::decklink_device_found()) {
        return false;
    }
    Mlt::Profile profile;
    Mlt::Consumer bm(profile, "decklink");
    int found_devices = 0;
    if (bm.is_valid()) {
        bm.set("list_devices", 1);
        found_devices = bm.get_int("devices");
    } else {
        KdenliveSettings::setDecklink_device_found(false);
    }
    if (found_devices <= 0) {
        devicelist->setEnabled(false);
        return false;
    }
    KdenliveSettings::setDecklink_device_found(true);
    for (int i = 0; i < found_devices; ++i) {
        char *tmp = qstrdup(QStringLiteral("device.%1").arg(i).toUtf8().constData());
        devicelist->addItem(bm.get(tmp));
        delete[] tmp;
    }
    devicelist->addItem(QStringLiteral("test"));
    return true;
}

Laurent Montel's avatar
Laurent Montel committed
492
void KdenliveSettingsDialog::setupJogshuttleBtns(const QString &device)
493
{
494
    QList<QComboBox *> list;
495
    QList<QLabel *> list1;
496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512

    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;

Nicolas Carion's avatar
Nicolas Carion committed
513 514 515 516 517 518 519 520
    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
521 522 523 524 525 526 527 528
    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

529
    for (int i = 0; i < list.count(); ++i) {
530 531 532
        list[i]->hide();
        list1[i]->hide();
    }
533
#ifdef USE_JOGSHUTTLE
534 535 536
    if (!m_configShuttle.kcfg_enableshuttle->isChecked()) {
        return;
    }
537 538
    int keysCount = JogShuttle::keysCount(device);

539
    for (int i = 0; i < keysCount; ++i) {
540 541 542 543 544 545 546 547 548
        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();
549
    QList<QString>::Iterator iter = action_names.begin();
Nicolas Carion's avatar
Nicolas Carion committed
550
    // qCDebug(KDENLIVE_LOG) << "::::::::::::::::";
551
    while (iter != action_names.end()) {
Nicolas Carion's avatar
Nicolas Carion committed
552
        // qCDebug(KDENLIVE_LOG) << *iter;
553 554 555
        ++iter;
    }

Nicolas Carion's avatar
Nicolas Carion committed
556
    // qCDebug(KDENLIVE_LOG) << "::::::::::::::::";
557

558
    std::sort(action_names.begin(), action_names.end());
559 560
    iter = action_names.begin();
    while (iter != action_names.end()) {
Nicolas Carion's avatar
Nicolas Carion committed
561
        // qCDebug(KDENLIVE_LOG) << *iter;
562 563
        ++iter;
    }
Nicolas Carion's avatar
Nicolas Carion committed
564
    // qCDebug(KDENLIVE_LOG) << "::::::::::::::::";
565 566 567 568 569

    // 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;
Vincent Pinon's avatar
Vincent Pinon committed
570
    for (const QString &action_id : qAsConst(actions_map)) {
571 572 573 574 575 576 577 578 579 580
        // 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;
Vincent Pinon's avatar
Vincent Pinon committed
581
    for (QComboBox *button : qAsConst(m_shuttle_buttons)) {
582 583 584
        button->addItems(action_names);
        connect(button, SIGNAL(activated(int)), this, SLOT(slotShuttleModified()));
        ++i;
585
        if (i < actions_map.size()) {
586
            button->setCurrentIndex(action_pos[actions_map[i]]);
587
        }
588
    }
Vincent Pinon's avatar
Vincent Pinon committed
589 590
#else
    Q_UNUSED(device)
591
#endif
592 593
}

Nicolas Carion's avatar
Nicolas Carion committed
594
KdenliveSettingsDialog::~KdenliveSettingsDialog() = default;
595

596
void KdenliveSettingsDialog::slotUpdateGrabRegionStatus()
597
{
598
    m_configCapture.region_group->setHidden(m_configCapture.kcfg_grab_capture_type->currentIndex() != 1);
599
}
600

601 602 603 604 605
void KdenliveSettingsDialog::slotEnableCaptureFolder()
{
    m_configEnv.capturefolderurl->setEnabled(!m_configEnv.kcfg_capturetoprojectfolder->isChecked());
}

606 607 608 609 610
void KdenliveSettingsDialog::slotEnableLibraryFolder()
{
    m_configEnv.libraryfolderurl->setEnabled(!m_configEnv.kcfg_librarytodefaultfolder->isChecked());
}

611 612 613 614 615
void KdenliveSettingsDialog::slotEnableVideoFolder()
{
    m_configEnv.videofolderurl->setEnabled(!m_configEnv.kcfg_videotodefaultfolder->isChecked());
}

616 617
void KdenliveSettingsDialog::initDevices()
{
618 619
    // Fill audio drivers
    m_configSdl.kcfg_audio_driver->addItem(i18n("Automatic"), QString());
620 621 622 623 624 625
#if defined(Q_OS_WIN)
    //TODO: i18n
    m_configSdl.kcfg_audio_driver->addItem("DirectSound", "directsound");
    m_configSdl.kcfg_audio_driver->addItem("WinMM", "winmm");
    m_configSdl.kcfg_audio_driver->addItem("Wasapi", "wasapi");
#elif !defined(Q_WS_MAC)
626
    m_configSdl.kcfg_audio_driver->addItem(i18n("ALSA"), "alsa");
627 628 629
    m_configSdl.kcfg_audio_driver->addItem(i18n("PulseAudio"), "pulseaudio");
    m_configSdl.kcfg_audio_driver->addItem(i18n("OSS"), "dsp");
    //m_configSdl.kcfg_audio_driver->addItem(i18n("OSS with DMA access"), "dma");
630 631
    m_configSdl.kcfg_audio_driver->addItem(i18n("Esound daemon"), "esd");
    m_configSdl.kcfg_audio_driver->addItem(i18n("ARTS daemon"), "artsc");
632
#endif
633

634
    if (!KdenliveSettings::audiodrivername().isEmpty())
635
        for (int i = 1; i < m_configSdl.kcfg_audio_driver->count(); ++i) {
636 637
            if (m_configSdl.kcfg_audio_driver->itemData(i).toString() == KdenliveSettings::audiodrivername()) {
                m_configSdl.kcfg_audio_driver->setCurrentIndex(i);
Nicolas Carion's avatar
Nicolas Carion committed
638
                KdenliveSettings::setAudio_driver((uint)i);
639 640
            }
        }
641

642
    // Fill the list of audio playback / recording devices
643
    m_configSdl.kcfg_audio_device->addItem(i18n("Default"), QString());
644
    m_configCapture.kcfg_v4l_alsadevice->addItem(i18n("Default"), "default");
645
    if (!QStandardPaths::findExecutable(QStringLiteral("aplay")).isEmpty()) {
646
        m_readProcess.setOutputChannelMode(KProcess::OnlyStdoutChannel);
647
        m_readProcess.setProgram(QStringLiteral("aplay"), QStringList() << QStringLiteral("-l"));
Laurent Montel's avatar
Laurent Montel committed
648
        connect(&m_readProcess, &KProcess::readyReadStandardOutput, this, &KdenliveSettingsDialog::slotReadAudioDevices);
649 650 651
        m_readProcess.execute(5000);
    } else {
        // If aplay is not installed on the system, parse the /proc/asound/pcm file
652
        QFile file(QStringLiteral("/proc/asound/pcm"));
653
        if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
654
            QTextStream stream(&file);
655
            QString line = stream.readLine();
656
            QString deviceId;
657
            while (!line.isNull()) {
658
                if (line.contains(QStringLiteral("playback"))) {
Laurent Montel's avatar
Laurent Montel committed
659
                    deviceId = line.section(QLatin1Char(':'), 0, 0);
Nicolas Carion's avatar
Nicolas Carion committed
660 661 662
                    m_configSdl.kcfg_audio_device->addItem(line.section(QLatin1Char(':'), 1, 1), QStringLiteral("plughw:%1,%2")
                                                                                                     .arg(deviceId.section(QLatin1Char('-'), 0, 0).toInt())
                                                                                                     .arg(deviceId.section(QLatin1Char('-'), 1, 1).toInt()));
663
                }
664
                if (line.contains(QStringLiteral("capture"))) {
Laurent Montel's avatar
Laurent Montel committed
665
                    deviceId = line.section(QLatin1Char(':'), 0, 0);
Nicolas Carion's avatar
Nicolas Carion committed
666 667 668
                    m_configCapture.kcfg_v4l_alsadevice->addItem(
                        line.section(QLatin1Char(':'), 1, 1).simplified(),
                        QStringLiteral("hw:%1,%2").arg(deviceId.section(QLatin1Char('-'), 0, 0).toInt()).arg(deviceId.section(QLatin1Char('-'), 1, 1).toInt()));
669
                }
670
                line = stream.readLine();
671
            }
672
            file.close();
673 674 675
        } else {
            qCDebug(KDENLIVE_LOG) << " / / / /CANNOT READ PCM";
        }
676
    }
677

678 679
    // Add pulseaudio capture option
    m_configCapture.kcfg_v4l_alsadevice->addItem(i18n("PulseAudio"), "pulse");
680

681 682
    if (!KdenliveSettings::audiodevicename().isEmpty()) {
        // Select correct alsa device
683 684 685
        int ix = m_configSdl.kcfg_audio_device->findData(KdenliveSettings::audiodevicename());
        m_configSdl.kcfg_audio_device->setCurrentIndex(ix);
        KdenliveSettings::setAudio_device(ix);
686
    }
Alberto Villa's avatar
Alberto Villa committed
687

688 689 690 691 692 693 694
    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);
    }

695
    m_configSdl.kcfg_audio_backend->addItem(i18n("SDL"), KdenliveSettings::sdlAudioBackend());
696 697 698 699 700 701 702
    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);
    }
703
    m_configSdl.group_sdl->setEnabled(KdenliveSettings::audiobackend().startsWith(QLatin1String("sdl")));
704

705
    loadCurrentV4lProfileInfo();
706 707
}

708 709
void KdenliveSettingsDialog::slotReadAudioDevices()
{
710
    QString result = QString(m_readProcess.readAllStandardOutput());
Nicolas Carion's avatar
Nicolas Carion committed
711 712
    // qCDebug(KDENLIVE_LOG) << "// / / / / / READING APLAY: ";
    // qCDebug(KDENLIVE_LOG) << result;
Laurent Montel's avatar
Laurent Montel committed
713
    const QStringList lines = result.split(QLatin1Char('\n'));
714
    for (const QString &devicestr : lines) {
Laurent Montel's avatar
Laurent Montel committed
715
        ////qCDebug(KDENLIVE_LOG) << "// READING LINE: " << data;
716 717 718
        if (!devicestr.startsWith(QLatin1Char(' ')) && devicestr.count(QLatin1Char(':')) > 1) {
            QString card = devicestr.section(QLatin1Char(':'), 0, 0).section(QLatin1Char(' '), -1);
            QString device = devicestr.section(QLatin1Char(':'), 1, 1).section(QLatin1Char(' '), -1);
Vincent Pinon's avatar
Vincent Pinon committed
719
            m_configSdl.kcfg_audio_device->addItem(devicestr.section(QLatin1Char(':'), -1).simplified(), QStringLiteral("plughw:%1,%2").arg(card, device));
Nicolas Carion's avatar
Nicolas Carion committed
720
            m_configCapture.kcfg_v4l_alsadevice->addItem(devicestr.section(QLatin1Char(':'), -1).simplified(),
Vincent Pinon's avatar
Vincent Pinon committed
721
                                                         QStringLiteral("hw:%1,%2").arg(card, device));
722
        }
Jean-Baptiste Mardelle's avatar