]> git.sesse.net Git - kdenlive/commitdiff
Required changes to make Kdenlive work with some locales that have a comma (,) as...
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Thu, 14 Jul 2011 21:06:38 +0000 (21:06 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Thu, 14 Jul 2011 21:06:38 +0000 (21:06 +0000)
svn path=/trunk/kdenlive/; revision=5793

49 files changed:
CMakeLists.txt
data/kdenliveeffectscategory.rc
effects/audiopan.xml
effects/channelcopy.xml
effects/frei0r_alpha0ps.xml
effects/frei0r_alphagrad.xml
effects/frei0r_alphaspot.xml
effects/frei0r_bezier_curves.xml
effects/frei0r_c0rners.xml
effects/frei0r_coloradj_rgb.xml
effects/frei0r_curves.xml
effects/frei0r_defish0r.xml
effects/frei0r_facedetect.xml
effects/frei0r_levels.xml
effects/frei0r_pr0be.xml
effects/frei0r_pr0file.xml
effects/frei0r_select0r.xml
effects/mirror.xml
effects/obscure.xml
effects/rotoscoping.xml
effects/sox_flanger.xml
src/beziercurve/cubicbezierspline.cpp
src/clipitem.cpp
src/clipproperties.cpp
src/colorscopes/vectorscope.cpp
src/customtrackview.cpp
src/customtrackview.h
src/documentvalidator.cpp
src/dvdwizard.cpp
src/effectstackedit.cpp
src/initeffects.cpp
src/kdenlivedoc.cpp
src/kdenlivedoc.h
src/kis_cubic_curve.cpp
src/kthumb.cpp
src/mainwindow.cpp
src/mainwindow.h
src/mltdevicecapture.cpp
src/profilesdialog.cpp
src/projectlist.cpp
src/projectlist.h
src/projectsettings.cpp
src/renderer.cpp
src/renderer.h
src/renderwidget.cpp
src/stopmotion/stopmotion.cpp
src/timecode.cpp
src/trackview.cpp
src/trackview.h

index 9171639969d1c9a4d1145a9987d8477f1ccda055..19557a17322f025cdcf267c8356c7b0fe236fbc9 100644 (file)
@@ -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})
 
index 5bc3c74ff86805b38b0f328bf2693c2938f7fdf0..1a5a09f97d8ce9b34908812b3b986c6fc1c30b99 100644 (file)
@@ -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>
index 97b2b3edf20deb562174b51a0b01fc4d5a5d85e7..4f01812c7a49c3700df34a0e7e23eb42242ee840 100644 (file)
@@ -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>
index 1cfac8e876d862927b8644fdd092efa492e056bd..9223899d96c9b8212f2d7aab1e1a7d08ea7a5e84 100644 (file)
@@ -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>
index 7ac05659d729fac9d49c2842c728821a556a1a6a..cb1a57b7d51dc58abbb2506a3f594096520b139f 100644 (file)
@@ -1,10 +1,10 @@
 <!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>
index 4c516ccebacd7f9ca7a9674a2071569b7f400743..e970893ff6cb8c86f8021b00430fd7255a963fc0 100644 (file)
@@ -1,5 +1,5 @@
 <!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>
index 748fd7da3e9c6cc39f516aa08ac98f4950f02403..e31d4e9e4b60743310490714f9f214b5a0ab2cc3 100644 (file)
@@ -1,11 +1,11 @@
 <!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>
index 61374e9d6ccb87362fe93b639c600d29d8064723..e87f1a668a9f8d66b0d96186befbcec77e936b27 100644 (file)
@@ -1,15 +1,15 @@
 <!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>
index def9d3c2ae2856ec72a36344c2a2aa16fa2e3694..4ddb746772f810be0d18ea377257748e00d48aca 100644 (file)
@@ -1,5 +1,5 @@
 <!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>
index b5abd62bb6b590ddd33f2eebb05d0b6ef8a8ef34..f8adceca11d0d36f244c4148ddd16f0161086091 100644 (file)
@@ -1,5 +1,5 @@
 <!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>
index 690691d929141dada78da533f1277d2835e2d998..aeb79647f4872db1670280018d00a7cc2b104e46 100644 (file)
@@ -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>
index 77ccb219dfaecf8837d30a2a1469669fd3d7ee2d..ad90a582836c15f7d980bdd542101df5bc23750e 100644 (file)
@@ -1,5 +1,5 @@
 <!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>
index c4ac254f5ef54cb816f709b7b721e5f1a5a1050f..3bfe379d2c14064c9ed98ab201fbcb40359e4ccb 100644 (file)
@@ -1,5 +1,5 @@
 <!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>
index 470702de54f868f6d0c3532d1478e89fb65b2228..2c80efc844940bb37af09306d623220400691dca 100644 (file)
@@ -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>
index 375806f204f2ea6ca003ff0b22d4d83c814ac7fa..6bd6e977a3d180c45edf17b4a473c700842fe0e6 100644 (file)
@@ -1,10 +1,10 @@
 <!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>
index afd5511913a06ce9f58f39ff277c220baf870215..94adb4a326d4353d3102aa48482a9cdcc22e1397 100644 (file)
@@ -1,5 +1,5 @@
 <!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>
index b96877e2cfa9771fdf39416e4fd28a70c3eda0af..76473186c2f9568be857f32c4eb485ab27e02b25 100644 (file)
@@ -1,5 +1,5 @@
 <!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>
                 <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>
index 7ca6557d017b4e715bdf4b0790a0a121478afe26..9f905c45ac342fc59cd6a3771c7c15540db9eb2e 100644 (file)
@@ -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">
index 83e61e741c94c98e4da6914a60c8ee7b1d28a4ab..cf5f3085d1292853abb75f07c9b28c5ddf55d11c 100644 (file)
@@ -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>
index 6e56593858f4a607982b9f7f8203487eadc56366..afdd481cceda90160720464ca6f43077690a0f92 100644 (file)
@@ -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>
index a0a4e3eef4a803f439edd9a3fafeed9b6ab44165..515b3d43ef5dd6da5d445c3bafad31aa14b54eec 100644 (file)
        <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>
index 175aed213494107ef0414af18a36cf1ad8613201..13b1b73e082137f6aaed07ac1e761bef95c03653 100644 (file)
@@ -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("|");
 }
index 2af20baf0aed36c8d4a0502b2549988a27826b35..f761acf6f0803c73a4f8d60a5eade977e679033f 100644 (file)
@@ -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;
     // parse keyframes
     QDomNodeList params = effect.elementsByTagName("parameter");
     QDomElement e = params.item(m_visibleParam).toElement();
@@ -1730,7 +1737,7 @@ void ClipItem::updateKeyframes(QDomElement effect)
     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.contains(m_selectedKeyframe)) m_selectedKeyframe = -1;
@@ -1830,11 +1837,12 @@ bool ClipItem::updateNormalKeyframes(QDomElement parameter)
 {
     int in = cropStart().frames(m_fps);
     int out = (cropStart() + cropDuration()).frames(m_fps) - 1;
+    QLocale locale;
 
     const QStringList data = parameter.attribute("keyframes").split(';', QString::SkipEmptyParts);
     QMap <int, double> keyframes;
     foreach (QString keyframe, data)
-        keyframes[keyframe.section(':', 0, 0).toInt()] = keyframe.section(':', 1, 1).toDouble();
+        keyframes[keyframe.section(':', 0, 0).toInt()] = locale.toDouble(keyframe.section(':', 1, 1));
 
 
     QMap<int, double>::iterator i = keyframes.end();
@@ -1929,3 +1937,4 @@ void ClipItem::slotGotThumbsCache()
 }
 
 #include "clipitem.moc"
