Required changes to make Kdenlive work with some locales that have a comma (,)...

Required changes to make Kdenlive work with some locales that have a comma (,) as numeric separator. Also now documents with a different locale will open as read only. Sadly this breaks the string freeze by introducing a new string and probably messing up some effects translation, since I changed the "paramlist" type to use ';' as separator instead of ','.

svn path=/trunk/kdenlive/; revision=5793
parent d922e620
......@@ -14,15 +14,14 @@ include(MacroLibrary)
include(FindGettext)
include(MacroOptionalAddSubdirectory)
set(catalogname kdenlive)
find_package(Qt COMPONENTS QtOpenGL)
find_package(Qt4 COMPONENTS QtCore QtGui QtOpenGL QtScript REQUIRED)
if ( NOT QT_QTOPENGL_FOUND )
message(FATAL_ERROR "QtOpenGL (most likely called libqt4-opengl-dev) not found.")
else ( NOT QT_QTOPENGL_FOUND )
message(-- " Found QtOpenGL.")
endif ( NOT QT_QTOPENGL_FOUND )
find_library(Qt COMPONENTS QtOpenGL REQUIRED)
find_library(Qt COMPONENTS QtScript REQUIRED)
find_library(Qt COMPONENTS QtOpenGL QtScript REQUIRED)
add_definitions(${QT_DEFINITIONS})
......
......@@ -8,7 +8,7 @@
<text>Colour</text>
</group>
<group list="frei0r.letterb0xed,pan_zoom,frei0r.scale0tilt,crop,affine,affinerotate">
<text>Crop &amp; transform</text>
<text>Crop and transform</text>
</group>
<group list="volume,normalise,gain,ladspa.1049,ladspa.1048,ladspa.1413,mute">
<text>Audio correction</text>
......@@ -22,8 +22,8 @@
<group list="burningtv,charcoal,dust,grain,lines,lightgraffiti,oldfilm,vignette">
<text>Fun</text>
</group>
<group list="boxblur,obscure,autotrack_rectangle,frei0r.squareblur,frei0r.glow">
<text>Blur &amp; hide</text>
<group list="boxblur,obscure,autotrack_rectangle,frei0r.squareblur,frei0r.glow,frei0r.IIRblur">
<text>Blur and hide</text>
</group>
<group list="speed,freeze">
<text>Motion</text>
......
......@@ -3,7 +3,7 @@
<name>Pan</name>
<description>Adjust the left/right spread of a channel</description>
<author>Dan Dennedy</author>
<parameter type="list" name="channel" default="0" paramlist="0,1">
<parameter type="list" name="channel" default="0" paramlist="0;1">
<paramlistdisplay>Left,Right</paramlistdisplay>
<name>Channel</name>
</parameter>
......
......@@ -3,11 +3,11 @@
<name>Mono to stereo</name>
<description>Copy one channel to another</description>
<author>Dan Dennedy</author>
<parameter type="list" name="from" default="0" paramlist="0,1">
<parameter type="list" name="from" default="0" paramlist="0;1">
<paramlistdisplay>Left,Right</paramlistdisplay>
<name>From</name>
</parameter>
<parameter type="list" name="to" default="1" paramlist="0,1">
<parameter type="list" name="to" default="1" paramlist="0;1">
<paramlistdisplay>Left,Right</paramlistdisplay>
<name>To</name>
</parameter>
......
<!DOCTYPE kpartgui>
<effect tag="frei0r.alpha0ps" id="frei0r.alpha0ps">
<effect LC_NUMERIC="C" tag="frei0r.alpha0ps" id="frei0r.alpha0ps">
<name>Alpha operations</name>
<description>Display and manipulation of the alpha channel</description>
<author>Marko Cebokli</author>
<parameter type="list" name="Display" default="0.0" paramlist="0.0,0.21,0.36,0.50,0.64,0.79,1.0">
<parameter type="list" name="Display" default="0.0" paramlist="0.0;0.21;0.36;0.50;0.64;0.79;1.0">
<paramlistdisplay>Image,Alpha as gray,Gray + red,Selection on black,Selection on gray,Selection on white,Selection on checkers</paramlistdisplay>
<name>Display</name>
</parameter>
......@@ -13,7 +13,7 @@
<name>Display input alpha</name>
</parameter>
<parameter type="list" name="Operation" default="0.0" paramlist="0.0,0.21,0.36,0.50,0.64,0.79,1.0">
<parameter type="list" name="Operation" default="0.0" paramlist="0.0;0.21;0.36;0.50;0.64;0.79;1.0">
<paramlistdisplay>NO OP,Shave,Shrink hard,Shrink soft,Grow hard,Grow soft,Threshold</paramlistdisplay>
<name>Operation</name>
</parameter>
......
<!DOCTYPE kpartgui>
<effect tag="frei0r.alphagrad" id="frei0r.alphagrad">
<effect LC_NUMERIC="C" tag="frei0r.alphagrad" id="frei0r.alphagrad">
<name>Alpha gradient</name>
<description>Fill the alpha channel with a specified gradient</description>
<author>Marko Cebokli</author>
......@@ -25,7 +25,7 @@
<name>Max</name>
</parameter>
<parameter type="list" name="Operation" default="0.0" paramlist="0.0,0.3,0.5,0.7,1.0">
<parameter type="list" name="Operation" default="0.0" paramlist="0.0;0.3;0.5;0.7;1.0">
<paramlistdisplay>Write on clear,Max,Min,Add,Subtract</paramlistdisplay>
<name>Operation</name>
</parameter>
......
<!DOCTYPE kpartgui>
<effect tag="frei0r.alphaspot" id="frei0r.alphaspot">
<effect LC_NUMERIC="C" tag="frei0r.alphaspot" id="frei0r.alphaspot">
<name>Alpha shapes</name>
<description>Draws simple shapes into the alpha channel</description>
<author>Marko Cebokli</author>
<parameter type="list" name="Shape" default="0.0" paramlist="0.0,0.38,0.62,1.0">
<parameter type="list" name="Shape" default="0.0" paramlist="0.0;0.38;0.62;1.0">
<paramlistdisplay>Rectangle,Ellipse,Triangle,Diamond</paramlistdisplay>
<name>Shape</name>
</parameter>
......@@ -42,7 +42,7 @@
<name>Max</name>
</parameter>
<parameter type="list" name="Operation" default="0.0" paramlist="0.0,0.3,0.5,0.7,1.0">
<parameter type="list" name="Operation" default="0.0" paramlist="0.0;0.3;0.5;0.7;1.0">
<paramlistdisplay>Write on clear,Max,Min,Add,Subtract</paramlistdisplay>
<name>Operation</name>
</parameter>
......
<!DOCTYPE kpartgui>
<effect tag="frei0r.curves" id="frei0r.bezier_curves" version="0.2">
<effect LC_NUMERIC="C" tag="frei0r.curves" id="frei0r.bezier_curves" version="0.2">
<name>Bézier Curves</name>
<description>Color curves adjustment</description>
<author>Till Theato, Maksim Golovkin</author>
<parameter type="list" name="Channel" default="0.5" paramlist="0.5,0,0.1,0.2,0.3,0.4,0.6,0.71">
<parameter type="list" name="Channel" default="0.5" paramlist="0.5;0;0.1;0.2;0.3;0.4;0.6;0.71">
<paramlistdisplay>RGB,Red,Green,Blue,Alpha,Luma,Hue,Saturation</paramlistdisplay>
<name>Channel</name>
</parameter>
<parameter type="list" name="Luma formula" default="1" paramlist="0,1">
<parameter type="list" name="Luma formula" default="1" paramlist="0;1">
<paramlistdisplay>Rec. 601,Rec. 709</paramlistdisplay>
<name>Luma formula</name>
</parameter>
......
<!DOCTYPE kpartgui>
<effect tag="frei0r.c0rners" id="frei0r.c0rners">
<effect LC_NUMERIC="C" tag="frei0r.c0rners" id="frei0r.c0rners">
<name>Corners</name>
<description>Four corners geometry engine</description>
<author>Marko Cebokli</author>
......@@ -52,7 +52,7 @@
<name>Enable Stretch</name>
</parameter>
<parameter type="list" name="Interpolator" default="0.166" paramlist="0,0.166,0.333,0.5,0.666,0.833,1.0">
<parameter type="list" name="Interpolator" default="0.166" paramlist="0;0.166;0.333;0.5;0.666;0.833;1.0">
<paramlistdisplay>Nearest neighbor,Bilinear,Bicubic smooth,Bicubic sharp,Spline 4x4,Spline 6x6,Lanczos</paramlistdisplay>
<name>Interpolator</name>
</parameter>
......@@ -61,7 +61,7 @@
<name>Transparent Background</name>
</parameter>
<parameter type="list" name="Alpha operation" default="0.0" paramlist="0.0,0.3,0.5,0.7,1.0">
<parameter type="list" name="Alpha operation" default="0.0" paramlist="0.0;0.3;0.5;0.7;1.0">
<paramlistdisplay>Write on clear,Maximum,Minimum,Add,Subtract</paramlistdisplay>
<name>Alpha operation</name>
</parameter>
......
<!DOCTYPE kpartgui>
<effect tag="frei0r.coloradj_RGB" id="frei0r.coloradj_RGB">
<effect LC_NUMERIC="C" tag="frei0r.coloradj_RGB" id="frei0r.coloradj_RGB">
<name>RGB adjustment</name>
<description>Simple color adjustment</description>
<author>Marko Cebokli</author>
......@@ -16,7 +16,7 @@
<name>B</name>
</parameter>
<parameter type="list" name="Action" default="0.5" paramlist="0.0,0.5,1.0">
<parameter type="list" name="Action" default="0.5" paramlist="0.0;0.5;1.0">
<paramlistdisplay>Add constant,Change gamma,Multiply</paramlistdisplay>
<name>Action</name>
</parameter>
......@@ -29,7 +29,7 @@
<name>Alpha controlled</name>
</parameter>
<parameter type="list" name="Luma formula" default="1.0" paramlist="0.0,1.0">
<parameter type="list" name="Luma formula" default="1.0" paramlist="0.0;1.0">
<paramlistdisplay>Rec. 601,Rec. 709</paramlistdisplay>
<name>Luma formula</name>
</parameter>
......
......@@ -3,7 +3,7 @@
<name>Curves</name>
<description>Color curves adjustment</description>
<author>Maksim Golovkin</author>
<parameter type="list" name="Channel" default="0" paramlist="0,1,2,3">
<parameter type="list" name="Channel" default="0" paramlist="0;1;2;3">
<paramlistdisplay>Red,Green,Blue,Luma</paramlistdisplay>
<name>Channel</name>
</parameter>
......@@ -51,7 +51,7 @@
<parameter type="bool" name="Show curves" default="0">
<name>Show graph in picture</name>
</parameter>
<parameter type="list" name="Graph position" default="3" paramlist="0,1,2,3">
<parameter type="list" name="Graph position" default="3" paramlist="0;1;2;3">
<paramlistdisplay>Top Left,Top Right,Bottom Left,Bottom Right</paramlistdisplay>
<name>Graph position</name>
</parameter>
......
<!DOCTYPE kpartgui>
<effect tag="frei0r.defish0r" id="frei0r.defish0r">
<effect LC_NUMERIC="C" tag="frei0r.defish0r" id="frei0r.defish0r">
<name>Defish</name>
<description>Non rectilinear lens mappings</description>
<author>Marko Cebokli</author>
......@@ -9,22 +9,22 @@
<parameter type="bool" name="DeFish" default="1">
<name>DeFish</name>
</parameter>
<parameter type="list" name="Type" default="0.666" paramlist="0,0.333,0.666,1.0">
<parameter type="list" name="Type" default="0.666" paramlist="0;0.333;0.666;1.0">
<paramlistdisplay>Equidistant,Orthographic,Equiarea,Stereographic</paramlistdisplay>
<name>Type</name>
</parameter>
<parameter type="list" name="Scaling" default="0" paramlist="0,0.333,0.666,1.0">
<parameter type="list" name="Scaling" default="0" paramlist="0;0.333;0.666;1.0">
<paramlistdisplay>Fill,Center,Fit,Manual</paramlistdisplay>
<name>Scaling</name>
</parameter>
<parameter type="constant" name="Manual Scale" default="500" min="0" max="1000" factor="1000">
<name>Manual Scale</name>
</parameter>
<parameter type="list" name="Interpolator" default="0.166" paramlist="0,0.166,0.333,0.5,0.666,0.833,1.0">
<parameter type="list" name="Interpolator" default="0.166" paramlist="0;0.166;0.333;0.5;0.666;0.833;1.0">
<paramlistdisplay>Nearest neighbor,Bilinear,Bicubic smooth,Bicubic sharp,Spline 4x4,Spline 6x6,Lanczos</paramlistdisplay>
<name>Interpolator</name>
</parameter>
<parameter type="list" name="Aspect type" default="0" paramlist="0,0.25,0.5,0.75,1.0">
<parameter type="list" name="Aspect type" default="0" paramlist="0;0.25;0.5;0.75;1.0">
<paramlistdisplay>Square,PAL DV,NTSC DV,HDV,Manual</paramlistdisplay>
<name>Aspect type</name>
</parameter>
......
<!DOCTYPE kpartgui>
<effect tag="frei0r.facedetect" id="frei0r.facedetect">
<effect LC_NUMERIC="C" tag="frei0r.facedetect" id="frei0r.facedetect">
<name>Face detect</name>
<description>Detect faces and draw shapes on them using OpenCV</description>
<author>binarymillenium, Dan Dennedy</author>
......@@ -24,7 +24,7 @@
<comment>How often to detect a face. In between checks, it does object motion tracking.</comment>
</parameter>
<parameter type="list" name="Shape" default="0.0" paramlist="0.0,0.1,0.2,1.0">
<parameter type="list" name="Shape" default="0.0" paramlist="0.0;0.1;0.2;1.0">
<paramlistdisplay>circle,ellipse,rectangle,random</paramlistdisplay>
<name>Shape</name>
</parameter>
......
......@@ -3,7 +3,7 @@
<name>Levels</name>
<description>Adjust levels</description>
<author>Maksim Golovkin</author>
<parameter type="list" name="Channel" default="3" paramlist="0,1,2,3">
<parameter type="list" name="Channel" default="3" paramlist="0;1;2;3">
<paramlistdisplay>Red,Green,Blue,Luma</paramlistdisplay>
<name>Channel</name>
</parameter>
......@@ -25,7 +25,7 @@
<parameter type="bool" name="Show histogram" default="0">
<name>Show histogram</name>
</parameter>
<parameter type="list" name="Histogram position" default="3" paramlist="0,1,2,3">
<parameter type="list" name="Histogram position" default="3" paramlist="0;1;2;3">
<paramlistdisplay>Top Left,Top Right,Bottom Left,Bottom Right</paramlistdisplay>
<name>Histogram position</name>
</parameter>
......
<!DOCTYPE kpartgui>
<effect tag="frei0r.pr0be" id="frei0r.pr0be">
<effect LC_NUMERIC="C" tag="frei0r.pr0be" id="frei0r.pr0be">
<name>pr0be</name>
<description>Measure video values</description>
<author>Marko Cebokli</author>
<parameter type="list" name="Measurement" default="0.0" paramlist="0.0,0.3,0.5,0.7,1.0">
<parameter type="list" name="Measurement" default="0.0" paramlist="0.0;0.3;0.5;0.7;1.0">
<paramlistdisplay>RGB,Y'PbPr - rec. 601,Y'PbPr - rec. 709,HSV,HSL</paramlistdisplay>
<name>Measurement</name>
</parameter>
......
<!DOCTYPE kpartgui>
<effect tag="frei0r.pr0file" id="frei0r.pr0file">
<effect LC_NUMERIC="C" tag="frei0r.pr0file" id="frei0r.pr0file">
<name>pr0file</name>
<description>2D video oscilloscope</description>
<author>Marko Cebokli</author>
......@@ -20,7 +20,7 @@
<name>Length</name>
</parameter>
<parameter type="list" name="Channel" default="0.5" paramlist="0.0,0.2,0.4,0.5,0.6,0.8,1.0">
<parameter type="list" name="Channel" default="0.5" paramlist="0.0;0.2;0.4;0.5;0.6;0.8;1.0">
<paramlistdisplay>R,G,B,Y',Pr,Pb,Alpha</paramlistdisplay>
<name>Channel</name>
</parameter>
......@@ -81,7 +81,7 @@
<name>256 scale</name>
</parameter>
<parameter type="list" name="Color" default="0.0" paramlist="0.0,1.0">
<parameter type="list" name="Color" default="0.0" paramlist="0.0;1.0">
<paramlistdisplay>CCIR rec. 601,CCIR rec. 709</paramlistdisplay>
<name>Color</name>
</parameter>
......
<!DOCTYPE kpartgui>
<effect tag="frei0r.select0r" id="frei0r.select0r">
<effect LC_NUMERIC="C" tag="frei0r.select0r" id="frei0r.select0r">
<name>Color Selection</name>
<description>Color based alpha selection</description>
<author>Marko Cebokli</author>
......@@ -24,22 +24,22 @@
<name>Delta B / I / I</name>
</parameter>
<parameter type="list" name="Selection subspace" default="0.0" paramlist="0.0,0.5,1.0">
<parameter type="list" name="Selection subspace" default="0.0" paramlist="0.0;0.5;1.0">
<paramlistdisplay>RGB,ABI,HCI</paramlistdisplay>
<name>Selection subspace</name>
</parameter>
<parameter type="list" name="Subspace shape" default="0.0" paramlist="0.0,0.5,1.0">
<parameter type="list" name="Subspace shape" default="0.0" paramlist="0.0;0.5;1.0">
<paramlistdisplay>Box,Ellipsoid,Diamond</paramlistdisplay>
<name>Subspace shape</name>
</parameter>
<parameter type="list" name="Edge mode" default="0.0" paramlist="0.0,0.35,0.60,1.0">
<parameter type="list" name="Edge mode" default="0.0" paramlist="0.0;0.35;0.60;1.0">
<paramlistdisplay>Hard,Fat,Normal,Skinny</paramlistdisplay>
<name>Edge mode</name>
</parameter>
<parameter type="list" name="Operation" default="0.0" paramlist="0.0,0.3,0.5,0.7,1.0">
<parameter type="list" name="Operation" default="0.0" paramlist="0.0;0.3;0.5;0.7;1.0">
<paramlistdisplay>Write on clear,Max,Min,Add,Subtract</paramlistdisplay>
<name>Operation</name>
</parameter>
......
......@@ -3,7 +3,7 @@
<name>Mirror</name>
<description>Flip your image in any direction</description>
<author>Charles Yates</author>
<parameter type="list" name="mirror" default="horizontal" paramlist="horizontal,vertical,diagonal,xdiagonal,flip,flop">
<parameter type="list" name="mirror" default="horizontal" paramlist="horizontal;vertical;diagonal;xdiagonal;flip;flop">
<name>Mirroring direction</name>
</parameter>
<parameter type="bool" name="reverse" default="0">
......
......@@ -3,7 +3,7 @@
<name>Obscure</name>
<description>Hide a region of the clip</description>
<author>Charles Yates</author>
<parameter type="geometry" name="start" default="40%,40%:20%x20%" fixed="1">
<parameter type="geometry" name="start" default="40%,40%:20%x20%">
<name>Region</name>
</parameter>
</effect>
......@@ -4,12 +4,12 @@
<description>Keyframable vector based rotoscoping</description>
<author>Till Theato</author>
<parameter type="list" name="mode" default="alpha" paramlist="alpha,luma,rgb">
<parameter type="list" name="mode" default="alpha" paramlist="alpha;luma;rgb">
<paramlistdisplay>Alpha,Luma,RGB</paramlistdisplay>
<name>Mode</name>
</parameter>
<parameter type="list" name="alpha_operation" default="clear" paramlist="clear,max,min,add,sub">
<parameter type="list" name="alpha_operation" default="clear" paramlist="clear;max;min;add;sub">
<paramlistdisplay>Write on clear,Maximum,Minimum,Add,Subtract</paramlistdisplay>
<name>Alpha Operation</name>
</parameter>
......
......@@ -18,13 +18,13 @@
<parameter type="constant" name="speed" max="100" min="0" default="5" factor="10" suffix="Hz">
<name>Speed</name>
</parameter>
<parameter type="list" name="shape" default="sine" paramlist="sine,triangle">
<parameter type="list" name="shape" default="sine" paramlist="sine;triangle">
<name>Shape</name>
</parameter>
<parameter type="constant" name="phase" max="100" min="0" default="25" suffix="%">
<name>Phase</name>
</parameter>
<parameter type="list" name="interp" default="linear" paramlist="linear,quadratic">
<parameter type="list" name="interp" default="linear" paramlist="linear;quadratic">
<name>Interpolation</name>
</parameter>
</effect>
......@@ -17,7 +17,7 @@
***************************************************************************/
#include "cubicbezierspline.h"
#include <KDebug>
/** @brief For sorting a Bezier spline. Whether a is before b. */
static bool pointLessThan(const BPoint &a, const BPoint &b)
......@@ -69,10 +69,11 @@ void CubicBezierSpline::fromString(const QString& spline)
QString CubicBezierSpline::toString() const
{
QStringList spline;
QLocale locale;
foreach(const BPoint &p, m_points) {
spline << QString("%1;%2#%3;%4#%5;%6").arg(p.h1.x()).arg(p.h1.y())
.arg(p.p.x()).arg(p.p.y())
.arg(p.h2.x()).arg(p.h2.y());
spline << QString("%1;%2#%3;%4#%5;%6").arg(locale.toString(p.h1.x())).arg(locale.toString(p.h1.y()))
.arg(locale.toString(p.p.x())).arg(locale.toString(p.p.y()))
.arg(locale.toString(p.h2.x())).arg(locale.toString(p.h2.y()));
}
return spline.join("|");
}
......
......@@ -320,6 +320,7 @@ void ClipItem::initEffect(QDomElement effect, int diff)
bool ClipItem::checkKeyFrames()
{
bool clipEffectsModified = false;
QLocale locale;
// go through all effects this clip has
for (int ix = 0; ix < m_effectList.count(); ++ix) {
QStringList keyframeParams = keyframes(ix);
......@@ -340,7 +341,7 @@ bool ClipItem::checkKeyFrames()
// go through all keyframes for one param
foreach(const QString &str, keyframes) {
int pos = str.section(':', 0, 0).toInt();
double val = str.section(':', 1, 1).toDouble();
double val = locale.toDouble(str.section(':', 1, 1));
if (pos - start < 0) {
// a keyframe is defined before the start of the clip
cutKeyFrame = true;
......@@ -350,7 +351,7 @@ bool ClipItem::checkKeyFrames()
int diff = pos - lastPos;
double ratio = (double)(start - lastPos) / diff;
double newValue = lastValue + (val - lastValue) * ratio;
newKeyFrames.append(QString::number(start) + ':' + QString::number(newValue));
newKeyFrames.append(QString::number(start) + ':' + locale.toString(newValue));
modified = true;
}
cutKeyFrame = false;
......@@ -362,12 +363,12 @@ bool ClipItem::checkKeyFrames()
if (diff != 0) {
double ratio = (double)(end - lastPos) / diff;
double newValue = lastValue + (val - lastValue) * ratio;
newKeyFrames.append(QString::number(end) + ':' + QString::number(newValue));
newKeyFrames.append(QString::number(end) + ':' + locale.toString(newValue));
modified = true;
}
break;
} else {
newKeyFrames.append(QString::number(pos) + ':' + QString::number(val));
newKeyFrames.append(QString::number(pos) + ':' + locale.toString(val));
}
}
lastPos = pos;
......@@ -392,6 +393,7 @@ void ClipItem::setKeyframes(const int ix, const QStringList keyframes)
{
QDomElement effect = getEffectAt(ix);
if (effect.attribute("disable") == "1") return;
QLocale locale;
QDomNodeList params = effect.elementsByTagName("parameter");
int keyframeParams = 0;
for (int i = 0; i < params.count(); i++) {
......@@ -401,17 +403,17 @@ void ClipItem::setKeyframes(const int ix, const QStringList keyframes)
if (ix == m_selectedEffect && keyframeParams == 0) {
m_keyframes.clear();
m_visibleParam = i;
double max = e.attribute("max").toDouble();
double min = e.attribute("min").toDouble();
double max = locale.toDouble(e.attribute("max"));
double min = locale.toDouble(e.attribute("min"));
m_keyframeFactor = 100.0 / (max - min);
m_keyframeOffset = min;
m_keyframeDefault = e.attribute("default").toDouble();
m_keyframeDefault = locale.toDouble(e.attribute("default"));
m_selectedKeyframe = 0;
// parse keyframes
const QStringList keyframes = e.attribute("keyframes").split(';', QString::SkipEmptyParts);
foreach(const QString &str, keyframes) {
int pos = str.section(':', 0, 0).toInt();
double val = str.section(':', 1, 1).toDouble();
double val = locale.toDouble(str.section(':', 1, 1));
m_keyframes[pos] = val;
}
if (m_keyframes.find(m_editedKeyframe) == m_keyframes.end()) m_editedKeyframe = -1;
......@@ -427,6 +429,7 @@ void ClipItem::setKeyframes(const int ix, const QStringList keyframes)
void ClipItem::setSelectedEffect(const int ix)
{
m_selectedEffect = ix;
QLocale locale;
QDomElement effect = effectAt(m_selectedEffect);
if (!effect.isNull() && effect.attribute("disable") != "1") {
QDomNodeList params = effect.elementsByTagName("parameter");
......@@ -436,18 +439,18 @@ void ClipItem::setSelectedEffect(const int ix)
m_keyframes.clear();
m_limitedKeyFrames = e.attribute("type") == "keyframe";
m_visibleParam = i;
double max = e.attribute("max").toDouble();
double min = e.attribute("min").toDouble();
double max = locale.toDouble(e.attribute("max"));
double min = locale.toDouble(e.attribute("min"));
m_keyframeFactor = 100.0 / (max - min);
m_keyframeOffset = min;
m_keyframeDefault = e.attribute("default").toDouble();
m_keyframeDefault = locale.toDouble(e.attribute("default"));
m_selectedKeyframe = 0;
// parse keyframes
const QStringList keyframes = e.attribute("keyframes").split(';', QString::SkipEmptyParts);
foreach(const QString &str, keyframes) {
int pos = str.section(':', 0, 0).toInt();
double val = str.section(':', 1, 1).toDouble();
double val = locale.toDouble(str.section(':', 1, 1));
m_keyframes[pos] = val;
}
if (m_keyframes.find(m_editedKeyframe) == m_keyframes.end())
......@@ -1362,6 +1365,7 @@ void ClipItem::setEffectAt(int ix, QDomElement effect)
EffectsParameterList ClipItem::addEffect(const QDomElement effect, bool /*animate*/)
{
bool needRepaint = false;
QLocale locale;
int ix;
if (!effect.hasAttribute("kdenlive_ix")) {
ix = effectsCounter();
......@@ -1398,12 +1402,12 @@ EffectsParameterList ClipItem::addEffect(const QDomElement effect, bool /*animat
}
if (e.attribute("type") == "simplekeyframe") {
QStringList values = e.attribute("keyframes").split(";", QString::SkipEmptyParts);
double factor = e.attribute("factor", "1").toDouble();
double factor = locale.toDouble(e.attribute("factor", "1"));
if (factor != 1) {
for (int j = 0; j < values.count(); j++) {
QString pos = values.at(j).section(':', 0, 0);
double val = values.at(j).section(':', 1, 1).toDouble() / factor;
values[j] = pos + "=" + QString::number(val);
double val = locale.toDouble(values.at(j).section(':', 1, 1)) / factor;
values[j] = pos + "=" + locale.toString(val);
}
}
parameters.addParam(e.attribute("name"), values.join(";"));
......@@ -1466,8 +1470,8 @@ EffectsParameterList ClipItem::addEffect(const QDomElement effect, bool /*animat
double fact;
if (e.attribute("factor").contains('%')) {
fact = ProfilesDialog::getStringEval(projectScene()->profile(), e.attribute("factor"));
} else fact = e.attribute("factor", "1").toDouble();
parameters.addParam(e.attribute("name"), QString::number(e.attribute("value").toDouble() / fact));
} else fact = locale.toDouble(e.attribute("factor", "1"));
parameters.addParam(e.attribute("name"), locale.toString(locale.toDouble(e.attribute("value")) / fact));
}
}
}
......@@ -1648,6 +1652,7 @@ bool ClipItem::isVideoOnly() const
void ClipItem::insertKeyframe(QDomElement effect, int pos, int val)
{
if (effect.attribute("disable") == "1") return;
QLocale locale;
effect.setAttribute("active_keyframe", pos);
m_editedKeyframe = pos;
QDomNodeList params = effect.elementsByTagName("parameter");
......@@ -1660,14 +1665,14 @@ void ClipItem::insertKeyframe(QDomElement effect, int pos, int val)
bool added = false;
foreach(const QString &str, keyframes) {
int kpos = str.section(':', 0, 0).toInt();
double newval = str.section(':', 1, 1).toDouble();
double newval = locale.toDouble(str.section(':', 1, 1));
if (kpos < pos) {
newkfr.append(str);
} else if (!added) {
if (i == m_visibleParam)
newkfr.append(QString::number(pos) + ":" + QString::number(val));
else
newkfr.append(QString::number(pos) + ":" + QString::number(newval));
newkfr.append(QString::number(pos) + ":" + locale.toString(newval));
if (kpos > pos) newkfr.append(str);
added = true;
} else newkfr.append(str);
......@@ -1686,6 +1691,7 @@ void ClipItem::insertKeyframe(QDomElement effect, int pos, int val)
void ClipItem::movedKeyframe(QDomElement effect, int oldpos, int newpos, double value)
{
if (effect.attribute("disable") == "1") return;
QLocale locale;
effect.setAttribute("active_keyframe", newpos);
QDomNodeList params = effect.elementsByTagName("parameter");
int start = cropStart().frames(m_fps);
......@@ -1703,7 +1709,7 @@ void ClipItem::movedKeyframe(QDomElement effect, int oldpos, int newpos, double
newpos = qMax(newpos, start);
newpos = qMin(newpos, end);
if (i == m_visibleParam)
newkfr.append(QString::number(newpos) + ":" + QString::number(value));
newkfr.append(QString::number(newpos) + ":" + locale.toString(value));
else
newkfr.append(QString::number(newpos) + ":" + str.section(':', 1, 1));
}
......@@ -1719,6 +1725,7 @@ void ClipItem::movedKeyframe(QDomElement effect, int oldpos, int newpos, double
void ClipItem::updateKeyframes(QDomElement effect)
{
m_keyframes.clear();
QLocale locale;