Commit 3153e6d8 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Add option to disable countdown on audio record

Fixes #1521
parent 81e4196b
Pipeline #232592 failed with stage
in 9 minutes and 59 seconds
......@@ -52,7 +52,7 @@ class MediaCapture : public QObject
public:
MediaCapture(QObject *parent);
~MediaCapture() override;
void recordAudio(int tid, bool /*record*/);
void recordAudio(int tid, bool record);
// TODO: fix video capture
// void recordVideo(int tid, bool /*record*/);
/** @brief Returns true if a recording is in progress **/
......
......@@ -449,6 +449,11 @@
<default></default>
</entry>
<entry name="disablereccountdown" type="Bool">
<label>Disable countdown before starting audio record.</label>
<default>false</default>
</entry>
<entry name="videodrivername" type="String">
<label>Video driver used for output.</label>
<default></default>
......
......@@ -1805,6 +1805,10 @@ void GLWidget::setRulerInfo(int duration, const std::shared_ptr<MarkerListModel>
void GLWidget::switchRecordState(bool on)
{
if (on) {
if (m_maxProducerPosition == 0x7fffffff) {
// We are already in rec mode
return;
}
m_bckpMax = m_maxProducerPosition;
m_maxProducerPosition = 0x7fffffff;
} else {
......
......@@ -1593,12 +1593,13 @@ void Monitor::slotSwitchPlay()
}
m_displayingCountdown = true;
} else if (pCore->getAudioDevice()->isMonitoring()) {
pCore->recordAudio(-1, true);
if (m_displayingCountdown) {
if (m_displayingCountdown || KdenliveSettings::disablereccountdown()) {
m_displayingCountdown = false;
m_playAction->setActive(false);
pCore->recordAudio(-1, true);
return;
}
pCore->recordAudio(-1, true);
}
m_glMonitor->switchPlay(play, m_offset);
bool showDropped = false;
......
......@@ -4527,7 +4527,12 @@ void TimelineController::switchRecording(int trackId, bool record)
}
pCore->monitorManager()->slotSwitchMonitors(false);
pCore->startMediaCapture(trackId, true, false);
pCore->getMonitor(Kdenlive::ProjectMonitor)->startCountDown();
if (KdenliveSettings::disablereccountdown()) {
pCore->startRecording();
} else {
pCore->getMonitor(Kdenlive::ProjectMonitor)->startCountDown();
}
} else {
pCore->getMonitor(Kdenlive::ProjectMonitor)->stopCountDown();
pCore->stopMediaCapture(trackId, true, false);
......
......@@ -53,7 +53,7 @@
</size>
</property>
<property name="currentIndex">
<number>0</number>
<number>3</number>
</property>
<widget class="QWidget" name="ffmpeg_tab">
<attribute name="title">
......@@ -544,21 +544,10 @@
<string>Audio</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="5" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Sample rate:</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Capture volume:</string>
</property>
</widget>
<item row="1" column="1">
<widget class="QComboBox" name="kcfg_defaultaudiocapture"/>
</item>
<item row="6" column="1">
<item row="7" column="1">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
......@@ -571,16 +560,6 @@
</property>
</spacer>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Channels:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="audiocapturesamplerate"/>
</item>
<item row="3" column="1">
<widget class="QSlider" name="kcfg_audiocapturevolume">
<property name="maximum">
......@@ -606,11 +585,15 @@
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="audiocapturechannels"/>
<item row="3" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Capture volume:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="kcfg_defaultaudiocapture"/>
<item row="5" column="1">
<widget class="QComboBox" name="audiocapturesamplerate"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_33">
......@@ -631,6 +614,30 @@
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="audiocapturechannels"/>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Sample rate:</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Channels:</string>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_disablereccountdown">
<property name="text">
<string>Disable countdown before recording</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
......
Supports Markdown
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