+
index 5d1c9b40532b3d3076af7e316c51e99520a33cc8..f9d79573a2b0d2e329899e1a86debb49daa39a1e 100644 (file)
@@ -711,6 +711,7 @@ const QString &ClipProperties::clipId() const
 QMap <QString, QString> ClipProperties::properties()
 {
     QMap <QString, QString> props;
+    QLocale locale;
     CLIPTYPE t = UNKNOWN;
     if (m_clip != NULL) {
         t = m_clip->clipType();
@@ -741,7 +742,7 @@ QMap <QString, QString> ClipProperties::properties()
     double fps = m_view.clip_framerate->value();
     if (m_view.clip_force_framerate->isChecked()) {
         if (fps != m_old_props.value("force_fps").toDouble()) {
-            props["force_fps"] = QString::number(fps);
+            props["force_fps"] = locale.toString(fps);
             m_clipNeedsRefresh = true;
         }
     } else if (m_old_props.contains("force_fps") && !m_old_props.value("force_fps").isEmpty()) {
index 2802a5d4c5afbcf84a04c724a84460a80695f305..fc98f1c78f0f50c6940574a0ee293750792b9ccb 100644 (file)
@@ -215,7 +215,7 @@ QImage Vectorscope::renderHUD(uint)
 {
 
     QImage hud;
-
+    QLocale locale;
     if (m_mouseWithinWidget) {
         // Mouse moved: Draw a circle over the scope
 
@@ -247,10 +247,10 @@ QImage Vectorscope::renderHUD(uint)
         }
         davinci.drawEllipse(m_centerPoint, (int)r, (int)r);
         davinci.setPen(penThin);
-        davinci.drawText(QPoint(m_scopeRect.width()-40, m_scopeRect.height()), i18n("%1 \%", QString::number(percent, 'f', 0)));
+        davinci.drawText(QPoint(m_scopeRect.width()-40, m_scopeRect.height()), i18n("%1 \%", locale.toString(percent, 'f', 0)));
 
         float angle = copysign(acos(dx/r)*180/M_PI, dy);
-        davinci.drawText(QPoint(10, m_scopeRect.height()), i18n("%1°", QString::number(angle, 'f', 1)));
+        davinci.drawText(QPoint(10, m_scopeRect.height()), i18n("%1°", locale.toString(angle, 'f', 1)));
 
 //        m_circleEnabled = false;
     } else {
@@ -505,8 +505,9 @@ QImage Vectorscope::renderBackground(uint)
 
 void Vectorscope::slotGainChanged(int newval)
 {
+    QLocale locale;
     m_gain = 1 + (float)newval/10;
-    ui->lblGain->setText(QString::number(m_gain, 'f', 1) + "x");
+    ui->lblGain->setText(locale.toString(m_gain, 'f', 1) + "x");
     forceUpdateScope();
 }
 
index 4fddc3a67b922a0fac09108a7d94cb2379723f3e..7faf8a2a8bdbfe4e5b4aee56cb1123daf2d01f1e 100644 (file)
@@ -130,7 +130,7 @@ CustomTrackView::CustomTrackView(KdenliveDoc *doc, CustomTrackScene* projectscen
         m_commandStack = doc->commandStack();
     else
         m_commandStack = NULL;
-
+    m_ct = 0;
     setMouseTracking(true);
     setAcceptDrops(true);
     setFrameShape(QFrame::NoFrame);
@@ -3711,9 +3711,15 @@ void CustomTrackView::mouseReleaseEvent(QMouseEvent * event)
 void CustomTrackView::deleteClip(ItemInfo info, bool refresh)
 {
     ClipItem *item = getClipItemAt((int) info.startPos.frames(m_document->fps()), info.track);
-
+    m_ct++;
+    if (!item) kDebug()<<"// PROBLEM FINDING CLIP ITEM TO REMOVVE!!!!!!!!!";
+    else kDebug()<<"// deleting CLIP: "<<info.startPos.frames(m_document->fps())<<", "<<item->baseClip()->fileURL();
+    //m_document->renderer()->saveSceneList(QString("/tmp/error%1.mlt").arg(m_ct), QDomElement());
     if (!item || m_document->renderer()->mltRemoveClip(m_document->tracksCount() - info.track, info.startPos) == false) {
         emit displayMessage(i18n("Error removing clip at %1 on track %2", m_document->timecode().getTimecodeFromFrames(info.startPos.frames(m_document->fps())), info.track), ErrorMessage);
+        kDebug()<<"CANNOT REMOVE: "<<info.startPos.frames(m_document->fps())<<", TK: "<<info.track;
+        //m_document->renderer()->saveSceneList(QString("/tmp/error%1.mlt").arg(m_ct), QDomElement());
+        exit(1);
         return;
     }
     m_waitingThumbs.removeAll(item);
@@ -5514,6 +5520,7 @@ void CustomTrackView::adjustKeyfames(GenTime oldstart, GenTime newstart, GenTime
     // parse parameters to check if we need to adjust to the new crop start
     int diff = (newstart - oldstart).frames(m_document->fps());
     int max = (newstart + duration).frames(m_document->fps());
+    QLocale locale;
     QDomNodeList params = xml.elementsByTagName("parameter");
     for (int i = 0; i < params.count(); i++) {
         QDomElement e = params.item(i).toElement();
@@ -5527,9 +5534,9 @@ void CustomTrackView::adjustKeyfames(GenTime oldstart, GenTime newstart, GenTime
                 double val = str.section(':', 1, 1).toDouble();
                 pos += diff;
                 if (pos > max) {
-                    newKeyFrames.append(QString::number(max) + ':' + QString::number(val));
+                    newKeyFrames.append(QString::number(max) + ':' + locale.toString(val));
                     break;
-                } else newKeyFrames.append(QString::number(pos) + ':' + QString::number(val));
+                } else newKeyFrames.append(QString::number(pos) + ':' + locale.toString(val));
             }
             //kDebug()<<"ORIGIN: "<<keys<<", FIXED: "<<newKeyFrames;
             e.setAttribute("keyframes", newKeyFrames.join(";"));
@@ -5641,8 +5648,8 @@ void CustomTrackView::slotUpdateAllThumbs()
                 } else {
                     QString startThumb = thumbBase + item->baseClip()->getClipHash() + '_';
                     QString endThumb = startThumb;
-                    startThumb.append(QString::number(item->speedIndependantCropStart().frames(m_document->fps())) + ".png");
-                    endThumb.append(QString::number((item->speedIndependantCropStart() + item->speedIndependantCropDuration()).frames(m_document->fps()) - 1) + ".png");
+                    startThumb.append(QString::number((int) item->speedIndependantCropStart().frames(m_document->fps())) + ".png");
+                    endThumb.append(QString::number((int) (item->speedIndependantCropStart() + item->speedIndependantCropDuration()).frames(m_document->fps()) - 1) + ".png");
                     if (QFile::exists(startThumb)) {
                         QPixmap pix(startThumb);
                         if (pix.isNull()) KIO::NetAccess::del(KUrl(startThumb), this);
@@ -5680,8 +5687,8 @@ void CustomTrackView::saveThumbnails()
                 } else {
                     QString startThumb = thumbBase + item->baseClip()->getClipHash() + '_';
                     QString endThumb = startThumb;
-                    startThumb.append(QString::number(item->speedIndependantCropStart().frames(m_document->fps())) + ".png");
-                    endThumb.append(QString::number((item->speedIndependantCropStart() + item->speedIndependantCropDuration()).frames(m_document->fps()) - 1) + ".png");
+                    startThumb.append(QString::number((int) item->speedIndependantCropStart().frames(m_document->fps())) + ".png");
+                    endThumb.append(QString::number((int) (item->speedIndependantCropStart() + item->speedIndependantCropDuration()).frames(m_document->fps()) - 1) + ".png");
                     if (!QFile::exists(startThumb)) {
                         QPixmap pix(item->startThumb());
                         pix.save(startThumb);
@@ -5809,6 +5816,7 @@ void CustomTrackView::autoTransition()
 QStringList CustomTrackView::getLadspaParams(QDomElement effect) const
 {
     QStringList result;
+    QLocale locale;
     QDomNodeList params = effect.elementsByTagName("parameter");
     for (int i = 0; i < params.count(); i++) {
         QDomElement e = params.item(i).toElement();
@@ -5817,7 +5825,7 @@ QStringList CustomTrackView::getLadspaParams(QDomElement effect) const
                 double factor = e.attribute("factor").toDouble();
                 double value = e.attribute("value").toDouble();
                 value = value / factor;
-                result.append(QString::number(value));
+                result.append(locale.toString(value));
             } else result.append(e.attribute("value"));
         }
     }
@@ -6531,6 +6539,7 @@ void CustomTrackView::slotAddTrackEffect(const QDomElement effect, int ix)
 EffectsParameterList CustomTrackView::getEffectArgs(const QDomElement effect)
 {
     EffectsParameterList parameters;
+    QLocale locale;
     parameters.addParam("tag", effect.attribute("tag"));
     if (effect.hasAttribute("region")) parameters.addParam("region", effect.attribute("region"));
     parameters.addParam("kdenlive_ix", effect.attribute("kdenlive_ix"));
@@ -6554,7 +6563,7 @@ EffectsParameterList CustomTrackView::getEffectArgs(const QDomElement effect)
             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);
+                values[j] = pos + "=" + locale.toString(val);
             }
             // kDebug() << "/ / / /SENDING KEYFR:" << values;
             parameters.addParam(e.attribute("name"), values.join(";"));
@@ -6589,7 +6598,7 @@ EffectsParameterList CustomTrackView::getEffectArgs(const QDomElement effect)
                 if (e.attribute("factor").contains('%')) {
                     fact = ProfilesDialog::getStringEval(m_document->mltProfile(), e.attribute("factor"));
                 } else fact = e.attribute("factor", "1").toDouble();
-                parameters.addParam(e.attribute("name"), QString::number(e.attribute("value").toDouble() / fact));
+                parameters.addParam(e.attribute("name"), locale.toString(e.attribute("value").toDouble() / fact));
             } else {
                 parameters.addParam(e.attribute("name"), e.attribute("value"));
             }
index 8b0b2da56a693e9a36dd5851a7d06ae36e9db148..36f94626f79925334f58dbe20a8adb48b733c137 100644 (file)
@@ -282,6 +282,7 @@ protected:
     virtual Qt::DropActions supportedDropActions() const;
 
 private:
+    int m_ct;
     int m_tracksHeight;
     int m_projectDuration;
     int m_cursorPos;
index 44fd3a41b43d2ba8428dfddc8c3c025e2576580c..d3eda935a27904f67047935f60c1a42b44800c1b 100644 (file)
@@ -48,8 +48,25 @@ bool DocumentValidator::validate(const double currentVersion)
     // Check if we're validating a Kdenlive project
     if (kdenliveDoc.isNull())
         return false;
+    
+    QLocale documentLocale;
+    
+    if (mlt.hasAttribute("LC_NUMERIC")) {
+        // Set locale for the document
+        documentLocale = QLocale(mlt.attribute("LC_NUMERIC"));
+        if (documentLocale.decimalPoint() != QLocale().decimalPoint()) {
+            QDomElement docProperties = kdenliveDoc.firstChildElement("documentproperties");
+            if (docProperties.isNull()) {
+                docProperties = m_doc.createElement("documentproperties");
+                kdenliveDoc.appendChild(docProperties);
+            }
+            docProperties.setAttribute("readonly", 1);
+            KMessageBox::sorry(kapp->activeWindow(), i18n("The document you are opening uses a different locale (%1) than your system. You can only open and render it, no editing is supported unless you change your system's locale.", mlt.attribute("LC_NUMERIC")), i18n("Read only project"));
+        }
+    }
+
     // Upgrade the document to the latest version
-    if (!upgrade(kdenliveDoc.attribute("version").toDouble(), currentVersion))
+    if (!upgrade(documentLocale.toDouble(kdenliveDoc.attribute("version")), currentVersion))
         return false;
 
     /*
index fe997c0a9293bd4c07293a9031a7de9caa8e55bd..9f5ee443faf6a52b677a311c430b72624ca8eb51 100644 (file)
@@ -305,9 +305,9 @@ void DvdWizard::generateDvd()
             // We need to make sure that the y coordinate is a multiple of 2, otherwise button may not be displayed
             buttonsTarget.append(it.key());
             but.setAttribute("x0", QString::number(r.x()));
-            but.setAttribute("y0", QString::number(2 * (r.y() / 2)));
+            but.setAttribute("y0", QString::number((int) 2 * (r.y() / 2)));
             but.setAttribute("x1", QString::number(r.right()));
-            but.setAttribute("y1", QString::number(2 * (r.bottom() / 2)));
+            but.setAttribute("y1", QString::number((int) 2 * (r.bottom() / 2)));
             spu.appendChild(but);
             i++;
         }
index 3d4a481f81791c64b5c73849b51168b5d46a0774..f66cfaf18d841f0a6e2f43bec26f05cac4948b9f 100644 (file)
@@ -281,7 +281,7 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, ItemInfo info, bool
         } else if (type == "list") {
             Listval *lsval = new Listval;
             lsval->setupUi(toFillin);
-            QStringList listitems = pa.attribute("paramlist").split(',');
+            QStringList listitems = pa.attribute("paramlist").split(';');
             QDomElement list = pa.firstChildElement("paramlistdisplay");
             QStringList listitemsdisplay;
             if (!list.isNull()) listitemsdisplay = i18n(list.text().toUtf8().data()).split(',');
@@ -552,16 +552,17 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, ItemInfo info, bool
 wipeInfo EffectStackEdit::getWipeInfo(QString value)
 {
     wipeInfo info;
+    // Convert old geometry values that used a comma as separator
+    if (value.contains(',')) value.replace(',','/');
     QString start = value.section(';', 0, 0);
     QString end = value.section(';', 1, 1).section('=', 1, 1);
-
-    if (start.startsWith("-100%,0"))
+    if (start.startsWith("-100%/0"))
         info.start = LEFT;
-    else if (start.startsWith("100%,0"))
+    else if (start.startsWith("100%/0"))
         info.start = RIGHT;
-    else if (start.startsWith("0%,100%"))
+    else if (start.startsWith("0%/100%"))
         info.start = DOWN;
-    else if (start.startsWith("0%,-100%"))
+    else if (start.startsWith("0%/-100%"))
         info.start = UP;
     else
         info.start = CENTER;
@@ -571,13 +572,13 @@ wipeInfo EffectStackEdit::getWipeInfo(QString value)
     else
         info.startTransparency = 100;
 
-    if (end.startsWith("-100%,0"))
+    if (end.startsWith("-100%/0"))
         info.end = LEFT;
-    else if (end.startsWith("100%,0"))
+    else if (end.startsWith("100%/0"))
         info.end = RIGHT;
-    else if (end.startsWith("0%,100%"))
+    else if (end.startsWith("0%/100%"))
         info.end = DOWN;
-    else if (end.startsWith("0%,-100%"))
+    else if (end.startsWith("0%/-100%"))
         info.end = UP;
     else
         info.end = CENTER;
@@ -597,38 +598,38 @@ QString EffectStackEdit::getWipeString(wipeInfo info)
     QString end;
     switch (info.start) {
     case LEFT:
-        start = "-100%,0%:100%x100%";
+        start = "-100%/0%:100%x100%";
         break;
     case RIGHT:
-        start = "100%,0%:100%x100%";
+        start = "100%/0%:100%x100%";
         break;
     case DOWN:
-        start = "0%,100%:100%x100%";
+        start = "0%/100%:100%x100%";
         break;
     case UP:
-        start = "0%,-100%:100%x100%";
+        start = "0%/-100%:100%x100%";
         break;
     default:
-        start = "0%,0%:100%x100%";
+        start = "0%/0%:100%x100%";
         break;
     }
     start.append(':' + QString::number(info.startTransparency));
 
     switch (info.end) {
     case LEFT:
-        end = "-100%,0%:100%x100%";
+        end = "-100%/0%:100%x100%";
         break;
     case RIGHT:
-        end = "100%,0%:100%x100%";
+        end = "100%/0%:100%x100%";
         break;
     case DOWN:
-        end = "0%,100%:100%x100%";
+        end = "0%/100%:100%x100%";
         break;
     case UP:
-        end = "0%,-100%:100%x100%";
+        end = "0%/-100%:100%x100%";
         break;
     default:
-        end = "0%,0%:100%x100%";
+        end = "0%/0%:100%x100%";
         break;
     }
     end.append(':' + QString::number(info.endTransparency));
@@ -638,6 +639,7 @@ QString EffectStackEdit::getWipeString(wipeInfo info)
 void EffectStackEdit::collectAllParameters()
 {
     if (m_valueItems.isEmpty() || m_params.isNull()) return;
+    QLocale locale;
     const QDomElement oldparam = m_params.cloneNode().toElement();
     QDomElement newparam = oldparam.cloneNode().toElement();
     QDomNodeList namenode = newparam.elementsByTagName("parameter");
@@ -663,7 +665,7 @@ void EffectStackEdit::collectAllParameters()
         QString setValue;
         if (type == "double" || type == "constant") {
             DoubleParameterWidget *doubleparam = (DoubleParameterWidget*)m_valueItems.value(paramName);
-            setValue = QString::number(doubleparam->getValue());
+            setValue = locale.toString(doubleparam->getValue());
         } else if (type == "list") {
             KComboBox *box = ((Listval*)m_valueItems.value(paramName))->list;
             setValue = box->itemData(box->currentIndex()).toString();
@@ -722,8 +724,8 @@ void EffectStackEdit::collectAllParameters()
                 in.replace("%i", QString::number(j + off));
                 QString out = outName;
                 out.replace("%i", QString::number(j + off));
-                EffectsList::setParameter(newparam, in, QString::number(points.at(j).x()));
-                EffectsList::setParameter(newparam, out, QString::number(points.at(j).y()));
+                EffectsList::setParameter(newparam, in, locale.toString(points.at(j).x()));
+                EffectsList::setParameter(newparam, out, locale.toString(points.at(j).y()));
             }
             QString depends = pa.attributes().namedItem("depends").nodeValue();
             if (!depends.isEmpty())
index 1c995ad25cd7ec124e9309d63ddd76b8131f42d2..e3fe464f72f46e36f5cfe2f6fe53235a0f6d4de9 100644 (file)
@@ -97,7 +97,7 @@ void initEffects::refreshLumas()
         QDomElement e = params.item(i).toElement();
         if (e.attribute("tag") == "resource") {
             e.setAttribute("paramlistdisplay", imagenamelist.join(","));
-            e.setAttribute("paramlist", imagefiles.join(","));
+            e.setAttribute("paramlist", imagefiles.join(";"));
             break;
         }
     }
@@ -108,7 +108,7 @@ void initEffects::refreshLumas()
         QDomElement e = params.item(i).toElement();
         if (e.attribute("tag") == "luma") {
             e.setAttribute("paramlistdisplay", imagenamelist.join(","));
-            e.setAttribute("paramlist", imagefiles.join(","));
+            e.setAttribute("paramlist", imagefiles.join(";"));
             break;
         }
     }
@@ -355,17 +355,24 @@ void initEffects::parseEffectFile(EffectsList *customEffectList, EffectsList *au
         kDebug() << "Effect broken: " << name;
         return;
     }
-
+    QLocale locale;
+    bool needsLocaleConversion = false;
     for (int i = 0; !effects.item(i).isNull(); ++i) {
         documentElement = effects.item(i).toElement();
         QString tag = documentElement.attribute("tag", QString());
-
+        if (documentElement.hasAttribute("LC_NUMERIC")) {
+            // set a locale for that file
+            locale = QLocale(documentElement.attribute("LC_NUMERIC"));
+            if (locale.decimalPoint() != QLocale().decimalPoint()) {
+                needsLocaleConversion = true;
+            }
+        }
         if (documentElement.hasAttribute("version")) {
             // a specific version of the filter is required
             Mlt::Properties *metadata = repository->metadata(filter_type, tag.toUtf8().data());
             if (metadata && metadata->is_valid()) {
                 double version = metadata->get_double("version");
-                if (documentElement.attribute("version").toDouble() > version) {
+                if (locale.toDouble(documentElement.attribute("version")) > version) {
                     delete metadata;
                     return;
                 }
@@ -373,6 +380,26 @@ void initEffects::parseEffectFile(EffectsList *customEffectList, EffectsList *au
             delete metadata;
         }
 
+        if (needsLocaleConversion) {
+            // we need to convert all numbers to the system's locale (for example 0.5 -> 0,5)
+            QChar separator = QLocale().decimalPoint();
+            QChar oldSeparator = locale.decimalPoint();
+            QDomNodeList params = documentElement.elementsByTagName("parameter");
+            for (int j = 0; j < params.count(); j++) {
+                QDomNamedNodeMap attrs = params.at(j).attributes();
+                for (int k = 0; k < attrs.count(); k++) {
+                    QString name = attrs.item(k).nodeName();
+                    if (name != "type" && name != "name") {
+                            QString val = attrs.item(k).nodeValue();
+                            if (val.contains(oldSeparator)) {
+                                QString newVal = val.replace(oldSeparator, separator);
+                                attrs.item(k).setNodeValue(newVal);
+                            }
+                    }
+                }
+            }
+        }
+
         // Parse effect information.
         if ((filtersList.contains(tag) || producersList.contains(tag))) {
             QString type = documentElement.attribute("type", QString());
@@ -783,7 +810,7 @@ void initEffects::fillTransitionsList(Mlt::Repository *repository, EffectsList *
 
                 paramList.append(quickParameterFill(ret, i18n("Softness"), "softness", "double", "0", "0", "100", "", "", "100"));
                 paramList.append(quickParameterFill(ret, i18nc("@property: means that the image is inverted", "Invert"), "invert", "bool", "0", "0", "1"));
-                paramList.append(quickParameterFill(ret, i18n("Image File"), "resource", "list", "", "", "", imagefiles.join(","), imagenamelist.join(",")));
+                paramList.append(quickParameterFill(ret, i18n("Image File"), "resource", "list", "", "", "", imagefiles.join(";"), imagenamelist.join(",")));
                 paramList.append(quickParameterFill(ret, i18n("Reverse Transition"), "reverse", "bool", "0", "0", "1"));
                 //thumbnailer.prepareThumbnailsCall(imagelist);
             } else if (name == "composite") {
@@ -795,7 +822,7 @@ void initEffects::fillTransitionsList(Mlt::Repository *repository, EffectsList *
                 paramList.append(quickParameterFill(ret, i18n("Align"), "aligned", "bool", "1", "0", "1"));
                 paramList.append(quickParameterFill(ret, i18n("Fill"), "fill", "bool", "1", "0", "1"));
                 paramList.append(quickParameterFill(ret, i18n("Distort"), "distort", "bool", "0", "0", "1"));
-                paramList.append(quickParameterFill(ret, i18n("Wipe File"), "luma", "list", "", "", "", imagefiles.join(","), imagenamelist.join(",")));
+                paramList.append(quickParameterFill(ret, i18n("Wipe File"), "luma", "list", "", "", "", imagefiles.join(";"), imagenamelist.join(",")));
                 paramList.append(quickParameterFill(ret, i18n("Wipe Softness"), "softness", "double", "0", "0", "100", "", "", "100"));
                 paramList.append(quickParameterFill(ret, i18n("Wipe Invert"), "luma_invert", "bool", "0", "0", "1"));
                 paramList.append(quickParameterFill(ret, i18n("Force Progressive Rendering"), "progressive", "bool", "1", "0", "1"));
@@ -840,7 +867,7 @@ void initEffects::fillTransitionsList(Mlt::Repository *repository, EffectsList *
                 paramList.append(quickParameterFill(ret, i18n("Align"), "composite.aligned", "bool", "1", "0", "1"));
                 paramList.append(quickParameterFill(ret, i18n("Fill"), "composite.fill", "bool", "1", "0", "1"));
                 paramList.append(quickParameterFill(ret, i18n("Distort"), "composite.distort", "bool", "0", "0", "1"));
-                paramList.append(quickParameterFill(ret, i18n("Wipe File"), "composite.luma", "list", "", "", "", imagefiles.join(","), imagenamelist.join(",")));
+                paramList.append(quickParameterFill(ret, i18n("Wipe File"), "composite.luma", "list", "", "", "", imagefiles.join(";"), imagenamelist.join(",")));
                 paramList.append(quickParameterFill(ret, i18n("Wipe Softness"), "composite.softness", "double", "0", "0", "100", "", "", "100"));
                 paramList.append(quickParameterFill(ret, i18n("Wipe Invert"), "composite.luma_invert", "bool", "0", "0", "1"));
                 paramList.append(quickParameterFill(ret, i18n("Force Progressive Rendering"), "composite.progressive", "bool", "1", "0", "1"));
index db62a28bac1466d48c06466ba34100643402f2c1..e190123f84171a467c3b7041c07893cd4f875182 100644 (file)
@@ -389,7 +389,7 @@ QDomDocument KdenliveDoc::createEmptyDocument(QList <TrackInfo> tracks)
 
     property = doc.createElement("property");
     property.setAttribute("name", "aspect_ratio");
-    value = doc.createTextNode(QString::number(0.0));
+    value = doc.createTextNode(QString::number(0));
     property.appendChild(value);
     blk.appendChild(property);
 
@@ -961,6 +961,7 @@ void KdenliveDoc::setUrl(KUrl url)
 
 void KdenliveDoc::setModified(bool mod)
 {
+    if (isReadOnly()) return;
     if (!m_url.isEmpty() && mod && KdenliveSettings::crashrecovery()) {
         m_autoSaveTimer->start(3000);
     }
@@ -1636,6 +1637,11 @@ void KdenliveDoc::backupLastSavedVersion(const QString &path)
     }    
 }
 
+bool KdenliveDoc::isReadOnly() const
+{
+    return m_documentProperties.contains("readonly");
+}
+
 void KdenliveDoc::cleanupBackupFiles()
 {
     KUrl backupFile = m_projectFolder;
index 958c59cf505611dc1a79220f5a440f2b627e4c31..0d1cd56934b7f7801b8e9a354534ebbff763f9e2 100644 (file)
@@ -163,6 +163,8 @@ Q_OBJECT public:
     static double getDisplayRatio(const QString &path);
     /** @brief Backup the project file */
     void backupLastSavedVersion(const QString &path);
+    /** @brief True if the document was opened in read only mode. */
+    bool isReadOnly() const;
     
 private:
     KUrl m_url;
index 849d57b99b247bb0e7440c3e174262c2b093e0cb..55b12233c5e08932fa66f831aff7d3c768276484 100644 (file)
@@ -24,6 +24,7 @@
 #include <QList>
 #include <QSharedData>
 #include <QStringList>
+#include <QLocale>
 
 template <typename T>
 class KisTridiagonalSystem
@@ -402,9 +403,10 @@ void KisCubicCurve::removePoint(int idx)
 QString KisCubicCurve::toString() const
 {
     QString sCurve;
+    QLocale locale;
     foreach(const QPointF & pair, d->data->points) {
-        sCurve += QString::number(pair.x());
-        sCurve += ',';
+        sCurve += locale.toString(pair.x());
+        sCurve += '/';
         sCurve += QString::number(pair.y());
         sCurve += ';';
     }
@@ -418,10 +420,10 @@ void KisCubicCurve::fromString(const QString& string)
     QList<QPointF> points;
 
     foreach(const QString & pair, data) {
-        if (pair.indexOf(',') > -1) {
+        if (pair.indexOf('/') > -1) {
             QPointF p;
-            p.rx() = pair.section(',', 0, 0).toDouble();
-            p.ry() = pair.section(',', 1, 1).toDouble();
+            p.rx() = pair.section('/', 0, 0).toDouble();
+            p.ry() = pair.section('/', 1, 1).toDouble();
             points.append(p);
         }
     }
index 6392f2b0d1045f0eea431ac873d48468086162aa..8fa3d6aaf6de10ca18647af6fbc71a4eb74d4ba3 100644 (file)
@@ -174,9 +174,6 @@ QImage KThumb::getFrame(Mlt::Producer *producer, int framepos, int width, int he
         return p;
     }
 
-    /*Mlt::Producer parentProd(producer->parent());
-    Mlt::Service service(parentProd.get_service());
-    mlt_service_lock(service.get_service());*/
     int ow = width;
     int oh = height;
     mlt_image_format format = mlt_image_rgb24a;
index 7574120fb8a148993b8c6bc5394be5de3049c66d..ccda3a2c4495ec45048fc4eb5cea4dfd1d4c6b06 100644 (file)
@@ -154,8 +154,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     new MainWindowAdaptor(this);
     QDBusConnection dbus = QDBusConnection::sessionBus();
     dbus.registerObject("/MainWindow", this);
-
-    setlocale(LC_NUMERIC, "POSIX");
+    //setlocale(LC_NUMERIC, "POSIX");
     if (!KdenliveSettings::colortheme().isEmpty()) slotChangePalette(NULL, KdenliveSettings::colortheme());
     setFont(KGlobalSettings::toolBarFont());
     parseProfiles(MltPath);
@@ -2030,7 +2029,8 @@ void MainWindow::doOpenFile(const KUrl &url, KAutoSaveFile *stale)
         delete m_stopmotion;
         m_stopmotion = NULL;
     }
-
+    
+    m_timer.start();
     KProgressDialog progressDialog(this, i18n("Loading project"), i18n("Loading project"));
     progressDialog.setAllowCancel(false);
     progressDialog.progressBar()->setMaximum(4);
@@ -2086,6 +2086,13 @@ void MainWindow::doOpenFile(const KUrl &url, KAutoSaveFile *stale)
     m_clipMonitor->refreshMonitor(true);
 
     progressDialog.progressBar()->setValue(4);
+    bool readOnly = !doc->isReadOnly();
+    factory()->container("edit", this)->setEnabled(readOnly);
+    factory()->container("project", this)->setEnabled(readOnly);
+    factory()->container("tool", this)->setEnabled(readOnly);
+    factory()->container("clip", this)->setEnabled(readOnly);
+    factory()->container("timeline", this)->setEnabled(readOnly);
+    factory()->container("monitor", this)->setEnabled(readOnly);
     if (openBackup) slotOpenBackupDialog(url);
 }
 
@@ -2366,7 +2373,7 @@ void MainWindow::slotUpdateMousePosition(int pos)
 
 void MainWindow::slotUpdateDocumentState(bool modified)
 {
-    if (!m_activeDocument) return;
+    if (!m_activeDocument || m_activeDocument->isReadOnly()) return;
     setCaption(m_activeDocument->description(), modified);
     m_saveAction->setEnabled(modified);
     if (modified) {
@@ -2527,6 +2534,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
     connect(trackView->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(activateMonitor()));
     connect(trackView, SIGNAL(zoneMoved(int, int)), this, SLOT(slotZoneMoved(int, int)));
     connect(m_projectList, SIGNAL(loadingIsOver()), trackView->projectView(), SLOT(slotUpdateAllThumbs()));
+    connect(m_projectList, SIGNAL(loadingIsOver()), this, SLOT(slotElapsedTime()));
     connect(m_projectList, SIGNAL(displayMessage(const QString&, int)), this, SLOT(slotGotProgressInfo(const QString&, int)));
     connect(m_projectList, SIGNAL(updateRenderStatus()), this, SLOT(slotCheckRenderStatus()));
 
@@ -4362,6 +4370,11 @@ void MainWindow::slotBlockClipMonitor(const QString id)
 }
 
 
+void MainWindow::slotElapsedTime()
+{
+    kDebug()<<"-----------------------------------------\n"<<"Time elapsed: "<<m_timer.elapsed()<<"\n-------------------------";
+}
+
 #include "mainwindow.moc"
 
 #ifdef DEBUG_MAINW
index a033e0e0302e185673ac221b99a6d4ff6c85a9d5..848f23fac393a396adc97ac150cc5f6441c95367 100644 (file)
@@ -305,6 +305,7 @@ private:
     void loadLayouts();
 
     StopmotionWidget *m_stopmotion;
+    QTime m_timer;
 
 public slots:
     /** @brief Prepares opening @param url.
@@ -548,6 +549,8 @@ private slots:
     /** @brief Disable proxies for this project. */
     void slotDisableProxies();
 
+    void slotElapsedTime();
+
 signals:
     Q_SCRIPTABLE void abortRenderJob(const QString &url);
 };
index 506d83e733bb70b3c598b926b92cf64728fa472d..7998aa2d4e83499baba0b25912a8684f7d79d439 100644 (file)
@@ -83,15 +83,15 @@ MltDeviceCapture::MltDeviceCapture(QString profile, VideoPreviewContainer *surfa
     AbstractRender("capture", parent),
     doCapture(0),
     sendFrameForAnalysis(false),
+    analyseAudio(KdenliveSettings::monitor_audio()),
+    processingImage(false),
     m_mltConsumer(NULL),
     m_mltProducer(NULL),
     m_mltProfile(NULL),
     m_droppedFrames(0),
     m_livePreview(KdenliveSettings::recording_preview()),
     m_captureDisplayWidget(surface),
-    m_winid((int) surface->winId()),
-    analyseAudio(KdenliveSettings::monitor_audio()),
-    processingImage(false)
+    m_winid((int) surface->winId())
 {
     if (profile.isEmpty()) profile = KdenliveSettings::current_profile();
     buildConsumer(profile);
@@ -196,20 +196,6 @@ void MltDeviceCapture::stop()
                 mlt_type = mlt_properties_get(properties, "mlt_type");
                 resource = mlt_properties_get(properties, "mlt_service");
             }
-            for (int trackNb = tractor.count() - 1; trackNb >= 0; --trackNb) {
-                Mlt::Producer trackProducer(tractor.track(trackNb));
-                Mlt::Playlist trackPlaylist((mlt_playlist) trackProducer.get_service());
-                if (trackPlaylist.type() == playlist_type) {
-                    for (int i = 0; i < trackPlaylist.count();i++) {
-                        // We need to manually decrease the ref count and close the producer, otherwise
-                        // the video4linux device stays open, seems like a bug in MLT that is not cleaning properly
-                        mlt_properties props = MLT_PRODUCER_PROPERTIES(trackPlaylist.get_clip(i)->get_parent());
-                        while (mlt_properties_ref_count(props) > 0) mlt_properties_dec_ref(props);
-                        if (trackPlaylist.get_clip(i)) mlt_producer_close(trackPlaylist.get_clip(i)->get_parent());
-                    }
-                    mlt_playlist_close(trackPlaylist.get_playlist());
-                }
-            }
             delete field;
             field = NULL;
         }
index 156aa17eec318a16157e2db5d16803c6250123df..68aff4698fce879418471f83f7a5890c307b4ab1 100644 (file)
@@ -569,7 +569,7 @@ void ProfilesDialog::slotUpdateDisplay(QString currentProfile)
         m_view.profiles_list->blockSignals(false);
         return;
     }
-
+    QLocale locale;
     m_selectedProfileIndex = m_view.profiles_list->currentIndex();
     if (currentProfile.isEmpty()) currentProfile = m_view.profiles_list->itemData(m_view.profiles_list->currentIndex()).toString();
     m_isCustomProfile = currentProfile.contains('/');
@@ -589,9 +589,9 @@ void ProfilesDialog::slotUpdateDisplay(QString currentProfile)
     m_view.frame_den->setValue(values.value("frame_rate_den").toInt());
     m_view.progressive->setChecked(values.value("progressive").toInt());
     if (values.value("progressive").toInt()) {
-        m_view.fields->setText(QString::number((double) values.value("frame_rate_num").toInt() / values.value("frame_rate_den").toInt(), 'f', 2));
+        m_view.fields->setText(locale.toString((double) values.value("frame_rate_num").toInt() / values.value("frame_rate_den").toInt(), 'f', 2));
     } else {
-        m_view.fields->setText(QString::number((double) 2 * values.value("frame_rate_num").toInt() / values.value("frame_rate_den").toInt(), 'f', 2));
+        m_view.fields->setText(locale.toString((double) 2 * values.value("frame_rate_num").toInt() / values.value("frame_rate_den").toInt(), 'f', 2));
     }
 
     int colorix = m_view.colorspace->findData(values.value("colorspace").toInt());
index 666036d4b7f5c302954059dd0b39857a7b916083..ab15315760d8299502545b3249a10de68630f80b 100644 (file)
@@ -1024,7 +1024,9 @@ void ProjectList::slotAddClip(DocClipBase *clip, bool getProperties)
         m_listView->processLayout();
         QDomElement e = clip->toXML().cloneNode().toElement();
         e.removeAttribute("file_hash");
+        m_mutex.lock();
         m_infoQueue.insert(clip->getId(), e);
+        m_mutex.unlock();
     }
     else if (item->hasProxy() && !item->isProxyRunning()) {
         slotCreateProxy(clip->getId());
@@ -1071,8 +1073,10 @@ void ProjectList::slotAddClip(DocClipBase *clip, bool getProperties)
         updateButtons();
     }
     
-    if (getProperties && m_processingClips.isEmpty())
-        m_queueRunner = QtConcurrent::run(this, &ProjectList::slotProcessNextClipInQueue);
+    //if (getProperties && m_processingClips.isEmpty())
+        //m_queueRunner = QtConcurrent::run(this, &ProjectList::slotProcessNextClipInQueue);
+    if (getProperties)
+        QtConcurrent::run(this, &ProjectList::slotProcessNextClipInQueue);
 }
 
 void ProjectList::slotGotProxy(const QString &proxyPath)
@@ -1107,8 +1111,11 @@ void ProjectList::slotGotProxy(ProjectItem *item)
         }
     }
     e.setAttribute("replace", 1);
+    m_mutex.lock();
     m_infoQueue.insert(clip->getId(), e);
-    if (!m_queueRunner.isRunning() && m_processingClips.isEmpty()) m_queueRunner = QtConcurrent::run(this, &ProjectList::slotProcessNextClipInQueue);   
+    m_mutex.unlock();
+    //if (!m_queueRunner.isRunning() && m_processingClips.isEmpty()) m_queueRunner = QtConcurrent::run(this, &ProjectList::slotProcessNextClipInQueue);
+    QtConcurrent::run(this, &ProjectList::slotProcessNextClipInQueue);
 }
 
 void ProjectList::slotResetProjectList()
