Commit 98d53944 authored by Simon Eugster's avatar Simon Eugster

Added option to enable Audio Alignment in the config dialog.

AA is disabled by default since it currently leads to crashes
in some cases, due to unknown reasons, and marked as experimental.
parent b4fef878
......@@ -155,6 +155,11 @@
<default>true</default>
</entry>
<entry name="enableaudioalign" type="Bool">
<label>Enable automatic audio alignment (experimental)</label>
<default>false</default>
</entry>
<entry name="verticalzoom" type="Bool">
<label>Vertical drag in timeline ruler zooms.</label>
<default>false</default>
......
......@@ -27,6 +27,10 @@ AudioCorrelation::~AudioCorrelation()
foreach (AudioEnvelope *envelope, m_children) {
delete envelope;
}
foreach (AudioCorrelationInfo *info, m_correlations) {
delete info;
}
std::cout << "Envelope deleted." << std::endl;
}
......
/*
/*
Copyright (C) 2012 Simon A. Eugster (Granjow) <simon.eu@gmail.com>
This file is part of kdenlive. See www.kdenlive.org.
......@@ -72,12 +72,12 @@ void FFTCorrelation::correlate(const int64_t *left, const int leftSize,
}
// Now we can convolve to get the correlation
convolute(leftF, leftSize, rightF, rightSize, out_correlated);
convolve(leftF, leftSize, rightF, rightSize, out_correlated);
std::cout << "Correlation (FFT based) computed in " << t.elapsed() << " ms." << std::endl;
}
void FFTCorrelation::convolute(const float *left, const int leftSize,
void FFTCorrelation::convolve(const float *left, const int leftSize,
const float *right, const int rightSize,
float *out_convolved)
{
......
......@@ -28,7 +28,7 @@ public:
\c out_correlated must be a pre-allocated vector of size
\c leftSize + \c rightSize.
*/
static void convolute(const float *left, const int leftSize,
static void convolve(const float *left, const int leftSize,
const float *right, const int rightSize,
float *out_convolved);
......
......@@ -543,8 +543,10 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
m_timelineContextClipMenu->addAction(actionCollection()->action("group_clip"));
m_timelineContextClipMenu->addAction(actionCollection()->action("ungroup_clip"));
m_timelineContextClipMenu->addAction(actionCollection()->action("split_audio"));
m_timelineContextClipMenu->addAction(actionCollection()->action("set_audio_align_ref"));
m_timelineContextClipMenu->addAction(actionCollection()->action("align_audio"));
if (KdenliveSettings::enableaudioalign()) {
m_timelineContextClipMenu->addAction(actionCollection()->action("set_audio_align_ref"));
m_timelineContextClipMenu->addAction(actionCollection()->action("align_audio"));
}
m_timelineContextClipMenu->addSeparator();
m_timelineContextClipMenu->addAction(actionCollection()->action("cut_timeline_clip"));
m_timelineContextClipMenu->addAction(actionCollection()->action(KStandardAction::name(KStandardAction::Copy)));
......
......@@ -6,105 +6,122 @@
<rect>
<x>0</x>
<y>0</y>
<width>314</width>
<height>218</height>
<width>348</width>
<height>268</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<item row="0" column="0" colspan="3">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Thumbnails</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="kcfg_videothumbnails">
<property name="text">
<string>Video</string>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>96</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="kcfg_audiothumbnails">
<property name="text">
<string>Audio</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="kcfg_normaliseaudiothumbs">
<property name="text">
<string>Normalise audio for thumbnails</string>
</property>
</widget>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QCheckBox" name="kcfg_audiothumbnails">
<property name="text">
<string>Audio</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="kcfg_normaliseaudiothumbs">
<property name="text">
<string>Normalise audio for thumbnails</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="1" column="0" colspan="2">
<item>
<widget class="QCheckBox" name="kcfg_showmarkers">
<property name="text">
<string>Display clip markers comments</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="3">
<item>
<widget class="QCheckBox" name="kcfg_autoscroll">
<property name="text">
<string>Autoscroll while playing</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label">
<item>
<widget class="QCheckBox" name="kcfg_verticalzoom">
<property name="text">
<string>Track height</string>
<string>Zoom using vertical drag in ruler</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QSpinBox" name="kcfg_trackheight">
<property name="minimum">
<number>10</number>
</property>
<property name="value">
<number>10</number>
<item>
<widget class="QCheckBox" name="kcfg_splitaudio">
<property name="text">
<string>Automatically split audio and video</string>
</property>
</widget>
</item>
<item row="5" column="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>166</width>
<height>20</height>
</size>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Track height</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="kcfg_trackheight">
<property name="minimum">
<number>10</number>
</property>
<property name="value">
<number>10</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="kcfg_enableaudioalign">
<property name="text">
<string>Enable Audio Alignment (experimental!)
Requires restart.</string>
</property>
</spacer>
</widget>
</item>
<item row="7" column="1">
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
......@@ -117,20 +134,6 @@
</property>
</spacer>
</item>
<item row="3" column="0" colspan="3">
<widget class="QCheckBox" name="kcfg_verticalzoom">
<property name="text">
<string>Zoom using vertical drag in ruler</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="kcfg_splitaudio">
<property name="text">
<string>Automatically split audio and video</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
......
......@@ -176,6 +176,9 @@ int main(int argc, char *argv[])
}
// Mlt::Factory::close();
return 0;
}
......
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