Commit d4ddab89 authored by Akhil K Gangadharan's avatar Akhil K Gangadharan

Add clang formatting style

parent 6135f4e2
Pipeline #1198 passed with stage
in 18 minutes and 46 seconds
......@@ -122,6 +122,7 @@ void RecManager::stopCapture()
}
}
void RecManager::stop()
{
if (m_captureProcess) {
......@@ -149,7 +150,7 @@ void RecManager::slotRecord(bool record)
} else {
extension = QStringLiteral("mpeg");
}
QString path = captureFolder.absoluteFilePath("capture0000." + extension);
int i = 1;
while (QFile::exists(path)) {
......@@ -162,33 +163,31 @@ void RecManager::slotRecord(bool record)
// TODO: when recording audio only, allow param configuration?
// audio only
if (!m_recVideo->isChecked() && m_recAudio->isChecked()) {
recordAudio = true;
if (!m_recVideo->isChecked() && m_recAudio->isChecked()) {
recordAudio = true;
recordVideo = false;
// consider replacing recordAudio and recordVideo with m_recordVideo.isChecked()
// consider replacing recordAudio and recordVideo with
// m_recordVideo.isChecked()
m_monitor->startCapture(recordAudio, recordVideo, m_captureFile);
}
// Add alsa audio capture
// video only
if (!m_recAudio->isChecked() && m_recVideo->isChecked()) {
recordAudio = false;
recordAudio = false;
recordVideo = true;
m_monitor->startCapture(recordAudio, recordVideo, m_captureFile);
}
// video + audio capture
if(m_recAudio->isChecked() && m_recVideo->isChecked()) {
if (m_recAudio->isChecked() && m_recVideo->isChecked()) {
recordAudio = true;
recordVideo = true;
recordAudio = true;
recordVideo = true;
m_monitor->startCapture(recordAudio, recordVideo, m_captureFile);
}
}
else {
} else {
m_monitor->stopCapture(recordAudio, recordVideo);
emit addClipToProject(m_captureFile);
}
......@@ -204,7 +203,6 @@ void RecManager::slotRecord(bool record)
}
if (m_captureProcess) {
return;
}
m_recError.clear();
......@@ -219,7 +217,9 @@ void RecManager::slotRecord(bool record)
QFileInfo checkCaptureFolder(captureFolder.absolutePath());
if (!checkCaptureFolder.isWritable()) {
emit warningMessage(i18n("The directory %1, could not be created.\nPlease make sure you have the required permissions.", captureFolder.absolutePath()));
emit warningMessage(i18n("The directory %1, could not be created.\nPlease "
"make sure you have the required permissions.",
captureFolder.absolutePath()));
m_recAction->blockSignals(true);
m_recAction->setChecked(false);
m_recAction->blockSignals(false);
......@@ -227,8 +227,10 @@ void RecManager::slotRecord(bool record)
}
m_captureProcess = new QProcess;
connect(m_captureProcess, &QProcess::stateChanged, this, &RecManager::slotProcessStatus);
connect(m_captureProcess, &QProcess::readyReadStandardError, this, &RecManager::slotReadProcessInfo);
connect(m_captureProcess, &QProcess::stateChanged, this,
&RecManager::slotProcessStatus);
connect(m_captureProcess, &QProcess::readyReadStandardError, this,
&RecManager::slotReadProcessInfo);
QString path = captureFolder.absoluteFilePath("capture0000." + extension);
int i = 1;
......@@ -248,7 +250,8 @@ void RecManager::slotRecord(bool record)
QStringList captureArgs;
captureArgs << QStringLiteral("-f") << QStringLiteral("x11grab");
if (KdenliveSettings::grab_follow_mouse()) {
captureArgs << QStringLiteral("-follow_mouse") << QStringLiteral("centered");
captureArgs << QStringLiteral("-follow_mouse")
<< QStringLiteral("centered");
}
if (!KdenliveSettings::grab_hide_frame()) {
captureArgs << QStringLiteral("-show_region") << QStringLiteral("1");
......@@ -256,33 +259,38 @@ void RecManager::slotRecord(bool record)
captureSize = QStringLiteral(":0.0");
if (KdenliveSettings::grab_capture_type() == 0) {
// Full screen capture
captureArgs << QStringLiteral("-s") << QString::number(screenSize.width()) + QLatin1Char('x') + QString::number(screenSize.height());
captureArgs << QStringLiteral("-s")
<< QString::number(screenSize.width()) + QLatin1Char('x') + QString::number(screenSize.height());
captureSize.append(QLatin1Char('+') + QString::number(screenSize.left()) + QLatin1Char('.') + QString::number(screenSize.top()));
} else {
// Region capture
captureArgs << QStringLiteral("-s")
<< QString::number(KdenliveSettings::grab_width()) + QLatin1Char('x') + QString::number(KdenliveSettings::grab_height());
captureSize.append(QLatin1Char('+') + QString::number(KdenliveSettings::grab_offsetx()) + QLatin1Char(',') +
QString::number(KdenliveSettings::grab_offsety()));
captureSize.append(
QLatin1Char('+') + QString::number(KdenliveSettings::grab_offsetx()) + QLatin1Char(',') + QString::number(KdenliveSettings::grab_offsety()));
}
// fps
captureArgs << QStringLiteral("-r") << QString::number(KdenliveSettings::grab_fps());
captureArgs << QStringLiteral("-r")
<< QString::number(KdenliveSettings::grab_fps());
if (KdenliveSettings::grab_hide_mouse()) {
captureSize.append(QStringLiteral("+nomouse"));
}
captureArgs << QStringLiteral("-i") << captureSize;
if (!KdenliveSettings::grab_parameters().simplified().isEmpty()) {
captureArgs << KdenliveSettings::grab_parameters().simplified().split(QLatin1Char(' '));
captureArgs << KdenliveSettings::grab_parameters().simplified().split(
QLatin1Char(' '));
}
captureArgs << path;
m_captureProcess->start(KdenliveSettings::ffmpegpath(), captureArgs);
if (!m_captureProcess->waitForStarted()) {
// Problem launching capture app
emit warningMessage(i18n("Failed to start the capture application:\n%1", KdenliveSettings::ffmpegpath()));
emit warningMessage(i18n("Failed to start the capture application:\n%1",
KdenliveSettings::ffmpegpath()));
// delete m_captureProcess;
}
}
void RecManager::slotProcessStatus(QProcess::ProcessState status)
{
if (status == QProcess::NotRunning) {
......
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