@@ -1120,25 +1127,20 @@ void ProjectList::slotResetProjectList()
     m_refreshed = false;
 }
 
-void ProjectList::requestClipInfo(const QDomElement xml, const QString id)
-{
-    m_infoQueue.insert(id, xml);
-    //if (m_infoQueue.count() == 1 || ) QTimer::singleShot(300, this, SLOT(slotProcessNextClipInQueue()));
-}
-
 void ProjectList::slotProcessNextClipInQueue()
 {
     if (m_infoQueue.isEmpty()) {
         emit processNextThumbnail();
         return;
     }
-
+    QMutexLocker locker(&m_mutex);
     QMap<QString, QDomElement>::const_iterator j = m_infoQueue.constBegin();
     if (j != m_infoQueue.constEnd()) {
         QDomElement dom = j.value().cloneNode().toElement();
         const QString id = j.key();
         m_infoQueue.remove(id);
         m_processingClips.append(id);
+        locker.unlock();
         bool replace;
         if (dom.hasAttribute("replace")) {
             // Proxy action was enabled / disabled and we want to replace current producer
@@ -1176,7 +1178,7 @@ void ProjectList::updateAllClips(bool displayRatioChanged, bool fpsChanged)
     QPainter p(&missingPixmap);
     p.drawPixmap(3, 3, icon.pixmap(width - 6, height - 6));
     p.end();
-                        
+    kDebug()<<"//////////////7  UPDATE ALL CLPS";
     while (*it) {
         if ((*it)->type() == PROJECTSUBCLIPTYPE) {
             // subitem
@@ -1202,7 +1204,10 @@ void ProjectList::updateAllClips(bool displayRatioChanged, bool fpsChanged)
                         xml.removeAttribute("file_hash");
                         xml.removeAttribute("proxy_out");
                     }
-                    requestClipInfo(xml, clip->getId());
+                    m_mutex.lock();
+                    m_infoQueue.insert(clip->getId(), xml);
+                    m_mutex.unlock();
+                    QtConcurrent::run(this, &ProjectList::slotProcessNextClipInQueue);
                 }
                 else {
                     item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDropEnabled);
@@ -1240,7 +1245,12 @@ void ProjectList::updateAllClips(bool displayRatioChanged, bool fpsChanged)
         ++it;
     }
 
-    if (!m_queueRunner.isRunning() && m_processingClips.isEmpty()) m_queueRunner = QtConcurrent::run(this, &ProjectList::slotProcessNextClipInQueue);
+    //if (!m_queueRunner.isRunning() && m_processingClips.isEmpty()) m_queueRunner = QtConcurrent::run(this, &ProjectList::slotProcessNextClipInQueue);
+    //QtConcurrent::run(this, &ProjectList::slotProcessNextClipInQueue);
+    /*while (!m_infoQueue.isEmpty()) {
+        QtConcurrent::run(this, &ProjectList::slotProcessNextClipInQueue);
+    }*/
+    
     if (m_listView->isEnabled())
         monitorItemEditing(true);
     m_listView->setSortingEnabled(true);
@@ -1356,7 +1366,8 @@ void ProjectList::slotRemoveInvalidClip(const QString &id, bool replace)
     ProjectItem *item = getItemById(id);
     m_processingClips.removeAll(id);
     m_thumbnailQueue.removeAll(id);
-    if (!m_queueRunner.isRunning() && m_processingClips.isEmpty()) m_queueRunner = QtConcurrent::run(this, &ProjectList::slotProcessNextClipInQueue);
+    //if (!m_queueRunner.isRunning() && m_processingClips.isEmpty()) m_queueRunner = QtConcurrent::run(this, &ProjectList::slotProcessNextClipInQueue);
+    QtConcurrent::run(this, &ProjectList::slotProcessNextClipInQueue);   
     if (item) {
         const QString path = item->referencedClip()->fileURL().path();
         if (item->referencedClip()->isPlaceHolder()) replace = false;
@@ -1390,7 +1401,8 @@ void ProjectList::slotRemoveInvalidProxy(const QString &id, bool durationError)
     }
     m_processingClips.removeAll(id);
     m_thumbnailQueue.removeAll(id);
-    if (!m_queueRunner.isRunning() && m_processingClips.isEmpty()) m_queueRunner = QtConcurrent::run(this, &ProjectList::slotProcessNextClipInQueue);
+    //if (!m_queueRunner.isRunning() && m_processingClips.isEmpty()) m_queueRunner = QtConcurrent::run(this, &ProjectList::slotProcessNextClipInQueue);
+    QtConcurrent::run(this, &ProjectList::slotProcessNextClipInQueue);
 }
 
 void ProjectList::slotAddColorClip()
@@ -1510,6 +1522,7 @@ void ProjectList::setDocument(KdenliveDoc *doc)
     m_timecode = doc->timecode();
     m_commandStack = doc->commandStack();
     m_doc = doc;
+    setEnabled(!m_doc->isReadOnly());
 
     QMap <QString, QString> flist = doc->clipManager()->documentFolderList();
     QStringList openedFolders = doc->getExpandedFolders();
@@ -1566,8 +1579,8 @@ void ProjectList::slotCheckForEmptyQueue()
         if (!m_refreshed) {
             emit loadingIsOver();
             emit displayMessage(QString(), -1);
+            m_refreshed = true;
         }
-        m_refreshed = true;
         m_listView->blockSignals(false);
         m_listView->setEnabled(true);
         updateButtons();
@@ -1741,7 +1754,8 @@ void ProjectList::slotReplyGetFileProperties(const QString &clipId, Mlt::Produce
     if (!toReload.isEmpty())
         emit clipNeedsReload(toReload, true);
 
-    if (!m_queueRunner.isRunning() && m_processingClips.isEmpty()) m_queueRunner = QtConcurrent::run(this, &ProjectList::slotProcessNextClipInQueue);
+    //if (!m_queueRunner.isRunning() && m_processingClips.isEmpty()) m_queueRunner = QtConcurrent::run(this, &ProjectList::slotProcessNextClipInQueue);
+    QtConcurrent::run(this, &ProjectList::slotProcessNextClipInQueue);
 }
 
 bool ProjectList::adjustProjectProfileToItem(ProjectItem *item)
@@ -2434,7 +2448,8 @@ void ProjectList::updateProxyConfig()
     }
     if (command->childCount() > 0) m_doc->commandStack()->push(command);
     else delete command;
