1 /***************************************************************************
2 * Copyright (C) 2008 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
20 #include "kdenlivesettingsdialog.h"
21 #include "profilesdialog.h"
22 #if !defined(Q_OS_FREEBSD)
23 #include "v4l/v4lcapture.h"
25 #include "blackmagic/devices.h"
26 #include "encodingprofilesdialog.h"
27 #include "kdenlivesettings.h"
29 #include <KStandardDirs>
31 #include <kopenwithdialog.h>
32 #include <KConfigDialogManager>
34 #include <KIO/NetAccess>
35 #include <kdeversion.h>
39 #include <QTreeWidgetItem>
47 #include "jogaction.h"
48 #include "jogshuttleconfig.h"
49 #include <linux/input.h>
50 #endif /* NO_JOGSHUTTLE */
53 KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString>& mappable_actions, QWidget * parent) :
54 KConfigDialog(parent, "settings", KdenliveSettings::self()),
56 m_shuttleModified(false),
57 m_mappable_actions(mappable_actions)
59 KdenliveSettings::setV4l_format(0);
60 QWidget *p1 = new QWidget;
61 m_configMisc.setupUi(p1);
62 m_page1 = addPage(p1, i18n("Misc"), "configure");
64 // Hide multi tab option until Kdenlive really supports it
65 m_configMisc.kcfg_activatetabs->setVisible(false);
67 QWidget *p8 = new QWidget;
68 m_configProject.setupUi(p8);
69 m_page8 = addPage(p8, i18n("Project Defaults"), "document-new");
70 connect(m_configProject.kcfg_generateproxy, SIGNAL(toggled(bool)), m_configProject.kcfg_proxyminsize, SLOT(setEnabled(bool)));
71 m_configProject.kcfg_proxyminsize->setEnabled(KdenliveSettings::generateproxy());
72 connect(m_configProject.kcfg_generateimageproxy, SIGNAL(toggled(bool)), m_configProject.kcfg_proxyimageminsize, SLOT(setEnabled(bool)));
73 m_configProject.kcfg_proxyimageminsize->setEnabled(KdenliveSettings::generateimageproxy());
75 QWidget *p3 = new QWidget;
76 m_configTimeline.setupUi(p3);
77 m_page3 = addPage(p3, i18n("Timeline"), "video-display");
79 QWidget *p2 = new QWidget;
80 m_configEnv.setupUi(p2);
81 m_configEnv.mltpathurl->setMode(KFile::Directory);
82 m_configEnv.mltpathurl->lineEdit()->setObjectName("kcfg_mltpath");
83 m_configEnv.rendererpathurl->lineEdit()->setObjectName("kcfg_rendererpath");
84 m_configEnv.kcfg_mltthreads->setMaximum(QThread::idealThreadCount());
85 m_configEnv.tmppathurl->setMode(KFile::Directory);
86 m_configEnv.tmppathurl->lineEdit()->setObjectName("kcfg_currenttmpfolder");
87 m_configEnv.projecturl->setMode(KFile::Directory);
88 m_configEnv.projecturl->lineEdit()->setObjectName("kcfg_defaultprojectfolder");
89 m_configEnv.capturefolderurl->setMode(KFile::Directory);
90 m_configEnv.capturefolderurl->lineEdit()->setObjectName("kcfg_capturefolder");
91 m_configEnv.capturefolderurl->setEnabled(!KdenliveSettings::capturetoprojectfolder());
92 connect(m_configEnv.kcfg_capturetoprojectfolder, SIGNAL(clicked()), this, SLOT(slotEnableCaptureFolder()));
93 m_page2 = addPage(p2, i18n("Environment"), "application-x-executable-script");
95 QWidget *p4 = new QWidget;
96 m_configCapture.setupUi(p4);
98 #if !defined(Q_WS_MAC) && !defined(Q_OS_FREEBSD)
100 // Video 4 Linux device detection
101 for (int i = 0; i < 10; i++) {
102 QString path = "/dev/video" + QString::number(i);
103 if (QFile::exists(path)) {
104 QStringList deviceInfo = V4lCaptureHandler::getDeviceName(path.toUtf8().constData());
105 if (!deviceInfo.isEmpty()) {
106 m_configCapture.kcfg_detectedv4ldevices->addItem(deviceInfo.at(0), path);
107 m_configCapture.kcfg_detectedv4ldevices->setItemData(m_configCapture.kcfg_detectedv4ldevices->count() - 1, deviceInfo.at(1), Qt::UserRole + 1);
111 connect(m_configCapture.kcfg_detectedv4ldevices, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdatev4lDevice()));
112 connect(m_configCapture.kcfg_v4l_format, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdatev4lCaptureProfile()));
113 connect(m_configCapture.kcfg_v4l_captureaudio, SIGNAL(toggled(bool)), m_configCapture.kcfg_v4l_alsadevice, SLOT(setEnabled(bool)));
114 connect(m_configCapture.config_v4l, SIGNAL(clicked()), this, SLOT(slotEditVideo4LinuxProfile()));
116 slotUpdatev4lDevice();
119 m_page4 = addPage(p4, i18n("Capture"), "media-record");
120 m_configCapture.tabWidget->setCurrentIndex(KdenliveSettings::defaultcapture());
122 m_configCapture.tabWidget->setEnabled(false);
123 m_configCapture.kcfg_defaultcapture->setEnabled(false);
124 m_configCapture.label->setText(i18n("Capture is not yet available on OS X."));
127 QWidget *p5 = new QWidget;
128 m_configShuttle.setupUi(p5);
130 m_configShuttle.kcfg_enableshuttle->hide();
131 m_configShuttle.kcfg_enableshuttle->setDisabled(true);
133 connect(m_configShuttle.kcfg_enableshuttle, SIGNAL(stateChanged(int)), this, SLOT(slotCheckShuttle(int)));
134 connect(m_configShuttle.shuttledevicelist, SIGNAL(activated(int)), this, SLOT(slotUpdateShuttleDevice(int)));
135 slotCheckShuttle(KdenliveSettings::enableshuttle());
136 m_configShuttle.shuttledisabled->hide();
138 // Store the button pointers into an array for easier handling them in the other functions.
139 m_shuttle_buttons.push_back(m_configShuttle.shuttle1);
140 m_shuttle_buttons.push_back(m_configShuttle.shuttle2);
141 m_shuttle_buttons.push_back(m_configShuttle.shuttle3);
142 m_shuttle_buttons.push_back(m_configShuttle.shuttle4);
143 m_shuttle_buttons.push_back(m_configShuttle.shuttle5);
145 // populate the buttons with the current configuration. The items are sorted
146 // according to the user-selected language, so they do not appear in random order.
147 QList<QString> action_names = mappable_actions.keys();
150 // Here we need to compute the action_id -> index-in-action_names. We iterate over the
151 // action_names, as the sorting may depend on the user-language.
152 QStringList actions_map = JogShuttleConfig::actionMap(KdenliveSettings::shuttlebuttons());
153 QMap<QString, int> action_pos;
154 foreach (const QString& action_id, actions_map) {
155 // This loop find out at what index is the string that would map to the action_id.
156 for (int i = 0; i < action_names.size(); i++) {
157 if (mappable_actions[action_names[i]] == action_id) {
158 action_pos[action_id] = i;
165 foreach (KComboBox* button, m_shuttle_buttons) {
166 button->addItems(action_names);
167 connect(button, SIGNAL(activated(int)), this, SLOT(slotShuttleModified()));
169 if (i < actions_map.size())
170 button->setCurrentIndex(action_pos[actions_map[i]]);
172 #endif /* NO_JOGSHUTTLE */
173 m_page5 = addPage(p5, i18n("JogShuttle"), "input-mouse");
175 QWidget *p6 = new QWidget;
176 m_configSdl.setupUi(p6);
178 #if not defined(Q_WS_MAC) && not defined(USE_OPEN_GL)
179 m_configSdl.kcfg_openglmonitors->setHidden(true);
182 m_page6 = addPage(p6, i18n("Playback"), "media-playback-start");
184 QWidget *p7 = new QWidget;
185 m_configTranscode.setupUi(p7);
186 m_page7 = addPage(p7, i18n("Transcode"), "edit-copy");
187 connect(m_configTranscode.button_add, SIGNAL(clicked()), this, SLOT(slotAddTranscode()));
188 connect(m_configTranscode.button_delete, SIGNAL(clicked()), this, SLOT(slotDeleteTranscode()));
189 connect(m_configTranscode.profiles_list, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(slotDialogModified()));
191 connect(m_configCapture.kcfg_rmd_capture_audio, SIGNAL(clicked(bool)), m_configCapture.audio_group, SLOT(setVisible(bool)));
193 m_configCapture.audio_group->setVisible(KdenliveSettings::rmd_capture_audio());
195 connect(m_configEnv.kp_image, SIGNAL(clicked()), this, SLOT(slotEditImageApplication()));
196 connect(m_configEnv.kp_audio, SIGNAL(clicked()), this, SLOT(slotEditAudioApplication()));
197 connect(m_configEnv.kp_player, SIGNAL(clicked()), this, SLOT(slotEditVideoApplication()));
199 loadEncodingProfiles();
204 connect(m_configSdl.kcfg_audio_driver, SIGNAL(currentIndexChanged(int)), this, SLOT(slotCheckAlsaDriver()));
206 connect(m_configProject.kcfg_profiles_list, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateDisplay()));
207 connect(m_configCapture.kcfg_rmd_capture_type, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateRmdRegionStatus()));
209 slotUpdateRmdRegionStatus();
210 loadTranscodeProfiles();
213 //HACK: check dvgrab version, because only dvgrab >= 3.3 supports
214 // --timestamp option without bug
216 if (KdenliveSettings::dvgrab_path().isEmpty() || !QFile::exists(KdenliveSettings::dvgrab_path())) {
217 QString dvgrabpath = KStandardDirs::findExe("dvgrab");
218 KdenliveSettings::setDvgrab_path(dvgrabpath);
222 m_configCapture.decklink_showprofileinfo->setIcon(KIcon("help-about"));
223 m_configCapture.decklink_manageprofile->setIcon(KIcon("configure"));
224 m_configCapture.decklink_parameters->setVisible(false);
225 m_configCapture.decklink_parameters->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 4);
226 m_configCapture.decklink_parameters->setPlainText(KdenliveSettings::decklink_parameters());
227 connect(m_configCapture.decklink_manageprofile, SIGNAL(clicked(bool)), this, SLOT(slotManageEncodingProfile()));
228 connect(m_configCapture.kcfg_decklink_profile, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateDecklinkProfile()));
229 connect(m_configCapture.decklink_showprofileinfo, SIGNAL(clicked(bool)), m_configCapture.decklink_parameters, SLOT(setVisible(bool)));
232 m_configCapture.v4l_showprofileinfo->setIcon(KIcon("help-about"));
233 m_configCapture.v4l_manageprofile->setIcon(KIcon("configure"));
234 m_configCapture.v4l_parameters->setVisible(false);
235 m_configCapture.v4l_parameters->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 4);
236 m_configCapture.v4l_parameters->setPlainText(KdenliveSettings::v4l_parameters());
237 connect(m_configCapture.v4l_manageprofile, SIGNAL(clicked(bool)), this, SLOT(slotManageEncodingProfile()));
238 connect(m_configCapture.kcfg_v4l_profile, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateV4lProfile()));
239 connect(m_configCapture.v4l_showprofileinfo, SIGNAL(clicked(bool)), m_configCapture.v4l_parameters, SLOT(setVisible(bool)));
241 // proxy profile stuff
242 m_configProject.proxy_showprofileinfo->setIcon(KIcon("help-about"));
243 m_configProject.proxy_manageprofile->setIcon(KIcon("configure"));
244 m_configProject.proxyparams->setVisible(false);
245 m_configProject.proxyparams->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 4);
246 m_configProject.proxyparams->setPlainText(KdenliveSettings::proxyparams());
247 connect(m_configProject.proxy_manageprofile, SIGNAL(clicked(bool)), this, SLOT(slotManageEncodingProfile()));
248 connect(m_configProject.proxy_showprofileinfo, SIGNAL(clicked(bool)), m_configProject.proxyparams, SLOT(setVisible(bool)));
249 connect(m_configProject.kcfg_proxy_profile, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateProxyProfile()));
252 slotUpdateProxyProfile(-1);
253 slotUpdateV4lProfile(-1);
254 slotUpdateDecklinkProfile(-1);
256 BMInterface::getBlackMagicDeviceList(m_configCapture.kcfg_decklink_capturedevice);
257 if (m_configCapture.kcfg_decklink_capturedevice->count() > 0) {
258 QStringList modes = m_configCapture.kcfg_decklink_capturedevice->itemData(m_configCapture.kcfg_decklink_capturedevice->currentIndex()).toStringList();
259 m_configCapture.kcfg_decklink_capturedevice->setToolTip(i18n("Supported capture modes:\n") + modes.join("\n"));
261 connect(m_configCapture.kcfg_decklink_capturedevice, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateHDMIModes()));
263 if (BMInterface::getBlackMagicOutputDeviceList(m_configSdl.kcfg_blackmagic_output_device)) {
264 // Found blackmagic card
265 } else m_configSdl.kcfg_external_display->setEnabled(false);
267 double dvgrabVersion = 0;
268 if (!KdenliveSettings::dvgrab_path().isEmpty()) {
269 QProcess *versionCheck = new QProcess;
270 versionCheck->setProcessChannelMode(QProcess::MergedChannels);
271 versionCheck->start("dvgrab", QStringList() << "--version");
272 if (versionCheck->waitForFinished()) {
273 QString version = QString(versionCheck->readAll()).simplified();
274 if (version.contains(' ')) version = version.section(' ', -1);
275 dvgrabVersion = version.toDouble();
277 kDebug() << "// FOUND DVGRAB VERSION: " << dvgrabVersion;
280 if (dvgrabVersion < 3.3) {
281 KdenliveSettings::setFirewiretimestamp(false);
282 m_configCapture.kcfg_firewiretimestamp->setEnabled(false);
284 m_configCapture.dvgrab_info->setText(i18n("dvgrab version %1 at %2", dvgrabVersion, KdenliveSettings::dvgrab_path()));
285 } else m_configCapture.dvgrab_info->setText(i18n("<strong><em>dvgrab</em> utility not found, please install it for firewire capture</strong>"));
287 if (KdenliveSettings::rmd_path().isEmpty() || !QFile::exists(KdenliveSettings::rmd_path())) {
288 QString rmdpath = KStandardDirs::findExe("recordmydesktop");
289 KdenliveSettings::setRmd_path(rmdpath);
291 if (KdenliveSettings::rmd_path().isEmpty())
292 m_configCapture.rmd_info->setText(i18n("<strong><em>Recordmydesktop</em> utility not found, please install it for screen grabs</strong>"));
294 m_configCapture.rmd_info->setText(i18n("Recordmydesktop found at: %1", KdenliveSettings::rmd_path()));
297 KdenliveSettingsDialog::~KdenliveSettingsDialog() {}
299 void KdenliveSettingsDialog::slotUpdateHDMIModes()
301 QStringList modes = m_configCapture.kcfg_decklink_capturedevice->itemData(m_configCapture.kcfg_decklink_capturedevice->currentIndex()).toStringList();
302 m_configCapture.kcfg_decklink_capturedevice->setToolTip(i18n("Supported capture modes:\n") + modes.join("\n"));
305 void KdenliveSettingsDialog::slotUpdateRmdRegionStatus()
307 m_configCapture.region_group->setHidden(m_configCapture.kcfg_rmd_capture_type->currentIndex() != 1);
310 void KdenliveSettingsDialog::slotEnableCaptureFolder()
312 m_configEnv.capturefolderurl->setEnabled(!m_configEnv.kcfg_capturetoprojectfolder->isChecked());
315 void KdenliveSettingsDialog::checkProfile()
317 m_configProject.kcfg_profiles_list->clear();
318 QMap <QString, QString> profilesInfo = ProfilesDialog::getProfilesInfo();
319 QMapIterator<QString, QString> i(profilesInfo);
320 while (i.hasNext()) {
322 m_configProject.kcfg_profiles_list->addItem(i.key(), i.value());
325 if (!KdenliveSettings::default_profile().isEmpty()) {
326 for (int i = 0; i < m_configProject.kcfg_profiles_list->count(); i++) {
327 if (m_configProject.kcfg_profiles_list->itemData(i).toString() == KdenliveSettings::default_profile()) {
328 m_configProject.kcfg_profiles_list->setCurrentIndex(i);
329 KdenliveSettings::setProfiles_list(i);
336 void KdenliveSettingsDialog::initDevices()
338 // Fill audio drivers
339 m_configSdl.kcfg_audio_driver->addItem(i18n("Automatic"), QString());
341 m_configSdl.kcfg_audio_driver->addItem(i18n("OSS"), "dsp");
342 m_configSdl.kcfg_audio_driver->addItem(i18n("ALSA"), "alsa");
343 m_configSdl.kcfg_audio_driver->addItem(i18n("PulseAudio"), "pulse");
344 m_configSdl.kcfg_audio_driver->addItem(i18n("OSS with DMA access"), "dma");
345 m_configSdl.kcfg_audio_driver->addItem(i18n("Esound daemon"), "esd");
346 m_configSdl.kcfg_audio_driver->addItem(i18n("ARTS daemon"), "artsc");
349 if (!KdenliveSettings::audiodrivername().isEmpty())
350 for (int i = 1; i < m_configSdl.kcfg_audio_driver->count(); i++) {
351 if (m_configSdl.kcfg_audio_driver->itemData(i).toString() == KdenliveSettings::audiodrivername()) {
352 m_configSdl.kcfg_audio_driver->setCurrentIndex(i);
353 KdenliveSettings::setAudio_driver((uint) i);
357 // Fill video drivers
358 m_configSdl.kcfg_video_driver->addItem(i18n("Automatic"), QString());
360 m_configSdl.kcfg_video_driver->addItem(i18n("XVideo"), "x11");
361 m_configSdl.kcfg_video_driver->addItem(i18n("X11"), "x11_noaccel");
362 m_configSdl.kcfg_video_driver->addItem(i18n("XFree86 DGA 2.0"), "dga");
363 m_configSdl.kcfg_video_driver->addItem(i18n("Nano X"), "nanox");
364 m_configSdl.kcfg_video_driver->addItem(i18n("Framebuffer console"), "fbcon");
365 m_configSdl.kcfg_video_driver->addItem(i18n("Direct FB"), "directfb");
366 m_configSdl.kcfg_video_driver->addItem(i18n("SVGAlib"), "svgalib");
367 m_configSdl.kcfg_video_driver->addItem(i18n("General graphics interface"), "ggi");
368 m_configSdl.kcfg_video_driver->addItem(i18n("Ascii art library"), "aalib");
371 // Fill the list of audio playback devices
372 m_configSdl.kcfg_audio_device->addItem(i18n("Default"), QString());
373 m_configCapture.kcfg_rmd_alsa_device->addItem(i18n("Default"), QString());
374 if (!KStandardDirs::findExe("aplay").isEmpty()) {
375 m_readProcess.setOutputChannelMode(KProcess::OnlyStdoutChannel);
376 m_readProcess.setProgram("aplay", QStringList() << "-l");
377 connect(&m_readProcess, SIGNAL(readyReadStandardOutput()) , this, SLOT(slotReadAudioDevices()));
378 m_readProcess.execute(5000);
380 // If aplay is not installed on the system, parse the /proc/asound/pcm file
381 QFile file("/proc/asound/pcm");
382 if (file.open(QIODevice::ReadOnly)) {
383 QTextStream stream(&file);
386 while (!stream.atEnd()) {
387 line = stream.readLine();
388 if (line.contains("playback")) {
389 deviceId = line.section(':', 0, 0);
390 m_configSdl.kcfg_audio_device->addItem(line.section(':', 1, 1), "plughw:" + QString::number(deviceId.section('-', 0, 0).toInt()) + ',' + QString::number(deviceId.section('-', 1, 1).toInt()));
392 if (line.contains("capture")) {
393 deviceId = line.section(':', 0, 0);
394 m_configCapture.kcfg_rmd_alsa_device->addItem(line.section(':', 1, 1), "plughw:" + QString::number(deviceId.section('-', 0, 0).toInt()) + ',' + QString::number(deviceId.section('-', 1, 1).toInt()));
395 m_configCapture.kcfg_v4l_alsadevice->addItem(line.section(':', 1, 1), "hw:" + QString::number(deviceId.section('-', 0, 0).toInt()) + ',' + QString::number(deviceId.section('-', 1, 1).toInt()));
401 if (!KdenliveSettings::audiodevicename().isEmpty()) {
402 // Select correct alsa device
403 int ix = m_configSdl.kcfg_audio_device->findData(KdenliveSettings::audiodevicename());
404 m_configSdl.kcfg_audio_device->setCurrentIndex(ix);
405 KdenliveSettings::setAudio_device(ix);
408 if (!KdenliveSettings::rmd_alsadevicename().isEmpty()) {
409 // Select correct alsa device
410 int ix = m_configCapture.kcfg_rmd_alsa_device->findData(KdenliveSettings::rmd_alsadevicename());
411 m_configCapture.kcfg_rmd_alsa_device->setCurrentIndex(ix);
412 KdenliveSettings::setRmd_alsa_device(ix);
415 if (!KdenliveSettings::v4l_alsadevicename().isEmpty()) {
416 // Select correct alsa device
417 int ix = m_configCapture.kcfg_v4l_alsadevice->findData(KdenliveSettings::v4l_alsadevicename());
418 m_configCapture.kcfg_v4l_alsadevice->setCurrentIndex(ix);
419 KdenliveSettings::setV4l_alsadevice(ix);
422 loadCurrentV4lProfileInfo();
426 void KdenliveSettingsDialog::slotReadAudioDevices()
428 QString result = QString(m_readProcess.readAllStandardOutput());
429 kDebug() << "// / / / / / READING APLAY: ";
431 QStringList lines = result.split('\n');
432 foreach(const QString & data, lines) {
433 kDebug() << "// READING LINE: " << data;
434 if (data.simplified().startsWith("card")) {
435 QString card = data.section(':', 0, 0).section(' ', -1);
436 QString device = data.section(':', 1, 1).section(' ', -1);
437 m_configSdl.kcfg_audio_device->addItem(data.section(':', -1), "plughw:" + card + ',' + device);
438 m_configCapture.kcfg_rmd_alsa_device->addItem(data.section(':', -1), "plughw:" + card + ',' + device);
439 m_configCapture.kcfg_v4l_alsadevice->addItem(data.section(':', -1), "hw:" + card + ',' + device);
444 void KdenliveSettingsDialog::showPage(int page, int option)
448 setCurrentPage(m_page1);
451 setCurrentPage(m_page2);
454 setCurrentPage(m_page3);
457 setCurrentPage(m_page4);
458 m_configCapture.tabWidget->setCurrentIndex(option);
461 setCurrentPage(m_page5);
464 setCurrentPage(m_page6);
467 setCurrentPage(m_page7);
470 setCurrentPage(m_page1);
474 void KdenliveSettingsDialog::slotEditVideoApplication()
476 KService::Ptr service;
477 KOpenWithDialog dlg(KUrl::List(), i18n("Select default video player"), m_configEnv.kcfg_defaultplayerapp->text(), this);
478 if (dlg.exec() != QDialog::Accepted)
481 service = dlg.service();
482 m_configEnv.kcfg_defaultplayerapp->setText(service->exec());
485 void KdenliveSettingsDialog::slotEditAudioApplication()
487 KService::Ptr service;
488 KOpenWithDialog dlg(KUrl::List(), i18n("Select default audio editor"), m_configEnv.kcfg_defaultaudioapp->text(), this);
489 if (dlg.exec() != QDialog::Accepted)
492 service = dlg.service();
493 m_configEnv.kcfg_defaultaudioapp->setText(service->exec());
496 void KdenliveSettingsDialog::slotEditImageApplication()
498 KService::Ptr service;
499 KOpenWithDialog dlg(KUrl::List(), i18n("Select default image editor"), m_configEnv.kcfg_defaultimageapp->text(), this);
500 if (dlg.exec() != QDialog::Accepted)
503 service = dlg.service();
504 m_configEnv.kcfg_defaultimageapp->setText(service->exec());
507 #ifndef NO_JOGSHUTTLE
508 void KdenliveSettingsDialog::slotCheckShuttle(int state)
510 m_configShuttle.config_group->setEnabled(state);
511 if (m_configShuttle.shuttledevicelist->count() == 0) {
513 QString baseName = "/dev/input/event";
515 for (int i = 0; i < 30; i++) {
516 QString filename = baseName + QString::number(i);
517 kDebug() << "/// CHECKING OFR: " << filename;
519 char name[256] = "unknown";
520 fd = KDE_open((char *) filename.toUtf8().data(), O_RDONLY);
521 if (fd >= 0 && ioctl(fd, EVIOCGNAME(sizeof(name)), name) >= 0) {
522 m_configShuttle.shuttledevicelist->addItem(name, filename);
526 if (KdenliveSettings::shuttledevice().isEmpty()) QTimer::singleShot(1500, this, SLOT(slotUpdateShuttleDevice()));
530 void KdenliveSettingsDialog::slotUpdateShuttleDevice(int ix)
532 QString device = m_configShuttle.shuttledevicelist->itemData(ix).toString();
533 //KdenliveSettings::setShuttledevice(device);
534 m_configShuttle.kcfg_shuttledevice->setText(device);
537 #endif /* NO_JOGSHUTTLE */
539 void KdenliveSettingsDialog::updateWidgets()
541 // Revert widgets to last saved state (for example when user pressed "Cancel")
542 // kDebug() << "// // // KCONFIG Revert called";
543 #ifndef NO_JOGSHUTTLE
544 // revert jog shuttle device
545 if (m_configShuttle.shuttledevicelist->count() > 0) {
546 for (int i = 0; i < m_configShuttle.shuttledevicelist->count(); i++) {
547 if (m_configShuttle.shuttledevicelist->itemData(i) == KdenliveSettings::shuttledevice()) {
548 m_configShuttle.shuttledevicelist->setCurrentIndex(i);
554 // Revert jog shuttle buttons
555 QList<QString> action_names = m_mappable_actions.keys();
557 QStringList actions_map = JogShuttleConfig::actionMap(KdenliveSettings::shuttlebuttons());
558 QMap<QString, int> action_pos;
559 foreach (const QString& action_id, actions_map) {
560 // This loop find out at what index is the string that would map to the action_id.
561 for (int i = 0; i < action_names.size(); i++) {
562 if (m_mappable_actions[action_names[i]] == action_id) {
563 action_pos[action_id] = i;
569 foreach (KComboBox* button, m_shuttle_buttons) {
571 if (i < actions_map.size())
572 button->setCurrentIndex(action_pos[actions_map[i]]);
577 void KdenliveSettingsDialog::updateSettings()
579 // Save changes to settings (for example when user pressed "Apply" or "Ok")
580 // kDebug() << "// // // KCONFIG UPDATE called";
581 m_defaultProfile = m_configProject.kcfg_profiles_list->currentText();
582 KdenliveSettings::setDefault_profile(m_defaultPath);
584 bool resetProfile = false;
585 bool updateCapturePath = false;
587 /*if (m_configShuttle.shuttledevicelist->count() > 0) {
588 QString device = m_configShuttle.shuttledevicelist->itemData(m_configShuttle.shuttledevicelist->currentIndex()).toString();
589 if (device != KdenliveSettings::shuttledevice()) KdenliveSettings::setShuttledevice(device);
592 if (m_configEnv.kcfg_capturetoprojectfolder->isChecked() != KdenliveSettings::capturetoprojectfolder()) {
593 KdenliveSettings::setCapturetoprojectfolder(m_configEnv.kcfg_capturetoprojectfolder->isChecked());
594 updateCapturePath = true;
597 if (m_configEnv.capturefolderurl->url().path() != KdenliveSettings::capturefolder()) {
598 KdenliveSettings::setCapturefolder(m_configEnv.capturefolderurl->url().path());
599 updateCapturePath = true;
602 if (m_configCapture.kcfg_dvgrabfilename->text() != KdenliveSettings::dvgrabfilename()) {
603 KdenliveSettings::setDvgrabfilename(m_configCapture.kcfg_dvgrabfilename->text());
604 updateCapturePath = true;
607 if ((uint) m_configCapture.kcfg_firewireformat->currentIndex() != KdenliveSettings::firewireformat()) {
608 KdenliveSettings::setFirewireformat(m_configCapture.kcfg_firewireformat->currentIndex());
609 updateCapturePath = true;
612 if ((uint) m_configCapture.kcfg_v4l_format->currentIndex() != KdenliveSettings::v4l_format()) {
613 saveCurrentV4lProfile();
614 KdenliveSettings::setV4l_format(0);
617 // Check encoding profiles
618 QString data = m_configCapture.kcfg_v4l_profile->itemData(m_configCapture.kcfg_v4l_profile->currentIndex()).toString();
619 if (!data.isEmpty() && data.section(";", 0, 0) != KdenliveSettings::v4l_parameters()) {
620 KdenliveSettings::setV4l_parameters(data.section(";", 0, 0));
621 KdenliveSettings::setV4l_extension(data.section(";", 1, 1));
623 data = m_configCapture.kcfg_decklink_profile->itemData(m_configCapture.kcfg_decklink_profile->currentIndex()).toString();
624 if (!data.isEmpty() && data.section(";", 0, 0) != KdenliveSettings::decklink_parameters()) {
625 KdenliveSettings::setDecklink_parameters(data.section(";", 0, 0));
626 KdenliveSettings::setDecklink_extension(data.section(";", 1, 1));
628 data = m_configProject.kcfg_proxy_profile->itemData(m_configProject.kcfg_proxy_profile->currentIndex()).toString();
629 if (!data.isEmpty() && data.section(";", 0, 0) != KdenliveSettings::proxyparams()) {
630 KdenliveSettings::setProxyparams(data.section(";", 0, 0));
631 KdenliveSettings::setProxyextension(data.section(";", 1, 1));
635 if (updateCapturePath) emit updateCaptureFolder();
637 QString value = m_configCapture.kcfg_rmd_alsa_device->itemData(m_configCapture.kcfg_rmd_alsa_device->currentIndex()).toString();
638 if (value != KdenliveSettings::rmd_alsadevicename()) {
639 KdenliveSettings::setRmd_alsadevicename(value);
642 value = m_configCapture.kcfg_v4l_alsadevice->itemData(m_configCapture.kcfg_v4l_alsadevice->currentIndex()).toString();
643 if (value != KdenliveSettings::v4l_alsadevicename()) {
644 KdenliveSettings::setV4l_alsadevicename(value);
647 value = m_configCapture.kcfg_rmd_audio_freq->itemText(m_configCapture.kcfg_rmd_audio_freq->currentIndex());
648 kDebug() << "// AUDIO FREQ VALUE: " << value << ", CURRENT: " << KdenliveSettings::rmd_freq() << ", IX: " << m_configCapture.kcfg_rmd_audio_freq->currentIndex();
649 if (value != KdenliveSettings::rmd_freq()) {
650 kDebug() << "// SETTING AUDIO FREQ TO: " << value;
651 KdenliveSettings::setRmd_freq(value);
654 if (m_configSdl.kcfg_external_display->isChecked() != KdenliveSettings::external_display()) {
655 KdenliveSettings::setExternal_display(m_configSdl.kcfg_external_display->isChecked());
659 value = m_configSdl.kcfg_audio_driver->itemData(m_configSdl.kcfg_audio_driver->currentIndex()).toString();
660 if (value != KdenliveSettings::audiodrivername()) {
661 KdenliveSettings::setAudiodrivername(value);
665 if (value == "alsa") {
666 // Audio device setting is only valid for alsa driver
667 value = m_configSdl.kcfg_audio_device->itemData(m_configSdl.kcfg_audio_device->currentIndex()).toString();
668 if (value != KdenliveSettings::audiodevicename()) {
669 KdenliveSettings::setAudiodevicename(value);
672 } else if (KdenliveSettings::audiodevicename().isEmpty() == false) {
673 KdenliveSettings::setAudiodevicename(QString::null);
677 value = m_configSdl.kcfg_video_driver->itemData(m_configSdl.kcfg_video_driver->currentIndex()).toString();
678 if (value != KdenliveSettings::videodrivername()) {
679 KdenliveSettings::setVideodrivername(value);
683 if (m_configSdl.kcfg_window_background->color() != KdenliveSettings::window_background()) {
684 KdenliveSettings::setWindow_background(m_configSdl.kcfg_window_background->color());
688 if (m_configSdl.kcfg_volume->value() != KdenliveSettings::volume()) {
689 KdenliveSettings::setVolume(m_configSdl.kcfg_volume->value());
694 // The transcoding profiles were modified, save.
696 saveTranscodeProfiles();
699 #ifndef NO_JOGSHUTTLE
700 m_shuttleModified = false;
703 actions << "monitor_pause"; // the Job rest position action.
704 foreach (KComboBox* button, m_shuttle_buttons) {
705 actions << m_mappable_actions[button->currentText()];
707 QString maps = JogShuttleConfig::actionMap(actions);
708 //fprintf(stderr, "Shuttle config: %s\n", JogShuttleConfig::actionMap(actions).toAscii().constData());
709 if (KdenliveSettings::shuttlebuttons() != maps)
710 KdenliveSettings::setShuttlebuttons(maps);
713 #if KDE_IS_VERSION(4,3,0)
714 KConfigDialog::settingsChangedSlot();
717 //KConfigDialog::updateSettings();
718 if (resetProfile) emit doResetProfile();
721 void KdenliveSettingsDialog::slotUpdateDisplay()
723 QString currentProfile = m_configProject.kcfg_profiles_list->itemData(m_configProject.kcfg_profiles_list->currentIndex()).toString();
724 QMap< QString, QString > values = ProfilesDialog::getSettingsFromFile(currentProfile);
725 m_configProject.p_size->setText(values.value("width") + 'x' + values.value("height"));
726 m_configProject.p_fps->setText(values.value("frame_rate_num") + '/' + values.value("frame_rate_den"));
727 m_configProject.p_aspect->setText(values.value("sample_aspect_num") + '/' + values.value("sample_aspect_den"));
728 m_configProject.p_display->setText(values.value("display_aspect_num") + '/' + values.value("display_aspect_den"));
729 if (values.value("progressive").toInt() == 0)
730 m_configProject.p_progressive->setText(i18n("Interlaced"));
732 m_configProject.p_progressive->setText(i18n("Progressive"));
733 m_defaultProfile = m_configProject.kcfg_profiles_list->itemText(m_configProject.kcfg_profiles_list->currentIndex());
734 m_defaultPath = currentProfile;
737 void KdenliveSettingsDialog::slotCheckAlsaDriver()
739 QString value = m_configSdl.kcfg_audio_driver->itemData(m_configSdl.kcfg_audio_driver->currentIndex()).toString();
740 m_configSdl.kcfg_audio_device->setEnabled(value == "alsa");
743 void KdenliveSettingsDialog::loadTranscodeProfiles()
745 KSharedConfigPtr config = KSharedConfig::openConfig("kdenlivetranscodingrc");
746 KConfigGroup transConfig(config, "Transcoding");
748 m_configTranscode.profiles_list->blockSignals(true);
749 QMap< QString, QString > profiles = transConfig.entryMap();
750 QMapIterator<QString, QString> i(profiles);
751 while (i.hasNext()) {
753 QTreeWidgetItem *item = new QTreeWidgetItem(m_configTranscode.profiles_list, QStringList() << i.key() << i.value());
754 item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable);
756 m_configTranscode.profiles_list->blockSignals(false);
759 void KdenliveSettingsDialog::saveTranscodeProfiles()
761 KSharedConfigPtr config = KSharedConfig::openConfig("kdenlivetranscodingrc");
762 //KSharedConfigPtr config = KGlobal::config();
763 KConfigGroup transConfig(config, "Transcoding");
765 transConfig.deleteGroup();
766 int max = m_configTranscode.profiles_list->topLevelItemCount();
767 for (int i = 0; i < max; i++) {
768 QTreeWidgetItem *item = m_configTranscode.profiles_list->topLevelItem(i);
769 transConfig.writeEntry(item->text(0), item->text(1));
774 void KdenliveSettingsDialog::slotAddTranscode()
776 QTreeWidgetItem *item = new QTreeWidgetItem(m_configTranscode.profiles_list, QStringList() << i18n("Name") << i18n("Parameters"));
777 item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable);
778 m_configTranscode.profiles_list->setCurrentItem(item);
779 m_configTranscode.profiles_list->editItem(item);
780 slotDialogModified();
783 void KdenliveSettingsDialog::slotDeleteTranscode()
785 QTreeWidgetItem *item = m_configTranscode.profiles_list->currentItem();
786 if (item == NULL) return;
788 slotDialogModified();
791 void KdenliveSettingsDialog::slotShuttleModified()
793 #ifndef NO_JOGSHUTTLE
795 actions << "monitor_pause"; // the Job rest position action.
796 foreach (KComboBox* button, m_shuttle_buttons) {
797 actions << m_mappable_actions[button->currentText()];
799 QString maps = JogShuttleConfig::actionMap(actions);
800 m_shuttleModified = KdenliveSettings::shuttlebuttons() != maps;
802 #if KDE_IS_VERSION(4,3,0)
803 KConfigDialog::updateButtons();
807 void KdenliveSettingsDialog::slotDialogModified()
810 #if KDE_IS_VERSION(4,3,0)
811 KConfigDialog::updateButtons();
816 bool KdenliveSettingsDialog::hasChanged()
818 if (m_modified || m_shuttleModified) return true;
819 return KConfigDialog::hasChanged();
822 void KdenliveSettingsDialog::slotUpdatev4lDevice()
824 QString device = m_configCapture.kcfg_detectedv4ldevices->itemData(m_configCapture.kcfg_detectedv4ldevices->currentIndex()).toString();
825 if (!device.isEmpty()) m_configCapture.kcfg_video4vdevice->setText(device);
826 QString info = m_configCapture.kcfg_detectedv4ldevices->itemData(m_configCapture.kcfg_detectedv4ldevices->currentIndex(), Qt::UserRole + 1).toString();
828 m_configCapture.kcfg_v4l_format->blockSignals(true);
829 m_configCapture.kcfg_v4l_format->clear();
831 QString vl4ProfilePath = KStandardDirs::locateLocal("appdata", "profiles/video4linux");
832 if (QFile::exists(vl4ProfilePath)) {
833 m_configCapture.kcfg_v4l_format->addItem(i18n("Current settings"));
836 QStringList pixelformats = info.split(">", QString::SkipEmptyParts);
839 QStringList itemRates;
840 for (int i = 0; i < pixelformats.count(); i++) {
841 QString format = pixelformats.at(i).section(':', 0, 0);
842 QStringList sizes = pixelformats.at(i).split(":", QString::SkipEmptyParts);
843 pixelFormat = sizes.takeFirst();
844 for (int j = 0; j < sizes.count(); j++) {
845 itemSize = sizes.at(j).section("=", 0, 0);
846 itemRates = sizes.at(j).section("=", 1, 1).split(",", QString::SkipEmptyParts);
847 for (int k = 0; k < itemRates.count(); k++) {
848 m_configCapture.kcfg_v4l_format->addItem("[" + format + "] " + itemSize + " (" + itemRates.at(k) + ")", QStringList() << format << itemSize.section('x', 0, 0) << itemSize.section('x', 1, 1) << itemRates.at(k).section('/', 0, 0) << itemRates.at(k).section('/', 1, 1));
852 m_configCapture.kcfg_v4l_format->blockSignals(false);
853 slotUpdatev4lCaptureProfile();
856 void KdenliveSettingsDialog::slotUpdatev4lCaptureProfile()
858 QStringList info = m_configCapture.kcfg_v4l_format->itemData(m_configCapture.kcfg_v4l_format->currentIndex(), Qt::UserRole).toStringList();
859 if (info.isEmpty()) {
860 // No auto info, display the current ones
861 loadCurrentV4lProfileInfo();
864 m_configCapture.p_size->setText(info.at(1) + 'x' + info.at(2));
865 m_configCapture.p_fps->setText(info.at(3) + '/' + info.at(4));
866 m_configCapture.p_aspect->setText("1/1");
867 m_configCapture.p_display->setText(info.at(1) + '/' + info.at(2));
868 m_configCapture.p_colorspace->setText(ProfilesDialog::getColorspaceDescription(601));
869 m_configCapture.p_progressive->setText(i18n("Progressive"));
871 QString vl4ProfilePath = KStandardDirs::locateLocal("appdata", "profiles/video4linux");
872 if (!QFile::exists(vl4ProfilePath)) saveCurrentV4lProfile();
875 void KdenliveSettingsDialog::loadCurrentV4lProfileInfo()
877 QString vl4ProfilePath = KStandardDirs::locateLocal("appdata", "profiles/video4linux");
878 MltVideoProfile prof;
879 if (!QFile::exists(vl4ProfilePath)) {
880 // No default formats found, build one
883 prof.frame_rate_num = 15;
884 prof.frame_rate_den = 1;
885 prof.display_aspect_num = 4;
886 prof.display_aspect_den = 3;
887 prof.sample_aspect_num = 1;
888 prof.sample_aspect_den = 1;
889 prof.progressive = 1;
890 prof.colorspace = 601;
891 ProfilesDialog::saveProfile(prof, vl4ProfilePath);
893 else prof = ProfilesDialog::getVideoProfile(vl4ProfilePath);
894 m_configCapture.p_size->setText(QString::number(prof.width) + 'x' + QString::number(prof.height));
895 m_configCapture.p_fps->setText(QString::number(prof.frame_rate_num) + '/' + QString::number(prof.frame_rate_den));
896 m_configCapture.p_aspect->setText(QString::number(prof.sample_aspect_num) + '/' + QString::number(prof.sample_aspect_den));
897 m_configCapture.p_display->setText(QString::number(prof.display_aspect_num) + '/' + QString::number(prof.display_aspect_den));
898 m_configCapture.p_colorspace->setText(ProfilesDialog::getColorspaceDescription(prof.colorspace));
899 if (prof.progressive) m_configCapture.p_progressive->setText(i18n("Progressive"));
902 void KdenliveSettingsDialog::saveCurrentV4lProfile()
904 MltVideoProfile profile;
905 profile.description = "Video4Linux capture";
906 profile.colorspace = ProfilesDialog::getColorspaceFromDescription(m_configCapture.p_colorspace->text());
907 profile.width = m_configCapture.p_size->text().section('x', 0, 0).toInt();
908 profile.height = m_configCapture.p_size->text().section('x', 1, 1).toInt();
909 profile.sample_aspect_num = m_configCapture.p_aspect->text().section('/', 0, 0).toInt();
910 profile.sample_aspect_den = m_configCapture.p_aspect->text().section('/', 1, 1).toInt();
911 profile.display_aspect_num = m_configCapture.p_display->text().section('/', 0, 0).toInt();
912 profile.display_aspect_den = m_configCapture.p_display->text().section('/', 1, 1).toInt();
913 profile.frame_rate_num = m_configCapture.p_fps->text().section('/', 0, 0).toInt();
914 profile.frame_rate_den = m_configCapture.p_fps->text().section('/', 1, 1).toInt();
915 profile.progressive = m_configCapture.p_progressive->text() == i18n("Progressive");
916 QString vl4ProfilePath = KStandardDirs::locateLocal("appdata", "profiles/video4linux");
917 ProfilesDialog::saveProfile(profile, vl4ProfilePath);
920 void KdenliveSettingsDialog::slotManageEncodingProfile()
923 if (currentPage() == m_page4) {
924 if (m_configCapture.tabWidget->currentIndex() == 1) type = 1;
925 else if (m_configCapture.tabWidget->currentIndex() == 3) type = 2;
927 EncodingProfilesDialog *d = new EncodingProfilesDialog(type);
930 loadEncodingProfiles();
933 void KdenliveSettingsDialog::loadEncodingProfiles()
935 QString profileFile = KStandardDirs::locateLocal("appdata", "encodingprofiles.rc");
936 KConfig conf(profileFile, KConfig::SimpleConfig);
937 if (!QFile::exists(profileFile)) {
938 KConfigGroup g1(&conf, "video4linux");
939 g1.writeEntry("Normal MPEG", KdenliveSettings::v4l_parameters() + ";" + KdenliveSettings::v4l_extension());
940 KConfigGroup g2(&conf, "decklink");
941 g2.writeEntry("Normal MPEG", KdenliveSettings::decklink_parameters() + ";" + KdenliveSettings::decklink_extension());
942 KConfigGroup g3(&conf, "proxy");
943 g3.writeEntry("Normal MPEG", KdenliveSettings::proxyparams() + ";" + KdenliveSettings::proxyextension());
947 m_configCapture.kcfg_v4l_profile->blockSignals(true);
948 QString currentItem = m_configCapture.kcfg_v4l_profile->currentText();
949 m_configCapture.kcfg_v4l_profile->clear();
950 KConfigGroup group(&conf, "video4linux");
951 QMap< QString, QString > values = group.entryMap();
952 QMapIterator<QString, QString> i(values);
953 while (i.hasNext()) {
955 if (!i.key().isEmpty()) m_configCapture.kcfg_v4l_profile->addItem(i.key(), i.value());
957 m_configCapture.kcfg_v4l_profile->blockSignals(false);
958 if (!currentItem.isEmpty()) m_configCapture.kcfg_v4l_profile->setCurrentIndex(m_configCapture.kcfg_v4l_profile->findText(currentItem));
960 // Load Decklink profiles
961 m_configCapture.kcfg_decklink_profile->blockSignals(true);
962 currentItem = m_configCapture.kcfg_decklink_profile->currentText();
963 m_configCapture.kcfg_decklink_profile->clear();
964 KConfigGroup group2(&conf, "decklink");
965 values = group2.entryMap();
966 QMapIterator<QString, QString> j(values);
967 while (j.hasNext()) {
969 if (!j.key().isEmpty()) m_configCapture.kcfg_decklink_profile->addItem(j.key(), j.value());
971 m_configCapture.kcfg_decklink_profile->blockSignals(false);
972 if (!currentItem.isEmpty()) m_configCapture.kcfg_decklink_profile->setCurrentIndex(m_configCapture.kcfg_decklink_profile->findText(currentItem));
974 // Load Proxy profiles
975 m_configProject.kcfg_proxy_profile->blockSignals(true);
976 currentItem = m_configProject.kcfg_proxy_profile->currentText();
977 m_configProject.kcfg_proxy_profile->clear();
978 KConfigGroup group3(&conf, "proxy");
979 values = group3.entryMap();
980 QMapIterator<QString, QString> k(values);
981 while (k.hasNext()) {
983 if (!k.key().isEmpty()) m_configProject.kcfg_proxy_profile->addItem(k.key(), k.value());
985 m_configProject.kcfg_proxy_profile->blockSignals(false);
986 if (!currentItem.isEmpty()) m_configProject.kcfg_proxy_profile->setCurrentIndex(m_configProject.kcfg_proxy_profile->findText(currentItem));
989 void KdenliveSettingsDialog::slotUpdateDecklinkProfile(int ix)
991 if (ix == -1) ix = KdenliveSettings::decklink_profile();
992 else ix = m_configCapture.kcfg_decklink_profile->currentIndex();
993 QString data = m_configCapture.kcfg_decklink_profile->itemData(ix).toString();
994 if (data.isEmpty()) return;
995 m_configCapture.decklink_parameters->setPlainText(data.section(";", 0, 0));
999 void KdenliveSettingsDialog::slotUpdateV4lProfile(int ix)
1001 if (ix == -1) ix = KdenliveSettings::v4l_profile();
1002 else ix = m_configCapture.kcfg_v4l_profile->currentIndex();
1003 QString data = m_configCapture.kcfg_v4l_profile->itemData(ix).toString();
1004 if (data.isEmpty()) return;
1005 m_configCapture.v4l_parameters->setPlainText(data.section(";", 0, 0));
1009 void KdenliveSettingsDialog::slotUpdateProxyProfile(int ix)
1011 if (ix == -1) ix = KdenliveSettings::v4l_profile();
1012 else ix = m_configProject.kcfg_proxy_profile->currentIndex();
1013 QString data = m_configProject.kcfg_proxy_profile->itemData(ix).toString();
1014 if (data.isEmpty()) return;
1015 m_configProject.proxyparams->setPlainText(data.section(";", 0, 0));
1019 void KdenliveSettingsDialog::slotEditVideo4LinuxProfile()
1021 QString vl4ProfilePath = KStandardDirs::locateLocal("appdata", "profiles/video4linux");
1022 ProfilesDialog *w = new ProfilesDialog(vl4ProfilePath);
1023 if (w->exec() == QDialog::Accepted) {
1024 // save and update profile
1025 loadCurrentV4lProfileInfo();
1030 #include "kdenlivesettingsdialog.moc"