diff --git a/data/effects/audiobalance.xml b/data/effects/audiobalance.xml index 7e0d7d455..d689b7376 100644 --- a/data/effects/audiobalance.xml +++ b/data/effects/audiobalance.xml @@ -1,9 +1,9 @@ Balance Adjust the left/right balance Dan Dennedy - + Balance diff --git a/data/effects/audiopan.xml b/data/effects/audiopan.xml index 1cd01d1df..723ee38e0 100644 --- a/data/effects/audiopan.xml +++ b/data/effects/audiopan.xml @@ -1,13 +1,13 @@ Pan Adjust the left/right spread of a channel Dan Dennedy Left,Right Channel - + Pan diff --git a/data/effects/boxblur.xml b/data/effects/boxblur.xml index 761388e11..a80b8006b 100644 --- a/data/effects/boxblur.xml +++ b/data/effects/boxblur.xml @@ -1,15 +1,15 @@ Box Blur Box blur (separate horizontal and vertical blur) Leny Grisel - + Horizontal multiplicator - + Vertical multiplicator - - Blur factor - + + Blur factor + diff --git a/data/effects/frei0r_3dflippo.xml b/data/effects/frei0r_3dflippo.xml index 7a9f2c24c..848a0588e 100644 --- a/data/effects/frei0r_3dflippo.xml +++ b/data/effects/frei0r_3dflippo.xml @@ -1,39 +1,39 @@ 3dflippo Frame rotation in 3D space c.e. prelz AS FLUIDO - + X axis rotation - + Y axis rotation - + Z axis rotation - + X axis rotation rate - + Y axis rotation rate - + Z axis rotation rate - + Center position (X) - + Center position (Y) Invert rotation assignment Don't blank mask Fill with image or black diff --git a/data/effects/frei0r_alpha0ps.xml b/data/effects/frei0r_alpha0ps.xml index 33811c042..e4e748aaf 100644 --- a/data/effects/frei0r_alpha0ps.xml +++ b/data/effects/frei0r_alpha0ps.xml @@ -1,66 +1,66 @@ Alpha operations Display and manipulation of the alpha channel Marko Cebokli Image,Alpha as gray,Gray + red,Selection on black,Selection on gray,Selection on white,Selection on checkers Display Display input alpha NO OP,Shave,Shrink hard,Shrink soft,Grow hard,Grow soft,Threshold Operation - + Threshold - + Shrink/grow amount Invert Alpha operations Display and manipulation of the alpha channel Marko Cebokli Image,Alpha as gray,Gray + red,Selection on black,Selection on gray,Selection on white,Selection on checkers Display Display input alpha NO OP,Shave,Shrink hard,Shrink soft,Grow hard,Grow soft,Threshold,Blur Operation - + Threshold - + Shrink/Grow/Blur amount Invert diff --git a/data/effects/frei0r_alphagrad.xml b/data/effects/frei0r_alphagrad.xml index d8fef3081..653914918 100644 --- a/data/effects/frei0r_alphagrad.xml +++ b/data/effects/frei0r_alphagrad.xml @@ -1,31 +1,33 @@ Alpha gradient Fill the alpha channel with a specified gradient Marko Cebokli - + + Position - + Transition width - + Tilt - + Min - + Max Write on clear,Max,Min,Add,Subtract Operation + diff --git a/data/effects/frei0r_alphaspot.xml b/data/effects/frei0r_alphaspot.xml index 463beda6e..75cebc45a 100644 --- a/data/effects/frei0r_alphaspot.xml +++ b/data/effects/frei0r_alphaspot.xml @@ -1,49 +1,50 @@ Alpha shapes Draws simple shapes into the alpha channel Marko Cebokli + Rectangle,Ellipse,Triangle,Diamond Shape - + Position X - + Position Y - + Size X - + Size Y - + Tilt - + Transition width - + Min - + Max Write on clear,Max,Min,Add,Subtract Operation diff --git a/data/effects/frei0r_balanc0r.xml b/data/effects/frei0r_balanc0r.xml index 226d888e5..2ff3f3a88 100644 --- a/data/effects/frei0r_balanc0r.xml +++ b/data/effects/frei0r_balanc0r.xml @@ -1,25 +1,25 @@ White Balance Adjust the white balance / color temperature Dan Dennedy Neutral Color - + Green Tint White Balance Adjust the white balance / color temperature Dan Dennedy Neutral Color - + Green Tint diff --git a/data/effects/frei0r_bezier_curves.xml b/data/effects/frei0r_bezier_curves.xml index bfa38147e..e87f1a668 100644 --- a/data/effects/frei0r_bezier_curves.xml +++ b/data/effects/frei0r_bezier_curves.xml @@ -1,17 +1,18 @@ Bézier Curves Color curves adjustment Till Theato, Maksim Golovkin RGB,Red,Green,Blue,Alpha,Luma,Hue,Saturation Channel - + + Rec. 601,Rec. 709 Luma formula - + diff --git a/data/effects/frei0r_brightness.xml b/data/effects/frei0r_brightness.xml index 397c06976..ac435cd6f 100644 --- a/data/effects/frei0r_brightness.xml +++ b/data/effects/frei0r_brightness.xml @@ -1,9 +1,9 @@ Brightness Adjusts the brightness of a source image Jean-Sebastien Senecal - + Brightness diff --git a/data/effects/frei0r_c0rners.xml b/data/effects/frei0r_c0rners.xml index e00e1efd1..822a82204 100644 --- a/data/effects/frei0r_c0rners.xml +++ b/data/effects/frei0r_c0rners.xml @@ -1,69 +1,71 @@ - Corners - Four corners geometry engine - Marko Cebokli - - - Corner 1 X - - - - Corner 1 Y - - - - Corner 2 X - - - - Corner 2 Y - - - - Corner 3 X - - - - Corner 3 Y - - - - Corner 4 X - - - - Corner 4 Y - - - - Stretch X - - - - Stretch Y - - - - Feather Alpha - + Corners + Four corners geometry engine + Marko Cebokli + + + Corner 1 X + + + + Corner 1 Y + + + + Corner 2 X + + + + Corner 2 Y + + + + Corner 3 X + + + + Corner 3 Y + + + + Corner 4 X + + + + Corner 4 Y + + + + Stretch X + + + + Stretch Y + + + + Feather Alpha + + + + Enable Stretch + + + + Nearest neighbor,Bilinear,Bicubic smooth,Bicubic sharp,Spline 4x4,Spline 6x6,Lanczos + Interpolator + - - Enable Stretch - + + Transparent Background + - - Nearest neighbor,Bilinear,Bicubic smooth,Bicubic sharp,Spline 4x4,Spline 6x6,Lanczos - Interpolator - + + Write on clear,Maximum,Minimum,Add,Subtract + Alpha operation + - - Transparent Background - - - Write on clear,Maximum,Minimum,Add,Subtract - Alpha operation - diff --git a/data/effects/frei0r_cartoon.xml b/data/effects/frei0r_cartoon.xml index 42197a6e1..8eca157e4 100644 --- a/data/effects/frei0r_cartoon.xml +++ b/data/effects/frei0r_cartoon.xml @@ -1,25 +1,12 @@ - - + Cartoon Cartoonify video, do a form of edge detect Dries Pruimboom, Jaromil - + Level of trip - + Difference space - - - Cartoon - Cartoonify video, do a form of edge detect - Dries Pruimboom, Jaromil - - Level of trip - - - Difference space - - - + diff --git a/data/effects/frei0r_cluster.xml b/data/effects/frei0r_cluster.xml index f4e990ddf..221b958a2 100644 --- a/data/effects/frei0r_cluster.xml +++ b/data/effects/frei0r_cluster.xml @@ -1,12 +1,12 @@ K-Means Clustering Clusters of a source image by color and spatial distance binarymillenium - + Amount of clusters - + Weight on distance diff --git a/data/effects/frei0r_colgate.xml b/data/effects/frei0r_colgate.xml index 7dc29bd05..d752de654 100644 --- a/data/effects/frei0r_colgate.xml +++ b/data/effects/frei0r_colgate.xml @@ -1,14 +1,12 @@ White Balance (LMS space) - Do simple color correction, in a physically meaningful -way + Do simple color correction, in a physically meaningful way Steiner H. Gunderson Neutral Color - + Color Temperature diff --git a/data/effects/frei0r_coloradj_rgb.xml b/data/effects/frei0r_coloradj_rgb.xml index f8adceca1..e56448c96 100644 --- a/data/effects/frei0r_coloradj_rgb.xml +++ b/data/effects/frei0r_coloradj_rgb.xml @@ -1,37 +1,37 @@ RGB adjustment Simple color adjustment Marko Cebokli - + R - + G - + B Add constant,Change gamma,Multiply Action Keep luma Alpha controlled Rec. 601,Rec. 709 Luma formula diff --git a/data/effects/frei0r_contrast0r.xml b/data/effects/frei0r_contrast0r.xml index f1d871183..60da62ca9 100644 --- a/data/effects/frei0r_contrast0r.xml +++ b/data/effects/frei0r_contrast0r.xml @@ -1,9 +1,9 @@ Contrast Adjusts the contrast of a source image Jean-Sebastien Senecal - + Contrast diff --git a/data/effects/frei0r_curves.xml b/data/effects/frei0r_curves.xml index 0ae29c4f6..f98929174 100644 --- a/data/effects/frei0r_curves.xml +++ b/data/effects/frei0r_curves.xml @@ -1,117 +1,117 @@ Curves Color curves adjustment Maksim Golovkin Red,Green,Blue,Luma Channel - + Rec. 601,Rec. 709 Luma formula - + - + Number of curve points - + Point 1 input value - + Point 1 output value - + Point 2 input value - + Point 2 output value - + Point 3 input value - + Point 3 output value - + Point 4 input value - + Point 4 output value - + Point 5 input value - + Point 5 output value - + Show graph in picture - + Top Left,Top Right,Bottom Left,Bottom Right Graph position Curves Color curves adjustment Maksim Golovkin RGB,Red,Green,Blue,Alpha,Luma,Hue,Saturation Channel - + Rec. 601,Rec. 709 Luma formula - + - + - + Number of curve points - + Point 1 input value - + Point 1 output value - + Point 2 input value - + Point 2 output value - + Point 3 input value - + Point 3 output value - + Point 4 input value - + Point 4 output value - + Point 5 input value - + Point 5 output value - + Show graph in picture - + Top Left,Top Right,Bottom Left,Bottom Right Graph position diff --git a/data/effects/frei0r_defish0r.xml b/data/effects/frei0r_defish0r.xml index ad90a5828..9ed0dc1e2 100644 --- a/data/effects/frei0r_defish0r.xml +++ b/data/effects/frei0r_defish0r.xml @@ -1,34 +1,34 @@ Defish Non rectilinear lens mappings Marko Cebokli - + Amount DeFish - - Equidistant,Orthographic,Equiarea,Stereographic + + Equidistant,Orthographic,Equiarea,Stereographic Type - - Fill,Center,Fit,Manual + + Fill,Center,Fit,Manual Scaling - + Manual Scale - - Nearest neighbor,Bilinear,Bicubic smooth,Bicubic sharp,Spline 4x4,Spline 6x6,Lanczos + + Nearest neighbor,Bilinear,Bicubic smooth,Bicubic sharp,Spline 4x4,Spline 6x6,Lanczos Interpolator - - Square,PAL DV,NTSC DV,HDV,Manual + + Square,PAL DV,NTSC DV,HDV,Manual Aspect type - + Manual Aspect diff --git a/data/effects/frei0r_delay0r.xml b/data/effects/frei0r_delay0r.xml index 690348ea2..9048f4650 100644 --- a/data/effects/frei0r_delay0r.xml +++ b/data/effects/frei0r_delay0r.xml @@ -1,9 +1,9 @@ delay0r Video delay Martin Bayer - + Delay time diff --git a/data/effects/frei0r_distort0r.xml b/data/effects/frei0r_distort0r.xml index a7a930360..7b4b31567 100644 --- a/data/effects/frei0r_distort0r.xml +++ b/data/effects/frei0r_distort0r.xml @@ -1,12 +1,12 @@ Distort Plasma Gephex crew - + Amplitude - + Frequency diff --git a/data/effects/frei0r_edgeglow.xml b/data/effects/frei0r_edgeglow.xml index 2333a09e4..88ea7918d 100644 --- a/data/effects/frei0r_edgeglow.xml +++ b/data/effects/frei0r_edgeglow.xml @@ -1,15 +1,15 @@ Edge glow Edge glow filter Salsaman - + Edge lightening threshold - + Edge brightness upscaling multiplier - + Non-edge brightness downscaling multiplier diff --git a/data/effects/frei0r_facebl0r.xml b/data/effects/frei0r_facebl0r.xml index 39d3db419..c6e63415d 100644 --- a/data/effects/frei0r_facebl0r.xml +++ b/data/effects/frei0r_facebl0r.xml @@ -1,37 +1,37 @@ Face blur Automatically detect and blur a face using OpenCV ZioKernel, Biilly, Jilt, Jaromil, Dan Dennedy - + Search scale The search window scale factor. For example, 120 = 1.20 = increases by 20% on each pass. - + Neighbors Minimum number of rectangles that determines an object. - + Smallest The minimum window size in pixels. - + Largest The largest size face in pixels - both horizontally and vertically (square window). - + Recheck How often to detect a face. In between checks, it does object motion tracking. Show ellipse Draw a blue ellipse around the face area? diff --git a/data/effects/frei0r_facedetect.xml b/data/effects/frei0r_facedetect.xml index 3bfe379d2..08f894ec9 100644 --- a/data/effects/frei0r_facedetect.xml +++ b/data/effects/frei0r_facedetect.xml @@ -1,74 +1,74 @@ Face detect Detect faces and draw shapes on them using OpenCV binarymillenium, Dan Dennedy - + Search scale The search window scale factor. For example, 120 = 1.20 = increases by 20% on each pass. - + Neighbors Minimum number of rectangles that determines an object. - + Smallest The minimum window size in pixels. - + Recheck How often to detect a face. In between checks, it does object motion tracking. circle,ellipse,rectangle,random Shape - + Stroke width 0 means fill; otherwise, draw unfilled with a stroke width of this size. - + Alpha Set the alpha channel of the shape area to a percentage of fully opaque. Antialias Draw with anti-aliasing? diff --git a/data/effects/frei0r_glow.xml b/data/effects/frei0r_glow.xml index 4d275f30b..b0c0481dd 100644 --- a/data/effects/frei0r_glow.xml +++ b/data/effects/frei0r_glow.xml @@ -1,9 +1,9 @@ Glow Creates a Glamorous Glow Richard Spindler - + Blur diff --git a/data/effects/frei0r_hqdn3d.xml b/data/effects/frei0r_hqdn3d.xml index 0a6494eeb..0420928c7 100644 --- a/data/effects/frei0r_hqdn3d.xml +++ b/data/effects/frei0r_hqdn3d.xml @@ -1,14 +1,16 @@ Denoiser High quality 3D denoiser Marko Cebokli, Daniel Moreno - + + Spatial Amount of spatial filtering - + + Temporal Amount of temporal filtering diff --git a/data/effects/frei0r_hueshift0r.xml b/data/effects/frei0r_hueshift0r.xml index a74d05efb..6932d72b1 100644 --- a/data/effects/frei0r_hueshift0r.xml +++ b/data/effects/frei0r_hueshift0r.xml @@ -1,9 +1,9 @@ Hue shift Shifts the hue of a source image Jean-Sebastien Senecal - + Hue diff --git a/data/effects/frei0r_iirblur.xml b/data/effects/frei0r_iirblur.xml index 6ff3ee63d..a919e15ac 100644 --- a/data/effects/frei0r_iirblur.xml +++ b/data/effects/frei0r_iirblur.xml @@ -1,21 +1,23 @@ Blur Blur using 2D IIR filters (Exponential, Lowpass, Gaussian) Marko Cebokli - + + Amount Amount of blur - + + Exponential,Lowpass,Gaussian Type Select blurring algorithm Edge Enable edge compensation diff --git a/data/effects/frei0r_keyspillm0pup.xml b/data/effects/frei0r_keyspillm0pup.xml index 3ca32b307..a9698cff2 100644 --- a/data/effects/frei0r_keyspillm0pup.xml +++ b/data/effects/frei0r_keyspillm0pup.xml @@ -1,61 +1,61 @@ Key Spill Mop Up Reduces the visibility of key color spill in chroma keying Marko Cebokli Key color Target color Color distance, Transparency, Edge inwards, Edge outwards Mask type - + Tolerance - + Slope - + Hue gate - + Saturation threshold None, De-Key, Target, Desaturate, Luma adjust Operation 1 - + Amount 1 None, De-Key, Target, Desaturate, Luma adjust Operation 2 - + Amount 2 Show mask Mask to Alpha diff --git a/data/effects/frei0r_lenscorrection.xml b/data/effects/frei0r_lenscorrection.xml index a0a416f9b..767ebb76c 100644 --- a/data/effects/frei0r_lenscorrection.xml +++ b/data/effects/frei0r_lenscorrection.xml @@ -1,22 +1,22 @@ Lens Correction Allows compensation of lens distortion Richard Spindler - + Horizontal center - + Vertical center - + Center correction - + Edges correction - + Brightness diff --git a/data/effects/frei0r_letterb0xed.xml b/data/effects/frei0r_letterb0xed.xml index 4f3ad47d4..9cc1653ba 100644 --- a/data/effects/frei0r_letterb0xed.xml +++ b/data/effects/frei0r_letterb0xed.xml @@ -1,12 +1,12 @@ LetterB0xed Adds black borders at top and bottom for cinema look Richard Spindler - + Border Width Transparency diff --git a/data/effects/frei0r_levels.xml b/data/effects/frei0r_levels.xml index c9a05079a..238a40b20 100644 --- a/data/effects/frei0r_levels.xml +++ b/data/effects/frei0r_levels.xml @@ -1,66 +1,67 @@ Levels Adjust levels Maksim Golovkin - - Red,Green,Blue,Luma - Channel + + + Red,Green,Blue,Luma + Channel - + Input black level - + Input white level - + Gamma - + Black output - + White output Show histogram Top Left,Top Right,Bottom Left,Bottom Right Histogram position - + Levels Adjust levels Maksim Golovkin Red,Green,Blue,Luma Channel - + Input black level - + Input white level - + Gamma - + Black output - + White output Show histogram Top Left,Top Right,Bottom Left,Bottom Right Histogram position diff --git a/data/effects/frei0r_lightgraffiti.xml b/data/effects/frei0r_lightgraffiti.xml index acf331e21..953e81897 100644 --- a/data/effects/frei0r_lightgraffiti.xml +++ b/data/effects/frei0r_lightgraffiti.xml @@ -1,148 +1,148 @@ Light Graffiti Light Graffiti effect. Simon A. Eugster (Granjow) - + Brightness Threshold R+G+B) does a pixel need to be in order to be recognized as a light source?
Increasing this threshold requires brighter light sources (i.e. more white or less color, respectively) but prevents some «false alarms» where semi-bright parts, e.g. hands where colors can change quite a lot compared to the background, are incorrectly recognized as light source.]]>
- + Difference Threshold max(dR, dG, dB)), in order to be recognized as light source?
Increasing this threshold makes it harder for light sources to be accepted on bright backgrounds, but decreases the danger of noise or generally bright spots counting as light source.]]>
- + Difference Sum Threshold relative to the background image (dR + dG + dB) have to change until a pixel is recognized as a light source?
Raising this value might, in some cases, avoid that some light objects lit by the light source are added to the light mask.]]>
- + Sensitivity For slowly moving light source try to use a lower sensitivity to obtain a better exposure.]]> - + Lower Overexposure The light mask does not get white immediately when the light source is moving slowly or staying steady.]]> - + Dimming Dims the light mask. Lights will leave a fainting trail if it is set to a value > 0. - + Background Weight Strength of the (calculated) background image. Setting it to 100 paints the light mask directly over the background, without the painting person in the image if the video starts with a «clean» background image. (See the α parameter.) - + α The Light Graffiti effect remembers the first frame of the clip it is applied to, so the clip should always start with the painter outside of the video. If the background constantly changes, e.g. on a street, try to set α > 0 to calculate an average background image.]]> - + Saturation Increases the saturation of lights. Show brightness statistics Example: To adjust the brightness threshold, check this box and adjust the threshold until the whole light source is highlighted. Repeat the same with the other parameters. Only parts that are highlighted in all thresholds will count as light source.]]> Show background difference statistics Show background difference sum statistics Transparent Background Makes the background transparent, allowing to apply a composite effect and paint the light mask over a completely different video. Nonlinear dimming If normal dimming does not look natural enough, try this one. Reset Resets the light mask and the background image. This is necessary e.g. if you apply this effect to a clip in the timeline and then move the timeline cursor from outside of the clip to the middle of it. The effect receives this frame in the middle as first frame and uses it as background image. For proper threshold adjusting move the timeline cursor to the beginning of the clip, check the Reset box and uncheck it again.
Light Graffiti Light Graffiti effect. Simon A. Eugster (Granjow) - + Brightness Threshold R+G+B) does a pixel need to be in order to be recognized as a light source?
Increasing this threshold requires brighter light sources (i.e. more white or less color, respectively) but prevents some «false alarms» where semi-bright parts, e.g. hands where colors can change quite a lot compared to the background, are incorrectly recognized as light source.]]>
- + Difference Threshold max(dR, dG, dB)), in order to be recognized as light source?
Increasing this threshold makes it harder for light sources to be accepted on bright backgrounds, but decreases the danger of noise or generally bright spots counting as light source.]]>
- + Difference Sum Threshold relative to the background image (dR + dG + dB) have to change until a pixel is recognized as a light source?
Raising this value might, in some cases, avoid that some light objects lit by the light source are added to the light mask.]]>
- + Sensitivity For slowly moving light source try to use a lower sensitivity to obtain a better exposure.]]> - + Lower Overexposure The light mask does not get white immediately when the light source is moving slowly or staying steady.]]> - + Dimming Dims the light mask. Lights will leave a fainting trail if it is set to a value > 0. - + Background Weight Strength of the (calculated) background image. Setting it to 100 paints the light mask directly over the background, without the painting person in the image if the video starts with a «clean» background image. (See the α parameter.) - + α The Light Graffiti effect remembers the first frame of the clip it is applied to, so the clip should always start with the painter outside of the video. If the background constantly changes, e.g. on a street, try to set α > 0 to calculate an average background image.]]> - + Saturation Increases the saturation of lights. Show brightness statistics Example: To adjust the brightness threshold, check this box and adjust the threshold until the whole light source is highlighted. Repeat the same with the other parameters. Only parts that are highlighted in all thresholds will count as light source.]]> Show background difference statistics Show background difference sum statistics Transparent Background Makes the background transparent, allowing to apply a composite effect and paint the light mask over a completely different video. Nonlinear dimming If normal dimming does not look natural enough, try this one. Reset Resets the light mask and the background image. This is necessary e.g. if you apply this effect to a clip in the timeline and then move the timeline cursor from outside of the clip to the middle of it. The effect receives this frame in the middle as first frame and uses it as background image. For proper threshold adjusting move the timeline cursor to the beginning of the clip, check the Reset box and uncheck it again.
diff --git a/data/effects/frei0r_mask0mate.xml b/data/effects/frei0r_mask0mate.xml index 26ca6eec6..0451b487d 100644 --- a/data/effects/frei0r_mask0mate.xml +++ b/data/effects/frei0r_mask0mate.xml @@ -1,24 +1,24 @@ Rectangular Alpha mask Creates an square alpha-channel mask Richard Spindler - + Left - + Right - + Top - + Bottom Invert - + Blur diff --git a/data/effects/frei0r_medians.xml b/data/effects/frei0r_medians.xml index 51f2d52fd..6fbee2859 100644 --- a/data/effects/frei0r_medians.xml +++ b/data/effects/frei0r_medians.xml @@ -1,17 +1,17 @@ Medians Implements several median-type filters Marko Cebokli Cross5,Square3x3,Bilevel,Diamond3x3,Square5x5,Temp3,Temp5,ArceBI,ML3D,ML3dEX,VarSize Type - + Size diff --git a/data/effects/frei0r_nosync0r.xml b/data/effects/frei0r_nosync0r.xml index 8e2d4cb86..382a66dfe 100644 --- a/data/effects/frei0r_nosync0r.xml +++ b/data/effects/frei0r_nosync0r.xml @@ -1,9 +1,9 @@ nosync0r Broken TV Martin Bayer - + HSync diff --git a/data/effects/frei0r_pixeliz0r.xml b/data/effects/frei0r_pixeliz0r.xml index ab59583d6..f250d6503 100644 --- a/data/effects/frei0r_pixeliz0r.xml +++ b/data/effects/frei0r_pixeliz0r.xml @@ -1,12 +1,12 @@ Pixelize Pixelize input image. Gephex crew - + Block Size X - + Block Size Y diff --git a/data/effects/frei0r_pr0be.xml b/data/effects/frei0r_pr0be.xml index 9f0717fe0..9990da337 100644 --- a/data/effects/frei0r_pr0be.xml +++ b/data/effects/frei0r_pr0be.xml @@ -1,40 +1,40 @@ Video values Measure video values Marko Cebokli RGB,Y'PbPr - rec. 601,Y'PbPr - rec. 709,HSV,HSL Measurement - + X - + Y - + X size - + Y size 256 scale Show alpha Big window diff --git a/data/effects/frei0r_pr0file.xml b/data/effects/frei0r_pr0file.xml index 5f1fa3fde..b35e5a489 100644 --- a/data/effects/frei0r_pr0file.xml +++ b/data/effects/frei0r_pr0file.xml @@ -1,93 +1,93 @@ Oscilloscope 2D video oscilloscope Marko Cebokli - + X - + Y - + Tilt - + Length R,G,B,Y',Pr,Pb,Alpha Channel - + Marker 1 - + Marker 2 R trace G trace B trace Y trace Pr trace Pb trace Alpha trace Display average Display RMS Display minimum Display maximum 256 scale CCIR rec. 601,CCIR rec. 709 Color - + Crosshair color diff --git a/data/effects/frei0r_primaries.xml b/data/effects/frei0r_primaries.xml index 88e4c30af..c6215ed93 100644 --- a/data/effects/frei0r_primaries.xml +++ b/data/effects/frei0r_primaries.xml @@ -1,10 +1,10 @@ Primaries Reduce image to primary colors Hedde Bosman - + Factor 32 = 0]]> diff --git a/data/effects/frei0r_saturat0r.xml b/data/effects/frei0r_saturat0r.xml index d5c08031c..b2de7e49c 100644 --- a/data/effects/frei0r_saturat0r.xml +++ b/data/effects/frei0r_saturat0r.xml @@ -1,9 +1,9 @@ Saturation Adjusts the saturation of a source image Jean-Sebastien Senecal - + Saturation diff --git a/data/effects/frei0r_scale0tilt.xml b/data/effects/frei0r_scale0tilt.xml index 7d72e5f3b..12be4ebfe 100644 --- a/data/effects/frei0r_scale0tilt.xml +++ b/data/effects/frei0r_scale0tilt.xml @@ -1,30 +1,30 @@ Crop, Scale and Tilt Scales, Tilts and Crops an Image Richard Spindler - + Crop left - + Crop right - + Crop top - + Crop bottom - + Scale X - + Scale Y - + Tilt X - + Tilt Y diff --git a/data/effects/frei0r_select0r.xml b/data/effects/frei0r_select0r.xml index 339ad9098..2b8b348a4 100644 --- a/data/effects/frei0r_select0r.xml +++ b/data/effects/frei0r_select0r.xml @@ -1,99 +1,99 @@ - Chroma-key + Color Selection Color based alpha selection Marko Cebokli Color to select Invert selection - + Delta R / A / Hue - + Delta G / B / Chroma - + Delta B / I / I RGB,ABI,HCI Selection subspace Box,Ellipsoid,Diamond Subspace shape Hard,Fat,Normal,Skinny Edge mode Write on clear,Max,Min,Add,Subtract Operation Color Selection Color based alpha selection Marko Cebokli Color to select Invert selection RGB,ABI,HCI Selection subspace Box,Ellipsoid,Diamond Subspace shape Hard,Fat,Normal,Skinny,Slope Edge mode - + Delta R / A / Hue - + Delta G / B / Chroma - + Delta B / I / I - + Slope Write on clear,Max,Min,Add,Subtract Operation diff --git a/data/effects/frei0r_sharpness.xml b/data/effects/frei0r_sharpness.xml index a0a1ea9ed..253983bd2 100644 --- a/data/effects/frei0r_sharpness.xml +++ b/data/effects/frei0r_sharpness.xml @@ -1,15 +1,15 @@ Sharpen Unsharp masking (port from Mplayer) Marko Cebokli, Remi Guyomarch - + Amount - + Size diff --git a/data/effects/frei0r_sopsat.xml b/data/effects/frei0r_sopsat.xml index f4a9c1e3a..ed4f34026 100644 --- a/data/effects/frei0r_sopsat.xml +++ b/data/effects/frei0r_sopsat.xml @@ -1,112 +1,112 @@ SOP/Sat Changes Slope, Offset, and Power of the color components, and the overall Saturation, according to the ASC CDL (Color Decision List). Simon A. Eugster (Granjow) - + Slope Red All effects can be observed well when applied on a greyscale gradient and looking at the RGB Parade monitor.]]> - + Slope Green - + Slope Blue - + Slope Alpha - + Offset Red Changing the offset lifts (or lowers) the brightness of each pixel by the given value. - + Offset Green - + Offset Blue - + Offset Alpha - + Power Red Mathematically, what happens is an exponentiation of the pixel brightness on [0,1] by the gamma value.]]> - + Power Green - + Power Blue - + Power Alpha - + Overall Saturation The overall saturation will be changed in the last step of this filter. SOP/Sat Changes Slope, Offset, and Power of the color components, and the overall Saturation, according to the ASC CDL (Color Decision List). Simon A. Eugster (Granjow) - + Slope Red All effects can be observed well when applied on a greyscale gradient and looking at the RGB Parade monitor.]]> - + Slope Green - + Slope Blue - + Slope Alpha - + Offset Red Changing the offset lifts (or lowers) the brightness of each pixel by the given value. - + Offset Green - + Offset Blue - + Offset Alpha - + Power Red Mathematically, what happens is an exponentiation of the pixel brightness on [0,1] by the gamma value.]]> - + Power Green - + Power Blue - + Power Alpha - + Overall Saturation The overall saturation will be changed in the last step of this filter. diff --git a/data/effects/frei0r_squareblur.xml b/data/effects/frei0r_squareblur.xml index 1c0c3be32..26e8fa3dc 100644 --- a/data/effects/frei0r_squareblur.xml +++ b/data/effects/frei0r_squareblur.xml @@ -1,9 +1,9 @@ Square Blur Square blur Drone - + Kernel size diff --git a/data/effects/frei0r_tehroxx0r.xml b/data/effects/frei0r_tehroxx0r.xml index cc47c7fdf..d55b94ee4 100644 --- a/data/effects/frei0r_tehroxx0r.xml +++ b/data/effects/frei0r_tehroxx0r.xml @@ -1,9 +1,9 @@ TehRoxx0r Something videowall-ish Coma - + Interval diff --git a/data/effects/frei0r_threshold0r.xml b/data/effects/frei0r_threshold0r.xml index 96fe812a7..42c3e5662 100644 --- a/data/effects/frei0r_threshold0r.xml +++ b/data/effects/frei0r_threshold0r.xml @@ -1,9 +1,9 @@ Threshold Thresholds a source image Jean-Sebastien Senecal - + Threshold diff --git a/data/effects/frei0r_timeout.xml b/data/effects/frei0r_timeout.xml index 3b1683371..6b3c6abcf 100644 --- a/data/effects/frei0r_timeout.xml +++ b/data/effects/frei0r_timeout.xml @@ -1,16 +1,16 @@ Timeout indicator Simon A. Eugster (Granjow) Indicator color - + Time - + Transparency diff --git a/data/effects/frei0r_tint0r.xml b/data/effects/frei0r_tint0r.xml index 102a3cc7b..5246d1265 100644 --- a/data/effects/frei0r_tint0r.xml +++ b/data/effects/frei0r_tint0r.xml @@ -1,15 +1,15 @@ Tint Maps source image luminance between two colors specified Maksim Golovkin Map black to Map white to - + Tint amount diff --git a/data/effects/frei0r_vertigo.xml b/data/effects/frei0r_vertigo.xml index 32e39d6dd..2c7b176ea 100644 --- a/data/effects/frei0r_vertigo.xml +++ b/data/effects/frei0r_vertigo.xml @@ -1,25 +1,25 @@ Vertigo Alpha blending with zoomed and rotated images Fukuchi Kentarou - + Phase Increment - + Zoom Rate Vertigo Alpha blending with zoomed and rotated images Fukuchi Kentarou - + Phase Increment - + Zoom Rate diff --git a/data/effects/frei0r_vignette.xml b/data/effects/frei0r_vignette.xml index d18cc8c6f..28814b2c2 100644 --- a/data/effects/frei0r_vignette.xml +++ b/data/effects/frei0r_vignette.xml @@ -1,15 +1,15 @@ Vignette Natural lens vignetting effect Simon A. Eugster (Granjow) - + Aspect ratio - + Clear center size - + Softness diff --git a/data/effects/gain.xml b/data/effects/gain.xml index 21f0af5ed..38d9f9800 100644 --- a/data/effects/gain.xml +++ b/data/effects/gain.xml @@ -1,9 +1,9 @@ - Gain - Adjust the audio volume without keyframes - Dan Dennedy - - Gain - + Gain + Adjust the audio volume without keyframes + Dan Dennedy + + Gain + diff --git a/data/effects/ladspa_limiter.xml b/data/effects/ladspa_limiter.xml index 849a2409f..23663b101 100644 --- a/data/effects/ladspa_limiter.xml +++ b/data/effects/ladspa_limiter.xml @@ -1,15 +1,15 @@ Limiter LADSPA limiter audio effect http://www.ladspa.org Input gain (dB) Limit (dB) - + Release time (s) diff --git a/data/effects/ladspa_phaser.xml b/data/effects/ladspa_phaser.xml index af324e902..ab4b1d4d9 100644 --- a/data/effects/ladspa_phaser.xml +++ b/data/effects/ladspa_phaser.xml @@ -1,19 +1,19 @@ Phaser LADSPA phaser audio effect http://www.ladspa.org Rate (Hz) - + Depth Feedback - + Spread diff --git a/data/effects/ladspa_pitch.xml b/data/effects/ladspa_pitch.xml index 52be8fd50..682b7252d 100644 --- a/data/effects/ladspa_pitch.xml +++ b/data/effects/ladspa_pitch.xml @@ -1,9 +1,9 @@ Pitch Shift LADSPA change pitch audio effect http://www.ladspa.org - + Shift \ No newline at end of file diff --git a/data/effects/ladspa_pitch_scale.xml b/data/effects/ladspa_pitch_scale.xml index dff80fe1a..e71307775 100644 --- a/data/effects/ladspa_pitch_scale.xml +++ b/data/effects/ladspa_pitch_scale.xml @@ -1,9 +1,9 @@ Pitch Scaler LADSPA pitch scale audio effect http://www.ladspa.org - + Co-efficient diff --git a/data/effects/ladspa_rate_scale.xml b/data/effects/ladspa_rate_scale.xml index 66eb2c251..0aec3e8a3 100644 --- a/data/effects/ladspa_rate_scale.xml +++ b/data/effects/ladspa_rate_scale.xml @@ -1,10 +1,10 @@ Rate Scaler LADSPA rate scale audio effect http://www.ladspa.org - + Rate diff --git a/data/effects/ladspa_reverb.xml b/data/effects/ladspa_reverb.xml index c70410445..1c0f4eea5 100644 --- a/data/effects/ladspa_reverb.xml +++ b/data/effects/ladspa_reverb.xml @@ -1,12 +1,12 @@ Reverb LADSPA reverb audio effect http://www.ladspa.org - + Reverb time - + Damping diff --git a/data/effects/ladspa_room_reverb.xml b/data/effects/ladspa_room_reverb.xml index d1b7e5f77..c9e1d8c61 100644 --- a/data/effects/ladspa_room_reverb.xml +++ b/data/effects/ladspa_room_reverb.xml @@ -1,15 +1,15 @@ Room Reverb LADSPA room reverb audio effect http://www.ladspa.org Room size (m) - + Delay (s/10) - + Damping diff --git a/data/effects/lift_gamma_gain.xml b/data/effects/lift_gamma_gain.xml index 84b13ce6b..6a56b5034 100644 --- a/data/effects/lift_gamma_gain.xml +++ b/data/effects/lift_gamma_gain.xml @@ -1,32 +1,32 @@ Lift/gamma/gain Brian Matherly Lift: Red - + Lift: Green - + Lift: Blue - + Gamma: Red - + Gamma: Green - + Gamma: Blue - + Gain: Red - + Gain: Green - + Gain: Blue diff --git a/data/effects/movit_deconvolution_sharpen.xml b/data/effects/movit_deconvolution_sharpen.xml index c76b64448..2e82208db 100644 --- a/data/effects/movit_deconvolution_sharpen.xml +++ b/data/effects/movit_deconvolution_sharpen.xml @@ -1,20 +1,20 @@ Deconvolution sharpen (GPU) Steinar H. Gunderson - + Matrix size Circle radius Gaussian radius Correlation Noise diff --git a/data/effects/movit_lift_gamma_gain.xml b/data/effects/movit_lift_gamma_gain.xml index 85aa83fb7..d7bc469f2 100644 --- a/data/effects/movit_lift_gamma_gain.xml +++ b/data/effects/movit_lift_gamma_gain.xml @@ -1,32 +1,32 @@ Lift/gamma/gain (GPU) Steinar H. Gunderson Lift: Red - + Lift: Green - + Lift: Blue - + Gamma: Red - + Gamma: Green - + Gamma: Blue - + Gain: Red - + Gain: Green - + Gain: Blue diff --git a/data/effects/movit_lift_gamma_gain2.xml b/data/effects/movit_lift_gamma_gain2.xml index fd645876f..861ccd850 100644 --- a/data/effects/movit_lift_gamma_gain2.xml +++ b/data/effects/movit_lift_gamma_gain2.xml @@ -1,32 +1,32 @@ Movit: Lift/gamma/gain (colors) Steinar H. Gunderson - + Lift: Red - + Lift: Green - + Lift: Blue - + Gamma: Red - + Gamma: Green - + Gamma: Blue - + Gain: Red - + Gain: Green - + Gain: Blue diff --git a/data/effects/movit_white_balance.xml b/data/effects/movit_white_balance.xml index d5913b1ea..b3a13e5fb 100644 --- a/data/effects/movit_white_balance.xml +++ b/data/effects/movit_white_balance.xml @@ -1,12 +1,12 @@ White Balance (GPU) Steinar H. Gunderson Neutral Color - + Color Temperature diff --git a/data/effects/pan_zoom.xml b/data/effects/pan_zoom.xml index cf3841606..b61d59c1e 100644 --- a/data/effects/pan_zoom.xml +++ b/data/effects/pan_zoom.xml @@ -1,18 +1,18 @@ Position and Zoom Adjust size and position of clip Charles Yates Rectangle - - Distort - - - Normalise - + + Distort + + + Normalise + Background Color diff --git a/data/effects/qtblend.xml b/data/effects/qtblend.xml index 158446dc3..8049a6161 100644 --- a/data/effects/qtblend.xml +++ b/data/effects/qtblend.xml @@ -1,44 +1,44 @@ Transform Position, scale and opacity. Jean-Baptiste Mardelle Rectangle Rotation Alpha blend,Xor,Plus,Multiply,Screen,Overlay,Darken,Lighten,Color dodge,Color burn,Hard light,Soft light,Difference,Exclusion,Bitwise or,Bitwise and,Bitwise xor,Bitwise nor,Bitwise nand,Bitwise not xor,Destination in,Destination out Compositing Distort Transform Position, scale and opacity. Jean-Baptiste Mardelle Rectangle - + Rotation Alpha blend,Xor,Plus,Multiply,Screen,Overlay,Darken,Lighten,Color dodge,Color burn,Hard light,Soft light,Difference,Exclusion,Bitwise or,Bitwise and,Bitwise xor,Bitwise nor,Bitwise nand,Bitwise not xor,Destination in,Destination out Compositing Distort Rotate from center diff --git a/data/effects/rotoscoping.xml b/data/effects/rotoscoping.xml index c77b07ac7..b3ff1d63a 100644 --- a/data/effects/rotoscoping.xml +++ b/data/effects/rotoscoping.xml @@ -1,32 +1,33 @@ Rotoscoping Keyframable vector based rotoscoping Till Theato + Alpha,Luma,RGB Mode Write on clear,Maximum,Minimum,Add,Subtract Alpha Operation Invert Feather width Feathering passes diff --git a/data/effects/sox_echo.xml b/data/effects/sox_echo.xml index a9780861b..a35210c02 100644 --- a/data/effects/sox_echo.xml +++ b/data/effects/sox_echo.xml @@ -1,18 +1,18 @@ Sox Echo Sox echo audio effect http://sox.sourceforge.net - + Gain In - + Gain Out Delay - + Decay diff --git a/data/effects/sox_flanger.xml b/data/effects/sox_flanger.xml index 515b3d43e..0138eb4fa 100644 --- a/data/effects/sox_flanger.xml +++ b/data/effects/sox_flanger.xml @@ -1,30 +1,30 @@ Sox Flanger Sox flanger audio effect http://sox.sourceforge.net Delay Depth Regeneration Width - + Speed Shape Phase Interpolation diff --git a/data/effects/sox_phaser.xml b/data/effects/sox_phaser.xml index f0fc204e6..3308eca25 100644 --- a/data/effects/sox_phaser.xml +++ b/data/effects/sox_phaser.xml @@ -1,21 +1,21 @@ Sox Phaser Sox phaser audio effect http://sox.sourceforge.net - + Gain In - + Gain Out Delay - + Decay - + Speed diff --git a/data/effects/sox_stretch.xml b/data/effects/sox_stretch.xml index 2b2c777e5..fb072228d 100644 --- a/data/effects/sox_stretch.xml +++ b/data/effects/sox_stretch.xml @@ -1,12 +1,12 @@ Sox Stretch Sox stretch audio effect http://sox.sourceforge.net - + Factor Window diff --git a/data/effects/speed.xml b/data/effects/speed.xml index c09bb93ab..00971e5fb 100644 --- a/data/effects/speed.xml +++ b/data/effects/speed.xml @@ -1,9 +1,9 @@ Speed Make clip play faster or slower Brian Matherly - + Speed diff --git a/data/effects/vignette.xml b/data/effects/vignette.xml index 3ded174e1..ae6003d90 100644 --- a/data/effects/vignette.xml +++ b/data/effects/vignette.xml @@ -1,24 +1,24 @@ Vignette Effect Adjustable Vignette Marco Gittler - + smooth - + radius - + x - + y opacity use cos instead of linear diff --git a/data/effects/volume.xml b/data/effects/volume.xml index 5393daf5e..c0bfb75c0 100644 --- a/data/effects/volume.xml +++ b/data/effects/volume.xml @@ -1,9 +1,9 @@ Volume (keyframable) Adjust audio volume with keyframes Dan Dennedy - + Gain diff --git a/data/effects/wave.xml b/data/effects/wave.xml index a0da2d4ca..6bdc3ef68 100644 --- a/data/effects/wave.xml +++ b/data/effects/wave.xml @@ -1,15 +1,15 @@ Wave Make waves on your clip with keyframes Leny Grisel - + Amplitude Horizontal Vertical diff --git a/src/assets/model/assetparametermodel.cpp b/src/assets/model/assetparametermodel.cpp index e3f9c5e87..d43ad2217 100644 --- a/src/assets/model/assetparametermodel.cpp +++ b/src/assets/model/assetparametermodel.cpp @@ -1,817 +1,811 @@ /*************************************************************************** * Copyright (C) 2017 by Nicolas Carion * * This file is part of Kdenlive. See www.kdenlive.org. * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) version 3 or any later version accepted by the * * membership of KDE e.V. (or its successor approved by the membership * * of KDE e.V.), which shall act as a proxy defined in Section 14 of * * version 3 of the license. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ***************************************************************************/ #include "assetparametermodel.hpp" #include "assets/keyframes/model/keyframemodellist.hpp" #include "core.h" #include "kdenlivesettings.h" #include "klocalizedstring.h" #include "profiles/profilemodel.hpp" #include #include #include #include #include AssetParameterModel::AssetParameterModel(std::unique_ptr asset, const QDomElement &assetXml, const QString &assetId, ObjectId ownerId, QObject *parent) : QAbstractListModel(parent) , monitorId(ownerId.first == ObjectType::BinClip ? Kdenlive::ClipMonitor : Kdenlive::ProjectMonitor) , m_assetId(assetId) , m_ownerId(ownerId) , m_asset(std::move(asset)) , m_keyframes(nullptr) { Q_ASSERT(m_asset->is_valid()); QDomNodeList nodeList = assetXml.elementsByTagName(QStringLiteral("parameter")); m_hideKeyframesByDefault = assetXml.hasAttribute(QStringLiteral("hideKeyframes")); bool needsLocaleConversion = false; QChar separator, oldSeparator; // Check locale, default effects xml has no LC_NUMERIC defined and always uses the C locale QLocale locale; if (assetXml.hasAttribute(QStringLiteral("LC_NUMERIC"))) { QLocale effectLocale = QLocale(assetXml.attribute(QStringLiteral("LC_NUMERIC"))); if (QLocale::c().decimalPoint() != effectLocale.decimalPoint()) { needsLocaleConversion = true; separator = QLocale::c().decimalPoint(); oldSeparator = effectLocale.decimalPoint(); } } qDebug() << "XML parsing of " << assetId << ". found : " << nodeList.count(); for (int i = 0; i < nodeList.count(); ++i) { QDomElement currentParameter = nodeList.item(i).toElement(); // Convert parameters if we need to if (needsLocaleConversion) { QDomNamedNodeMap attrs = currentParameter.attributes(); for (int k = 0; k < attrs.count(); ++k) { QString nodeName = attrs.item(k).nodeName(); if (nodeName != QLatin1String("type") && nodeName != QLatin1String("name")) { QString val = attrs.item(k).nodeValue(); if (val.contains(oldSeparator)) { QString newVal = val.replace(oldSeparator, separator); attrs.item(k).setNodeValue(newVal); } } } } // Parse the basic attributes of the parameter QString name = currentParameter.attribute(QStringLiteral("name")); QString type = currentParameter.attribute(QStringLiteral("type")); QString value = currentParameter.attribute(QStringLiteral("value")); ParamRow currentRow; currentRow.type = paramTypeFromStr(type); currentRow.xml = currentParameter; if (value.isNull()) { QVariant defaultValue = parseAttribute(m_ownerId, QStringLiteral("default"), currentParameter); value = defaultValue.type() == QVariant::Double ? locale.toString(defaultValue.toDouble()) : defaultValue.toString(); } bool isFixed = (type == QLatin1String("fixed")); if (isFixed) { m_fixedParams[name] = value; } else if (currentRow.type == ParamType::Position) { int val = value.toInt(); if (val < 0) { int in = pCore->getItemIn(m_ownerId); int out = in + pCore->getItemDuration(m_ownerId); val += out; value = QString::number(val); } } else if (currentRow.type == ParamType::KeyframeParam || currentRow.type == ParamType::AnimatedRect) { if (!value.contains(QLatin1Char('='))) { value.prepend(QStringLiteral("%1=").arg(pCore->getItemIn(m_ownerId))); } } if (!name.isEmpty()) { setParameter(name, value, false); // Keep track of param order m_paramOrder.push_back(name); } if (isFixed) { // fixed parameters are not displayed so we don't store them. continue; } currentRow.value = value; QString title = currentParameter.firstChildElement(QStringLiteral("name")).text(); currentRow.name = title.isEmpty() ? name : title; m_params[name] = currentRow; m_rows.push_back(name); } if (m_assetId.startsWith(QStringLiteral("sox_"))) { // Sox effects need to have a special "Effect" value set QStringList effectParam = {m_assetId.section(QLatin1Char('_'), 1)}; for (const QString &pName : m_paramOrder) { effectParam << m_asset->get(pName.toUtf8().constData()); } m_asset->set("effect", effectParam.join(QLatin1Char(' ')).toUtf8().constData()); } qDebug() << "END parsing of " << assetId << ". Number of found parameters" << m_rows.size(); emit modelChanged(); } void AssetParameterModel::prepareKeyframes() { if (m_keyframes) return; int ix = 0; for (const auto &name : m_rows) { if (m_params[name].type == ParamType::KeyframeParam || m_params[name].type == ParamType::AnimatedRect || m_params[name].type == ParamType::Roto_spline) { addKeyframeParam(index(ix, 0)); } ix++; } } void AssetParameterModel::setParameter(const QString &name, int value, bool update) { Q_ASSERT(m_asset->is_valid()); m_asset->set(name.toLatin1().constData(), value); if (m_fixedParams.count(name) == 0) { m_params[name].value = value; } else { m_fixedParams[name] = value; } if (update) { if (m_assetId.startsWith(QStringLiteral("sox_"))) { // Warning, SOX effect, need unplug/replug qDebug() << "// Warning, SOX effect, need unplug/replug"; QStringList effectParam = {m_assetId.section(QLatin1Char('_'), 1)}; for (const QString &pName : m_paramOrder) { effectParam << m_asset->get(pName.toUtf8().constData()); } m_asset->set("effect", effectParam.join(QLatin1Char(' ')).toUtf8().constData()); emit replugEffect(shared_from_this()); } else if (m_assetId == QLatin1String("autotrack_rectangle") || m_assetId.startsWith(QStringLiteral("ladspa"))) { // these effects don't understand param change and need to be rebuild emit replugEffect(shared_from_this()); } else { emit modelChanged(); emit dataChanged(index(0, 0), index(m_rows.count() - 1, 0), {}); } // Update fades in timeline pCore->updateItemModel(m_ownerId, m_assetId); // Trigger monitor refresh pCore->refreshProjectItem(m_ownerId); // Invalidate timeline preview pCore->invalidateItem(m_ownerId); } } void AssetParameterModel::setParameter(const QString &name, const QString ¶mValue, bool update, const QModelIndex ¶mIndex) { Q_ASSERT(m_asset->is_valid()); QLocale locale; locale.setNumberOptions(QLocale::OmitGroupSeparator); qDebug() << "// PROCESSING PARAM CHANGE: " << name << ", UPDATE: " << update << ", VAL: " << paramValue; // TODO: this does not really belong here, but I don't see another way to do it so that undo works if (data(paramIndex, AssetParameterModel::TypeRole).value() == ParamType::Curve) { QStringList vals = paramValue.split(QLatin1Char(';'), QString::SkipEmptyParts); int points = vals.size(); m_asset->set("3", points / 10.); // for the curve, inpoints are numbered: 6, 8, 10, 12, 14 // outpoints, 7, 9, 11, 13,15 so we need to deduce these enums for (int i = 0; i < points; i++) { const QString &pointVal = vals.at(i); int idx = 2 * i + 6; m_asset->set(QString::number(idx).toLatin1().constData(), pointVal.section(QLatin1Char('/'), 0, 0).toDouble()); idx++; m_asset->set(QString::number(idx).toLatin1().constData(), pointVal.section(QLatin1Char('/'), 1, 1).toDouble()); } } bool conversionSuccess; double doubleValue = locale.toDouble(paramValue, &conversionSuccess); if (conversionSuccess) { m_asset->set(name.toLatin1().constData(), doubleValue); if (m_fixedParams.count(name) == 0) { m_params[name].value = doubleValue; } else { m_fixedParams[name] = doubleValue; } } else { m_asset->set(name.toLatin1().constData(), paramValue.toUtf8().constData()); qDebug() << " = = SET EFFECT PARAM: " << name << " = " << paramValue; if (m_fixedParams.count(name) == 0) { m_params[name].value = paramValue; } else { m_fixedParams[name] = paramValue; } } if (update) { if (m_assetId.startsWith(QStringLiteral("sox_"))) { // Warning, SOX effect, need unplug/replug qDebug() << "// Warning, SOX effect, need unplug/replug"; QStringList effectParam = {m_assetId.section(QLatin1Char('_'), 1)}; for (const QString &pName : m_paramOrder) { effectParam << m_asset->get(pName.toUtf8().constData()); } m_asset->set("effect", effectParam.join(QLatin1Char(' ')).toUtf8().constData()); emit replugEffect(shared_from_this()); } else if (m_assetId == QLatin1String("autotrack_rectangle") || m_assetId.startsWith(QStringLiteral("ladspa"))) { // these effects don't understand param change and need to be rebuild emit replugEffect(shared_from_this()); } else { qDebug() << "// SENDING DATA CHANGE...."; if (paramIndex.isValid()) { emit dataChanged(paramIndex, paramIndex); } else { QModelIndex ix = index(m_rows.indexOf(name), 0); emit dataChanged(ix, ix); } emit modelChanged(); } } emit updateChildren(name); // Update timeline view if necessary if (m_ownerId.first == ObjectType::NoItem) { // Used for generator clips if (!update) emit modelChanged(); } else { // Update fades in timeline pCore->updateItemModel(m_ownerId, m_assetId); // Trigger monitor refresh pCore->refreshProjectItem(m_ownerId); // Invalidate timeline preview pCore->invalidateItem(m_ownerId); } } void AssetParameterModel::setParameter(const QString &name, double &value) { Q_ASSERT(m_asset->is_valid()); m_asset->set(name.toLatin1().constData(), value); if (m_fixedParams.count(name) == 0) { m_params[name].value = value; } else { m_fixedParams[name] = value; } if (m_assetId.startsWith(QStringLiteral("sox_"))) { // Warning, SOX effect, need unplug/replug qDebug() << "// Warning, SOX effect, need unplug/replug"; QStringList effectParam = {m_assetId.section(QLatin1Char('_'), 1)}; for (const QString &pName : m_paramOrder) { effectParam << m_asset->get(pName.toUtf8().constData()); } m_asset->set("effect", effectParam.join(QLatin1Char(' ')).toUtf8().constData()); emit replugEffect(shared_from_this()); } else if (m_assetId == QLatin1String("autotrack_rectangle") || m_assetId.startsWith(QStringLiteral("ladspa"))) { // these effects don't understand param change and need to be rebuild emit replugEffect(shared_from_this()); } else { emit modelChanged(); } pCore->refreshProjectItem(m_ownerId); pCore->invalidateItem(m_ownerId); } AssetParameterModel::~AssetParameterModel() = default; QVariant AssetParameterModel::data(const QModelIndex &index, int role) const { if (index.row() < 0 || index.row() >= m_rows.size() || !index.isValid()) { return QVariant(); } QString paramName = m_rows[index.row()]; Q_ASSERT(m_params.count(paramName) > 0); const QDomElement &element = m_params.at(paramName).xml; switch (role) { case Qt::DisplayRole: case Qt::EditRole: return m_params.at(paramName).name; case NameRole: return paramName; case TypeRole: return QVariant::fromValue(m_params.at(paramName).type); case CommentRole: { QDomElement commentElem = element.firstChildElement(QStringLiteral("comment")); QString comment; if (!commentElem.isNull()) { comment = i18n(commentElem.text().toUtf8().data()); } return comment; } case InRole: return m_asset->get_int("in"); case OutRole: return m_asset->get_int("out"); case ParentInRole: return pCore->getItemIn(m_ownerId); case ParentDurationRole: return pCore->getItemDuration(m_ownerId); case ParentPositionRole: return pCore->getItemPosition(m_ownerId); case HideKeyframesFirstRole: return m_hideKeyframesByDefault; case MinRole: return parseAttribute(m_ownerId, QStringLiteral("min"), element); case MaxRole: return parseAttribute(m_ownerId, QStringLiteral("max"), element); case FactorRole: return parseAttribute(m_ownerId, QStringLiteral("factor"), element, 1); case ScaleRole: return parseAttribute(m_ownerId, QStringLiteral("scale"), element, 0); case DecimalsRole: return parseAttribute(m_ownerId, QStringLiteral("decimals"), element); case DefaultRole: return parseAttribute(m_ownerId, QStringLiteral("default"), element); case FilterRole: return parseAttribute(m_ownerId, QStringLiteral("filter"), element); case SuffixRole: return element.attribute(QStringLiteral("suffix")); case OpacityRole: return element.attribute(QStringLiteral("opacity")) != QLatin1String("false"); case RelativePosRole: return element.attribute(QStringLiteral("relative")) == QLatin1String("true"); case ShowInTimelineRole: return !element.hasAttribute(QStringLiteral("notintimeline")); case AlphaRole: return element.attribute(QStringLiteral("alpha")) == QLatin1String("1"); case ValueRole: { QString value(m_asset->get(paramName.toUtf8().constData())); return value.isEmpty() ? (element.attribute(QStringLiteral("value")).isNull() ? parseAttribute(m_ownerId, QStringLiteral("default"), element) : element.attribute(QStringLiteral("value"))) : value; } case ListValuesRole: return element.attribute(QStringLiteral("paramlist")).split(QLatin1Char(';')); case ListNamesRole: { QDomElement namesElem = element.firstChildElement(QStringLiteral("paramlistdisplay")); return i18n(namesElem.text().toUtf8().data()).split(QLatin1Char(',')); } case List1Role: return parseAttribute(m_ownerId, QStringLiteral("list1"), element); case List2Role: return parseAttribute(m_ownerId, QStringLiteral("list2"), element); case Enum1Role: return m_asset->get_double("1"); case Enum2Role: return m_asset->get_double("2"); case Enum3Role: return m_asset->get_double("3"); case Enum4Role: return m_asset->get_double("4"); case Enum5Role: return m_asset->get_double("5"); case Enum6Role: return m_asset->get_double("6"); case Enum7Role: return m_asset->get_double("7"); case Enum8Role: return m_asset->get_double("8"); case Enum9Role: return m_asset->get_double("9"); case Enum10Role: return m_asset->get_double("10"); case Enum11Role: return m_asset->get_double("11"); case Enum12Role: return m_asset->get_double("12"); case Enum13Role: return m_asset->get_double("13"); case Enum14Role: return m_asset->get_double("14"); case Enum15Role: return m_asset->get_double("15"); } return QVariant(); } int AssetParameterModel::rowCount(const QModelIndex &parent) const { qDebug() << "===================================================== Requested rowCount" << parent << m_rows.size(); if (parent.isValid()) return 0; return m_rows.size(); } // static ParamType AssetParameterModel::paramTypeFromStr(const QString &type) { if (type == QLatin1String("double") || type == QLatin1String("float") || type == QLatin1String("constant")) { return ParamType::Double; } if (type == QLatin1String("list")) { return ParamType::List; } if (type == QLatin1String("bool")) { return ParamType::Bool; } if (type == QLatin1String("switch")) { return ParamType::Switch; } else if (type == QLatin1String("simplekeyframe")) { return ParamType::KeyframeParam; } else if (type == QLatin1String("animatedrect")) { return ParamType::AnimatedRect; } else if (type == QLatin1String("geometry")) { return ParamType::Geometry; } else if (type == QLatin1String("addedgeometry")) { return ParamType::Addedgeometry; } else if (type == QLatin1String("keyframe") || type == QLatin1String("animated")) { return ParamType::KeyframeParam; } else if (type == QLatin1String("color")) { return ParamType::Color; } else if (type == QLatin1String("colorwheel")) { return ParamType::ColorWheel; } else if (type == QLatin1String("position")) { return ParamType::Position; } else if (type == QLatin1String("curve")) { return ParamType::Curve; } else if (type == QLatin1String("bezier_spline")) { return ParamType::Bezier_spline; } else if (type == QLatin1String("roto-spline")) { return ParamType::Roto_spline; } else if (type == QLatin1String("wipe")) { return ParamType::Wipe; } else if (type == QLatin1String("url")) { return ParamType::Url; } else if (type == QLatin1String("keywords")) { return ParamType::Keywords; } else if (type == QLatin1String("fontfamily")) { return ParamType::Fontfamily; } else if (type == QLatin1String("filterjob")) { return ParamType::Filterjob; } else if (type == QLatin1String("readonly")) { return ParamType::Readonly; } else if (type == QLatin1String("hidden")) { return ParamType::Hidden; } qDebug() << "WARNING: Unknown type :" << type; return ParamType::Double; } // static QString AssetParameterModel::getDefaultKeyframes(int start, const QString &defaultValue, bool linearOnly) { QString keyframes = QString::number(start); if (linearOnly) { keyframes.append(QLatin1Char('=')); } else { switch (KdenliveSettings::defaultkeyframeinterp()) { case mlt_keyframe_discrete: keyframes.append(QStringLiteral("|=")); break; case mlt_keyframe_smooth: keyframes.append(QStringLiteral("~=")); break; default: keyframes.append(QLatin1Char('=')); break; } } keyframes.append(defaultValue); return keyframes; } // static QVariant AssetParameterModel::parseAttribute(const ObjectId &owner, const QString &attribute, const QDomElement &element, QVariant defaultValue) { if (!element.hasAttribute(attribute) && !defaultValue.isNull()) { return defaultValue; } ParamType type = paramTypeFromStr(element.attribute(QStringLiteral("type"))); QString content = element.attribute(attribute); if (content.contains(QLatin1Char('%'))) { std::unique_ptr &profile = pCore->getCurrentProfile(); int width = profile->width(); int height = profile->height(); int in = pCore->getItemIn(owner); int out = in + pCore->getItemDuration(owner); // replace symbols in the double parameter content.replace(QLatin1String("%maxWidth"), QString::number(width)) .replace(QLatin1String("%maxHeight"), QString::number(height)) .replace(QLatin1String("%width"), QString::number(width)) .replace(QLatin1String("%height"), QString::number(height)) .replace(QLatin1String("%out"), QString::number(out)); - if (type == ParamType::Double) { + if (type == ParamType::Double || type == ParamType::Hidden) { // Use a Mlt::Properties to parse mathematical operators Mlt::Properties p; p.set("eval", content.prepend(QLatin1Char('@')).toLatin1().constData()); return p.get_double("eval"); } } else if (type == ParamType::Double || type == ParamType::Hidden) { QLocale locale; locale.setNumberOptions(QLocale::OmitGroupSeparator); - if (attribute == QLatin1String("default")) { - int factor = element.attribute(QStringLiteral("factor"), QStringLiteral("1")).toInt(); - if (factor > 0) { - return content.toDouble() / factor; - } - } return locale.toDouble(content); } if (attribute == QLatin1String("default")) { if (type == ParamType::RestrictedAnim) { content = getDefaultKeyframes(0, content, true); } else if (type == ParamType::KeyframeParam) { return content.toDouble(); } else if (type == ParamType::List) { bool ok; double res = content.toDouble(&ok); if (ok) { return res; } } else if (type == ParamType::Bezier_spline) { QLocale locale; if (locale.decimalPoint() != QLocale::c().decimalPoint()) { return content.replace(QLocale::c().decimalPoint(), locale.decimalPoint()); } } } return content; } QString AssetParameterModel::getAssetId() const { return m_assetId; } QVector> AssetParameterModel::getAllParameters() const { QVector> res; res.reserve((int)m_fixedParams.size() + (int)m_params.size()); for (const auto &fixed : m_fixedParams) { res.push_back(QPair(fixed.first, fixed.second)); } for (const auto ¶m : m_params) { res.push_back(QPair(param.first, param.second.value)); } return res; } QJsonDocument AssetParameterModel::toJson() const { QJsonArray list; QLocale locale; for (const auto &fixed : m_fixedParams) { QJsonObject currentParam; QModelIndex ix = index(m_rows.indexOf(fixed.first), 0); currentParam.insert(QLatin1String("name"), QJsonValue(fixed.first)); currentParam.insert(QLatin1String("value"), fixed.second.toString()); int type = data(ix, AssetParameterModel::TypeRole).toInt(); double min = data(ix, AssetParameterModel::MinRole).toDouble(); double max = data(ix, AssetParameterModel::MaxRole).toDouble(); double factor = data(ix, AssetParameterModel::FactorRole).toDouble(); if (factor > 0) { min /= factor; max /= factor; } currentParam.insert(QLatin1String("type"), QJsonValue(type)); currentParam.insert(QLatin1String("min"), QJsonValue(min)); currentParam.insert(QLatin1String("max"), QJsonValue(max)); list.push_back(currentParam); } for (const auto ¶m : m_params) { QJsonObject currentParam; QModelIndex ix = index(m_rows.indexOf(param.first), 0); currentParam.insert(QLatin1String("name"), QJsonValue(param.first)); currentParam.insert(QLatin1String("value"), QJsonValue(param.second.value.toString())); int type = data(ix, AssetParameterModel::TypeRole).toInt(); double min = data(ix, AssetParameterModel::MinRole).toDouble(); double max = data(ix, AssetParameterModel::MaxRole).toDouble(); double factor = data(ix, AssetParameterModel::FactorRole).toDouble(); if (factor > 0) { min /= factor; max /= factor; } currentParam.insert(QLatin1String("type"), QJsonValue(type)); currentParam.insert(QLatin1String("min"), QJsonValue(min)); currentParam.insert(QLatin1String("max"), QJsonValue(max)); list.push_back(currentParam); } return QJsonDocument(list); } void AssetParameterModel::deletePreset(const QString &presetFile, const QString &presetName) { QJsonObject object; QJsonArray array; QFile loadFile(presetFile); if (loadFile.exists()) { if (loadFile.open(QIODevice::ReadOnly)) { QByteArray saveData = loadFile.readAll(); QJsonDocument loadDoc(QJsonDocument::fromJson(saveData)); if (loadDoc.isArray()) { qDebug() << " * * ** JSON IS AN ARRAY, DELETING: " << presetName; array = loadDoc.array(); QList toDelete; for (int i = 0; i < array.size(); i++) { QJsonValue val = array.at(i); if (val.isObject() && val.toObject().keys().contains(presetName)) { toDelete << i; } } for (int i : toDelete) { array.removeAt(i); } } else if (loadDoc.isObject()) { QJsonObject obj = loadDoc.object(); qDebug() << " * * ** JSON IS AN OBJECT, DELETING: " << presetName; if (obj.keys().contains(presetName)) { obj.remove(presetName); } else { qDebug() << " * * ** JSON DOES NOT CONTAIN: " << obj.keys(); } array.append(obj); } loadFile.close(); } else if (!loadFile.open(QIODevice::ReadWrite)) { // TODO: error message } } if (!loadFile.open(QIODevice::WriteOnly)) { // TODO: error message } loadFile.write(QJsonDocument(array).toJson()); } void AssetParameterModel::savePreset(const QString &presetFile, const QString &presetName) { QJsonObject object; QJsonArray array; QJsonDocument doc = toJson(); QFile loadFile(presetFile); if (loadFile.exists()) { if (loadFile.open(QIODevice::ReadOnly)) { QByteArray saveData = loadFile.readAll(); QJsonDocument loadDoc(QJsonDocument::fromJson(saveData)); if (loadDoc.isArray()) { array = loadDoc.array(); QList toDelete; for (int i = 0; i < array.size(); i++) { QJsonValue val = array.at(i); if (val.isObject() && val.toObject().keys().contains(presetName)) { toDelete << i; } } for (int i : toDelete) { array.removeAt(i); } } else if (loadDoc.isObject()) { QJsonObject obj = loadDoc.object(); if (obj.keys().contains(presetName)) { obj.remove(presetName); } array.append(obj); } loadFile.close(); } else if (!loadFile.open(QIODevice::ReadWrite)) { // TODO: error message } } if (!loadFile.open(QIODevice::WriteOnly)) { // TODO: error message } object[presetName] = doc.array(); array.append(object); loadFile.write(QJsonDocument(array).toJson()); } const QStringList AssetParameterModel::getPresetList(const QString &presetFile) const { QFile loadFile(presetFile); if (loadFile.exists() && loadFile.open(QIODevice::ReadOnly)) { QByteArray saveData = loadFile.readAll(); QJsonDocument loadDoc(QJsonDocument::fromJson(saveData)); if (loadDoc.isObject()) { qDebug() << "// PRESET LIST IS AN OBJECT!!!"; return loadDoc.object().keys(); } else if (loadDoc.isArray()) { qDebug() << "// PRESET LIST IS AN ARRAY!!!"; QStringList result; QJsonArray array = loadDoc.array(); for (auto &&i : array) { QJsonValue val = i; if (val.isObject()) { result << val.toObject().keys(); } } return result; } } return QStringList(); } const QVector> AssetParameterModel::loadPreset(const QString &presetFile, const QString &presetName) { QFile loadFile(presetFile); QVector> params; if (loadFile.exists() && loadFile.open(QIODevice::ReadOnly)) { QByteArray saveData = loadFile.readAll(); QJsonDocument loadDoc(QJsonDocument::fromJson(saveData)); if (loadDoc.isObject() && loadDoc.object().contains(presetName)) { qDebug() << "..........\n..........\nLOADING OBJECT JSON"; QJsonValue val = loadDoc.object().value(presetName); if (val.isObject()) { QVariantMap map = val.toObject().toVariantMap(); QMap::const_iterator i = map.constBegin(); while (i != map.constEnd()) { params.append({i.key(), i.value()}); ++i; } } } else if (loadDoc.isArray()) { QJsonArray array = loadDoc.array(); for (auto &&i : array) { QJsonValue val = i; if (val.isObject() && val.toObject().contains(presetName)) { QJsonValue preset = val.toObject().value(presetName); if (preset.isArray()) { QJsonArray paramArray = preset.toArray(); for (auto &&j : paramArray) { QJsonValue v1 = j; if (v1.isObject()) { QJsonObject ob = v1.toObject(); params.append({ob.value("name").toString(), ob.value("value").toVariant()}); } } } qDebug() << "// LOADED PRESET: " << presetName << "\n" << params; break; } } } } return params; } void AssetParameterModel::setParameters(const QVector> ¶ms) { QLocale locale; for (const auto ¶m : params) { if (param.second.type() == QVariant::Double) { setParameter(param.first, locale.toString(param.second.toDouble()), false); } else { setParameter(param.first, param.second.toString(), false); } } if (m_keyframes) { m_keyframes->refresh(); } // emit modelChanged(); emit dataChanged(index(0), index(m_rows.count()), {}); } ObjectId AssetParameterModel::getOwnerId() const { return m_ownerId; } void AssetParameterModel::addKeyframeParam(const QModelIndex &index) { if (m_keyframes) { m_keyframes->addParameter(index); } else { m_keyframes.reset(new KeyframeModelList(shared_from_this(), index, pCore->undoStack())); } } std::shared_ptr AssetParameterModel::getKeyframeModel() { return m_keyframes; } void AssetParameterModel::resetAsset(std::unique_ptr asset) { m_asset = std::move(asset); } bool AssetParameterModel::hasMoreThanOneKeyframe() const { if (m_keyframes) { return (!m_keyframes->isEmpty() && !m_keyframes->singleKeyframe()); } return false; } int AssetParameterModel::time_to_frames(const QString &time) { return m_asset->time_to_frames(time.toUtf8().constData()); } void AssetParameterModel::passProperties(Mlt::Properties &target) { target.set("_profile", pCore->getCurrentProfile()->get_profile(), 0); target.set_lcnumeric(m_asset->get_lcnumeric()); }