+void KdenliveSettingsDialog::slotManageEncodingProfile()
+{
+ int type = 0;
+ if (currentPage() == m_page4) {
+ type = m_configCapture.tabWidget->currentIndex();
+ }
+ QPointer<EncodingProfilesDialog> d = new EncodingProfilesDialog(type);
+ d->exec();
+ delete d;
+ loadEncodingProfiles();
+}
+
+void KdenliveSettingsDialog::loadEncodingProfiles()
+{
+ KConfig conf("encodingprofiles.rc", KConfig::CascadeConfig, "appdata");
+
+ // Load v4l profiles
+ m_configCapture.kcfg_v4l_profile->blockSignals(true);
+ QString currentItem = m_configCapture.kcfg_v4l_profile->currentText();
+ m_configCapture.kcfg_v4l_profile->clear();
+ KConfigGroup group(&conf, "video4linux");
+ QMap< QString, QString > values = group.entryMap();
+ QMapIterator<QString, QString> i(values);
+ while (i.hasNext()) {
+ i.next();
+ if (!i.key().isEmpty()) m_configCapture.kcfg_v4l_profile->addItem(i.key(), i.value());
+ }
+ m_configCapture.kcfg_v4l_profile->blockSignals(false);
+ if (!currentItem.isEmpty()) m_configCapture.kcfg_v4l_profile->setCurrentIndex(m_configCapture.kcfg_v4l_profile->findText(currentItem));
+
+ // Load Screen Grab profiles
+ m_configCapture.kcfg_grab_profile->blockSignals(true);
+ currentItem = m_configCapture.kcfg_grab_profile->currentText();
+ m_configCapture.kcfg_grab_profile->clear();
+ KConfigGroup group2(&conf, "screengrab");
+ values = group2.entryMap();
+ QMapIterator<QString, QString> j(values);
+ while (j.hasNext()) {
+ j.next();
+ if (!j.key().isEmpty()) m_configCapture.kcfg_grab_profile->addItem(j.key(), j.value());
+ }
+ m_configCapture.kcfg_grab_profile->blockSignals(false);
+ if (!currentItem.isEmpty()) m_configCapture.kcfg_grab_profile->setCurrentIndex(m_configCapture.kcfg_grab_profile->findText(currentItem));
+
+ // Load Decklink profiles
+ m_configCapture.kcfg_decklink_profile->blockSignals(true);
+ currentItem = m_configCapture.kcfg_decklink_profile->currentText();
+ m_configCapture.kcfg_decklink_profile->clear();
+ KConfigGroup group3(&conf, "decklink");
+ values = group3.entryMap();
+ QMapIterator<QString, QString> k(values);
+ while (k.hasNext()) {
+ k.next();
+ if (!k.key().isEmpty()) m_configCapture.kcfg_decklink_profile->addItem(k.key(), k.value());
+ }
+ m_configCapture.kcfg_decklink_profile->blockSignals(false);
+ if (!currentItem.isEmpty()) m_configCapture.kcfg_decklink_profile->setCurrentIndex(m_configCapture.kcfg_decklink_profile->findText(currentItem));
+
+ // Load Proxy profiles
+ m_configProject.kcfg_proxy_profile->blockSignals(true);
+ currentItem = m_configProject.kcfg_proxy_profile->currentText();
+ m_configProject.kcfg_proxy_profile->clear();
+ KConfigGroup group4(&conf, "proxy");
+ values = group4.entryMap();
+ QMapIterator<QString, QString> l(values);
+ while (l.hasNext()) {
+ l.next();
+ if (!l.key().isEmpty()) m_configProject.kcfg_proxy_profile->addItem(l.key(), l.value());
+ }
+ if (!currentItem.isEmpty()) m_configProject.kcfg_proxy_profile->setCurrentIndex(m_configProject.kcfg_proxy_profile->findText(currentItem));
+ m_configProject.kcfg_proxy_profile->blockSignals(false);
+ slotUpdateProxyProfile();
+
+}
+
+void KdenliveSettingsDialog::slotUpdateDecklinkProfile(int ix)
+{
+ if (ix == -1) ix = KdenliveSettings::decklink_profile();
+ else ix = m_configCapture.kcfg_decklink_profile->currentIndex();
+ QString data = m_configCapture.kcfg_decklink_profile->itemData(ix).toString();
+ if (data.isEmpty()) return;
+ m_configCapture.decklink_parameters->setPlainText(data.section(';', 0, 0));
+ //
+}
+
+void KdenliveSettingsDialog::slotUpdateV4lProfile(int ix)
+{
+ if (ix == -1) ix = KdenliveSettings::v4l_profile();
+ else ix = m_configCapture.kcfg_v4l_profile->currentIndex();
+ QString data = m_configCapture.kcfg_v4l_profile->itemData(ix).toString();
+ if (data.isEmpty()) return;
+ m_configCapture.v4l_parameters->setPlainText(data.section(';', 0, 0));
+ //
+}
+
+void KdenliveSettingsDialog::slotUpdateGrabProfile(int ix)
+{
+ if (ix == -1) ix = KdenliveSettings::grab_profile();
+ else ix = m_configCapture.kcfg_grab_profile->currentIndex();
+ QString data = m_configCapture.kcfg_grab_profile->itemData(ix).toString();
+ if (data.isEmpty()) return;
+ m_configCapture.grab_parameters->setPlainText(data.section(';', 0, 0));
+ //
+}
+
+void KdenliveSettingsDialog::slotUpdateProxyProfile(int ix)
+{
+ if (ix == -1) ix = KdenliveSettings::v4l_profile();
+ else ix = m_configProject.kcfg_proxy_profile->currentIndex();
+ QString data = m_configProject.kcfg_proxy_profile->itemData(ix).toString();
+ if (data.isEmpty()) return;
+ m_configProject.proxyparams->setPlainText(data.section(';', 0, 0));
+ //
+}
+
+void KdenliveSettingsDialog::slotEditVideo4LinuxProfile()
+{
+ QString vl4ProfilePath = KStandardDirs::locateLocal("appdata", "profiles/video4linux");
+ QPointer<ProfilesDialog> w = new ProfilesDialog(vl4ProfilePath);
+ if (w->exec() == QDialog::Accepted) {
+ // save and update profile
+ loadCurrentV4lProfileInfo();
+ }
+ delete w;
+}
+
+void KdenliveSettingsDialog::slotReloadBlackMagic()
+{
+ Render::getBlackMagicDeviceList(m_configCapture.kcfg_decklink_capturedevice, true);
+ if (!Render::getBlackMagicOutputDeviceList(m_configSdl.kcfg_blackmagic_output_device), true) {
+ // No blackmagic card found
+ m_configSdl.kcfg_external_display->setEnabled(false);
+ }
+ m_configSdl.kcfg_external_display->setEnabled(KdenliveSettings::decklink_device_found());
+}
+
+void KdenliveSettingsDialog::slotReloadShuttleDevices()
+{
+#ifdef USE_JOGSHUTTLE
+ QString devDirStr = "/dev/input/by-id";
+ QDir devDir(devDirStr);
+ if (!devDir.exists()) {
+ devDirStr = "/dev/input";
+ }
+
+ DeviceMap devMap = JogShuttle::enumerateDevices(devDirStr);
+ if (!devMap.isEmpty()) {
+ m_configShuttle.shuttledevicelist->clear();
+ }
+
+ QStringList devNamesList;
+ QStringList devPathList;
+ DeviceMapIter iter = devMap.begin();
+ if (iter == devMap.end()) {
+ KdenliveSettings::shuttledevicenames().clear();
+ KdenliveSettings::shuttledevicepaths().clear();
+ m_configShuttle.shuttledevicelist->clear();
+ }
+ while (iter != devMap.end()) {
+ kDebug() << iter.key() << ": " << iter.value();
+ m_configShuttle.shuttledevicelist->addItem(iter.key(), iter.value());
+ devNamesList << iter.key();
+ devPathList << iter.value();
+ ++iter;
+ }
+
+ KdenliveSettings::setShuttledevicenames(devNamesList);
+ KdenliveSettings::setShuttledevicepaths(devPathList);
+ QTimer::singleShot(200, this, SLOT(slotUpdateShuttleDevice()));
+
+ kDebug() << "Devices reloaded";
+
+#endif //USE_JOGSHUTTLE
+}
+