-    if (!m_infoQueue.isEmpty() && !m_queueRunner.isRunning() && m_processingClips.isEmpty()) m_queueRunner = QtConcurrent::run(this, &ProjectList::slotProcessNextClipInQueue);
+    //if (!m_infoQueue.isEmpty() && !m_queueRunner.isRunning() && m_processingClips.isEmpty()) m_queueRunner = QtConcurrent::run(this, &ProjectList::slotProcessNextClipInQueue);
+    QtConcurrent::run(this, &ProjectList::slotProcessNextClipInQueue);
 }
 
 void ProjectList::slotProxyCurrentItem(bool doProxy)
@@ -2483,6 +2498,7 @@ void ProjectList::slotProxyCurrentItem(bool doProxy)
     }
     else delete command;
     //if (!m_infoQueue.isEmpty() && !m_queueRunner.isRunning() && m_processingClips.isEmpty()) m_queueRunner = QtConcurrent::run(this, &ProjectList::slotProcessNextClipInQueue);
+    if (!m_infoQueue.isEmpty()) QtConcurrent::run(this, &ProjectList::slotProcessNextClipInQueue);
 }
 
 
index b064f4ba1fa1c9fda271d13ca04fbd33a0715802..63c8f7450f4321e1b3a2884c5e8bc8e948b48687 100644 (file)
@@ -266,7 +266,6 @@ private:
     QToolButton *m_editButton;
     QMap <QString, QDomElement> m_infoQueue;
     QMap <QString, QDomElement> m_producerQueue;
-    void requestClipInfo(const QDomElement xml, const QString id);
     QList <QString> m_thumbnailQueue;
     QAction *m_proxyAction;
     QStringList m_processingClips;
@@ -274,6 +273,7 @@ private:
     QStringList m_abortProxy;
     /** @brief Holds a list of proxy urls that are currently being created. */
     QStringList m_processingProxy;
+    QMutex m_mutex;
     
     void requestClipThumbnail(const QString id);
 
index 5f5e902a82fb4b223cc0d09bd54a0ca3e79b68d3..8edb92549b09a9baecc8663b7841cf0be5062b4f 100644 (file)
@@ -330,6 +330,7 @@ void ProjectSettings::accept()
 
 void ProjectSettings::slotUpdateDisplay()
 {
+    QLocale locale;
     QString currentProfile = profiles_list->itemData(profiles_list->currentIndex()).toString();
     QMap< QString, QString > values = ProfilesDialog::getSettingsFromFile(currentProfile);
     p_size->setText(values.value("width") + 'x' + values.value("height"));
@@ -338,7 +339,7 @@ void ProjectSettings::slotUpdateDisplay()
     p_display->setText(values.value("display_aspect_num") + '/' + values.value("display_aspect_den"));
     if (values.value("progressive").toInt() == 0) {
         p_progressive->setText(i18n("Interlaced (%1 fields per second)",
-                                    QString::number((double)2 * values.value("frame_rate_num").toInt() / values.value("frame_rate_den").toInt(), 'f', 2)));
+                                    locale.toString((double)2 * values.value("frame_rate_num").toInt() / values.value("frame_rate_den").toInt(), 'f', 2)));
     } else {
         p_progressive->setText(i18n("Progressive"));
     }
