]> git.sesse.net Git - kdenlive/commitdiff
Only enable custom audio device with alsa driver:
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 8 Apr 2009 17:39:56 +0000 (17:39 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 8 Apr 2009 17:39:56 +0000 (17:39 +0000)
http://www.kdenlive.org/mantis/view.php?id=748

svn path=/trunk/kdenlive/; revision=3260

src/kdenlivesettingsdialog.cpp
src/kdenlivesettingsdialog.h

index cb95c7f0bb0a1c216aea5470e806ef41af61bc9a..a04edb0f420052eeb69647d2acd8caa72c3580cb 100644 (file)
@@ -53,7 +53,7 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QWidget * parent) :
 
     QWidget *p3 = new QWidget;
     m_configDisplay.setupUi(p3);
-    page3 = addPage(p3, i18n("Display"), "display");
+    page3 = addPage(p3, i18n("Display"), "video-display");
 
     QWidget *p2 = new QWidget;
     m_configEnv.setupUi(p2);
@@ -120,6 +120,7 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QWidget * parent) :
 
     slotUpdateDisplay();
 
+    connect(m_configSdl.kcfg_audio_driver, SIGNAL(currentIndexChanged(int)), this, SLOT(slotCheckAlsaDriver()));
     initDevices();
     connect(m_configMisc.kcfg_profiles_list, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateDisplay()));
     connect(m_configCapture.kcfg_rmd_capture_type, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateRmdRegionStatus()));
@@ -388,11 +389,6 @@ void KdenliveSettingsDialog::updateSettings()
     KdenliveSettings::setDefault_profile(m_defaultPath);
 
     bool resetProfile = false;
-    QString value = m_configSdl.kcfg_audio_device->itemData(m_configSdl.kcfg_audio_device->currentIndex()).toString();
-    if (value != KdenliveSettings::audiodevicename()) {
-        KdenliveSettings::setAudiodevicename(value);
-        resetProfile = true;
-    }
 
     if (m_configEnv.capturefolderurl->url().path() != KdenliveSettings::capturefolder()) {
         kDebug() << "/// CAPT FOLDER UPDATED";
@@ -400,7 +396,7 @@ void KdenliveSettingsDialog::updateSettings()
         emit updateCaptureFolder();
     }
 
-    value = m_configCapture.kcfg_rmd_alsa_device->itemData(m_configCapture.kcfg_rmd_alsa_device->currentIndex()).toString();
+    QString value = m_configCapture.kcfg_rmd_alsa_device->itemData(m_configCapture.kcfg_rmd_alsa_device->currentIndex()).toString();
     if (value != KdenliveSettings::rmd_alsadevicename()) {
         KdenliveSettings::setRmd_alsadevicename(value);
     }
@@ -418,6 +414,18 @@ void KdenliveSettingsDialog::updateSettings()
         resetProfile = true;
     }
 
+    if (value == "alsa") {
+        // Audio device setting is only valid for alsa driver
+        value = m_configSdl.kcfg_audio_device->itemData(m_configSdl.kcfg_audio_device->currentIndex()).toString();
+        if (value != KdenliveSettings::audiodevicename()) {
+            KdenliveSettings::setAudiodevicename(value);
+            resetProfile = true;
+        }
+    } else if (KdenliveSettings::audiodevicename().isEmpty() == false) {
+        KdenliveSettings::setAudiodevicename(QString::null);
+        resetProfile = true;
+    }
+
     value = m_configSdl.kcfg_video_driver->itemData(m_configSdl.kcfg_video_driver->currentIndex()).toString();
     if (value != KdenliveSettings::videodrivername()) {
         KdenliveSettings::setVideodrivername(value);
@@ -449,7 +457,11 @@ void KdenliveSettingsDialog::slotUpdateDisplay()
     m_defaultPath = currentProfile;
 }
 
-
+void KdenliveSettingsDialog::slotCheckAlsaDriver()
+{
+    QString value = m_configSdl.kcfg_audio_driver->itemData(m_configSdl.kcfg_audio_driver->currentIndex()).toString();
+    m_configSdl.kcfg_audio_device->setEnabled(value == "alsa");
+}
 
 #include "kdenlivesettingsdialog.moc"
 
index fc0eccb96b4599bc14ce24d6387dd9094fce918c..a538270293c7f7ee8bfcca0aa4b79629cc30a6a4 100644 (file)
@@ -59,6 +59,7 @@ private slots:
     void slotEditVideoApplication();
     void slotReadAudioDevices();
     void slotUpdateRmdRegionStatus();
+    void slotCheckAlsaDriver();
 
 private:
     KPageWidgetItem *page1;