Commit 2e2043df authored by Akhil K Gangadharan's avatar Akhil K Gangadharan

Add slotAduioDeviceChanged(int) to remember default audio capture device

parent 06d4e724
Pipeline #1247 passed with stage
in 14 minutes and 18 seconds
......@@ -79,7 +79,14 @@ RecManager::RecManager(Monitor *parent)
m_audio_device = new QComboBox(parent);
QStringList audioDevices = m_monitor->getAudioCaptureDevices();
m_audio_device->addItems(audioDevices);
for(int ix=0; ix < audioDevices.count(); ix++) {
m_audio_device->addItem(audioDevices.at(ix), ix);
}
int selectedCapture = m_audio_device->findData(KdenliveSettings::defaultaudiocapture());
if (selectedCapture > -1) {
m_audio_device->setCurrentIndex(selectedCapture);
}
connect(m_audio_device, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &RecManager::slotAudioDeviceChanged);
m_recToolbar->addWidget(m_audio_device);
m_recToolbar->addSeparator();
......@@ -88,7 +95,7 @@ RecManager::RecManager(Monitor *parent)
// m_device_selector->addItems(QStringList() << i18n("Firewire") << i18n("Webcam") << i18n("Screen Grab") << i18n("Blackmagic Decklink"));
m_device_selector->addItem(i18n("Webcam"), Video4Linux);
m_device_selector->addItem(i18n("Screen Grab"), ScreenGrab);
int selectedCapture = m_device_selector->findData(KdenliveSettings::defaultcapture());
selectedCapture = m_device_selector->findData(KdenliveSettings::defaultcapture());
if (selectedCapture > -1) {
m_device_selector->setCurrentIndex(selectedCapture);
}
......@@ -329,6 +336,11 @@ void RecManager::slotReadProcessInfo()
m_recError.append(data + QLatin1Char('\n'));
}
void RecManager::slotAudioDeviceChanged(int)
{
int currentItem = m_audio_device->currentData().toInt();
KdenliveSettings::setDefaultaudiocapture(currentItem);
}
void RecManager::slotVideoDeviceChanged(int)
{
int currentItem = m_device_selector->currentData().toInt();
......
......@@ -91,6 +91,7 @@ private slots:
void slotReadProcessInfo();
void showRecConfig();
void slotVideoDeviceChanged(int ix = -1);
void slotAudioDeviceChanged(int ix = -1);
void slotShowLog();
signals:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment