Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
261
Issues
261
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
Kdenlive
Commits
209e4fcc
Commit
209e4fcc
authored
Apr 17, 2017
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '17.04'
parents
9f01d936
3404da90
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
97 additions
and
222 deletions
+97
-222
src/dialogs/renderwidget.cpp
src/dialogs/renderwidget.cpp
+54
-35
src/doc/documentvalidator.cpp
src/doc/documentvalidator.cpp
+0
-130
src/doc/documentvalidator.h
src/doc/documentvalidator.h
+0
-9
src/lib/audio/fftCorrelation.cpp
src/lib/audio/fftCorrelation.cpp
+16
-22
src/lib/audio/fftCorrelation.h
src/lib/audio/fftCorrelation.h
+2
-2
src/mainwindow.cpp
src/mainwindow.cpp
+4
-0
src/mltcontroller/effectscontroller.cpp
src/mltcontroller/effectscontroller.cpp
+7
-7
src/renderer.cpp
src/renderer.cpp
+4
-8
src/ui/saveprofile_ui.ui
src/ui/saveprofile_ui.ui
+1
-1
src/utils/thememanager.cpp
src/utils/thememanager.cpp
+9
-8
No files found.
src/dialogs/renderwidget.cpp
View file @
209e4fcc
...
...
@@ -45,7 +45,6 @@
#include <QProcess>
#include <QDBusConnectionInterface>
#include <QThread>
#include <QScriptEngine>
#include <QKeyEvent>
#include <QTimer>
#include <QStandardPaths>
...
...
@@ -92,6 +91,16 @@ enum JOBSTATUS {
ABORTEDJOB
};
#ifdef Q_OS_WIN
const
QLatin1String
ScriptFormat
(
".bat"
);
QString
ScriptSetVar
(
const
QString
name
,
const
QString
value
)
{
return
QString
(
"set "
)
+
name
+
"="
+
value
;
}
QString
ScriptGetVar
(
const
QString
varName
)
{
return
QString
(
'%'
)
+
varName
+
'%'
;
}
#else
const
QLatin1String
ScriptFormat
(
".sh"
);
QString
ScriptSetVar
(
const
QString
name
,
const
QString
value
)
{
return
name
+
"=
\"
"
+
value
+
'\"'
;
}
QString
ScriptGetVar
(
const
QString
varName
)
{
return
QString
(
'$'
)
+
varName
;
}
#endif
static
QStringList
acodecsList
;
static
QStringList
vcodecsList
;
static
QStringList
supportedFormats
;
...
...
@@ -1063,9 +1072,11 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut,
return
;
}
QTextStream
outStream
(
&
file
);
#ifndef Q_OS_WIN
outStream
<<
"#! /bin/sh"
<<
'\n'
<<
'\n'
;
outStream
<<
"RENDERER="
<<
'\"'
+
m_renderer
+
QLatin1Char
(
'\"'
)
<<
'\n'
;
outStream
<<
"MELT="
<<
'\"'
+
KdenliveSettings
::
rendererpath
()
+
QLatin1Char
(
'\"'
)
<<
"
\n\n
"
;
#endif
outStream
<<
ScriptSetVar
(
"RENDERER"
,
m_renderer
)
<<
'\n'
;
outStream
<<
ScriptSetVar
(
"MELT"
,
KdenliveSettings
::
rendererpath
())
<<
"
\n\n
"
;
}
QStringList
overlayargs
;
...
...
@@ -1081,12 +1092,13 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut,
if
(
!
scriptExport
)
{
render_process_args
<<
QStringLiteral
(
"-erase"
);
}
#ifndef Q_OS_WIN
if
(
KdenliveSettings
::
usekuiserver
())
{
render_process_args
<<
QStringLiteral
(
"-kuiserver"
);
}
// get process id
render_process_args
<<
QStringLiteral
(
"-pid:%1"
).
arg
(
QCoreApplication
::
applicationPid
());
#endif
// Set locale for render process if required
if
(
QLocale
().
decimalPoint
()
!=
QLocale
::
system
().
decimalPoint
())
{
...
...
@@ -1168,7 +1180,7 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut,
}
if
(
scriptExport
)
{
render_process_args
<<
QStringLiteral
(
"$
MELT"
);
render_process_args
<<
ScriptGetVar
(
"
MELT"
);
}
else
{
render_process_args
<<
KdenliveSettings
::
rendererpath
();
}
...
...
@@ -1255,14 +1267,6 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut,
QStringList
paramsList
=
renderArgs
.
split
(
' '
,
QString
::
SkipEmptyParts
);
QScriptEngine
sEngine
;
sEngine
.
globalObject
().
setProperty
(
QStringLiteral
(
"bitrate"
),
m_view
.
video
->
value
());
sEngine
.
globalObject
().
setProperty
(
QStringLiteral
(
"quality"
),
m_view
.
video
->
value
());
sEngine
.
globalObject
().
setProperty
(
QStringLiteral
(
"audiobitrate"
),
m_view
.
audio
->
value
());
sEngine
.
globalObject
().
setProperty
(
QStringLiteral
(
"audioquality"
),
m_view
.
audio
->
value
());
sEngine
.
globalObject
().
setProperty
(
QStringLiteral
(
"dar"
),
'@'
+
QString
::
number
(
profile
->
display_aspect_num
())
+
QLatin1Char
(
'/'
)
+
QString
::
number
(
profile
->
display_aspect_den
()));
sEngine
.
globalObject
().
setProperty
(
QStringLiteral
(
"passes"
),
static_cast
<
int
>
(
m_view
.
checkTwoPass
->
isChecked
())
+
1
);
for
(
int
i
=
0
;
i
<
paramsList
.
count
();
++
i
)
{
QString
paramName
=
paramsList
.
at
(
i
).
section
(
QLatin1Char
(
'='
),
0
,
-
2
);
QString
paramValue
=
paramsList
.
at
(
i
).
section
(
QLatin1Char
(
'='
),
-
1
);
...
...
@@ -1272,19 +1276,35 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut,
}
// evaluate expression
if
(
paramValue
.
startsWith
(
QLatin1Char
(
'%'
)))
{
paramValue
=
sEngine
.
evaluate
(
paramValue
.
remove
(
0
,
1
)).
toString
();
if
(
paramValue
.
startsWith
(
QStringLiteral
(
"%bitrate"
))
||
paramValue
==
QStringLiteral
(
"%quality"
))
{
if
(
paramValue
.
contains
(
"+'k'"
))
paramValue
=
QString
::
number
(
m_view
.
video
->
value
())
+
'k'
;
else
paramValue
=
QString
::
number
(
m_view
.
video
->
value
());
}
if
(
paramValue
.
startsWith
(
QStringLiteral
(
"%audiobitrate"
))
||
paramValue
==
QStringLiteral
(
"%audioquality"
))
{
if
(
paramValue
.
contains
(
"+'k'"
))
paramValue
=
QString
::
number
(
m_view
.
audio
->
value
())
+
'k'
;
else
paramValue
=
QString
::
number
(
m_view
.
audio
->
value
());
}
if
(
paramValue
==
QStringLiteral
(
"%dar"
))
paramValue
=
'@'
+
QString
::
number
(
profile
->
display_aspect_num
())
+
QLatin1Char
(
'/'
)
+
QString
::
number
(
profile
->
display_aspect_den
());
if
(
paramValue
==
QStringLiteral
(
"%passes"
))
paramValue
=
QString
::
number
(
static_cast
<
int
>
(
m_view
.
checkTwoPass
->
isChecked
())
+
1
);
paramsList
[
i
]
=
paramName
+
QLatin1Char
(
'='
)
+
paramValue
;
}
sEngine
.
globalObject
().
setProperty
(
paramName
.
toUtf8
().
constData
(),
paramValue
);
}
if
(
resizeProfile
&&
!
KdenliveSettings
::
gpu_accel
())
{
render_process_args
<<
"consumer:"
+
(
scriptExport
?
"$SOURCE_"
+
QString
::
number
(
stemIdx
)
:
QUrl
::
fromLocalFile
(
playlistPaths
.
at
(
stemIdx
)).
toEncoded
());
render_process_args
<<
"consumer:"
+
(
scriptExport
?
ScriptGetVar
(
"SOURCE_"
+
QString
::
number
(
stemIdx
)
)
:
QUrl
::
fromLocalFile
(
playlistPaths
.
at
(
stemIdx
)).
toEncoded
());
}
else
{
render_process_args
<<
(
scriptExport
?
"$SOURCE_"
+
QString
::
number
(
stemIdx
)
:
QUrl
::
fromLocalFile
(
playlistPaths
.
at
(
stemIdx
)).
toEncoded
());
render_process_args
<<
(
scriptExport
?
ScriptGetVar
(
"SOURCE_"
+
QString
::
number
(
stemIdx
)
)
:
QUrl
::
fromLocalFile
(
playlistPaths
.
at
(
stemIdx
)).
toEncoded
());
}
render_process_args
<<
(
scriptExport
?
"$TARGET_"
+
QString
::
number
(
stemIdx
)
:
QUrl
::
fromLocalFile
(
dest
).
toEncoded
());
render_process_args
<<
(
scriptExport
?
ScriptGetVar
(
"TARGET_"
+
QString
::
number
(
stemIdx
)
)
:
QUrl
::
fromLocalFile
(
dest
).
toEncoded
());
if
(
KdenliveSettings
::
gpu_accel
())
{
render_process_args
<<
QStringLiteral
(
"glsl.=1"
);
}
...
...
@@ -1294,10 +1314,10 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut,
QTextStream
outStream
(
&
file
);
QString
stemIdxStr
(
QString
::
number
(
stemIdx
));
outStream
<<
"SOURCE_"
<<
stemIdxStr
<<
"="
<<
'\"'
+
QUrl
::
fromLocalFile
(
playlistPaths
.
at
(
stemIdx
)).
toEncoded
()
+
QLatin1Char
(
'\"'
)
<<
'\n'
;
outStream
<<
"TARGET_"
<<
stemIdxStr
<<
"="
<<
'\"'
+
QUrl
::
fromLocalFile
(
dest
).
toEncoded
()
+
QLatin1Char
(
'\"'
)
<<
'\n'
;
outStream
<<
"PARAMETERS_"
<<
stemIdxStr
<<
"="
<<
'\"'
+
render_process_args
.
join
(
QLatin1Char
(
' '
))
+
QLatin1Char
(
'\"'
)
<<
'\n'
;
outStream
<<
"$RENDERER $PARAMETERS_"
<<
stemIdxStr
<<
"
\n
\n
"
;
outStream
<<
ScriptSetVar
(
"SOURCE_"
+
stemIdxStr
,
QUrl
::
fromLocalFile
(
playlistPaths
.
at
(
stemIdx
)).
toEncoded
()
)
<<
'\n'
;
outStream
<<
ScriptSetVar
(
"TARGET_"
+
stemIdxStr
,
QUrl
::
fromLocalFile
(
dest
).
toEncoded
()
)
<<
'\n'
;
outStream
<<
ScriptSetVar
(
"PARAMETERS_"
+
stemIdxStr
,
render_process_args
.
join
(
QLatin1Char
(
' '
))
)
<<
'\n'
;
outStream
<<
ScriptGetVar
(
"RENDERER"
)
+
" "
+
ScriptGetVar
(
"PARAMETERS_"
+
stemIdxStr
)
<<
"
\n
"
;
if
(
stemIdx
==
(
stemCount
-
1
))
{
if
(
file
.
error
()
!=
QFile
::
NoError
)
{
...
...
@@ -2284,13 +2304,12 @@ void RenderWidget::slotCLeanUpJobs()
void
RenderWidget
::
parseScriptFiles
()
{
QStringList
scriptsFilter
;
scriptsFilter
<<
Q
StringLiteral
(
"*.sh"
)
;
scriptsFilter
<<
Q
Latin1Char
(
'*'
)
+
ScriptFormat
;
m_view
.
scripts_list
->
clear
();
QTreeWidgetItem
*
item
;
// List the project scripts
QDir
directory
(
m_projectFolder
);
directory
.
cd
(
QStringLiteral
(
"scripts"
));
QDir
directory
(
m_projectFolder
+
QStringLiteral
(
"scripts/"
));
QStringList
scriptFiles
=
directory
.
entryList
(
scriptsFilter
,
QDir
::
Files
);
for
(
int
i
=
0
;
i
<
scriptFiles
.
size
();
++
i
)
{
QUrl
scriptpath
=
QUrl
::
fromLocalFile
(
directory
.
absoluteFilePath
(
scriptFiles
.
at
(
i
)));
...
...
@@ -2302,15 +2321,15 @@ void RenderWidget::parseScriptFiles()
QTextStream
stream
(
&
file
);
while
(
!
stream
.
atEnd
())
{
QString
line
=
stream
.
readLine
();
if
(
line
.
startsWith
(
QLatin1String
(
"TARGET_0="
)))
{
target
=
line
.
section
(
QStringLiteral
(
"TARGET_0=
\"
"
),
1
);
target
=
target
.
section
(
QLatin1Char
(
'"'
),
0
,
0
);
}
else
if
(
line
.
startsWith
(
QLatin1String
(
"RENDERER="
)))
{
renderer
=
line
.
section
(
QStringLiteral
(
"RENDERER=
\"
"
),
1
);
renderer
=
renderer
.
section
(
QLatin1Char
(
'"'
),
0
,
0
);
}
else
if
(
line
.
startsWith
(
QLatin1String
(
"MELT="
)))
{
melt
=
line
.
section
(
QStringLiteral
(
"MELT=
\"
"
),
1
);
melt
=
melt
.
section
(
QLatin1Char
(
'"'
),
0
,
0
);
if
(
line
.
contains
(
QLatin1String
(
"TARGET_0="
)))
{
target
=
line
.
section
(
QStringLiteral
(
"TARGET_0="
),
1
);
target
=
target
.
section
(
QLatin1Char
(
'"'
),
0
,
0
,
QString
::
SectionSkipEmpty
);
}
else
if
(
line
.
contains
(
QLatin1String
(
"RENDERER="
)))
{
renderer
=
line
.
section
(
QStringLiteral
(
"RENDERER="
),
1
);
renderer
=
renderer
.
section
(
QLatin1Char
(
'"'
),
0
,
0
,
QString
::
SectionSkipEmpty
);
}
else
if
(
line
.
contains
(
QLatin1String
(
"MELT="
)))
{
melt
=
line
.
section
(
QStringLiteral
(
"MELT="
),
1
);
melt
=
melt
.
section
(
QLatin1Char
(
'"'
),
0
,
0
,
QString
::
SectionSkipEmpty
);
}
}
file
.
close
();
...
...
@@ -2551,7 +2570,7 @@ QString RenderWidget::getFreeScriptName(const QUrl &projectName, const QString &
}
while
(
path
.
isEmpty
()
||
QFile
::
exists
(
path
))
{
++
ix
;
path
=
scriptsFolder
+
prefix
+
fileName
+
QString
::
number
(
ix
).
rightJustified
(
3
,
'0'
,
false
)
+
QStringLiteral
(
".sh"
)
;
path
=
scriptsFolder
+
prefix
+
fileName
+
QString
::
number
(
ix
).
rightJustified
(
3
,
'0'
,
false
)
+
ScriptFormat
;
}
return
path
;
}
...
...
src/doc/documentvalidator.cpp
View file @
209e4fcc
...
...
@@ -33,7 +33,6 @@
#include <QColor>
#include <QString>
#include <QDir>
#include <QScriptEngine>
#include <mlt++/Mlt.h>
...
...
@@ -1809,135 +1808,6 @@ bool DocumentValidator::isModified() const
return
m_modified
;
}
/*
void DocumentValidator::updateEffects()
{
// WARNING: order by findDirs will determine which js file to use (in case multiple scripts for the same filter exist)
QMap<QString, QUrl> paths;
QMap<QString, QScriptProgram> scripts;
QStringList directories = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, "effects/update");
foreach (const QString &directoryName, directories) {
QDir directory(directoryName);
QStringList fileList = directory.entryList(QStringList() << "*.js", QDir::Files);
foreach (const QString &fileName, fileList) {
QString identifier = fileName;
// remove extension (".js")
identifier.chop(3);
paths.insert(identifier, QUrl(directoryName + fileName));
}
}
QDomNodeList effects = m_doc.elementsByTagName("filter");
int max = effects.count();
QStringList safeEffects;
for(int i = 0; i < max; ++i) {
QDomElement effect = effects.at(i).toElement();
QString effectId = EffectsList::property(effect, "kdenlive_id");
if (safeEffects.contains(effectId)) {
// Do not check the same effect twice if it is at the correct version
// (assume we don't have different versions of the same effect in a project file)
continue;
}
QString effectTag = EffectsList::property(effect, "tag");
QString effectVersionStr = EffectsList::property(effect, "version");
double effectVersion = effectVersionStr.isNull() ? -1 : effectVersionStr.toDouble();
QDomElement effectDescr = MainWindow::customEffects.getEffectByTag(QString(), effectId);
if (effectDescr.isNull()) {
effectDescr = MainWindow::videoEffects.getEffectByTag(effectTag, effectId);
}
if (effectDescr.isNull()) {
effectDescr = MainWindow::audioEffects.getEffectByTag(effectTag, effectId);
}
if (!effectDescr.isNull()) {
double serviceVersion = -1;
QDomElement serviceVersionElem = effectDescr.firstChildElement("version");
if (!serviceVersionElem.isNull()) {
serviceVersion = serviceVersionElem.text().toDouble();
}
if (serviceVersion != effectVersion && paths.contains(effectId)) {
if (!scripts.contains(effectId)) {
QFile scriptFile(paths.value(effectId).path());
if (!scriptFile.open(QIODevice::ReadOnly)) {
continue;
}
QScriptProgram scriptProgram(scriptFile.readAll());
scriptFile.close();
scripts.insert(effectId, scriptProgram);
}
QScriptEngine scriptEngine;
scriptEngine.importExtension("qt.core");
scriptEngine.importExtension("qt.xml");
scriptEngine.evaluate(scripts.value(effectId));
QScriptValue updateRules = scriptEngine.globalObject().property("update");
if (!updateRules.isValid())
continue;
if (updateRules.isFunction()) {
QDomDocument scriptDoc;
scriptDoc.appendChild(scriptDoc.importNode(effect, true));
QString effectString = updateRules.call(QScriptValue(), QScriptValueList() << serviceVersion << effectVersion << scriptDoc.toString()).toString();
if (!effectString.isEmpty() && !scriptEngine.hasUncaughtException()) {
scriptDoc.setContent(effectString);
QDomNode updatedEffect = effect.ownerDocument().importNode(scriptDoc.documentElement(), true);
effect.parentNode().replaceChild(updatedEffect, effect);
m_modified = true;
}
} else {
m_modified = updateEffectParameters(effect.childNodes(), &updateRules, serviceVersion, effectVersion);
}
// set version number since MLT won't change it (only initially set it)
QDomElement versionElem = effect.firstChildElement("version");
if (EffectsList::property(effect, "version").isNull()) {
versionElem = effect.ownerDocument().createTextNode(QLocale().toString(serviceVersion)).toElement();
versionElem.setTagName("property");
versionElem.setAttribute("name", "version");
effect.appendChild(versionElem);
} else {
EffectsList::setProperty(effect, "version", QLocale().toString(serviceVersion));
}
}
else safeEffects.append(effectId);
}
}
}
bool DocumentValidator::updateEffectParameters(const QDomNodeList ¶meters, const QScriptValue* updateRules, const double serviceVersion, const double effectVersion)
{
bool updated = false;
bool isDowngrade = serviceVersion < effectVersion;
for (int i = 0; i < parameters.count(); ++i) {
QDomElement parameter = parameters.at(i).toElement();
QScriptValue rules = updateRules->property(parameter.attribute("name"));
if (rules.isValid() && rules.isArray()) {
int rulesCount = rules.property("length").toInt32();
if (isDowngrade) {
// start with the highest version and downgrade step by step
for (int j = rulesCount - 1; j >= 0; --j) {
double version = rules.property(j).property(0).toNumber();
if (version <= effectVersion && version > serviceVersion) {
parameter.firstChild().setNodeValue(rules.property(j).property(1).call(QScriptValue(), QScriptValueList() << parameter.text() << isDowngrade).toString());
updated = true;
}
}
} else {
for (int j = 0; j < rulesCount; ++j) {
double version = rules.property(j).property(0).toNumber();
if (version > effectVersion && version <= serviceVersion) {
parameter.firstChild().setNodeValue(rules.property(j).property(1).call(QScriptValue(), QScriptValueList() << parameter.text() << isDowngrade).toString());
updated = true;
}
}
}
}
}
return updated;
}
*/
bool
DocumentValidator
::
checkMovit
()
{
QString
playlist
=
m_doc
.
toString
();
...
...
src/doc/documentvalidator.h
View file @
209e4fcc
...
...
@@ -26,8 +26,6 @@
#include <QUrl>
#include <QMap>
class
QScriptValue
;
class
DocumentValidator
{
...
...
@@ -51,13 +49,6 @@ private:
void
checkOrphanedProducers
();
QStringList
getInfoFromEffectName
(
const
QString
&
oldName
);
QString
colorToString
(
const
QColor
&
c
);
/*
/// @brief Updates effects that were created using a different version of the underlaying filter than the one installed.
void updateEffects();
/// @brief Updates the parameters according to the updateRules.
/// @see the related in README in effects/update
bool updateEffectParameters(const QDomNodeList ¶meters, const QScriptValue *updateRules, const double serviceVersion, const double effectVersion);
*/
QString
factorizeGeomValue
(
const
QString
&
value
,
double
factor
);
/** @brief Kdenlive <= 0.9.10 saved title clip item position/opacity with locale which was wrong, fix. */
void
fixTitleProducerLocale
(
QDomElement
&
producer
);
...
...
src/lib/audio/fftCorrelation.cpp
View file @
209e4fcc
...
...
@@ -18,6 +18,7 @@ extern "C"
#include "kdenlive_debug.h"
#include <QTime>
#include <algorithm>
#include <vector>
void
FFTCorrelation
::
correlate
(
const
qint64
*
left
,
const
int
leftSize
,
const
qint64
*
right
,
const
int
rightSize
,
...
...
@@ -61,7 +62,7 @@ void FFTCorrelation::correlate(const qint64 *left, const int leftSize,
}
}
// One side needs to be rever
t
ed, since multiplication in frequency domain (fourier space)
// One side needs to be rever
s
ed, since multiplication in frequency domain (fourier space)
// calculates the convolution: \sum l[x]r[N-x] and not the correlation: \sum l[x]r[x]
for
(
int
i
=
0
;
i
<
leftSize
;
++
i
)
{
leftF
[
i
]
=
double
(
left
[
i
])
/
maxLeft
;
...
...
@@ -97,30 +98,27 @@ void FFTCorrelation::convolve(const float *left, const int leftSize,
while
(
size
/
2
<
largestSize
)
{
size
=
size
<<
1
;
}
const
int
fft_size
=
size
/
2
+
1
;
kiss_fftr_cfg
fftConfig
=
kiss_fftr_alloc
(
size
,
false
,
nullptr
,
nullptr
);
kiss_fftr_cfg
ifftConfig
=
kiss_fftr_alloc
(
size
,
true
,
nullptr
,
nullptr
);
kiss_fft_cpx
leftFFT
[
size
/
2
]
;
kiss_fft_cpx
rightFFT
[
size
/
2
]
;
kiss_fft_cpx
correlatedFFT
[
size
/
2
]
;
std
::
vector
<
kiss_fft_cpx
>
leftFFT
(
fft_size
)
;
std
::
vector
<
kiss_fft_cpx
>
rightFFT
(
fft_size
)
;
std
::
vector
<
kiss_fft_cpx
>
correlatedFFT
(
fft_size
)
;
// Fill in the data into our new vectors with padding
float
*
leftData
=
new
float
[
size
];
float
*
rightData
=
new
float
[
size
];
float
*
convolved
=
new
float
[
size
];
std
::
fill
(
leftData
,
leftData
+
size
,
0
);
std
::
fill
(
rightData
,
rightData
+
size
,
0
);
std
::
vector
<
float
>
leftData
(
size
,
0
);
std
::
vector
<
float
>
rightData
(
size
,
0
);
std
::
vector
<
float
>
convolved
(
size
);
std
::
copy
(
left
,
left
+
leftSize
,
leftData
);
std
::
copy
(
right
,
right
+
rightSize
,
rightData
);
std
::
copy
(
left
,
left
+
leftSize
,
leftData
.
begin
()
);
std
::
copy
(
right
,
right
+
rightSize
,
rightData
.
begin
()
);
// Fourier transformation of the vectors
kiss_fftr
(
fftConfig
,
leftData
,
leftFFT
);
kiss_fftr
(
fftConfig
,
rightData
,
rightFFT
);
kiss_fftr
(
fftConfig
,
&
leftData
[
0
],
&
leftFFT
[
0
]
);
kiss_fftr
(
fftConfig
,
&
rightData
[
0
],
&
rightFFT
[
0
]
);
// Convolution in spacial domain is a multiplication in fourier domain. O(n).
for
(
int
i
=
0
;
i
<
size
/
2
;
++
i
)
{
for
(
int
i
=
0
;
i
<
correlatedFFT
.
size
()
;
++
i
)
{
correlatedFFT
[
i
].
r
=
leftFFT
[
i
].
r
*
rightFFT
[
i
].
r
-
leftFFT
[
i
].
i
*
rightFFT
[
i
].
i
;
correlatedFFT
[
i
].
i
=
leftFFT
[
i
].
r
*
rightFFT
[
i
].
i
+
leftFFT
[
i
].
i
*
rightFFT
[
i
].
r
;
}
...
...
@@ -131,16 +129,12 @@ void FFTCorrelation::convolve(const float *left, const int leftSize,
*
out_convolved
=
0
;
int
out_size
=
leftSize
+
rightSize
+
1
;
kiss_fftri
(
ifftConfig
,
correlatedFFT
,
convolved
);
std
::
copy
(
convolved
,
convolved
+
out_size
-
1
,
out_convolved
+
1
);
kiss_fftri
(
ifftConfig
,
&
correlatedFFT
[
0
],
&
convolved
[
0
]
);
std
::
copy
(
convolved
.
begin
(),
convolved
.
begin
()
+
out_size
-
1
,
out_convolved
+
1
);
// Finally some cleanup.
kiss_fftr_free
(
fftConfig
);
kiss_fftr_free
(
ifftConfig
);
delete
[]
leftData
;
delete
[]
rightData
;
delete
[]
convolved
;
qCDebug
(
KDENLIVE_LOG
)
<<
"FFT convolution computed. Time taken: "
<<
time
.
elapsed
()
<<
" ms"
;
}
src/lib/audio/fftCorrelation.h
View file @
209e4fcc
...
...
@@ -25,7 +25,7 @@ public:
/**
Computes the convolution between \c left and \c right.
\c out_correlated must be a pre-allocated vector of size
\c leftSize + \c rightSize.
\c leftSize + \c rightSize
+ 1
.
*/
static
void
convolve
(
const
float
*
left
,
const
int
leftSize
,
const
float
*
right
,
const
int
rightSize
,
...
...
@@ -34,7 +34,7 @@ public:
/**
Computes the correlation between \c left and \c right.
\c out_correlated must be a pre-allocated vector of size
\c leftSize + \c rightSize.
\c leftSize + \c rightSize
+ 1
.
*/
static
void
correlate
(
const
qint64
*
left
,
const
int
leftSize
,
const
qint64
*
right
,
const
int
rightSize
,
...
...
src/mainwindow.cpp
View file @
209e4fcc
...
...
@@ -650,6 +650,10 @@ void MainWindow::init(const QString &MltPath, const QUrl &Url, const QString &cl
KdenliveSettings
::
setDecklink_extension
(
data
.
section
(
QLatin1Char
(
';'
),
1
,
1
));
}
}
if
(
!
QDir
(
KdenliveSettings
::
currenttmpfolder
()).
isReadable
())
KdenliveSettings
::
setCurrenttmpfolder
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
TempLocation
));
pCore
->
projectManager
()
->
init
(
Url
,
clipsToLoad
);
QTimer
::
singleShot
(
0
,
pCore
->
projectManager
(),
&
ProjectManager
::
slotLoadOnOpen
);
QTimer
::
singleShot
(
0
,
this
,
&
MainWindow
::
GUISetupDone
);
...
...
src/mltcontroller/effectscontroller.cpp
View file @
209e4fcc
...
...
@@ -25,7 +25,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "effectstack/widgets/animationwidget.h"
#include "kdenlive_debug.h"
#include <QScriptEngine>
EffectInfo
::
EffectInfo
()
{
...
...
@@ -227,12 +226,13 @@ void EffectsController::adjustEffectParameters(EffectsParameterList ¶meters,
double
EffectsController
::
getStringEval
(
const
ProfileInfo
&
info
,
QString
eval
,
const
QPoint
&
frameSize
)
{
QScriptEngine
sEngine
;
sEngine
.
globalObject
().
setProperty
(
QStringLiteral
(
"maxWidth"
),
info
.
profileSize
.
width
()
>
frameSize
.
x
()
?
info
.
profileSize
.
width
()
:
frameSize
.
x
());
sEngine
.
globalObject
().
setProperty
(
QStringLiteral
(
"maxHeight"
),
info
.
profileSize
.
height
()
>
frameSize
.
y
()
?
info
.
profileSize
.
height
()
:
frameSize
.
y
());
sEngine
.
globalObject
().
setProperty
(
QStringLiteral
(
"width"
),
info
.
profileSize
.
width
());
sEngine
.
globalObject
().
setProperty
(
QStringLiteral
(
"height"
),
info
.
profileSize
.
height
());
return
sEngine
.
evaluate
(
eval
.
remove
(
'%'
)).
toNumber
();
eval
.
replace
(
QLatin1String
(
"%maxWidth"
),
QString
::
number
(
info
.
profileSize
.
width
()
>
frameSize
.
x
()
?
info
.
profileSize
.
width
()
:
frameSize
.
x
()))
.
replace
(
QLatin1String
(
"%maxHeight"
),
QString
::
number
(
info
.
profileSize
.
height
()
>
frameSize
.
y
()
?
info
.
profileSize
.
height
()
:
frameSize
.
y
()))
.
replace
(
QLatin1String
(
"%width"
),
QString
::
number
(
info
.
profileSize
.
width
()))
.
replace
(
QLatin1String
(
"%height"
),
QString
::
number
(
info
.
profileSize
.
height
()));
Mlt
::
Properties
p
;
p
.
set
(
"eval"
,
eval
.
toLatin1
().
constData
());
return
p
.
get_double
(
"eval"
);
}
QString
EffectsController
::
getStringRectEval
(
const
ProfileInfo
&
info
,
QString
eval
)
...
...
src/renderer.cpp
View file @
209e4fcc
...
...
@@ -754,14 +754,12 @@ void Render::switchPlay(bool play, double speed)
}
m_mltProducer
->
set_speed
(
speed
);
}
else
{
m_mltConsumer
->
set
(
"refresh"
,
0
);
m_mltConsumer
->
purge
();
m_mltProducer
->
set_speed
(
0.0
);
m_mltConsumer
->
stop
();
m_mltConsumer
->
set
(
"real_time"
,
-
1
);
m_mltConsumer
->
set
(
"buffer"
,
0
);
m_mltConsumer
->
set
(
"prefill"
,
0
);
m_mlt
Consumer
->
set
(
"real_time"
,
-
1
);
m_mlt
Producer
->
set_speed
(
0.0
);
m_mltProducer
->
seek
(
m_mltConsumer
->
position
()
+
1
);
m_mltConsumer
->
purge
();
}
}
...
...
@@ -1010,9 +1008,7 @@ bool Render::checkFrameNumber(int pos)
}
}
else
{
m_isRefreshing
=
false
;
if
(
m_mltProducer
->
get_speed
()
==
0
)
{
m_mltConsumer
->
purge
();
}
else
if
(
m_isZoneMode
)
{
if
(
m_isZoneMode
&&
m_mltProducer
->
get_speed
()
!=
0
)
{
if
(
pos
>=
m_mltProducer
->
get_int
(
"out"
)
-
1
)
{
if
(
m_isLoopMode
)
{
m_mltConsumer
->
purge
();
...
...
src/ui/saveprofile_ui.ui
View file @
209e4fcc
...
...
@@ -142,7 +142,7 @@
<item
row=
"3"
column=
"0"
colspan=
"3"
>
<widget
class=
"QLabel"
name=
"parametersLabel"
>
<property
name=
"text"
>
<string>
Parameters (see
<
a href=
"
http
://www.mltframework.org/bin/view/MLT/ConsumerAvformat
">
MLT documentation
<
/a
>
)
</string>
<string>
Parameters (see
<
a href=
"
http
s://www.mltframework.org/plugins/ConsumerAvformat/
">
MLT documentation
<
/a
>
)
</string>
</property>
<property
name=
"openExternalLinks"
>
<bool>
true
</bool>
...
...
src/utils/thememanager.cpp
View file @
209e4fcc
...
...
@@ -205,14 +205,15 @@ void ThemeManager::populateThemeMenu()
updateCurrentKDEdefaultThemePreview
();
setCurrentTheme
(
theme
);
d
->
themeMenuAction
->
addSeparator
();
QAction
*
config
=
new
QAction
(
i18n
(
"Configuration..."
),
d
->
themeMenuAction
);
config
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"preferences-desktop-theme"
)));
d
->
themeMenuAction
->
addAction
(
config
);
connect
(
config
,
&
QAction
::
triggered
,
this
,
&
ThemeManager
::
slotConfigColors
);
if
(
!
QStandardPaths
::
findExecutable
(
QStringLiteral
(
"kcmshell5"
)).
isEmpty
())
{
d
->
themeMenuAction
->
addSeparator
();
QAction
*
config
=
new
QAction
(
i18n
(
"Configuration..."
),
d
->
themeMenuAction
);
config
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"preferences-desktop-theme"
)));
d
->
themeMenuAction
->
addAction
(
config
);
connect
(
config
,
&
QAction
::
triggered
,
this
,
&
ThemeManager
::
slotConfigColors
);
}
}
void
ThemeManager
::
slotConfigColors
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment