]> git.sesse.net Git - kdenlive/blobdiff - src/kdenlivesettingsdialog.cpp
number of buttons expanded to 15. Contour shuttle pro v2 full support
[kdenlive] / src / kdenlivesettingsdialog.cpp
index b91654ea20bf6a6c5e67df19f5259773a78ee819..adb12e5848c5cd0f8c96addef90f06325d32073b 100644 (file)
@@ -84,6 +84,8 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString>& map
     m_configEnv.mltpathurl->setMode(KFile::Directory);
     m_configEnv.mltpathurl->lineEdit()->setObjectName("kcfg_mltpath");
     m_configEnv.rendererpathurl->lineEdit()->setObjectName("kcfg_rendererpath");
+    m_configEnv.ffmpegurl->lineEdit()->setObjectName("kcfg_ffmpegpath");
+    m_configEnv.ffplayurl->lineEdit()->setObjectName("kcfg_ffplaypath");
     m_configEnv.kcfg_mltthreads->setMaximum( QThread::idealThreadCount() < 4 ? QThread::idealThreadCount() : 3 );
     m_configEnv.tmppathurl->setMode(KFile::Directory);
     m_configEnv.tmppathurl->lineEdit()->setObjectName("kcfg_currenttmpfolder");
@@ -135,11 +137,22 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString>& map
     m_configShuttle.shuttledisabled->hide();
 
     // Store the button pointers into an array for easier handling them in the other functions.
+    // TODO: impl enumerator or live with cut and paste :-)))
     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);
+    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);
+    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);
 
     // 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.