index b96f1f6be913fc5ecc1e7bf4a7a16df2bf8c64c1..5a859b9a3365c404ee63f471877d2df99c2050f4 100644 (file)
@@ -556,6 +556,7 @@ void Render::slotSplitView(bool doit)
 void Render::getFileProperties(const QDomElement xml, const QString &clipId, int imageHeight, bool replaceProducer, bool selectClip)
 {
     QString path;
+    QLocale locale;
     bool proxyProducer;
     if (xml.hasAttribute("proxy") && xml.attribute("proxy") != "-") {
         path = xml.attribute("proxy");
@@ -590,7 +591,9 @@ void Render::getFileProperties(const QDomElement xml, const QString &clipId, int
         play.appendChild(doc.importNode(xml, true));
         producer = new Mlt::Producer(*m_mltProfile, "xml-string", doc.toString().toUtf8().constData());
     } else {
+        char *resTag = qstrdup(QString("nocache:" + path).toUtf8().constData());
         producer = new Mlt::Producer(*m_mltProfile, path.toUtf8().constData());
+        delete[] resTag;
     }
 
 
@@ -693,8 +696,8 @@ void Render::getFileProperties(const QDomElement xml, const QString &clipId, int
         // Clip  already has all properties
         if (replaceProducer) emit blockClipMonitor(clipId);
         // Querying a frame is required by MLT, otherwise the producer is not correctly initialised
-        Mlt::Frame *frame = producer->get_frame();
-        delete frame;
+        //Mlt::Frame *frame = producer->get_frame();
+        //delete frame;
         emit replyGetFileProperties(clipId, producer, QMap < QString, QString >(), QMap < QString, QString >(), replaceProducer, selectClip);
         return;
     }
@@ -758,7 +761,7 @@ void Render::getFileProperties(const QDomElement xml, const QString &clipId, int
     }
 
     if (producer->get_double("meta.media.frame_rate_den") > 0) {
-        filePropertyMap["fps"] = QString::number(producer->get_double("meta.media.frame_rate_num") / producer->get_double("meta.media.frame_rate_den"));
+        filePropertyMap["fps"] = locale.toString(producer->get_double("meta.media.frame_rate_num") / producer->get_double("meta.media.frame_rate_den"));
     } else filePropertyMap["fps"] = producer->get("source_fps");
 
     if (frame && frame->is_valid()) {
@@ -796,7 +799,7 @@ void Render::getFileProperties(const QDomElement xml, const QString &clipId, int
                 } else
                     pix.fill(Qt::black);
 
-                if (frameNumber == 0 && variance < 6) {
+                if (frameNumber == 0 && variance< 6) {
                     // Thumbnail is not interesting (for example all black, seek to fetch better thumb
                     frameNumber = 100;
                     producer->seek(frameNumber);
@@ -1146,7 +1149,6 @@ bool Render::saveSceneList(QString path, QDomElement kdenliveData)
 
 void Render::saveZone(KUrl url, QString desc, QPoint zone)
 {
-    kDebug() << "// SAVING CLIP ZONE, RENDER: " << m_name;
     Mlt::Consumer xmlConsumer(*m_mltProfile, ("xml:" + url.path()).toUtf8().constData());
     m_mltProducer->optimise();
     xmlConsumer.set("terminate_on_pause", 1);
@@ -1254,18 +1256,15 @@ void Render::slotOsdTimeout()
 
 void Render::start()
 {
-    kDebug() << "-----  STARTING MONITOR: " << m_name;
     if (m_winid == -1) {
         kDebug() << "-----  BROKEN MONITOR: " << m_name << ", RESTART";
         return;
     }
     if (m_mltConsumer && m_mltConsumer->is_stopped()) {
-        kDebug() << "-----  MONITOR: " << m_name << " WAS STOPPED";
         if (m_mltConsumer->start() == -1) {
             //KMessageBox::error(qApp->activeWindow(), i18n("Could not create the video preview window.\nThere is something wrong with your Kdenlive install or your driver settings, please fix it."));
             kDebug(QtWarningMsg) << "/ / / / CANNOT START MONITOR";
         } else {
-            kDebug() << "-----  MONITOR: " << m_name << " REFRESH";
             m_isBlocked = false;
             refresh();
         }
@@ -1277,13 +1276,12 @@ void Render::stop()
 {
     if (m_mltProducer == NULL) return;
     if (m_mltConsumer && !m_mltConsumer->is_stopped()) {
-        kDebug() << "/////////////   RENDER STOPPED: " << m_name;
+        //kDebug() << "/////////////   RENDER STOPPED: " << m_name;
         //m_mltConsumer->set("refresh", 0);
         m_mltConsumer->stop();
         // delete m_mltConsumer;
         // m_mltConsumer = NULL;
     }
-    kDebug() << "/////////////   RENDER STOP2-------";
     m_isBlocked = true;
 
     if (m_mltProducer) {
@@ -1292,13 +1290,10 @@ void Render::stop()
         //m_mltProducer->set("out", m_mltProducer->get_length() - 1);
         //kDebug() << m_mltProducer->get_length();
     }
-    kDebug() << "/////////////   RENDER STOP3-------";
 }
 
 void Render::stop(const GenTime & startTime)
 {
-
-    kDebug() << "/////////////   RENDER STOP-------2";
     if (m_mltProducer) {
         if (m_isZoneMode) resetZoneMode();
         m_mltProducer->set_speed(0.0);
@@ -1639,12 +1634,12 @@ void Render::mltCheckLength(Mlt::Tractor *tractor)
 Mlt::Producer *Render::checkSlowMotionProducer(Mlt::Producer *prod, QDomElement element)
 {
     if (element.attribute("speed", "1.0").toDouble() == 1.0 && element.attribute("strobe", "1").toInt() == 1) return prod;
-
+    QLocale locale;
     // We want a slowmotion producer
     double speed = element.attribute("speed", "1.0").toDouble();
     int strobe = element.attribute("strobe", "1").toInt();
     QString url = QString::fromUtf8(prod->get("resource"));
-    url.append('?' + QString::number(speed));
+    url.append('?' + locale.toString(speed));
     if (strobe > 1) url.append("&strobe=" + QString::number(strobe));
     Mlt::Producer *slowprod = m_slowmotionProducers.value(url);
     if (!slowprod || slowprod->get_producer() == NULL) {
@@ -1652,7 +1647,7 @@ Mlt::Producer *Render::checkSlowMotionProducer(Mlt::Producer *prod, QDomElement
         if (strobe > 1) slowprod->set("strobe", strobe);
         QString id = prod->parent().get("id");
         if (id.contains('_')) id = id.section('_', 0, 0);
-        QString producerid = "slowmotion:" + id + ':' + QString::number(speed);
+        QString producerid = "slowmotion:" + id + ':' + locale.toString(speed);
         if (strobe > 1) producerid.append(':' + QString::number(strobe));
         slowprod->set("id", producerid.toUtf8().constData());
         m_slowmotionProducers.insert(url, slowprod);
@@ -1879,34 +1874,21 @@ bool Render::mltRemoveClip(int track, GenTime position)
         kWarning() << "// TRACTOR PROBLEM";
         return false;
     }
-
+    //service.lock();
     Mlt::Tractor tractor(service);
-    mlt_service_lock(service.get_service());
     Mlt::Producer trackProducer(tractor.track(track));
     Mlt::Playlist trackPlaylist((mlt_playlist) trackProducer.get_service());
     int clipIndex = trackPlaylist.get_clip_index_at((int) position.frames(m_fps));
 
-    // Display playlist info
-    //kDebug() << "////  BEFORE -( " << position.frames(m_fps) << " )-------------------------------";
-    /*for (int i = 0; i < trackPlaylist.count(); i++) {
-    int blankStart = trackPlaylist.clip_start(i);
-    int blankDuration = trackPlaylist.clip_length(i) - 1;
-    QString blk;
-    if (trackPlaylist.is_blank(i)) blk = "(blank)";
-    kDebug()<<"CLIP "<<i<<": ("<<blankStart<<'x'<<blankStart + blankDuration<<")"<<blk;
-    }*/
     if (trackPlaylist.is_blank(clipIndex)) {
-        kDebug() << "// WARNING, TRYING TO REMOVE A BLANK: " << position.frames(25);
-        mlt_service_unlock(service.get_service());
+        kDebug() << "// WARNING, TRYING TO REMOVE A BLANK: " << position.frames(m_fps);
+        //mlt_service_unlock(service.get_service());
         return false;
     }
-    //kDebug()<<"////  Deleting at: "<< (int) position.frames(m_fps) <<" --------------------------------------";
     m_isBlocked = true;
     Mlt::Producer *clip = trackPlaylist.replace_with_blank(clipIndex);
     if (clip) delete clip;
     trackPlaylist.consolidate_blanks(0);
-    /*if (QString(clip.parent().get("transparency")).toInt() == 1)
-        mltDeleteTransparency((int) position.frames(m_fps), track, QString(clip.parent().get("id")).toInt());*/
 
     /* // Display playlist info
     kDebug()<<"////  AFTER";
@@ -1917,7 +1899,7 @@ bool Render::mltRemoveClip(int track, GenTime position)
     if (trackPlaylist.is_blank(i)) blk = "(blank)";
     kDebug()<<"CLIP "<<i<<": ("<<blankStart<<'x'<<blankStart + blankDuration<<")"<<blk;
     }*/
-    mlt_service_unlock(service.get_service());
+    //service.unlock();
     if (track != 0 && trackPlaylist.count() <= clipIndex) mltCheckLength(&tractor);
     m_isBlocked = false;
     return true;
@@ -2137,6 +2119,7 @@ int Render::mltChangeClipSpeed(ItemInfo info, ItemInfo speedIndependantInfo, dou
         kWarning() << "// TRACTOR PROBLEM";
         return -1;
     }
+    
     //kDebug() << "Changing clip speed, set in and out: " << info.cropStart.frames(m_fps) << " to " << (info.endPos - info.startPos).frames(m_fps) - 1;
     Mlt::Tractor tractor(service);
     Mlt::Producer trackProducer(tractor.track(info.track));
@@ -2168,13 +2151,13 @@ int Render::mltChangeClipSpeed(ItemInfo info, ItemInfo speedIndependantInfo, dou
     if ((serv == "avformat" || serv == "avformat-novalidate") && (speed != 1.0 || strobe > 1)) {
         mlt_service_lock(service.get_service());
         QString url = QString::fromUtf8(clipparent.get("resource"));
-        url.append('?' + QString::number(speed));
+        url.append('?' + m_locale.toString(speed));
         if (strobe > 1) url.append("&strobe=" + QString::number(strobe));
         Mlt::Producer *slowprod = m_slowmotionProducers.value(url);
         if (!slowprod || slowprod->get_producer() == NULL) {
             slowprod = new Mlt::Producer(*m_mltProfile, 0, ("framebuffer:" + url).toUtf8().constData());
             if (strobe > 1) slowprod->set("strobe", strobe);
-            QString producerid = "slowmotion:" + id + ':' + QString::number(speed);
+            QString producerid = "slowmotion:" + id + ':' + m_locale.toString(speed);
             if (strobe > 1) producerid.append(':' + QString::number(strobe));
             slowprod->set("id", producerid.toUtf8().constData());
             // copy producer props
@@ -2247,13 +2230,13 @@ int Render::mltChangeClipSpeed(ItemInfo info, ItemInfo speedIndependantInfo, dou
         mlt_service_lock(service.get_service());
         QString url = QString::fromUtf8(clipparent.get("resource"));
         url = url.section('?', 0, 0);
-        url.append('?' + QString::number(speed));
+        url.append('?' + m_locale.toString(speed));
         if (strobe > 1) url.append("&strobe=" + QString::number(strobe));
         Mlt::Producer *slowprod = m_slowmotionProducers.value(url);
         if (!slowprod || slowprod->get_producer() == NULL) {
             slowprod = new Mlt::Producer(*m_mltProfile, 0, ("framebuffer:" + url).toUtf8().constData());
             slowprod->set("strobe", strobe);
-            QString producerid = "slowmotion:" + id.section(':', 1, 1) + ':' + QString::number(speed);
+            QString producerid = "slowmotion:" + id.section(':', 1, 1) + ':' + m_locale.toString(speed);
             if (strobe > 1) producerid.append(':' + QString::number(strobe));
             slowprod->set("id", producerid.toUtf8().constData());
             // copy producer props
@@ -2476,7 +2459,7 @@ bool Render::mltAddEffect(Mlt::Service service, EffectsParameterList params, int
 
     // create filter
     QString tag =  params.paramValue("tag");
-    kDebug() << " / / INSERTING EFFECT: " << tag << ", REGI: " << region;
+    //kDebug() << " / / INSERTING EFFECT: " << tag << ", REGI: " << region;
     char *filterTag = qstrdup(tag.toUtf8().constData());
     char *filterId = qstrdup(params.paramValue("id").toUtf8().constData());
     QHash<QString, QString>::Iterator it;
@@ -2484,10 +2467,10 @@ bool Render::mltAddEffect(Mlt::Service service, EffectsParameterList params, int
 
     if (!kfr.isEmpty()) {
         QStringList keyFrames = kfr.split(';', QString::SkipEmptyParts);
-        kDebug() << "// ADDING KEYFRAME EFFECT: " << params.paramValue("keyframes");
+        //kDebug() << "// ADDING KEYFRAME EFFECT: " << params.paramValue("keyframes");
         char *starttag = qstrdup(params.paramValue("starttag", "start").toUtf8().constData());
         char *endtag = qstrdup(params.paramValue("endtag", "end").toUtf8().constData());
-        kDebug() << "// ADDING KEYFRAME TAGS: " << starttag << ", " << endtag;
+        //kDebug() << "// ADDING KEYFRAME TAGS: " << starttag << ", " << endtag;
         //double max = params.paramValue("max").toDouble();
         double min = params.paramValue("min").toDouble();
         double factor = params.paramValue("factor", "1").toDouble();
@@ -2510,7 +2493,7 @@ bool Render::mltAddEffect(Mlt::Service service, EffectsParameterList params, int
                 }
                 filter->set("in", x1);
                 //kDebug() << "// ADDING KEYFRAME vals: " << min<<" / "<<max<<", "<<y1<<", factor: "<<factor;
-                filter->set(starttag, QString::number((min + y1) / factor).toUtf8().data());
+                filter->set(starttag, m_locale.toString((min + y1) / factor).toUtf8().data());
                 service.attach(*filter);
             }
         } else for (int i = 0; i < keyFrames.size() - 1; ++i) {
@@ -2530,8 +2513,8 @@ bool Render::mltAddEffect(Mlt::Service service, EffectsParameterList params, int
                     filter->set("in", x1);
                     filter->set("out", x2);
                     //kDebug() << "// ADDING KEYFRAME vals: " << min<<" / "<<max<<", "<<y1<<", factor: "<<factor;
-                    filter->set(starttag, QString::number((min + y1) / factor).toUtf8().data());
-                    filter->set(endtag, QString::number((min + y2) / factor).toUtf8().data());
+                    filter->set(starttag, m_locale.toString((min + y1) / factor).toUtf8().data());
+                    filter->set(endtag, m_locale.toString((min + y2) / factor).toUtf8().data());
                     service.attach(*filter);
                     offset = 1;
                 }
@@ -3199,7 +3182,7 @@ bool Render::mltUpdateClipProducer(int track, int pos, Mlt::Producer *prod)
         return false;
     }
     m_isBlocked++;
-    kDebug() << "// TRYING TO UPDATE CLIP at: " << pos << ", TK: " << track;
+    //kDebug() << "// TRYING TO UPDATE CLIP at: " << pos << ", TK: " << track;
     Mlt::Service service(m_mltProducer->parent().get_service());
     if (service.type() != tractor_type) {
         kWarning() << "// TRACTOR PROBLEM";
@@ -3251,7 +3234,7 @@ bool Render::mltMoveClip(int startTrack, int endTrack, int moveStart, int moveEn
     Mlt::Producer trackProducer(tractor.track(startTrack));
     Mlt::Playlist trackPlaylist((mlt_playlist) trackProducer.get_service());
     int clipIndex = trackPlaylist.get_clip_index_at(moveStart);
-    kDebug() << "//////  LOOKING FOR CLIP TO MOVE, INDEX: " << clipIndex;
+    //kDebug() << "//////  LOOKING FOR CLIP TO MOVE, INDEX: " << clipIndex;
     bool checkLength = false;
     if (endTrack == startTrack) {
         Mlt::Producer *clipProducer = trackPlaylist.replace_with_blank(clipIndex);
@@ -3486,7 +3469,7 @@ void Render::mltUpdateTransition(QString oldTag, QString tag, int a_track, int b
 {
     if (oldTag == tag && !force) mltUpdateTransitionParams(tag, a_track, b_track, in, out, xml);
     else {
-        kDebug()<<"// DELETING TRANS: "<<a_track<<"-"<<b_track;
+        //kDebug()<<"// DELETING TRANS: "<<a_track<<"-"<<b_track;
         mltDeleteTransition(oldTag, a_track, b_track, in, out, xml, false);
         mltAddTransition(tag, a_track, b_track, in, out, xml, false);
     }
@@ -3581,7 +3564,7 @@ void Render::mltDeleteTransition(QString tag, int /*a_track*/, int b_track, GenT
     QString resource = mlt_properties_get(properties, "mlt_service");
 
     const int old_pos = (int)((in + out).frames(m_fps) / 2);
-    kDebug() << " del trans pos: " << in.frames(25) << "-" << out.frames(25);
+    //kDebug() << " del trans pos: " << in.frames(25) << "-" << out.frames(25);
 
     while (mlt_type == "transition") {
         mlt_transition tr = (mlt_transition) nextservice;
@@ -3619,7 +3602,7 @@ QMap<QString, QString> Render::mltGetTransitionParamsFromXml(QDomElement xml)
             map[name] = e.attribute("value");
         }
         if (e.attribute("type") != "addedgeometry" && !e.attribute("factor").isEmpty() && e.attribute("factor").toDouble() > 0) {
-            map[name] = QString::number(map.value(name).toDouble() / e.attribute("factor").toDouble());
+            map[name] = m_locale.toString(map.value(name).toDouble() / e.attribute("factor").toDouble());
             //map[name]=map[name].replace(".",","); //FIXME how to solve locale conversion of . ,
         }
 
index 39690902bb8cd32b2d151ce1d7a166fcc8f78d5f..9749583b8df0295ffc3c38d2627647012165dbfd 100644 (file)
@@ -306,6 +306,8 @@ private:
     /** @brief A human-readable description of this renderer. */
     int m_winid;
 
+    QLocale m_locale;
+
     void closeMlt();
     void mltCheckLength(Mlt::Tractor *tractor);
     void mltPasteEffects(Mlt::Producer *source, Mlt::Producer *dest);
index 302f229e55fbd390811528c8ab88ce5665434cf7..8c2f9e9d3c5fdbd0388a0e308679acc01ad40689 100644 (file)
@@ -739,7 +739,7 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut, const
         double fps = (double) m_profile.frame_rate_num / m_profile.frame_rate_den;
         guideStart = m_view.guide_start->itemData(m_view.guide_start->currentIndex()).toDouble();
         guideEnd = m_view.guide_end->itemData(m_view.guide_end->currentIndex()).toDouble();
-        render_process_args << "in=" + QString::number(GenTime(guideStart).frames(fps)) << "out=" + QString::number(GenTime(guideEnd).frames(fps));
+        render_process_args << "in=" + QString::number((int) GenTime(guideStart).frames(fps)) << "out=" + QString::number((int) GenTime(guideEnd).frames(fps));
     }
 
     if (!overlayargs.isEmpty()) render_process_args << "preargs=" + overlayargs.join(" ");
index 136273cd039762ae66fc548f273f5b2e5bea1dfb..1055d0c2d219815be59c517f1b905e9cb7f456e8 100644 (file)
@@ -461,6 +461,7 @@ void StopmotionWidget::slotLive(bool isOn)
     if (isOn) {
         m_frame_preview->setHidden(true);
         m_videoBox->setHidden(false);
+        QLocale locale;
 
         MltVideoProfile profile;
         QString resource;
@@ -499,7 +500,7 @@ void StopmotionWidget::slotLive(bool isOn)
             }
             capture_button->setEnabled(true);
             live_button->setChecked(true);
-            log_box->insertItem(-1, i18n("Playing %1x%2 (%3 fps)", profile.width, profile.height, QString::number((double)profile.frame_rate_num/profile.frame_rate_den).rightJustified(2, '0')));
+            log_box->insertItem(-1, i18n("Playing %1x%2 (%3 fps)", profile.width, profile.height, locale.toString((double)profile.frame_rate_num/profile.frame_rate_den).rightJustified(2, '0')));
             log_box->setCurrentIndex(0);
         }
         else {
index 3b5749773f5a3ffe26051b57e0a88c6ae0b5746c..5e68e0d013513efdf7b0b8f5d1f5efdfe78ef5b3 100644 (file)
@@ -374,12 +374,13 @@ const QString Timecode::getTimecodeHH_MM_SS_HH(const GenTime & time) const
 
 const QString Timecode::getTimecodeFrames(const GenTime & time) const
 {
-    return QString::number(time.frames(m_realFps));
+    return QString::number((int) time.frames(m_realFps));
 }
 
 const QString Timecode::getTimecodeSeconds(const GenTime & time) const
 {
-    return QString::number(time.seconds());
+    QLocale locale;
+    return locale.toString(time.seconds());
 }
 
 const QString Timecode::getTimecodeDropFrame(const GenTime & time) const
index 41ea52094802dfffa506b171a54323781aeadc99..0e2bcd8a1b2bbacf67fcf032f8e68eccf1914fa3 100644 (file)
@@ -118,6 +118,7 @@ TrackView::TrackView(KdenliveDoc *doc, bool *ok, QWidget *parent) :
 
     slotChangeZoom(m_doc->zoom().x(), m_doc->zoom().y());
     slotSetZone(m_doc->zone(), false);
+    setEnabled(!doc->isReadOnly());
 }
 
 TrackView::~TrackView()
@@ -199,6 +200,7 @@ void TrackView::parseDocument(QDomDocument doc)
 
     // parse project tracks
     QDomElement mlt = doc.firstChildElement("mlt");
+    if (mlt.hasAttribute("LC_NUMERIC")) m_locale = QLocale(mlt.attribute("LC_NUMERIC"));
     QDomElement tractor = mlt.firstChildElement("tractor");
     QDomNodeList tracks = tractor.elementsByTagName("track");
     QDomNodeList playlists = doc.elementsByTagName("playlist");
@@ -216,21 +218,6 @@ void TrackView::parseDocument(QDomDocument doc)
         QDomNode n = producers.item(i);
         e = n.toElement();
 
-        /*
-        // Check for invalid markup
-        QDomNodeList params = e.elementsByTagName("property");
-        for (int j = 0; j < params.count(); j++) {
-            QDomElement p = params.item(j).toElement();
-            if (p.attribute("name") == "markup") {
-         QString val = p.text().toUtf8().data();
-         kDebug()<<"//FOUND MARKUP, VAL: "<<val;
-         //e.setAttribute("value", value);
-         n.removeChild(params.item(j));
-         break;
-            }
-        }
-        */
-
         if (e.hasAttribute("in") == false && e.hasAttribute("out") == false) continue;
         int in = e.attribute("in").toInt();
         int out = e.attribute("out").toInt();
@@ -347,15 +334,13 @@ void TrackView::parseDocument(QDomDocument doc)
                 // When adding composite transition, check if it is a wipe transition
                 if (mlt_geometry.count(';') == 1) {
                     mlt_geometry.remove(QChar('%'), Qt::CaseInsensitive);
-                    mlt_geometry.replace(QChar('x'), QChar(','), Qt::CaseInsensitive);
-                    QString start = mlt_geometry.section(';', 0, 0);
-                    start = start.section(':', 0, 1);
-                    start.replace(QChar(':'), QChar(','), Qt::CaseInsensitive);
-                    QString end = mlt_geometry.section('=', 1, 1);
-                    end = end.section(':', 0, 1);
-                    end.replace(QChar(':'), QChar(','), Qt::CaseInsensitive);
-                    start.append(',' + end);
-                    QStringList numbers = start.split(',', QString::SkipEmptyParts);
+                    mlt_geometry.replace(QChar('x'), QChar(':'), Qt::CaseInsensitive);
+                    mlt_geometry.replace(QChar(','), QChar(':'), Qt::CaseInsensitive);
+                    mlt_geometry.replace(QChar('/'), QChar(':'), Qt::CaseInsensitive);
+                    
+                    QString start = mlt_geometry.section('=', 0, 0).section(':', 0, -2) + ':';
+                    start.append(mlt_geometry.section('=', 1, 1).section(':', 0, -2));
+                    QStringList numbers = start.split(':', QString::SkipEmptyParts);
                     bool isWipeTransition = true;
                     int checkNumber;
                     for (int i = 0; i < numbers.size(); ++i) {
@@ -697,7 +682,10 @@ int TrackView::slotAddProjectTrack(int ix, QDomElement xml, bool locked, QDomNod
                             QString service = EffectsList::property(prod, "mlt_service");
                             QString type = EffectsList::property(prod, "mlt_type");
                             QString resource = EffectsList::property(prod, "resource");
-                            if (!resource.startsWith('/') && service != "colour") resource.prepend(docRoot);
+                            if (!resource.startsWith('/') && service != "colour") {
+                                resource.prepend(docRoot);
+                                kDebug()<<"******************\nADJUSTED 1\n*************************";
+                            }
                             QString length = EffectsList::property(prod, "length");
                             producerXml.setAttribute("mlt_service", service);
                             producerXml.setAttribute("mlt_type", type);
@@ -853,8 +841,8 @@ void TrackView::slotAddProjectEffects(QDomNodeList effects, QDomElement parentNo
                 // add first keyframe
                 if (effectout <= effectin) {
                     // there is only one keyframe
-                    keyframes.append(QString::number(effectin) + ':' + QString::number(startvalue) + ';');
-                } else keyframes.append(QString::number(effectin) + ':' + QString::number(startvalue) + ';' + QString::number(effectout) + ':' + QString::number(endvalue) + ';');
+                    keyframes.append(QString::number(effectin) + ':' + m_locale.toString(startvalue) + ';');
+                } else keyframes.append(QString::number(effectin) + ':' + m_locale.toString(startvalue) + ';' + QString::number(effectout) + ':' + QString::number(endvalue) + ';');
                 QDomNode lastParsedEffect;
                 ix++;
                 QDomNode n2 = effects.at(ix);
@@ -879,7 +867,7 @@ void TrackView::slotAddProjectEffects(QDomNodeList effects, QDomElement parentNo
                         }
                     }
                     if (continueParsing) {
-                        keyframes.append(QString::number(effectout) + ':' + QString::number(endvalue) + ';');
+                        keyframes.append(QString::number(effectout) + ':' + m_locale.toString(endvalue) + ';');
                         ix++;
                     }
                 }
@@ -926,13 +914,14 @@ void TrackView::slotAddProjectEffects(QDomNodeList effects, QDomElement parentNo
                             QStringList kfrs = paramvalue.split(";");
                             for (int l = 0; l < kfrs.count(); l++) {
                                 QString fr = kfrs.at(l).section('=', 0, 0);
-                                double val = kfrs.at(l).section('=', 1, 1).toDouble();
-                                kfrs[l] = fr + ":" + QString::number((int)(val * fact));
+                                double val = m_locale.toDouble(kfrs.at(l).section('=', 1, 1));
+                                //kfrs[l] = fr + ":" + m_locale.toString((int)(val * fact));
+                                kfrs[l] = fr + ":" + QString::number((int) (val * fact));
                             }
                             e.setAttribute("keyframes", kfrs.join(";"));
                         } else if (type == "double" || type == "constant") {
                             bool ok;
-                            e.setAttribute("value", paramvalue.toDouble(&ok) * fact);
+                            e.setAttribute("value", m_locale.toDouble(paramvalue, &ok) * fact);
                             if (!ok)
                                 e.setAttribute("value", paramvalue);
                         } else {
@@ -1011,7 +1000,10 @@ DocClipBase *TrackView::getMissingProducer(const QString id) const
 
     if (slowmotionClip) resource = resource.section('?', 0, 0);
     // prepend MLT XML document root if no path in clip resource and not a color clip
-    if (!resource.startsWith('/') && service != "colour") resource.prepend(docRoot);
+    if (!resource.startsWith('/') && service != "colour") {
+        resource.prepend(docRoot);
+        kDebug()<<"******************\nADJUSTED 2\n*************************";
+    }
     DocClipBase *missingClip = NULL;
     if (!resource.isEmpty()) {
         QList <DocClipBase *> list = m_doc->clipManager()->getClipByResource(resource);
index 5dcbd7e997385ac44266a879be77e27aa87d1e19..b7ea50dbeda36b1a84f5a041807944c15ee240c1 100644 (file)
@@ -100,6 +100,7 @@ private:
     KdenliveDoc *m_doc;
     int m_verticalZoom;
     QString m_documentErrors;
+    QLocale m_locale;
     void parseDocument(QDomDocument doc);
     int slotAddProjectTrack(int ix, QDomElement xml, bool locked, QDomNodeList producers);
     DocClipBase *getMissingProducer(const QString id) const;