Commit 067605cf authored by Akhil K Gangadharan's avatar Akhil K Gangadharan

Add combo box for audio capture input selection

parent 8f5a3567
Pipeline #1227 passed with stage
in 14 minutes and 59 seconds
......@@ -76,6 +76,13 @@ RecManager::RecManager(Monitor *parent)
QWidget *spacer = new QWidget(parent);
spacer->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
m_recToolbar->addWidget(spacer);
m_audio_device = new QComboBox(parent);
QStringList audioDevices = m_monitor->getAudioCaptureDevices();
m_audio_device->addItems(audioDevices);
m_recToolbar->addWidget(m_audio_device);
m_recToolbar->addSeparator();
m_device_selector = new QComboBox(parent);
// TODO: re-implement firewire / decklink capture
// m_device_selector->addItems(QStringList() << i18n("Firewire") << i18n("Webcam") << i18n("Screen Grab") << i18n("Blackmagic Decklink"));
......@@ -158,7 +165,7 @@ void RecManager::slotRecord(bool record)
path = captureFolder.absoluteFilePath("capture" + num + QLatin1Char('.') + extension);
++i;
}
QString audioDevice = m_audio_device->currentText();
m_captureFile = QUrl::fromLocalFile(path);
// TODO: when recording audio only, allow param configuration?
......@@ -166,10 +173,9 @@ void RecManager::slotRecord(bool record)
if (!m_recVideo->isChecked() && m_recAudio->isChecked()) {
recordAudio = true;
recordVideo = false;
// consider replacing recordAudio and recordVideo with
// m_recordVideo.isChecked()
m_monitor->startCapture(recordAudio, recordVideo, m_captureFile);
m_monitor->startCapture(recordAudio, recordVideo, m_captureFile, audioDevice);
}
// Add alsa audio capture
......@@ -177,7 +183,7 @@ void RecManager::slotRecord(bool record)
if (!m_recAudio->isChecked() && m_recVideo->isChecked()) {
recordAudio = false;
recordVideo = true;
m_monitor->startCapture(recordAudio, recordVideo, m_captureFile);
m_monitor->startCapture(recordAudio, recordVideo, m_captureFile, audioDevice);
}
// video + audio capture
......@@ -185,7 +191,7 @@ void RecManager::slotRecord(bool record)
recordAudio = true;
recordVideo = true;
m_monitor->startCapture(recordAudio, recordVideo, m_captureFile);
m_monitor->startCapture(recordAudio, recordVideo, m_captureFile, audioDevice);
}
} else {
m_monitor->stopCapture(recordAudio, recordVideo);
......
......@@ -79,6 +79,7 @@ private:
QToolBar *m_recToolbar;
QComboBox *m_screenCombo;
QComboBox *m_device_selector;
QComboBox *m_audio_device;
QCheckBox *m_recVideo;
QCheckBox *m_recAudio;
Mlt::Producer *createV4lProducer();
......
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