@@ -437,7 +450,7 @@ void KdenliveSettingsDialog::slotReadAudioDevices()
     QStringList lines = result.split('\n');
     foreach(const QString & data, lines) {
         //kDebug() << "// READING LINE: " << data;
-        if (!data.startsWith(" ") && data.count(':') > 1) {
+        if (!data.startsWith(' ') && data.count(':') > 1) {
             QString card = data.section(':', 0, 0).section(' ', -1);
             QString device = data.section(':', 1, 1).section(' ', -1);
             m_configSdl.kcfg_audio_device->addItem(data.section(':', -1).simplified(), "plughw:" + card + ',' + device);
@@ -521,10 +534,10 @@ void KdenliveSettingsDialog::slotEditImageApplication()
     delete dlg;
 }
 
-#ifdef USE_JOGSHUTTLE
 void KdenliveSettingsDialog::slotCheckShuttle(int state)
 {
-    m_configShuttle.config_group->setEnabled(state);
+#ifdef USE_JOGSHUTTLE
+  m_configShuttle.config_group->setEnabled(state);
     if (m_configShuttle.shuttledevicelist->count() == 0) {
         // parse devices
         QString baseName = "/dev/input/event";
@@ -542,16 +555,17 @@ void KdenliveSettingsDialog::slotCheckShuttle(int state)
         }
         if (KdenliveSettings::shuttledevice().isEmpty()) QTimer::singleShot(1500, this, SLOT(slotUpdateShuttleDevice()));
     }
+#endif /* USE_JOGSHUTTLE */
 }
 
 void KdenliveSettingsDialog::slotUpdateShuttleDevice(int ix)
 {
+#ifdef USE_JOGSHUTTLE
     QString device = m_configShuttle.shuttledevicelist->itemData(ix).toString();
     //KdenliveSettings::setShuttledevice(device);
     m_configShuttle.kcfg_shuttledevice->setText(device);
-}
-
 #endif /* USE_JOGSHUTTLE */
+}
 
 void KdenliveSettingsDialog::updateWidgets()
 {
@@ -633,19 +647,19 @@ void KdenliveSettingsDialog::updateSettings()
 
     // Check encoding profiles
     QString data = m_configCapture.kcfg_v4l_profile->itemData(m_configCapture.kcfg_v4l_profile->currentIndex()).toString();
-    if (!data.isEmpty() && (data.section(";", 0, 0) != KdenliveSettings::v4l_parameters() || data.section(";", 1, 1) != KdenliveSettings::v4l_extension())) {
-        KdenliveSettings::setV4l_parameters(data.section(";", 0, 0));
-        KdenliveSettings::setV4l_extension(data.section(";", 1, 1));
+    if (!data.isEmpty() && (data.section(';', 0, 0) != KdenliveSettings::v4l_parameters() || data.section(';', 1, 1) != KdenliveSettings::v4l_extension())) {
+        KdenliveSettings::setV4l_parameters(data.section(';', 0, 0));
+        KdenliveSettings::setV4l_extension(data.section(';', 1, 1));
     }
     data = m_configCapture.kcfg_decklink_profile->itemData(m_configCapture.kcfg_decklink_profile->currentIndex()).toString();
-    if (!data.isEmpty() && (data.section(";", 0, 0) != KdenliveSettings::decklink_parameters() || data.section(";", 1, 1) != KdenliveSettings::decklink_extension())) {
-        KdenliveSettings::setDecklink_parameters(data.section(";", 0, 0));
-        KdenliveSettings::setDecklink_extension(data.section(";", 1, 1));
+    if (!data.isEmpty() && (data.section(';', 0, 0) != KdenliveSettings::decklink_parameters() || data.section(';', 1, 1) != KdenliveSettings::decklink_extension())) {
+        KdenliveSettings::setDecklink_parameters(data.section(';', 0, 0));
+        KdenliveSettings::setDecklink_extension(data.section(';', 1, 1));
     }
     data = m_configProject.kcfg_proxy_profile->itemData(m_configProject.kcfg_proxy_profile->currentIndex()).toString();
-    if (!data.isEmpty() && (data.section(";", 0, 0) != KdenliveSettings::proxyparams() || data.section(";", 1, 1) != KdenliveSettings::proxyextension())) {
-        KdenliveSettings::setProxyparams(data.section(";", 0, 0));
-        KdenliveSettings::setProxyextension(data.section(";", 1, 1));
+    if (!data.isEmpty() && (data.section(';', 0, 0) != KdenliveSettings::proxyparams() || data.section(';', 1, 1) != KdenliveSettings::proxyextension())) {
+        KdenliveSettings::setProxyparams(data.section(';', 0, 0));
+        KdenliveSettings::setProxyextension(data.section(';', 1, 1));
     }
 
 
@@ -756,7 +770,7 @@ void KdenliveSettingsDialog::slotCheckAlsaDriver()
 
 void KdenliveSettingsDialog::loadTranscodeProfiles()
 {
-    KSharedConfigPtr config = KSharedConfig::openConfig("kdenlivetranscodingrc");
+    KSharedConfigPtr config = KSharedConfig::openConfig("kdenlivetranscodingrc", KConfig::CascadeConfig);
     KConfigGroup transConfig(config, "Transcoding");
     // read the entries
     m_configTranscode.profiles_list->blockSignals(true);
@@ -778,7 +792,7 @@ void KdenliveSettingsDialog::loadTranscodeProfiles()
 
 void KdenliveSettingsDialog::saveTranscodeProfiles()
 {
-    KSharedConfigPtr config = KSharedConfig::openConfig("kdenlivetranscodingrc");
+    KSharedConfigPtr config = KSharedConfig::openConfig("kdenlivetranscodingrc", KConfig::CascadeConfig);
     //KSharedConfigPtr config = KGlobal::config();
     KConfigGroup transConfig(config, "Transcoding");
     // read the entries
@@ -800,7 +814,7 @@ void KdenliveSettingsDialog::slotAddTranscode()
     QListWidgetItem *item = new QListWidgetItem(m_configTranscode.profile_name->text());
     QString data = m_configTranscode.profile_parameters->toPlainText();
     data.append(" %1." + m_configTranscode.profile_extension->text());
-    data.append(";");
+    data.append(';');
     if (!m_configTranscode.profile_description->text().isEmpty()) 
         data.append(m_configTranscode.profile_description->text());
     if (m_configTranscode.profile_audioonly->isChecked()) data.append(";audio");
@@ -818,7 +832,7 @@ void KdenliveSettingsDialog::slotUpdateTranscodingProfile()
     item->setText(m_configTranscode.profile_name->text());
     QString data = m_configTranscode.profile_parameters->toPlainText();
     data.append(" %1." + m_configTranscode.profile_extension->text());
-    data.append(";");
+    data.append(';');
     if (!m_configTranscode.profile_description->text().isEmpty())
         data.append(m_configTranscode.profile_description->text());
     if (m_configTranscode.profile_audioonly->isChecked()) data.append(";audio");
@@ -908,19 +922,19 @@ void KdenliveSettingsDialog::slotUpdatev4lDevice()
         m_configCapture.kcfg_v4l_format->addItem(i18n("Current settings"));
     }
 
-    QStringList pixelformats = info.split(">", QString::SkipEmptyParts);
+    QStringList pixelformats = info.split('>', QString::SkipEmptyParts);
     QString itemSize;
     QString pixelFormat;
     QStringList itemRates;
     for (int i = 0; i < pixelformats.count(); i++) {
         QString format = pixelformats.at(i).section(':', 0, 0);
-        QStringList sizes = pixelformats.at(i).split(":", QString::SkipEmptyParts);
+        QStringList sizes = pixelformats.at(i).split(':', QString::SkipEmptyParts);
         pixelFormat = sizes.takeFirst();
         for (int j = 0; j < sizes.count(); j++) {
-            itemSize = sizes.at(j).section("=", 0, 0);
-            itemRates = sizes.at(j).section("=", 1, 1).split(",", QString::SkipEmptyParts);
+            itemSize = sizes.at(j).section('=', 0, 0);
+            itemRates = sizes.at(j).section('=', 1, 1).split(',', QString::SkipEmptyParts);
             for (int k = 0; k < itemRates.count(); k++) {
-                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));
+                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));
             }
         }
     }
@@ -1060,7 +1074,7 @@ void KdenliveSettingsDialog::slotUpdateDecklinkProfile(int ix)
     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));
+    m_configCapture.decklink_parameters->setPlainText(data.section(';', 0, 0));
     //
 }
 
@@ -1070,7 +1084,7 @@ void KdenliveSettingsDialog::slotUpdateV4lProfile(int ix)
     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));
+    m_configCapture.v4l_parameters->setPlainText(data.section(';', 0, 0));
     //
 }
 
@@ -1080,7 +1094,7 @@ void KdenliveSettingsDialog::slotUpdateProxyProfile(int ix)
     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));
+    m_configProject.proxyparams->setPlainText(data.section(';', 0, 0));
     //
 }