mirror of
https://invent.kde.org/multimedia/kdenlive
synced 2025-12-07 00:39:58 +01:00
Compare commits
316 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
483f571439 | ||
|
|
a7a8837578 | ||
|
|
12444d4f72 | ||
|
|
ae3490fb4e | ||
|
|
96d7f5a694 | ||
|
|
07cc32ca35 | ||
|
|
b165d7e4ed | ||
|
|
b2f37cecd9 | ||
|
|
aec0143682 | ||
|
|
f5977736d9 | ||
|
|
d23c2b7a03 | ||
|
|
64834d517d | ||
|
|
fabec43611 | ||
|
|
f5a501e914 | ||
|
|
4b84e98f0c | ||
|
|
8fd72a3444 | ||
|
|
22f6ea68f7 | ||
|
|
4f332f85fe | ||
|
|
937f547e26 | ||
|
|
20f0cd1075 | ||
|
|
8f16f0db43 | ||
|
|
ec46feb0c8 | ||
|
|
9d7083dc62 | ||
|
|
17adadd166 | ||
|
|
d049b327af | ||
|
|
50a62076c3 | ||
|
|
645eed7aae | ||
|
|
f41d1de9f8 | ||
|
|
82160d2172 | ||
|
|
bf85ada792 | ||
|
|
f69a24d18f | ||
|
|
df931cad80 | ||
|
|
5359c90f9c | ||
|
|
255cfc0146 | ||
|
|
8de0bdc9a1 | ||
|
|
edb2e9a073 | ||
|
|
409332f58c | ||
|
|
87c20d036a | ||
|
|
f33651cfea | ||
|
|
32292778e5 | ||
|
|
c24658bd34 | ||
|
|
5bcb9b7ead | ||
|
|
8d7da28432 | ||
|
|
d679fbf19a | ||
|
|
f2fe0d6c46 | ||
|
|
8be6c85ffd | ||
|
|
de93dc84bc | ||
|
|
cdabeb4058 | ||
|
|
58a394d732 | ||
|
|
f4462e7ecb | ||
|
|
5f2ae774df | ||
|
|
e83d05274c | ||
|
|
3c844989ad | ||
|
|
5d4e8497fc | ||
|
|
29ceabd2af | ||
|
|
ac8c99168f | ||
|
|
7effb94476 | ||
|
|
5d4746e4c3 | ||
|
|
5505e4a10c | ||
|
|
b49b665fd1 | ||
|
|
a55f67c8e6 | ||
|
|
2f9294f5de | ||
|
|
8a6e4eb1de | ||
|
|
b6d6c25f1b | ||
|
|
9f42f1faa3 | ||
|
|
a2fa61bb46 | ||
|
|
281a717b89 | ||
|
|
dfd9e5fac6 | ||
|
|
3f4de01666 | ||
|
|
848a385c07 | ||
|
|
a3cec798a7 | ||
|
|
86e06b615e | ||
|
|
5beaaab806 | ||
|
|
56e9707ac4 | ||
|
|
910f914b9e | ||
|
|
79115f0c91 | ||
|
|
3bf409652c | ||
|
|
71d67240d4 | ||
|
|
c330200309 | ||
|
|
7711719113 | ||
|
|
f11350e355 | ||
|
|
8e062273d8 | ||
|
|
99286622cd | ||
|
|
1404e8f1d6 | ||
|
|
97d763458c | ||
|
|
c80beeb542 | ||
|
|
4ae3260592 | ||
|
|
4f9bd66f4c | ||
|
|
bf036e2364 | ||
|
|
8e89e7f20a | ||
|
|
07c0f30ade | ||
|
|
f223c83a30 | ||
|
|
0e89403638 | ||
|
|
365e5880d7 | ||
|
|
02d7ae3c38 | ||
|
|
8264860e07 | ||
|
|
c45c2060cb | ||
|
|
20ceaabff9 | ||
|
|
b01ea44927 | ||
|
|
5de022b429 | ||
|
|
2fa08bb33b | ||
|
|
9f9a125d2a | ||
|
|
3714e50009 | ||
|
|
eafc34b6b1 | ||
|
|
65401d13c2 | ||
|
|
621b1b7c0e | ||
|
|
c6feb4b960 | ||
|
|
71ad8e582b | ||
|
|
a1759d6417 | ||
|
|
c0ce09e2c0 | ||
|
|
8dd310a8ec | ||
|
|
8fc4ca35f2 | ||
|
|
d7224c861d | ||
|
|
3935d0f277 | ||
|
|
45adaf0e93 | ||
|
|
aa17f2397f | ||
|
|
0c14e62650 | ||
|
|
a12cf2d6e7 | ||
|
|
cba3c6aa64 | ||
|
|
31198f8670 | ||
|
|
9fda2e0908 | ||
|
|
c545609814 | ||
|
|
4b9c0b0557 | ||
|
|
4cff872312 | ||
|
|
3898eb9b7c | ||
|
|
e17f9f3caf | ||
|
|
537da7616a | ||
|
|
34b587e19b | ||
|
|
1feb9c1eff | ||
|
|
4f783848c1 | ||
|
|
bc47853986 | ||
|
|
eb9ff9e83c | ||
|
|
012c94867a | ||
|
|
7e7237ae57 | ||
|
|
4990696d54 | ||
|
|
c60be94617 | ||
|
|
6f206f85a9 | ||
|
|
95d462a785 | ||
|
|
25c924be85 | ||
|
|
9999e7e3fa | ||
|
|
70ebf67bae | ||
|
|
845a9839b1 | ||
|
|
254095f40e | ||
|
|
6955cc18d4 | ||
|
|
817cce999d | ||
|
|
58c5d98d7e | ||
|
|
b8f6dc09b4 | ||
|
|
3cec1c9380 | ||
|
|
8cd7e7b5ab | ||
|
|
9aad7a1577 | ||
|
|
0bee058218 | ||
|
|
aa37ed1efa | ||
|
|
b1fa19fdf4 | ||
|
|
e7e19cd293 | ||
|
|
713bfab11b | ||
|
|
e8f43a6f96 | ||
|
|
ba6cfa6067 | ||
|
|
4fba89810f | ||
|
|
ddd3e50e4f | ||
|
|
e0fa1332f1 | ||
|
|
7a74d9caf3 | ||
|
|
7ac877ea57 | ||
|
|
7ee8b6e016 | ||
|
|
f1b0412ac4 | ||
|
|
6c53c85ed0 | ||
|
|
af33d6164e | ||
|
|
af0cdc3a24 | ||
|
|
95b05b0300 | ||
|
|
3d9ff40b71 | ||
|
|
f4699aef75 | ||
|
|
55b10ef4f3 | ||
|
|
66477ff375 | ||
|
|
8ad7ae9512 | ||
|
|
fc1415ba45 | ||
|
|
8ba16be0b0 | ||
|
|
f0867739c9 | ||
|
|
7d4849cc85 | ||
|
|
466ea658cf | ||
|
|
db3694392b | ||
|
|
af4fd26ba0 | ||
|
|
36dc441fe0 | ||
|
|
7eb7390b56 | ||
|
|
054ff5c40e | ||
|
|
9b507272f9 | ||
|
|
9958f4a652 | ||
|
|
ff57a79c55 | ||
|
|
9a9c75a837 | ||
|
|
61652e69d3 | ||
|
|
8fc16957ff | ||
|
|
1ea8ebcfd3 | ||
|
|
ff2dda64a4 | ||
|
|
9a2c18e66c | ||
|
|
841cfc540d | ||
|
|
491b4c4411 | ||
|
|
32c8c40056 | ||
|
|
4dcd6d55da | ||
|
|
19c1cbda4a | ||
|
|
81f2be58c1 | ||
|
|
85b3d8c15f | ||
|
|
c05150ef69 | ||
|
|
3b8469402b | ||
|
|
fe41177675 | ||
|
|
014689d6fd | ||
|
|
4e8bd1d7f5 | ||
|
|
3e702534ad | ||
|
|
70437d8e45 | ||
|
|
1ef74c09df | ||
|
|
691411ad08 | ||
|
|
0d59a0487e | ||
|
|
370296c589 | ||
|
|
45562081dc | ||
|
|
378edb5c07 | ||
|
|
57aba4a5bf | ||
|
|
5be6421bad | ||
|
|
e9388f39f0 | ||
|
|
fc2d48a0aa | ||
|
|
b35e749e79 | ||
|
|
b641b3dd72 | ||
|
|
4e1767cbe4 | ||
|
|
a023a12f22 | ||
|
|
6d05b7504f | ||
|
|
2ab823a117 | ||
|
|
f8b94e4037 | ||
|
|
4af6675294 | ||
|
|
04f3889c3b | ||
|
|
470fc29bb8 | ||
|
|
1392e602e3 | ||
|
|
a9284e6be3 | ||
|
|
ff989e5bfb | ||
|
|
d08468b734 | ||
|
|
e692395e68 | ||
|
|
c40357ec54 | ||
|
|
a41bc84cad | ||
|
|
0731e6aacd | ||
|
|
a4609c2ef7 | ||
|
|
400911277e | ||
|
|
ba1ba937af | ||
|
|
5e70eb0386 | ||
|
|
c1ad9ec174 | ||
|
|
dd1f644e61 | ||
|
|
ac6267bc42 | ||
|
|
cb7c6a3410 | ||
|
|
8aeb94aa31 | ||
|
|
b2bd9defdc | ||
|
|
f6ee585152 | ||
|
|
2e13e777eb | ||
|
|
1cf57dcc36 | ||
|
|
c1b370c98c | ||
|
|
764e734c9f | ||
|
|
e94eecb4fa | ||
|
|
897ec70d85 | ||
|
|
77c63bf4b2 | ||
|
|
0f603b7df7 | ||
|
|
387a0a5fd9 | ||
|
|
fdfb73e2d7 | ||
|
|
8dd4d6bee4 | ||
|
|
27dd3890a5 | ||
|
|
3eae728a77 | ||
|
|
28033ea0df | ||
|
|
d0d276071c | ||
|
|
a970eea194 | ||
|
|
8d1e6aae86 | ||
|
|
cff661c0aa | ||
|
|
8511453ab2 | ||
|
|
99b80a55e3 | ||
|
|
e1b164013c | ||
|
|
f40d5c2365 | ||
|
|
5e07370d2e | ||
|
|
e9235a9040 | ||
|
|
b47d812160 | ||
|
|
7f66f7e73f | ||
|
|
929b293a89 | ||
|
|
169e417816 | ||
|
|
2347054c6d | ||
|
|
5e6ab39715 | ||
|
|
84f1d2fd6f | ||
|
|
7a296400d8 | ||
|
|
604434de17 | ||
|
|
09e42f7de3 | ||
|
|
54f89d367f | ||
|
|
7a75f3504d | ||
|
|
5bc0935dd6 | ||
|
|
65fb236198 | ||
|
|
027da8604a | ||
|
|
7ecd21beca | ||
|
|
43ffc1fcd8 | ||
|
|
3a2f497995 | ||
|
|
f3d9d916c7 | ||
|
|
0ef69cc8c8 | ||
|
|
19e3ddc20b | ||
|
|
0da95d7249 | ||
|
|
1023264f0c | ||
|
|
a1f47db125 | ||
|
|
f099e68e8c | ||
|
|
fc520c0706 | ||
|
|
f2a1b764d1 | ||
|
|
4ff013a91c | ||
|
|
e3585512b3 | ||
|
|
efa3eb3a43 | ||
|
|
c215537508 | ||
|
|
99d1cdc11c | ||
|
|
6fab0061c4 | ||
|
|
3abfbfe07d | ||
|
|
f610a587d3 | ||
|
|
53bd5bb0ca | ||
|
|
9d6a2940c8 | ||
|
|
012b954783 | ||
|
|
95231df40f | ||
|
|
3124eca181 | ||
|
|
a40d4dc043 | ||
|
|
ecf7219c79 | ||
|
|
91ccec927e | ||
|
|
e6644e3ca7 | ||
|
|
61d07a19c0 | ||
|
|
63b6ddbcde | ||
|
|
3b8b649754 |
@@ -2,17 +2,17 @@ project(kdenlive)
|
||||
|
||||
# An odd patch version number means development version, while an even one means
|
||||
# stable release. An additional number can be used for bugfix-only releases.
|
||||
set(KDENLIVE_VERSION 0.9.4)
|
||||
set(KDENLIVE_VERSION 0.9.7)
|
||||
|
||||
# Minimum versions of main dependencies.
|
||||
set(LIBMLT_MIN_VERSION 0.8.6)
|
||||
set(LIBMLT_MIN_VERSION 0.8.8)
|
||||
set(QT_MIN_VERSION 4.5.0)
|
||||
set(KDE_MIN_VERSION 4.3.0)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
|
||||
|
||||
# To be switched on when releasing.
|
||||
option(RELEASE_BUILD "Remove Git revision from program version (use for stable releases)" ON)
|
||||
option(RELEASE_BUILD "Remove Git revision from program version (use for stable releases)" OFF)
|
||||
|
||||
# Get current version.
|
||||
set(VERSION "\"${KDENLIVE_VERSION}\"")
|
||||
|
||||
38
ChangeLog
38
ChangeLog
@@ -1,3 +1,41 @@
|
||||
0.9.6
|
||||
* Fix keyframes when cutting a clip / undoing a clip cut
|
||||
* Warn before overwriting .mlt stabilized file
|
||||
* Fix monitor confusion (clip monitor sometimes playing timeline,...)
|
||||
* Fix the Mono to Stereo effect UI
|
||||
* Fix proxy of playlist having wrong aspect ratio in some locales
|
||||
* Fix transition widget not correctly updated when resizing a transition
|
||||
* Fix DVD chapters broken when using an intro movie
|
||||
* Fix error message (No matching profile) poping up in render widget when everything was ok
|
||||
* Fix clip keyframes not showing on project load
|
||||
* Fix bug when moving guide (was not moving to the correct place)
|
||||
* Fix project corruption (wrong character) caused by some clip's metadata
|
||||
* Fix possible crash on track deletion
|
||||
* Fix timeline corruption when using spacer tool or overwrite edit mode
|
||||
* Fix possible crash when editing speed effect
|
||||
* Fix transition losing all its properties when moved
|
||||
* Fix crash when pressing del when editing animation in title widget
|
||||
* Fix crash when doing quick clip resize
|
||||
* Fix corruption when groups where overlapping
|
||||
* Fix corruption when adding a title clip where a transition already existed
|
||||
* Fix timeline preview corruption with some transitions
|
||||
|
||||
0.9.4
|
||||
* Fix color parameter in some effects not working correctly (#2644)
|
||||
* Fix V4l licensing issue (#2632)
|
||||
* Fix keyframes lost / broken when pasting an effect
|
||||
|
||||
0.9.2
|
||||
* Fix firewire capture (preview not showing)
|
||||
* Fix freeze when reloading previously missing clip
|
||||
* Fade effects lost when moving / resizing clip
|
||||
* Undoing change in clip crop start breaking clip
|
||||
* Make disabling of track effects possible
|
||||
* Fix slideshow clips not working
|
||||
* Fix crash on composite transition
|
||||
* Fix crash when opening stop motion widget
|
||||
* Fix rendering of projects created in another locale
|
||||
|
||||
0.9
|
||||
* Fix monitor effect scene sometimes forcing monitor minimum size
|
||||
* Improve detection of locale issues (default to POSIX when there is a locale conflict on the system)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!bin/sh
|
||||
|
||||
kdenlive_subdirs="plugins renderer src src/widgets"
|
||||
kdenlive_subdirs="plugins renderer src src/ui"
|
||||
|
||||
$EXTRACTRC --tag=name --tag=description --tag=label --tag=comment --tag=paramlistdisplay effects/*.xml data/kdenliveeffectscategory.rc >> rc.cpp
|
||||
$EXTRACTRC `find $kdenlive_subdirs -name \*.rc -a ! -name encodingprofiles.rc -o -name \*.ui` >> rc.cpp
|
||||
|
||||
2
README
2
README
@@ -1,4 +1,4 @@
|
||||
Kdenlive 0.9.4
|
||||
Kdenlive 0.9.6
|
||||
by Jean-Baptiste Mardelle <jb@kdenlive.org> and the Kdenlive team
|
||||
|
||||
Kdenlive is a video editing application based on KDE Platform 4.
|
||||
|
||||
105
cmake/modules/FindGLEW.cmake
Normal file
105
cmake/modules/FindGLEW.cmake
Normal file
@@ -0,0 +1,105 @@
|
||||
# Copyright (c) 2009 Boudewijn Rempt <boud@valdyas.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
#
|
||||
# - try to find glew library and include files
|
||||
# GLEW_INCLUDE_DIR, where to find GL/glew.h, etc.
|
||||
# GLEW_LIBRARIES, the libraries to link against
|
||||
# GLEW_FOUND, If false, do not try to use GLEW.
|
||||
# Also defined, but not for general use are:
|
||||
# GLEW_GLEW_LIBRARY = the full path to the glew library.
|
||||
|
||||
IF (WIN32)
|
||||
|
||||
IF(CYGWIN)
|
||||
|
||||
FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h)
|
||||
|
||||
FIND_LIBRARY( GLEW_GLEW_LIBRARY glew32
|
||||
${OPENGL_LIBRARY_DIR}
|
||||
/usr/lib/w32api
|
||||
/usr/X11R6/lib
|
||||
)
|
||||
|
||||
|
||||
ELSE(CYGWIN)
|
||||
|
||||
FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
|
||||
$ENV{GLEW_ROOT_PATH}/include
|
||||
)
|
||||
|
||||
FIND_LIBRARY( GLEW_GLEW_LIBRARY
|
||||
NAMES glew glew32
|
||||
PATHS
|
||||
$ENV{GLEW_ROOT_PATH}/lib
|
||||
${OPENGL_LIBRARY_DIR}
|
||||
)
|
||||
|
||||
ENDIF(CYGWIN)
|
||||
|
||||
ELSE (WIN32)
|
||||
|
||||
IF (APPLE)
|
||||
# These values for Apple could probably do with improvement.
|
||||
FIND_PATH( GLEW_INCLUDE_DIR glew.h
|
||||
/System/Library/Frameworks/GLEW.framework/Versions/A/Headers
|
||||
${OPENGL_LIBRARY_DIR}
|
||||
)
|
||||
SET(GLEW_GLEW_LIBRARY "-framework GLEW" CACHE STRING "GLEW library for OSX")
|
||||
SET(GLEW_cocoa_LIBRARY "-framework Cocoa" CACHE STRING "Cocoa framework for OSX")
|
||||
ELSE (APPLE)
|
||||
|
||||
FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
|
||||
/usr/include/GL
|
||||
/usr/openwin/share/include
|
||||
/usr/openwin/include
|
||||
/usr/X11R6/include
|
||||
/usr/include/X11
|
||||
/opt/graphics/OpenGL/include
|
||||
/opt/graphics/OpenGL/contrib/libglew
|
||||
)
|
||||
|
||||
FIND_LIBRARY( GLEW_GLEW_LIBRARY GLEW
|
||||
/usr/openwin/lib
|
||||
/usr/X11R6/lib
|
||||
)
|
||||
|
||||
ENDIF (APPLE)
|
||||
|
||||
ENDIF (WIN32)
|
||||
|
||||
SET( GLEW_FOUND "NO" )
|
||||
IF(GLEW_INCLUDE_DIR)
|
||||
IF(GLEW_GLEW_LIBRARY)
|
||||
# Is -lXi and -lXmu required on all platforms that have it?
|
||||
# If not, we need some way to figure out what platform we are on.
|
||||
SET( GLEW_LIBRARIES
|
||||
${GLEW_GLEW_LIBRARY}
|
||||
${GLEW_cocoa_LIBRARY}
|
||||
)
|
||||
SET( GLEW_FOUND "YES" )
|
||||
|
||||
#The following deprecated settings are for backwards compatibility with CMake1.4
|
||||
SET (GLEW_LIBRARY ${GLEW_LIBRARIES})
|
||||
SET (GLEW_INCLUDE_PATH ${GLEW_INCLUDE_DIR})
|
||||
|
||||
ENDIF(GLEW_GLEW_LIBRARY)
|
||||
ENDIF(GLEW_INCLUDE_DIR)
|
||||
|
||||
IF(GLEW_FOUND)
|
||||
IF(NOT GLEW_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found Glew: ${GLEW_LIBRARIES}")
|
||||
ENDIF(NOT GLEW_FIND_QUIETLY)
|
||||
ELSE(GLEW_FOUND)
|
||||
IF(GLEW_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Could not find Glew")
|
||||
ENDIF(GLEW_FIND_REQUIRED)
|
||||
ENDIF(GLEW_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
GLEW_INCLUDE_DIR
|
||||
GLEW_GLEW_LIBRARY
|
||||
GLEW_Xmu_LIBRARY
|
||||
GLEW_Xi_LIBRARY
|
||||
)
|
||||
@@ -1,4 +1,4 @@
|
||||
install(FILES banner.png timeline_nothumbs.png timeline_athumbs.png timeline_vthumbs.png timeline_avthumbs.png metadata.properties blacklisted_effects.txt blacklisted_transitions.txt encodingprofiles.rc DESTINATION ${DATA_INSTALL_DIR}/kdenlive )
|
||||
install(FILES banner.png timeline_nothumbs.png timeline_athumbs.png timeline_vthumbs.png timeline_avthumbs.png metadata.properties blacklisted_effects.txt blacklisted_transitions.txt encodingprofiles.rc meta_ffmpeg.png meta_libav.png meta_magiclantern.png DESTINATION ${DATA_INSTALL_DIR}/kdenlive )
|
||||
install( FILES kdenliveeffectscategory.rc DESTINATION ${CONFIG_INSTALL_DIR} )
|
||||
install (FILES kdenlive.xpm DESTINATION share/pixmaps)
|
||||
install (FILES kdenlive.menu DESTINATION share/menu RENAME kdenlive)
|
||||
|
||||
@@ -25,6 +25,7 @@ frei0r.cluster
|
||||
frei0r.c0rners
|
||||
frei0r.coloradj_RGB
|
||||
frei0r.colordistance
|
||||
frei0r.colortap
|
||||
frei0r.contrast0r
|
||||
frei0r.curves
|
||||
frei0r.defish0r
|
||||
@@ -75,6 +76,8 @@ frei0r.vignette
|
||||
|
||||
|
||||
#MLT effects with XML UI
|
||||
channelcopy
|
||||
crop
|
||||
dust
|
||||
grain
|
||||
lines
|
||||
@@ -82,10 +85,8 @@ oldfilm
|
||||
tcolor
|
||||
rotoscoping
|
||||
wave
|
||||
volume
|
||||
vignette
|
||||
crop
|
||||
|
||||
volume
|
||||
|
||||
#Effects not usable with a simple GUI
|
||||
sox
|
||||
|
||||
@@ -3,13 +3,11 @@ DNxHD=vcodec=dnxhd vb=145000k acodec=pcm_s16le threads=%threads;mov
|
||||
Normal MPEG=vcodec=mpeg2video qscale=10 acodec=mp2 ac=2 ab=128k ar=48000 threads=%threads;mpg
|
||||
|
||||
[proxy]
|
||||
Normal MPEG=-f mpegts -acodec libmp3lame -ac 2 -ab 128k -ar 48000 -vcodec mpeg2video -g 5 -deinterlace -s 480x270 -vb 400k;ts
|
||||
Normal MPEG=-f mpegts -acodec libmp3lame -ac 2 -ab 128k -ar 48000 -vcodec mpeg2video -g 5 -deinterlace -s 640x360 -vb 700k;ts
|
||||
|
||||
[screengrab]
|
||||
X246 mute=-vcodec libx264 -preset fast -threads 0;mkv
|
||||
X246 with audio=-f alsa -i pulse -acodec libvorbis -ab 256k -vcodec libx264 -preset fast -threads 0;mkv
|
||||
X246 mute=-vcodec libx264 -preset fast -threads 0;mkv
|
||||
X246 with audio=-i pulse -acodec libvorbis -ab 256k -vcodec libx264 -preset fast -threads 0;mkv
|
||||
|
||||
[video4linux]
|
||||
Normal MPEG=f=mpeg acodec=mp2 ab=128k ar=48000 vcodec=mpeg2video minrate=0 vb=4000k;mpg
|
||||
|
||||
|
||||
Normal MPEG=acodec=mp2 ab=128k ar=48000 vcodec=mpeg2video minrate=0 vb=4000k;mpg
|
||||
|
||||
BIN
data/meta_ffmpeg.png
Normal file
BIN
data/meta_ffmpeg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 855 B |
BIN
data/meta_libav.png
Normal file
BIN
data/meta_libav.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 442 B |
BIN
data/meta_magiclantern.png
Normal file
BIN
data/meta_magiclantern.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
@@ -74,6 +74,7 @@ frei0r_levels.xml
|
||||
frei0r_lightgraffiti.xml
|
||||
frei0r_luminance.xml
|
||||
frei0r_mask0mate.xml
|
||||
frei0r_medians.xml
|
||||
frei0r_nervous.xml
|
||||
frei0r_nosync0r.xml
|
||||
frei0r_pixeliz0r.xml
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!DOCTYPE kpartgui>
|
||||
<effect tag="channelcopy" id="channelcopy" type="audio">
|
||||
<effect tag="channelcopy" id="stereocopy" type="audio">
|
||||
<name>Mono to stereo</name>
|
||||
<description>Copy one channel to another</description>
|
||||
<author>Dan Dennedy</author>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<name>Dust</name>
|
||||
<description>Add dust and specks to the video, as in old movies</description>
|
||||
<author>Marco Gittler</author>
|
||||
<parameter type="double" name="maxdiameter" max="100" min="0" default="2">
|
||||
<parameter type="double" name="maxdiameter" max="100" min="0" default="2" suffix="%">
|
||||
<name>Maximal Diameter</name>
|
||||
</parameter>
|
||||
<parameter type="double" name="maxcount" max="400" min="0" default="10">
|
||||
|
||||
17
effects/frei0r_medians.xml
Normal file
17
effects/frei0r_medians.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE kpartgui>
|
||||
<effect LC_NUMERIC="C" tag="frei0r.medians" id="frei0r.medians">
|
||||
<name>Medians</name>
|
||||
<description>Implements several median-type filters</description>
|
||||
<author>Marko Cebokli</author>
|
||||
|
||||
<parameter type="list" name="Type" default="Square3x3" paramlist="Cross5;Square3x3;Bilevel;Diamond3x3;Square5x5;Temp3;Temp5;ArceBI;ML3D;ML3dEX;VarSize">
|
||||
<paramlistdisplay>Cross5,Square3x3,Bilevel,Diamond3x3,Square5x5,Temp3,Temp5,ArceBI,ML3D,ML3dEX,VarSize</paramlistdisplay>
|
||||
<name>Type</name>
|
||||
</parameter>
|
||||
|
||||
<parameter type="constant" name="Size" default="5" min="0" max="50" factor="50">
|
||||
<name>Size</name>
|
||||
</parameter>
|
||||
|
||||
|
||||
</effect>
|
||||
@@ -3,7 +3,7 @@
|
||||
<name>Grain</name>
|
||||
<description>Grain over the image</description>
|
||||
<author>Marco Gittler</author>
|
||||
<parameter type="double" name="noise" max="200" min="0" default="40">
|
||||
<parameter type="double" name="noise" max="200" min="0" default="40" suffix="%">
|
||||
<name>Noise</name>
|
||||
</parameter>
|
||||
<parameter type="double" name="contrast" max="400" min="0" default="160">
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parameter type="double" name="delta" max="400" min="0" default="14">
|
||||
<name>Y-Delta</name>
|
||||
</parameter>
|
||||
<parameter type="double" name="every" max="100" min="0" default="20">
|
||||
<parameter type="double" name="every" max="100" min="0" default="20" suffix="%">
|
||||
<name>% of picture have a delta</name>
|
||||
</parameter>
|
||||
<parameter type="double" name="brightnessdelta_up" max="100" min="0" default="20">
|
||||
@@ -15,7 +15,7 @@
|
||||
<parameter type="double" name="brightnessdelta_down" max="100" min="0" default="30">
|
||||
<name>Brightness down</name>
|
||||
</parameter>
|
||||
<parameter type="double" name="brightnessdelta_every" max="100" min="0" default="70">
|
||||
<parameter type="double" name="brightnessdelta_every" max="100" min="0" default="70" suffix="%">
|
||||
<name>Brightness every</name>
|
||||
</parameter>
|
||||
<parameter type="double" name="unevendevelop_up" max="100" min="0" default="60">
|
||||
|
||||
@@ -1,148 +1,84 @@
|
||||
<profiles version="0.1">
|
||||
<group name="HDV" renderer="avformat" extension="m2t" type="av">
|
||||
<profile name="PAL 1080 50i" standard="PAL" args="f=mpegts acodec=mp2 ab=384k ar=48000 ac=2 vcodec=mpeg2video s=1440x1080 vb=25000k g=12 trellis=1 mlt_profile=hdv_1080_50i pass=%passes" />
|
||||
<profile name="PAL 1080 25p" standard="PAL" args="f=mpegts acodec=mp2 ab=384k ar=48000 ac=2 vcodec=mpeg2video s=1440x1080 vb=25000k g=12 trellis=1 mlt_profile=hdv_1080_25p pass=%passes" />
|
||||
<profile name="PAL 720 25p" standard="PAL" args="f=mpegts acodec=mp2 ab=384k ar=48000 ac=2 vcodec=mpeg2video s=1280x720 vb=19700k g=12 trellis=1 mlt_profile=hdv_720_25p pass=%passes" />
|
||||
<profile name="NTSC 1080 60i" standard="NTSC" args="f=mpegts acodec=mp2 ab=384k ar=48000 ac=2 vcodec=mpeg2video s=1440x1080 vb=25000k g=15 trellis=1 mlt_profile=hdv_1080_60i pass=%passes" />
|
||||
<profile name="NTSC 1080 30p" standard="NTSC" args="f=mpegts acodec=mp2 ab=384k ar=48000 ac=2 vcodec=mpeg2video s=1440x1080 vb=25000k g=15 trellis=1 mlt_profile=hdv_1080_30p pass=%passes" />
|
||||
<profile name="NTSC 720 30p" standard="NTSC" args="f=mpegts acodec=mp2 ab=384k ar=48000 ac=2 vcodec=mpeg2video s=1280x720 vb=19700k g=15 trellis=1 mlt_profile=hdv_720_30p pass=%passes" />
|
||||
</group>
|
||||
<group name="Web" renderer="avformat" type="av">
|
||||
<profile name="WebM" extension="webm" bitrates="400,600,800,1000,2000,4000,6000,8000" defaultbitrate="2000"
|
||||
args="properties=webm ar=44100 vb=%bitrate+'k' aspect=%dar" />
|
||||
<profile name="Theora" extension="ogv" bitrates="400,600,800,1000,2000,4000,6000,8000" defaultbitrate="2000"
|
||||
audiobitrates="64,128,192,256,384" defaultaudiobitrate="128"
|
||||
args="acodec=vorbis ar=44100 ab=%audiobitrate+'k' vcodec=libtheora vb=%bitrate+'k' aspect=%dar pass=%passes" />
|
||||
<profile name="Flash" extension="flv" bitrates="200,400,600,800,1000,2000,4000,6000,8000" defaultbitrate="1000"
|
||||
audiobitrates="64,128,192,256,384" defaultaudiobitrate="128"
|
||||
args="properties=Flash vb=%bitrate+'k' pass=%passes" />
|
||||
</group>
|
||||
|
||||
<group name="Raw DV" renderer="avformat" type="av" extension="dv">
|
||||
<profile name="DV PAL 4:3" standard="PAL" args="f=dv pix_fmt=yuv420p s=720x576 mlt_profile=dv_pal" />
|
||||
<profile name="DV PAL 16:9" standard="PAL" args="f=dv pix_fmt=yuv420p s=720x576 mlt_profile=dv_pal_wide" />
|
||||
<profile name="DVCPRO25 PAL 4:3" standard="PAL" args="f=dv pix_fmt=yuv411p s=720x576 mlt_profile=dv_pal" />
|
||||
<profile name="DVCPRO25 PAL 16:9" standard="PAL" args="f=dv pix_fmt=yuv411p s=720x576 mlt_profile=dv_pal_wide" />
|
||||
<profile name="DVCPRO50 PAL 4:3" standard="PAL" args="f=dv pix_fmt=yuv422p s=720x576 mlt_profile=dv_pal" />
|
||||
<profile name="DVCPRO50 PAL 16:9" standard="PAL" args="f=dv pix_fmt=yuv422p s=720x576 mlt_profile=dv_pal_wide" />
|
||||
<group name="Mobile devices" extension="mp4" renderer="avformat" type="av">
|
||||
<profile name="Mobile devices"
|
||||
args="acodec=aac ab=128k properties=x264-medium-baseline vb=700k s=480x320 aspect=%dar progressive=1 g=120 pass=%passes" />
|
||||
</group>
|
||||
|
||||
<profile name="DV NTSC 4:3" standard="NTSC" args="f=dv pix_fmt=yuv411p s=720x480 mlt_profile=dv_ntsc" />
|
||||
<profile name="DV NTSC 16:9" standard="NTSC" args="f=dv pix_fmt=yuv411p s=720x480 mlt_profile=dv_ntsc_wide" />
|
||||
<profile name="DVCPRO25 NTSC 4:3" standard="NTSC" args="f=dv pix_fmt=yuv411p s=720x480 mlt_profile=dv_ntsc" />
|
||||
<profile name="DVCPRO25 NTSC 16:9" standard="NTSC" args="f=dv pix_fmt=yuv411p s=720x480 mlt_profile=dv_ntsc_wide" />
|
||||
<profile name="DVCPRO50 NTSC 4:3" standard="NTSC" args="f=dv pix_fmt=yuv422p s=720x480 mlt_profile=dv_ntsc" />
|
||||
<profile name="DVCPRO50 NTSC 16:9" standard="NTSC" args="f=dv pix_fmt=yuv422p s=720x480 mlt_profile=dv_ntsc_wide" />
|
||||
</group>
|
||||
<group name="MP4" extension="mp4" renderer="avformat" type="av">
|
||||
<profile name="H.264/AAC" bitrates="400,600,800,1000,2000,4000,6000,8000,10000,12000,18000,25000" defaultbitrate="2000"
|
||||
audiobitrates="64,128,192,256,384" defaultaudiobitrate="192"
|
||||
args="acodec=aac ar=48000 ab=%audiobitrate+'k' vcodec=libx264 vb=%bitrate+'k' aspect=%dar pass=%passes" />
|
||||
<profile name="MPEG-4/MP3" bitrates="400,600,800,1000,2000,4000,6000,8000,10000,12000,18000,25000" defaultbitrate="2000"
|
||||
audiobitrates="64,128,192,256,384" defaultaudiobitrate="128"
|
||||
args="properties=MPEG-4-ASP ab=%audiobitrate+'k' vb=%bitrate+'k' aspect=%dar pass=%passes" />
|
||||
</group>
|
||||
|
||||
<group name="AVI DV" renderer="avformat" type="av" extension="avi">
|
||||
<profile name="DV PAL 4:3" standard="PAL" args="f=avi vcodec=dvvideo pix_fmt=yuv420p acodec=pcm_s16le s=720x576 mlt_profile=dv_pal" />
|
||||
<profile name="DV PAL 16:9" standard="PAL" args="f=avi vcodec=dvvideo pix_fmt=yuv420p acodec=pcm_s16le s=720x576 mlt_profile=dv_pal_wide" />
|
||||
<profile name="DVCPRO25 PAL 4:3" standard="PAL" args="f=avi vcodec=dvvideo pix_fmt=yuv411p acodec=pcm_s16le s=720x576 mlt_profile=dv_pal" />
|
||||
<profile name="DVCPRO25 PAL 16:9" standard="PAL" args="f=avi vcodec=dvvideo pix_fmt=yuv411p acodec=pcm_s16le s=720x576 mlt_profile=dv_pal_wide" />
|
||||
<profile name="DVCPRO50 PAL 4:3" standard="PAL" args="f=avi vcodec=dvvideo pix_fmt=yuv422p acodec=pcm_s16le s=720x576 mlt_profile=dv_pal" />
|
||||
<profile name="DVCPRO50 PAL 16:9" standard="PAL" args="f=avi vcodec=dvvideo pix_fmt=yuv422p acodec=pcm_s16le s=720x576 mlt_profile=dv_pal_wide" />
|
||||
<group name="MPEG-2" renderer="avformat" extension="mpg" type="av">
|
||||
<profile name="MPEG-2" bitrates="600,800,1000,2000,4000,6000,8000,10000,12000,18000,25000" defaultbitrate="4000"
|
||||
audiobitrates="64,128,192,256,384" defaultaudiobitrate="192"
|
||||
args="properties=MPEG-2 ab=%audiobitrate+'k' vb=%bitrate+'k' aspect=%dar pass=%passes" />
|
||||
</group>
|
||||
|
||||
<profile name="DV NTSC 4:3" standard="NTSC" args="f=avi vcodec=dvvideo pix_fmt=yuv411p acodec=pcm_s16le s=720x480 mlt_profile=dv_ntsc" />
|
||||
<profile name="DV NTSC 16:9" standard="NTSC" args="f=avi vcodec=dvvideo pix_fmt=yuv411p acodec=pcm_s16le s=720x480 mlt_profile=dv_ntsc_wide" />
|
||||
<profile name="DVCPRO25 NTSC 4:3" standard="NTSC" args="f=avi vcodec=dvvideo pix_fmt=yuv411p acodec=pcm_s16le s=720x480 mlt_profile=dv_ntsc" />
|
||||
<profile name="DVCPRO25 NTSC 16:9" standard="NTSC" args="f=avi vcodec=dvvideo pix_fmt=yuv411p acodec=pcm_s16le s=720x480 mlt_profile=dv_ntsc_wide" />
|
||||
<profile name="DVCPRO50 NTSC 4:3" standard="NTSC" args="f=avi vcodec=dvvideo pix_fmt=yuv422p acodec=pcm_s16le s=720x480 mlt_profile=dv_ntsc" />
|
||||
<profile name="DVCPRO50 NTSC 16:9" standard="NTSC" args="f=avi vcodec=dvvideo pix_fmt=yuv422p acodec=pcm_s16le s=720x480 mlt_profile=dv_ntsc_wide" />
|
||||
</group>
|
||||
<group name="HDV" renderer="avformat" type="av" extension="m2t">
|
||||
<profile name="PAL 1080 50i" standard="PAL" args="properties=hdv_1080_50i mlt_profile=hdv_1080_50i vb=25000k pass=%passes" />
|
||||
<profile name="PAL 1080 25p" standard="PAL" args="properties=hdv_1080_25p mlt_profile=hdv_1080_25p vb=25000k pass=%passes" />
|
||||
<profile name="PAL 720 25p" standard="PAL" args="properties=hdv_720_25p mlt_profile=hdv_720_25p vb=19700k pass=%passes" />
|
||||
<profile name="NTSC 1080 60i" standard="NTSC" args="properties=hdv_1080_60i mlt_profile=hdv_1080_60i vb=25000k pass=%passes" />
|
||||
<profile name="NTSC 1080 30p" standard="NTSC" args="properties=hdv_1080_30p mlt_profile=hdv_1080_30p vb=25000k pass=%passes" />
|
||||
<profile name="NTSC 720 30p" standard="NTSC" args="properties=hdv_720_30p mlt_profile=hdv_720_30p vb=19700k pass=%passes" />
|
||||
</group>
|
||||
|
||||
<group name="DVD" renderer="avformat" type="av">
|
||||
<groupname id="dvd">DVD</groupname>
|
||||
<profile name="PAL 4:3 VOB" standard="PAL" extension="vob" args="f=dvd vcodec=mpeg2video acodec=ac3 vb=5000k maxrate=8000k minrate=0 bufsize=1835008 packetsize=2048 muxrate=10080000 ab=192k ar=48000 s=720x576 g=15 me_range=63 trellis=1 mlt_profile=dv_pal pass=%passes" />
|
||||
<profile name="PAL 16:9 VOB" standard="PAL" extension="vob" args="f=dvd vcodec=mpeg2video acodec=ac3 vb=5000k maxrate=8000k minrate=0 bufsize=1835008 packetsize=2048 muxrate=10080000 ab=192k ar=48000 s=720x576 g=15 me_range=63 trellis=1 mlt_profile=dv_pal_wide pass=%passes" />
|
||||
<profile name="NTSC 4:3 VOB" standard="NTSC" extension="vob" args="f=dvd vcodec=mpeg2video acodec=ac3 s=720x480 vb=6000k maxrate=9000k minrate=0 bufsize=1835008 packetsize=2048 muxrate=10080000 ab=192k ar=48000 g=18 me_range=63 trellis=1 mlt_profile=dv_ntsc pass=%passes" />
|
||||
<profile name="NTSC 16:9 VOB" standard="NTSC" extension="vob" args="f=dvd vcodec=mpeg2video acodec=ac3 s=720x480 vb=6000k maxrate=9000k minrate=0 bufsize=1835008 packetsize=2048 muxrate=10080000 ab=192k ar=48000 g=18 me_range=63 trellis=1 mlt_profile=dv_ntsc_wide pass=%passes" />
|
||||
</group>
|
||||
<group name="DVD" renderer="avformat" type="av" extension="vob">
|
||||
<profile name="PAL 4:3 VOB" standard="PAL" args="properties=dv_pal/DVD mlt_profile=dv_pal pass=%passes" />
|
||||
<profile name="PAL 16:9 VOB" standard="PAL" args="properties=dv_pal_wide/DVD mlt_profile=dv_pal_wide pass=%passes" />
|
||||
<profile name="NTSC 4:3 VOB" standard="NTSC" args="properties=dv_ntsc/DVD mlt_profile=dv_ntsc pass=%passes" />
|
||||
<profile name="NTSC 16:9 VOB" standard="NTSC" args="properties=dv_ntsc_wide/DVD mlt_profile=dv_ntsc_wide pass=%passes" />
|
||||
</group>
|
||||
|
||||
<group name="MPEG-2" renderer="avformat" extension="mpg" type="av">
|
||||
<profile name="MPEG-2" bitrates="200,400,600,800,1000,2000,4000,6000,8000,10000,12000,18000,25000" defaultbitrate="12000" audiobitrates="64,128,192,256,384" defaultaudiobitrate="384"
|
||||
args="f=mpeg acodec=mp2 ab=%audiobitrate+'k' ar=48000 vcodec=mpeg2video minrate=0 vb=%bitrate+'k' bf=2 b_strategy=1 trellis=1 aspect=%dar pass=%passes" />
|
||||
</group>
|
||||
<group name="Media players" renderer="avformat" type="av">
|
||||
<profile name="AVI XVid4" extension="avi" bitrates="400,600,800,1000,2000,4000,8000" defaultbitrate="2000"
|
||||
audiobitrates="64,128,192,256,384" defaultaudiobitrate="128"
|
||||
args="acodec=libmp3lame ab=%audiobitrate+'k' ar=44100 vcodec=libxvid vb=%bitrate+'k' aspect=%dar pass=%passes" />
|
||||
<profile name="Windows Media Player WMV7" bitrates="400,1000,2000" defaultbitrate="2000"
|
||||
extension="avi" args="acodec=libmp3lame ab=128k ar=48000 ac=2 vcodec=wmv1 minrate=0 vb=%bitrate+'k' aspect=%dar pass=%passes" />
|
||||
<profile name="Apple Quicktime" bitrates="400,1000,2000" defaultbitrate="2000"
|
||||
extension="mov" args="acodec=aac ab=128k ac=2 ar=48000 vcodec=mpeg4 vb=%bitrate+'k' aspect=%dar pass=%passes" />
|
||||
</group>
|
||||
|
||||
<group name="MPEG-4" renderer="avformat" extension="mp4" type="av">
|
||||
<profile name="MPEG-4" bitrates="200,400,600,800,1000,2000,4000,6000,8000,10000,12000,18000,25000" defaultbitrate="12000" audiobitrates="64,128,192,256,384" defaultaudiobitrate="128"
|
||||
args="f=mp4 acodec=libmp3lame ab=%audiobitrate+'k' ar=44100 vcodec=mpeg4 minrate=0 vb=%bitrate+'k' aspect=%dar mbd=2 trellis=1 mv4=1 pass=%passes" />
|
||||
</group>
|
||||
<group name="Raw DV" renderer="avformat" type="av" extension="dv">
|
||||
<profile name="DV PAL 4:3" standard="PAL" args="properties=dv_pal/DV mlt_profile=dv_pal" />
|
||||
<profile name="DV PAL 16:9" standard="PAL" args="properties=dv_pal_wide/DV mlt_profile=dv_pal_wide" />
|
||||
<profile name="DVCPRO50 PAL 4:3" standard="PAL" args="properties=dv_pal/DVCPRO50 mlt_profile=dv_pal" />
|
||||
<profile name="DVCPRO50 PAL 16:9" standard="PAL" args="properties=dv_pal_wide/DVCPRO50 mlt_profile=dv_pal_wide" />
|
||||
<profile name="DV NTSC 4:3" standard="NTSC" args="properties=dv_ntsc/DV mlt_profile=dv_ntsc" />
|
||||
<profile name="DV NTSC 16:9" standard="NTSC" args="properties=dv_ntsc_wide/DV mlt_profile=dv_ntsc_wide" />
|
||||
<profile name="DVCPRO50 NTSC 4:3" standard="NTSC" args="properties=dv_ntsc/DVCPRO50 mlt_profile=dv_ntsc" />
|
||||
<profile name="DVCPRO50 NTSC 16:9" standard="NTSC" args="properties=dv_ntsc_wide/DVCPRO50 mlt_profile=dv_ntsc_wide" />
|
||||
</group>
|
||||
|
||||
<group name="XVid4" renderer="avformat" extension="avi" type="av">
|
||||
<profile name="XVid4" bitrates="400,600,800,1000,2000,4000,8000,10000,12000" defaultbitrate="8000"
|
||||
audiobitrates="64,128,192,256,384" defaultaudiobitrate="128" args="acodec=libmp3lame ab=%audiobitrate+'k' ar=44100 vcodec=libxvid minrate=0 vb=%bitrate+'k' aspect=%dar mbd=2 trellis=1 mv4=1 pass=%passes" />
|
||||
</group>
|
||||
<group name="Audio only" renderer="avformat" type="audio">
|
||||
<profile name="WAV 22050 KHz" extension="wav" args="properties=WAV ar=22050" />
|
||||
<profile name="WAV 44100 KHz" extension="wav" args="properties=WAV ar=44100" />
|
||||
<profile name="WAV 48000 KHz" extension="wav" args="properties=WAV ar=48000" />
|
||||
</group>
|
||||
|
||||
<group name="H.264" renderer="avformat" extension="mp4" type="av">
|
||||
<profile name="H.264" bitrates="200,400,600,800,1000,2000,4000,6000,8000,10000,12000,18000,25000" defaultbitrate="12000" audiobitrates="64,128,192,256,384" defaultaudiobitrate="384"
|
||||
args="f=mp4 hq=1 acodec=aac ab=%audiobitrate+'k' ar=48000 pix_fmt=yuv420p vcodec=libx264 minrate=0 vb=%bitrate+'k' g=250 bf=3 b_strategy=1 subcmp=2 cmp=2 coder=1 flags=+loop flags2=dct8x8 qmax=51 subq=7 qmin=10 qcomp=0.6 qdiff=4 trellis=1 aspect=%dar pass=%passes" />
|
||||
</group>
|
||||
|
||||
<group name="Flash" renderer="avformat" extension="flv" type="av">
|
||||
<profile name="Flash" bitrates="200,400,600,800,1000,2000,4000,6000,8000,10000,12000" defaultbitrate="8000"
|
||||
args="f=flv acodec=libmp3lame ab=128k ar=44100 vcodec=flv minrate=0 vb=%bitrate+'k' progressive=1 pass=%passes threads=1" />
|
||||
<profile name="Flash 720x576" standard="PAL" args="f=flv acodec=libmp3lame ab=128k ar=44100 vcodec=flv minrate=0 vb=12000k s=720x576 progressive=1 pass=%passes threads=1" />
|
||||
<profile name="Flash 720x480" standard="NTSC" args="f=flv acodec=libmp3lame ab=128k ar=44100 vcodec=flv minrate=0 vb=12000k s=720x480 progressive=1 pass=%passes threads=1" />
|
||||
</group>
|
||||
|
||||
<group name="RealVideo" renderer="avformat" extension="rm" type="av">
|
||||
<profile name="RealVideo" bitrates="200,400,600,800,1000,2000,4000,6000,8000,10000,12000" defaultbitrate="8000"
|
||||
args="vcodec=rv20 acodec=ac3 minrate=0 vb=%bitrate+'k' ab=128k ar=44100 g=8 pass=%passes" />
|
||||
<profile name="RealVideo 720x576" standard="PAL" args="vcodec=rv20 acodec=ac3 minrate=0 vb=12000k ab=384k ar=48000 s=720x576 g=8 pass=%passes" />
|
||||
<profile name="RealVideo 720x480" standard="NTSC" args="vcodec=rv20 acodec=ac3 minrate=0 vb=12000k ab=384k ar=48000 s=720x480 g=8 pass=%passes" />
|
||||
</group>
|
||||
|
||||
<group name="Theora" renderer="avformat" extension="ogv" type="av">
|
||||
<profile name="Theora" bitrates="200,400,600,800,1000,2000,4000,6000,8000,10000,12000" defaultbitrate="8000"
|
||||
audiobitrates="64,128,192,256,384" defaultaudiobitrate="128" args="acodec=vorbis ab=%audiobitrate+'k' ar=44100 aq=50 vcodec=libtheora minrate=0 vb=%bitrate+'k' aspect=%dar pass=%passes" />
|
||||
<profile name="Theora 720x576" standard="PAL" args="acodec=vorbis ab=384k aq=30 ar=44100 vcodec=libtheora minrate=0 vb=12000k s=720x576 aspect=%dar pass=%passes" />
|
||||
<profile name="Theora 720x480" standard="NTSC" args="acodec=vorbis ab=384k aq=30 ar=44100 vcodec=libtheora minrate=0 vb=12000k s=720x480 aspect=%dar pass=%passes" />
|
||||
</group>
|
||||
|
||||
<group name="WebM" renderer="avformat" extension="webm" type="av">
|
||||
<profile name="WebM" bitrates="200,400,600,800,1000,2000,4000,6000,8000,10000,12000" defaultbitrate="8000"
|
||||
audiobitrates="64,128,192,256,384" defaultaudiobitrate="128" args="acodec=vorbis ab=%audiobitrate+'k' ar=44100 aq=50 vcodec=libvpx minrate=0 vb=%bitrate+'k' aspect=%dar maxrate=%bitrate*2+'k' g=120 qmax=42 qmin=10" />
|
||||
</group>
|
||||
|
||||
<group name="Media players" renderer="avformat" type="av">
|
||||
<groupname id="mediaplayers">Media players</groupname>
|
||||
<profile name="Windows Media Player WMV V7" bitrates="400,1000,2000" defaultbitrate="2000"
|
||||
extension="avi" args="acodec=libmp3lame ab=128k ar=48000 ac=2 vcodec=wmv1 minrate=0 vb=%bitrate+'k' aspect=%dar pass=%passes" />
|
||||
<profile name="Apple Quicktime Player MPEG-4" bitrates="400,1000,2000" defaultbitrate="2000"
|
||||
extension="mov" args="acodec=aac ab=128k ac=2 ar=48000 vcodec=mpeg4 minrate=0 vb=%bitrate+'k' aspect=%dar pass=%passes" />
|
||||
</group>
|
||||
|
||||
<group name="Web sites" renderer="avformat" type="av">
|
||||
<groupname id="websites">Web sites</groupname>
|
||||
<profile name="Dailymotion 320x240" extension="flv" args="f=flv acodec=libmp3lame ab=128k ar=44100 vcodec=flv minrate=0 vb=800k s=320x240 aspect=%dar trellis=1 pass=%passes" url="http://www.dailymotion.com/upload" />
|
||||
<profile name="Dailymotion 512x384" extension="mp4" args="f=mp4 acodec=aac ab=96k ar=44100 vcodec=libx264 minrate=0 vb=600k g=250 bf=3 s=512x384 aspect=%dar mbd=2 trellis=1 mv4=1 subq=7 qmin=10 qcomp=0.6 qdiff=4 qmax=51 pass=%passes" url="http://www.dailymotion.com/upload" />
|
||||
<profile name="Dailymotion 1280x720" extension="mp4" args="f=mp4 acodec=aac ab=96k ar=44100 vcodec=libx264 minrate=0 vb=1500k g=250 bf=3 s=1280x720 aspect=%dar mbd=2 trellis=1 mv4=1 subq=7 qmin=10 qcomp=0.6 qdiff=4 qmax=51 pass=%passes" url="http://www.dailymotion.com/upload" />
|
||||
<profile name="Vimeo 640x480" extension="mp4" args="f=mp4 acodec=aac ab=128k ar=44100 vcodec=libx264 minrate=0 vb=3000k g=250 bf=3 s=640x480 aspect=%dar mbd=2 trellis=1 mv4=1 subq=7 qmin=10 qcomp=0.6 qdiff=4 qmax=51 pass=%passes" url="http://www.vimeo.com/upload" />
|
||||
<profile name="Vimeo 1280x720" extension="mp4" args="f=mp4 acodec=aac ab=128k ar=44100 vcodec=libx264 minrate=0 vb=5000k g=250 bf=3 s=1280x720 aspect=%dar mbd=2 trellis=1 mv4=1 subq=7 qmin=10 qcomp=0.6 qdiff=4 qmax=51 pass=%passes" url="http://www.vimeo.com/upload" />
|
||||
<profile name="YouTube 640x480" extension="mp4" args="f=mp4 acodec=libmp3lame ab=128k ar=44100 vcodec=mpeg4 minrate=0 vb=800k s=640x480 aspect=%dar mbd=2 trellis=1 mv4=1 subq=7 qmin=10 qcomp=0.6 qdiff=4 qmax=51 pass=%passes" url="http://www.youtube.com/upload" />
|
||||
<profile name="YouTube 1280x720" extension="mp4" args="f=mp4 hq=1 acodec=aac ab=128k ar=44100 vcodec=mpeg4 minrate=0 vb=2000k s=1280x720 aspect=%dar mbd=2 trellis=1 mv4=1 subq=7 qmin=10 qcomp=0.6 qdiff=4 qmax=51 pass=%passes" url="http://www.youtube.com/upload" />
|
||||
</group>
|
||||
|
||||
|
||||
<group name="Wav" renderer="avformat" type="audio">
|
||||
<groupname id="audioonly">Audio only</groupname>
|
||||
<profile name="WAV 22050 KHz" extension="wav" args="f=wav ar=22050 video_off=1" />
|
||||
<profile name="WAV 32000 KHz" extension="wav" args="f=wav ar=32000 video_off=1" />
|
||||
<profile name="WAV 44100 KHz" extension="wav" args="f=wav ar=44100 video_off=1" />
|
||||
<profile name="WAV 48000 KHz" extension="wav" args="f=wav ar=48000 video_off=1" />
|
||||
</group>
|
||||
|
||||
<group name="Lossless/HQ" renderer="avformat" type="av">
|
||||
<groupname id="lossless">Lossless / HQ</groupname>
|
||||
<profile name="FFV1 lossless (video) + FLAC (sound)" extension="mkv" args="f=matroska acodec=flac ar=48000 ac=2 vcodec=ffv1 aspect=%dar" />
|
||||
<profile name="FFV1 lossless (video) + PCM (sound)" extension="mkv" args="f=matroska acodec=pcm_s16le ac=2 vcodec=ffv1 aspect=%dar" />
|
||||
<profile name="HuffYUV lossless (video) + PCM (sound)" extension="avi" args="f=avi acodec=pcm_s16le ac=2 vcodec=huffyuv aspect=%dar" />
|
||||
<profile name="MPEG-2 I-frame only (video) + MP2 (sound)" extension="mpg" args="f=mpeg acodec=mp2 ab=384k ar=48000 ac=2 vcodec=mpeg2video qscale=1 qmin=1 aspect=%dar intra=1" />
|
||||
<profile name="MPEG-4 I-frame only (video) + MP3 (sound)" extension="mp4" args="f=mp4 acodec=libmp3lame ab=384k ar=48000 ac=2 vcodec=mpeg4 qscale=1 qmin=1 aspect=%dar intra=1" />
|
||||
<profile name="H.264 I-frame only (video) + AAC (sound)" extension="mp4" args="f=mp4 acodec=aac ab=384k ar=48000 ac=2 pix_fmt=yuv420p vcodec=libx264 cqp=1 subq=1 qmax=1 qmin=1 qcomp=0.6 qdiff=0 coder=ac trellis=1 aspect=%dar intra=1" />
|
||||
<profile name="H.264 lossless slow (video) + PCM (sound)" extension="mkv" args="f=matroska acodec=pcm_s16le ac=2 pix_fmt=yuv420p vcodec=libx264 qp=0 preset=veryslow aspect=%dar" />
|
||||
<profile name="H.264 lossless fast (video) + PCM (sound)" extension="mkv" args="f=matroska acodec=pcm_s16le ac=2 pix_fmt=yuv420p vcodec=libx264 qp=0 preset=ultrafast aspect=%dar" />
|
||||
</group>
|
||||
|
||||
<group name="Apple" renderer="avformat" type="av">
|
||||
<groupname id="mobile">Mobile devices</groupname>
|
||||
<profile name="iPod Classic 500k" extension="m4v" args="s=320x240 aspect=%dar progressive=1 acodec=aac ab=128k vcodec=libx264 vb=500k flags=+loop cmp=+chroma partitions=+parti8x8+parti4x4+partp8x8+partb8x8 me_method=umh subq=5 me_range=16 g=250 keyint_min=25 sc_threshold=40 i_qfactor=0.71 qcomp=0.6 qmin=10 qmax=51 qdiff=4 directpred=1 trellis=1 coder=0 bf=0 refs=1 flags2=-wpred-dct8x8 level=13 maxrate=3000k bufsize=768k wpredp=0 bt=256k pass=%passes" />
|
||||
<profile name="iPhone/iPod Touch 700k" extension="m4v" args="s=480x320 aspect=%dar progressive=1 acodec=aac ab=128k vcodec=libx264 vb=700k flags=+loop cmp=+chroma partitions=+parti8x8+parti4x4+partp8x8+partb8x8 me_method=umh subq=7 me_range=16 g=250 keyint_min=25 sc_threshold=40 i_qfactor=0.71 qcomp=0.6 qmin=10 qmax=51 qdiff=4 directpred=1 trellis=1 coder=0 bf=0 refs=3 flags2=-wpred-dct8x8 level=30 maxrate=10000k bufsize=10000k wpredp=0 pass=%passes" />
|
||||
</group>
|
||||
|
||||
<group name="Android" renderer="avformat" type="av">
|
||||
<groupname id="mobile">Mobile devices</groupname>
|
||||
<profile name="480x320 700k" extension="mp4" args="s=480x320 aspect=%dar progressive=1 acodec=aac ab=128k vcodec=libx264 vb=700k flags=+loop cmp=+chroma partitions=+parti8x8+parti4x4+partp8x8+partb8x8 me_method=umh subq=7 me_range=16 g=250 keyint_min=25 sc_threshold=40 i_qfactor=0.71 qcomp=0.6 qmin=10 qmax=51 qdiff=4 directpred=1 trellis=1 coder=0 bf=0 refs=1 flags2=-wpred-dct8x8 level=30 maxrate=10000k bufsize=10000k wpredp=0 pass=%passes" />
|
||||
</group>
|
||||
<group name="Lossless/HQ" renderer="avformat" type="av">
|
||||
<profile name="Lossless FFV1 + FLAC" extension="mkv" args="properties=lossless/FFV1" />
|
||||
<profile name="Lossless HuffYUV + FLAC" extension="mkv" args="properties=lossless/HuffYUV" />
|
||||
<profile name="Lossless MPEG-2 + AC3" extension="mpg" args="properties=lossless/MPEG-2" />
|
||||
<profile name="Lossless MPEG-4 + PCM" extension="avi" args="properties=lossless/MPEG-4" />
|
||||
<profile name="Lossless H.264 + AAC" extension="mp4" args="properties=lossless/H.264" />
|
||||
</group>
|
||||
|
||||
</profiles>
|
||||
|
||||
0
lumas/burst.pgm
Executable file → Normal file
0
lumas/burst.pgm
Executable file → Normal file
0
lumas/checkerboard_small.pgm
Executable file → Normal file
0
lumas/checkerboard_small.pgm
Executable file → Normal file
0
lumas/horizontal_blinds.pgm
Executable file → Normal file
0
lumas/horizontal_blinds.pgm
Executable file → Normal file
0
lumas/symmetric_clock.pgm
Executable file → Normal file
0
lumas/symmetric_clock.pgm
Executable file → Normal file
@@ -21,22 +21,18 @@
|
||||
#include "sampleplugin.h"
|
||||
#include "ui_countdown_ui.h"
|
||||
|
||||
#include <KUrlRequester>
|
||||
#include <KIntSpinBox>
|
||||
#include <KDebug>
|
||||
#include <KMessageBox>
|
||||
#include <KApplication>
|
||||
|
||||
#include <QDialog>
|
||||
#include <QDomDocument>
|
||||
#include <QInputDialog>
|
||||
#include <QProcess>
|
||||
|
||||
QStringList SamplePlugin::generators(const QStringList producers) const
|
||||
QStringList SamplePlugin::generators(const QStringList &producers) const
|
||||
{
|
||||
QStringList result;
|
||||
if (producers.contains("pango")) result << i18n("Countdown");
|
||||
if (producers.contains("noise")) result << i18n("Noise");
|
||||
if (producers.contains(QLatin1String("pango"))) result << i18n("Countdown");
|
||||
if (producers.contains(QLatin1String("noise"))) result << i18n("Noise");
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -45,75 +41,75 @@ KUrl SamplePlugin::generatedClip(const QString &renderer, const QString &generat
|
||||
{
|
||||
QString prePath;
|
||||
if (generator == i18n("Noise")) {
|
||||
prePath = projectFolder.path() + "/noise";
|
||||
} else prePath = projectFolder.path() + "/counter";
|
||||
prePath = projectFolder.path() + QLatin1String("/noise");
|
||||
} else prePath = projectFolder.path() + QLatin1String("/counter");
|
||||
int ct = 0;
|
||||
QString counter = QString::number(ct).rightJustified(5, '0', false);
|
||||
while (QFile::exists(prePath + counter + ".mlt")) {
|
||||
QString counter = QString::number(ct).rightJustified(5, QLatin1Char('0'), false);
|
||||
while (QFile::exists(prePath + counter + QLatin1String(".mlt"))) {
|
||||
ct++;
|
||||
counter = QString::number(ct).rightJustified(5, '0', false);
|
||||
counter = QString::number(ct).rightJustified(5, QLatin1Char('0'), false);
|
||||
}
|
||||
QPointer<QDialog> d = new QDialog;
|
||||
Ui::CountDown_UI view;
|
||||
view.setupUi(d);
|
||||
if (generator == i18n("Noise")) {
|
||||
d->setWindowTitle(tr("Create Noise Clip"));
|
||||
d->setWindowTitle(i18n("Create Noise Clip"));
|
||||
view.font_label->setHidden(true);
|
||||
view.font->setHidden(true);
|
||||
} else {
|
||||
d->setWindowTitle(tr("Create Countdown Clip"));
|
||||
d->setWindowTitle(i18n("Create Countdown Clip"));
|
||||
view.font->setValue(height);
|
||||
}
|
||||
|
||||
// Set single file mode. Default seems to be File::ExistingOnly.
|
||||
view.path->setMode(KFile::File);
|
||||
|
||||
QString clipFile = prePath + counter + ".mlt";
|
||||
QString clipFile = prePath + counter + QLatin1String(".mlt");
|
||||
view.path->setUrl(KUrl(clipFile));
|
||||
KUrl result;
|
||||
|
||||
if (d->exec() == QDialog::Accepted) {
|
||||
QProcess generatorProcess;
|
||||
QProcess generatorProcess;
|
||||
|
||||
// Disable VDPAU so that rendering will work even if there is a Kdenlive instance using VDPAU
|
||||
// Disable VDPAU so that rendering will work even if there is a Kdenlive instance using VDPAU
|
||||
#if QT_VERSION >= 0x040600
|
||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||
env.insert("MLT_NO_VDPAU", "1");
|
||||
generatorProcess.setProcessEnvironment(env);
|
||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||
env.insert(QLatin1String("MLT_NO_VDPAU"), QLatin1String("1"));
|
||||
generatorProcess.setProcessEnvironment(env);
|
||||
#else
|
||||
QStringList env = QProcess::systemEnvironment();
|
||||
env << "MLT_NO_VDPAU=1";
|
||||
generatorProcess.setEnvironment(env);
|
||||
QStringList env = QProcess::systemEnvironment();
|
||||
env << QLatin1String("MLT_NO_VDPAU=1");
|
||||
generatorProcess.setEnvironment(env);
|
||||
#endif
|
||||
QStringList args;
|
||||
if (generator == i18n("Noise")) {
|
||||
args << "noise:" << "in=0" << QString("out=" + QString::number((int) fps * view.duration->value()));
|
||||
}
|
||||
else {
|
||||
// Countdown producer
|
||||
for (int i = 0; i < view.duration->value(); i++) {
|
||||
QStringList args;
|
||||
if (generator == i18n("Noise")) {
|
||||
args << QLatin1String("noise:") << QLatin1String("in=0") << QLatin1String("out=") + QString::number((int) fps * view.duration->value());
|
||||
}
|
||||
else {
|
||||
// Countdown producer
|
||||
for (int i = 0; i < view.duration->value(); i++) {
|
||||
// Create the producers
|
||||
args << "pango:" << "in=0" << QString("out=" + QString::number((int) fps * view.duration->value()));
|
||||
args << QString("text=" + QString::number(view.duration->value() - i));
|
||||
args << QString("font=" + QString::number(view.font->value()) + "px");
|
||||
}
|
||||
}
|
||||
|
||||
args << "-consumer"<<QString("xml:%1").arg(view.path->url().path());
|
||||
generatorProcess.start(renderer, args);
|
||||
args << QLatin1String("pango:") << QLatin1String("in=0") << QLatin1String("out=") + QString::number((int) fps * view.duration->value());
|
||||
args << QLatin1String("text=") + QString::number(view.duration->value() - i);
|
||||
args << QLatin1String("font=") + QString::number(view.font->value()) + QLatin1String("px");
|
||||
}
|
||||
}
|
||||
|
||||
args << QLatin1String("-consumer")<<QString::fromLatin1("xml:%1").arg(view.path->url().path());
|
||||
generatorProcess.start(renderer, args);
|
||||
if (generatorProcess.waitForFinished()) {
|
||||
if (generatorProcess.exitStatus() == QProcess::CrashExit) {
|
||||
if (generatorProcess.exitStatus() == QProcess::CrashExit) {
|
||||
kDebug() << "/// Generator failed: ";
|
||||
QString error = generatorProcess.readAllStandardError();
|
||||
KMessageBox::sorry(kapp->activeWindow(), i18n("Failed to generate clip:\n%1", error, i18n("Generator Failed")));
|
||||
}
|
||||
else {
|
||||
result = view.path->url();
|
||||
}
|
||||
QString error = QString::fromLocal8Bit(generatorProcess.readAllStandardError());
|
||||
KMessageBox::sorry(kapp->activeWindow(), i18n("Failed to generate clip:\n%1", error, i18n("Generator Failed")));
|
||||
}
|
||||
else {
|
||||
result = view.path->url();
|
||||
}
|
||||
} else {
|
||||
kDebug() << "/// Generator failed: ";
|
||||
QString error = generatorProcess.readAllStandardError();
|
||||
KMessageBox::sorry(kapp->activeWindow(), i18n("Failed to generate clip:\n%1", error, i18n("Generator Failed")));
|
||||
kDebug() << "/// Generator failed: ";
|
||||
QString error = QString::fromLocal8Bit(generatorProcess.readAllStandardError());
|
||||
KMessageBox::sorry(kapp->activeWindow(), i18n("Failed to generate clip:\n%1", error, i18n("Generator Failed")));
|
||||
}
|
||||
}
|
||||
delete d;
|
||||
@@ -121,3 +117,5 @@ KUrl SamplePlugin::generatedClip(const QString &renderer, const QString &generat
|
||||
}
|
||||
|
||||
Q_EXPORT_PLUGIN2(kdenlive_sampleplugin, SamplePlugin)
|
||||
|
||||
#include "sampleplugin.moc"
|
||||
|
||||
@@ -34,7 +34,7 @@ class SamplePlugin : public QObject, public ClipGenerator
|
||||
Q_INTERFACES(ClipGenerator)
|
||||
|
||||
public:
|
||||
QStringList generators(const QStringList producers = QStringList()) const;
|
||||
QStringList generators(const QStringList &producers = QStringList()) const;
|
||||
KUrl generatedClip(const QString &renderer, const QString &generator, const KUrl &projectFolder, const QStringList &lumaNames, const QStringList &lumaFiles, const double fps, const int width, const int height);
|
||||
};
|
||||
|
||||
|
||||
@@ -22,8 +22,7 @@
|
||||
#include <QStringList>
|
||||
#include <QString>
|
||||
#include <QUrl>
|
||||
#include <QtDebug>
|
||||
|
||||
#include <QDebug>
|
||||
#include "renderjob.h"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
@@ -40,65 +39,74 @@ int main(int argc, char **argv)
|
||||
args.removeFirst();
|
||||
|
||||
bool erase = false;
|
||||
if (args.at(0) == "-erase") {
|
||||
if (args.at(0) == QLatin1String("-erase")) {
|
||||
erase = true;
|
||||
args.removeFirst();
|
||||
}
|
||||
bool usekuiserver = false;
|
||||
if (args.at(0) == "-kuiserver") {
|
||||
if (args.at(0) == QLatin1String("-kuiserver")) {
|
||||
usekuiserver = true;
|
||||
args.removeFirst();
|
||||
}
|
||||
if (QString(args.at(0)).startsWith("-pid:")) {
|
||||
pid = QString(args.at(0)).section(':', 1).toInt();
|
||||
if (QString(args.at(0)).startsWith(QLatin1String("-pid:"))) {
|
||||
pid = QString(args.at(0)).section(QLatin1Char(':'), 1).toInt();
|
||||
args.removeFirst();
|
||||
}
|
||||
|
||||
if (QString(args.at(0)).startsWith("-locale:")) {
|
||||
locale = QString(args.at(0)).section(':', 1);
|
||||
if (QString(args.at(0)).startsWith(QLatin1String("-locale:"))) {
|
||||
locale = QString(args.at(0)).section(QLatin1Char(':'), 1);
|
||||
args.removeFirst();
|
||||
}
|
||||
if (args.at(0).startsWith("in="))
|
||||
in = args.takeFirst().section('=', -1).toInt();
|
||||
if (args.at(0).startsWith("out="))
|
||||
out = args.takeFirst().section('=', -1).toInt();
|
||||
if (args.at(0).startsWith("preargs="))
|
||||
preargs = args.takeFirst().section('=', 1).split(' ', QString::SkipEmptyParts);
|
||||
if (args.at(0).startsWith(QLatin1String("in=")))
|
||||
in = args.takeFirst().section(QLatin1Char('='), -1).toInt();
|
||||
if (args.at(0).startsWith(QLatin1String("out=")))
|
||||
out = args.takeFirst().section(QLatin1Char('='), -1).toInt();
|
||||
if (args.at(0).startsWith(QLatin1String("preargs=")))
|
||||
preargs = args.takeFirst().section(QLatin1Char('='), 1).split(QLatin1Char(' '), QString::SkipEmptyParts);
|
||||
|
||||
QString render = args.takeFirst();
|
||||
QString profile = args.takeFirst();
|
||||
QString rendermodule = args.takeFirst();
|
||||
QString player = args.takeFirst();
|
||||
QByteArray srcString = args.takeFirst().toUtf8();
|
||||
QUrl srcurl = QUrl::fromEncoded(srcString);
|
||||
QByteArray srcString = args.takeFirst().toUtf8();
|
||||
QUrl srcurl = QUrl::fromEncoded(srcString);
|
||||
QString src = srcurl.path();
|
||||
// The QUrl path() strips the consumer: protocol, so re-add it if necessary
|
||||
if (srcString.startsWith("consumer:")) src.prepend("consumer:");
|
||||
// The QUrl path() strips the consumer: protocol, so re-add it if necessary
|
||||
if (srcString.startsWith("consumer:"))
|
||||
src.prepend(QLatin1String("consumer:"));
|
||||
QUrl desturl = QUrl::fromEncoded(args.takeFirst().toUtf8());
|
||||
QString dest = desturl.path();
|
||||
bool dualpass = false;
|
||||
bool doerase;
|
||||
QString vpre;
|
||||
|
||||
int vprepos = args.indexOf(QRegExp("vpre=.*"));
|
||||
int vprepos = args.indexOf(QRegExp(QLatin1String("vpre=.*")));
|
||||
if (vprepos >= 0) {
|
||||
vpre=args.at(vprepos);
|
||||
}
|
||||
QStringList vprelist = vpre.replace("vpre=", "").split(',');
|
||||
QStringList vprelist = vpre.replace(QLatin1String("vpre="), QLatin1String("")).split(QLatin1Char(','));
|
||||
if (vprelist.size() > 0) {
|
||||
args.replaceInStrings(QRegExp("^vpre=.*"), QString("vpre=").append(vprelist.at(0)));
|
||||
args.replaceInStrings(QRegExp(QLatin1String("^vpre=.*")), QString::fromLatin1("vpre=%1").arg(vprelist.at(0)));
|
||||
}
|
||||
|
||||
if (args.contains("pass=2")) {
|
||||
if (args.contains(QLatin1String("pass=2"))) {
|
||||
// dual pass encoding
|
||||
dualpass = true;
|
||||
doerase = false;
|
||||
args.replace(args.indexOf("pass=2"), "pass=1");
|
||||
if (args.contains("vcodec=libx264")) args << QString("passlogfile=%1").arg(dest + ".log");
|
||||
args.replace(args.indexOf(QLatin1String("pass=2")), QLatin1String("pass=1"));
|
||||
if (args.contains(QLatin1String("vcodec=libx264"))) args << QString::fromLatin1("passlogfile=%1").arg(dest + QLatin1String(".log"));
|
||||
} else {
|
||||
args.removeAll("pass=1");
|
||||
args.removeAll(QLatin1String("pass=1"));
|
||||
doerase = erase;
|
||||
}
|
||||
|
||||
// Decode metadata
|
||||
for (int i = 0; i < args.count(); ++i) {
|
||||
if (args.at(i).startsWith(QLatin1String("meta.attr"))) {
|
||||
QString data = args.at(i);
|
||||
args.replace(i, data.section(QLatin1Char('='), 0, 0) + QLatin1String("=\"") + QUrl::fromPercentEncoding(data.section(QLatin1Char('='), 1).toUtf8()) + QLatin1String("\""));
|
||||
}
|
||||
}
|
||||
|
||||
qDebug() << "//STARTING RENDERING: " << erase << "," << usekuiserver << "," << render << "," << profile << "," << rendermodule << "," << player << "," << src << "," << dest << "," << preargs << "," << args << "," << in << "," << out ;
|
||||
RenderJob *job = new RenderJob(doerase, usekuiserver, pid, render, profile, rendermodule, player, src, dest, preargs, args, in, out);
|
||||
@@ -106,8 +114,8 @@ int main(int argc, char **argv)
|
||||
job->start();
|
||||
if (dualpass) {
|
||||
if (vprelist.size()>1)
|
||||
args.replaceInStrings(QRegExp("^vpre=.*"),QString("vpre=").append(vprelist.at(1)));
|
||||
args.replace(args.indexOf("pass=1"), "pass=2");
|
||||
args.replaceInStrings(QRegExp(QLatin1String("^vpre=.*")),QString::fromLatin1("vpre=%1").arg(vprelist.at(1)));
|
||||
args.replace(args.indexOf(QLatin1String("pass=1")), QLatin1String("pass=2"));
|
||||
RenderJob *dualjob = new RenderJob(erase, usekuiserver, pid, render, profile, rendermodule, player, src, dest, preargs, args, in, out);
|
||||
QObject::connect(job, SIGNAL(renderingFinished()), dualjob, SLOT(start()));
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
class SleepThread : QThread
|
||||
{
|
||||
public:
|
||||
virtual void run() {};
|
||||
virtual void run() {}
|
||||
static void msleep(unsigned long msecs) {
|
||||
QThread::msleep(msecs);
|
||||
}
|
||||
@@ -57,29 +57,29 @@ RenderJob::RenderJob(bool erase, bool usekuiserver, int pid, const QString& rend
|
||||
// Disable VDPAU so that rendering will work even if there is a Kdenlive instance using VDPAU
|
||||
#if QT_VERSION >= 0x040600
|
||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||
env.insert("MLT_NO_VDPAU", "1");
|
||||
env.insert(QLatin1String("MLT_NO_VDPAU"), QLatin1String("1"));
|
||||
m_renderProcess->setProcessEnvironment(env);
|
||||
#else
|
||||
QStringList env = QProcess::systemEnvironment();
|
||||
env << "MLT_NO_VDPAU=1";
|
||||
env << QLatin1String("MLT_NO_VDPAU=1");
|
||||
m_renderProcess->setEnvironment(env);
|
||||
#endif
|
||||
|
||||
m_prog = renderer;
|
||||
m_args << scenelist;
|
||||
if (in != -1) m_args << "in=" + QString::number(in);
|
||||
if (out != -1) m_args << "out=" + QString::number(out);
|
||||
if (in != -1) m_args << QLatin1String("in=") + QString::number(in);
|
||||
if (out != -1) m_args << QLatin1String("out=") + QString::number(out);
|
||||
|
||||
m_args << preargs;
|
||||
//qDebug()<<"PRE ARGS: "<<preargs;
|
||||
if (scenelist.startsWith("consumer:")) {
|
||||
if (scenelist.startsWith(QLatin1String("consumer:"))) {
|
||||
// Use MLT's producer_consumer, needs a different syntax for profile:
|
||||
m_args << "profile=" + profile;
|
||||
} else m_args << "-profile" << profile;
|
||||
m_args << "-consumer" << rendermodule + ':' + m_dest << "progress=1" << args;
|
||||
m_args << QLatin1String("profile=") + profile;
|
||||
} else m_args << QLatin1String("-profile") << profile;
|
||||
m_args << QLatin1String("-consumer") << rendermodule + QLatin1Char(':') + m_dest << QLatin1String("progress=1") << args;
|
||||
|
||||
m_dualpass = false;
|
||||
if (args.contains("pass=1")) m_dualpass = true;
|
||||
if (args.contains(QLatin1String("pass=1"))) m_dualpass = true;
|
||||
|
||||
connect(m_renderProcess, SIGNAL(stateChanged(QProcess::ProcessState)), this, SLOT(slotCheckProcess(QProcess::ProcessState)));
|
||||
m_renderProcess->setReadChannel(QProcess::StandardError);
|
||||
@@ -88,7 +88,7 @@ RenderJob::RenderJob(bool erase, bool usekuiserver, int pid, const QString& rend
|
||||
if (m_enablelog) {
|
||||
// Create a log of every render process.
|
||||
m_logfile.setAutoRemove(false);
|
||||
m_logfile.setFileTemplate(QDir::tempPath() + "/kdenlive_render.log.XXXXXXXX");
|
||||
m_logfile.setFileTemplate(QDir::tempPath() + QLatin1String("/kdenlive_render.log.XXXXXXXX"));
|
||||
if (m_logfile.open()) {
|
||||
qDebug() << "Writing render log to " << m_logfile.fileName();
|
||||
|
||||
@@ -97,8 +97,8 @@ RenderJob::RenderJob(bool erase, bool usekuiserver, int pid, const QString& rend
|
||||
}
|
||||
m_logstream.setDevice(&m_logfile);
|
||||
QString tmplist = scenelist;
|
||||
if (tmplist.contains("consumer:")) {
|
||||
QStringList tl = tmplist.split("consumer:");
|
||||
if (tmplist.contains(QLatin1String("consumer:"))) {
|
||||
const QStringList tl = tmplist.split(QLatin1String("consumer:"));
|
||||
if (tl.count() == 2) {
|
||||
tmplist = tl[1];
|
||||
}
|
||||
@@ -118,7 +118,7 @@ RenderJob::RenderJob(bool erase, bool usekuiserver, int pid, const QString& rend
|
||||
|
||||
RenderJob::~RenderJob()
|
||||
{
|
||||
if (m_renderProcess) delete m_renderProcess;
|
||||
delete m_renderProcess;
|
||||
if (m_enablelog) {
|
||||
m_logfile.close();
|
||||
}
|
||||
@@ -128,11 +128,11 @@ void RenderJob::setLocale(const QString &locale)
|
||||
{
|
||||
#if QT_VERSION >= 0x040600
|
||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||
env.insert("LC_NUMERIC", locale);
|
||||
env.insert(QLatin1String("LC_NUMERIC"), locale);
|
||||
m_renderProcess->setProcessEnvironment(env);
|
||||
#else
|
||||
QStringList env = QProcess::systemEnvironment();
|
||||
env << QString("LC_NUMERIC=%1").arg(locale);
|
||||
env << QString::fromLatin1("LC_NUMERIC=%1").arg(locale);
|
||||
m_renderProcess->setEnvironment(env);
|
||||
#endif
|
||||
}
|
||||
@@ -150,9 +150,9 @@ void RenderJob::slotAbort()
|
||||
if (m_kdenliveinterface) {
|
||||
m_dbusargs[1] = -3;
|
||||
m_dbusargs.append(QString());
|
||||
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, "setRenderingFinished", m_dbusargs);
|
||||
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, QLatin1String("setRenderingFinished"), m_dbusargs);
|
||||
}
|
||||
if (m_jobUiserver) m_jobUiserver->call("terminate", QString());
|
||||
if (m_jobUiserver) m_jobUiserver->call(QLatin1String("terminate"), QString());
|
||||
if (m_erase) {
|
||||
QFile f(m_scenelist);
|
||||
f.remove();
|
||||
@@ -169,19 +169,19 @@ void RenderJob::slotAbort()
|
||||
|
||||
void RenderJob::receivedStderr()
|
||||
{
|
||||
QString result = QString(m_renderProcess->readAllStandardError()).simplified();
|
||||
QString result = QString::fromLocal8Bit(m_renderProcess->readAllStandardError()).simplified();
|
||||
//fprintf(stderr, "* * * *RENDER LG: %s\n", result.toUtf8().data());
|
||||
if (!result.startsWith("Current Frame")) m_errorMessage.append(result + "<br>");
|
||||
if (!result.startsWith(QLatin1String("Current Frame"))) m_errorMessage.append(result + QLatin1String("<br>"));
|
||||
else {
|
||||
if (m_enablelog) m_logstream << "ReceivedStderr from melt: " << result << endl;
|
||||
result = result.section(' ', -1);
|
||||
result = result.section(QLatin1Char(' '), -1);
|
||||
int pro = result.toInt();
|
||||
if (pro < 0 || pro > 100) return;
|
||||
if (pro > m_progress) {
|
||||
m_progress = pro;
|
||||
if (m_args.contains("pass=1")) {
|
||||
if (m_args.contains(QLatin1String("pass=1"))) {
|
||||
m_progress /= 2.0;
|
||||
} else if (m_args.contains("pass=2")) {
|
||||
} else if (m_args.contains(QLatin1String("pass=2"))) {
|
||||
m_progress = 50 + m_progress / 2.0;
|
||||
}
|
||||
if (m_kdenliveinterface) {
|
||||
@@ -191,7 +191,7 @@ void RenderJob::receivedStderr()
|
||||
// qDebug() << "BROKEN COMMUNICATION WITH KDENLIVE";
|
||||
} else {
|
||||
m_dbusargs[1] = m_progress;
|
||||
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, "setRenderingProgress", m_dbusargs);
|
||||
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, QLatin1String("setRenderingProgress"), m_dbusargs);
|
||||
}
|
||||
} else if (pro % 5 == 0) {
|
||||
// Try to restart communication with Kdenlive every 5 percents
|
||||
@@ -200,7 +200,7 @@ void RenderJob::receivedStderr()
|
||||
}
|
||||
|
||||
if (m_jobUiserver) {
|
||||
m_jobUiserver->call("setPercent", (uint) m_progress);
|
||||
m_jobUiserver->call(QLatin1String("setPercent"), (uint) m_progress);
|
||||
/*int seconds = m_startTime.secsTo(QTime::currentTime());
|
||||
seconds = seconds * (100 - m_progress) / m_progress;
|
||||
m_jobUiserver->call("setDescriptionField", (uint) 1, tr("Remaining time"), QTime().addSecs(seconds).toString("hh:mm:ss"));*/
|
||||
@@ -213,16 +213,16 @@ void RenderJob::start()
|
||||
{
|
||||
QDBusConnectionInterface* interface = QDBusConnection::sessionBus().interface();
|
||||
if (interface && m_usekuiserver) {
|
||||
if (!interface->isServiceRegistered("org.kde.JobViewServer")) {
|
||||
if (!interface->isServiceRegistered(QLatin1String("org.kde.JobViewServer"))) {
|
||||
qDebug() << "No org.kde.JobViewServer registered, trying to start kuiserver";
|
||||
if (m_enablelog) m_logstream << "No org.kde.JobViewServer registered, trying to start kuiserver";
|
||||
if (QProcess::startDetached("kuiserver")) {
|
||||
if (QProcess::startDetached(QLatin1String("kuiserver"))) {
|
||||
qDebug() << "Started kuiserver";
|
||||
if (m_enablelog) m_logstream << "Started kuiserver";
|
||||
// Give it a couple of seconds to start
|
||||
QTime t;
|
||||
t.start();
|
||||
while (!interface->isServiceRegistered("org.kde.JobViewServer") && t.elapsed() < 3000) {
|
||||
while (!interface->isServiceRegistered(QLatin1String("org.kde.JobViewServer")) && t.elapsed() < 3000) {
|
||||
SleepThread::msleep(100); //Sleep 100 ms
|
||||
}
|
||||
} else {
|
||||
@@ -231,26 +231,26 @@ void RenderJob::start()
|
||||
}
|
||||
}
|
||||
|
||||
if (interface->isServiceRegistered("org.kde.JobViewServer")) {
|
||||
QDBusInterface kuiserver("org.kde.JobViewServer", "/JobViewServer", "org.kde.JobViewServer");
|
||||
QDBusReply<QDBusObjectPath> objectPath = kuiserver.call("requestView", "Kdenlive", "kdenlive", 0x0001);
|
||||
if (interface->isServiceRegistered(QLatin1String("org.kde.JobViewServer"))) {
|
||||
QDBusInterface kuiserver(QLatin1String("org.kde.JobViewServer"), QLatin1String("/JobViewServer"), QLatin1String("org.kde.JobViewServer"));
|
||||
QDBusReply<QDBusObjectPath> objectPath = kuiserver.call(QLatin1String("requestView"),QLatin1String("Kdenlive"), QLatin1String("kdenlive"), 0x0001);
|
||||
QString reply = ((QDBusObjectPath) objectPath).path();
|
||||
|
||||
// Use of the KDE JobViewServer is an ugly hack, it is not reliable
|
||||
QString dbusView = "org.kde.JobViewV2";
|
||||
m_jobUiserver = new QDBusInterface("org.kde.JobViewServer", reply, dbusView);
|
||||
QString dbusView = QLatin1String("org.kde.JobViewV2");
|
||||
m_jobUiserver = new QDBusInterface(QLatin1String("org.kde.JobViewServer"), reply, dbusView);
|
||||
if (!m_jobUiserver || !m_jobUiserver->isValid()) {
|
||||
dbusView = "org.kde.JobView";
|
||||
m_jobUiserver = new QDBusInterface("org.kde.JobViewServer", reply, dbusView);
|
||||
dbusView = QLatin1String("org.kde.JobView");
|
||||
m_jobUiserver = new QDBusInterface(QLatin1String("org.kde.JobViewServer"), reply, dbusView);
|
||||
}
|
||||
|
||||
if (m_jobUiserver && m_jobUiserver->isValid()) {
|
||||
m_startTime = QTime::currentTime();
|
||||
if (!m_args.contains("pass=2"))
|
||||
m_jobUiserver->call("setPercent", (uint) 0);
|
||||
if (!m_args.contains(QLatin1String("pass=2")))
|
||||
m_jobUiserver->call(QLatin1String("setPercent"), (uint) 0);
|
||||
//m_jobUiserver->call("setInfoMessage", tr("Rendering %1").arg(QFileInfo(m_dest).fileName()));
|
||||
m_jobUiserver->call("setDescriptionField", (uint) 0, tr("Rendering"), m_dest);
|
||||
QDBusConnection::sessionBus().connect("org.kde.JobViewServer", reply, dbusView, "cancelRequested", this, SLOT(slotAbort()));
|
||||
m_jobUiserver->call(QLatin1String("setDescriptionField"), (uint) 0, tr("Rendering"), m_dest);
|
||||
QDBusConnection::sessionBus().connect(QLatin1String("org.kde.JobViewServer"), reply, dbusView, QLatin1String("cancelRequested"), this, SLOT(slotAbort()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -267,8 +267,8 @@ void RenderJob::start()
|
||||
// Because of the logging, we connect to stderr in all cases.
|
||||
connect(m_renderProcess, SIGNAL(readyReadStandardError()), this, SLOT(receivedStderr()));
|
||||
m_renderProcess->start(m_prog, m_args);
|
||||
if (m_enablelog) m_logstream << "Started render process: " << m_prog << " " << m_args.join(" ") << endl;
|
||||
qDebug() << "Started render process: " << m_prog << " " << m_args.join(" ");
|
||||
if (m_enablelog) m_logstream << "Started render process: " << m_prog << " " << m_args.join(QLatin1String(" ")) << endl;
|
||||
qDebug() << "Started render process: " << m_prog << " " << m_args.join(QLatin1String(" "));
|
||||
}
|
||||
|
||||
|
||||
@@ -277,13 +277,13 @@ void RenderJob::initKdenliveDbusInterface()
|
||||
QString kdenliveId;
|
||||
QDBusConnection connection = QDBusConnection::sessionBus();
|
||||
QDBusConnectionInterface* ibus = connection.interface();
|
||||
kdenliveId = QString("org.kde.kdenlive-%1").arg(m_pid);
|
||||
kdenliveId = QString::fromLatin1("org.kde.kdenlive-%1").arg(m_pid);
|
||||
if (!ibus->isServiceRegistered(kdenliveId))
|
||||
{
|
||||
kdenliveId.clear();
|
||||
const QStringList services = ibus->registeredServiceNames();
|
||||
foreach(const QString & service, services) {
|
||||
if (!service.startsWith("org.kde.kdenlive"))
|
||||
if (!service.startsWith(QLatin1String("org.kde.kdenlive")))
|
||||
continue;
|
||||
kdenliveId = service;
|
||||
break;
|
||||
@@ -292,18 +292,18 @@ void RenderJob::initKdenliveDbusInterface()
|
||||
m_dbusargs.clear();
|
||||
if (kdenliveId.isEmpty()) return;
|
||||
m_kdenliveinterface = new QDBusInterface(kdenliveId,
|
||||
"/MainWindow",
|
||||
"org.kdenlive.MainWindow",
|
||||
QLatin1String("/MainWindow"),
|
||||
QLatin1String("org.kdenlive.MainWindow"),
|
||||
connection,
|
||||
this);
|
||||
|
||||
if (m_kdenliveinterface) {
|
||||
m_dbusargs.append(m_dest);
|
||||
m_dbusargs.append((int) 0);
|
||||
if (!m_args.contains("pass=2"))
|
||||
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, "setRenderingProgress", m_dbusargs);
|
||||
connect(m_kdenliveinterface, SIGNAL(abortRenderJob(const QString&)),
|
||||
this, SLOT(slotAbort(const QString&)));
|
||||
if (!m_args.contains(QLatin1String("pass=2")))
|
||||
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, QLatin1String("setRenderingProgress"), m_dbusargs);
|
||||
connect(m_kdenliveinterface, SIGNAL(abortRenderJob(QString)),
|
||||
this, SLOT(slotAbort(QString)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -317,19 +317,19 @@ void RenderJob::slotCheckProcess(QProcess::ProcessState state)
|
||||
|
||||
void RenderJob::slotIsOver(QProcess::ExitStatus status, bool isWritable)
|
||||
{
|
||||
if (m_jobUiserver) m_jobUiserver->call("terminate", QString());
|
||||
if (m_jobUiserver) m_jobUiserver->call(QLatin1String("terminate"), QString());
|
||||
if (!isWritable) {
|
||||
QString error = tr("Cannot write to %1, check the permissions.").arg(m_dest);
|
||||
if (m_kdenliveinterface) {
|
||||
m_dbusargs[1] = (int) - 2;
|
||||
m_dbusargs.append(error);
|
||||
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, "setRenderingFinished", m_dbusargs);
|
||||
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, QLatin1String("setRenderingFinished"), m_dbusargs);
|
||||
}
|
||||
QStringList args;
|
||||
args << "--error" << error;
|
||||
args << QLatin1String("--error") << error;
|
||||
if (m_enablelog) m_logstream << error << endl;
|
||||
qDebug() << error;
|
||||
QProcess::startDetached("kdialog", args);
|
||||
QProcess::startDetached(QLatin1String("kdialog"), args);
|
||||
qApp->quit();
|
||||
}
|
||||
if (m_erase) {
|
||||
@@ -341,33 +341,33 @@ void RenderJob::slotIsOver(QProcess::ExitStatus status, bool isWritable)
|
||||
if (m_kdenliveinterface) {
|
||||
m_dbusargs[1] = (int) - 2;
|
||||
m_dbusargs.append(m_errorMessage);
|
||||
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, "setRenderingFinished", m_dbusargs);
|
||||
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, QLatin1String("setRenderingFinished"), m_dbusargs);
|
||||
}
|
||||
QStringList args;
|
||||
QString error = tr("Rendering of %1 aborted, resulting video will probably be corrupted.").arg(m_dest);
|
||||
args << "--error" << error;
|
||||
args << QLatin1String("--error") << error;
|
||||
if (m_enablelog) m_logstream << error << endl;
|
||||
qDebug() << error;
|
||||
QProcess::startDetached("kdialog", args);
|
||||
QProcess::startDetached(QLatin1String("kdialog"), args);
|
||||
qApp->quit();
|
||||
} else {
|
||||
if (!m_dualpass && m_kdenliveinterface) {
|
||||
m_dbusargs[1] = (int) - 1;
|
||||
m_dbusargs.append(QString());
|
||||
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, "setRenderingFinished", m_dbusargs);
|
||||
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, QLatin1String("setRenderingFinished"), m_dbusargs);
|
||||
}
|
||||
QDBusConnectionInterface* interface = QDBusConnection::sessionBus().interface();
|
||||
if (!m_dualpass && interface && interface->isServiceRegistered("org.kde.knotify")) {
|
||||
QDBusMessage m = QDBusMessage::createMethodCall("org.kde.knotify",
|
||||
"/Notify",
|
||||
"org.kde.KNotify",
|
||||
"event");
|
||||
if (!m_dualpass && interface && interface->isServiceRegistered(QLatin1String("org.kde.knotify"))) {
|
||||
QDBusMessage m = QDBusMessage::createMethodCall(QLatin1String("org.kde.knotify"),
|
||||
QLatin1String("/Notify"),
|
||||
QLatin1String("org.kde.KNotify"),
|
||||
QLatin1String("event"));
|
||||
int seconds = m_startTime.secsTo(QTime::currentTime());
|
||||
QList<QVariant> args;
|
||||
args.append(QString("RenderFinished")); // action name
|
||||
args.append(QString("kdenlive")); // app name
|
||||
args.append(QLatin1String("RenderFinished")); // action name
|
||||
args.append(QLatin1String("kdenlive")); // app name
|
||||
args.append(QVariantList()); // contexts
|
||||
args.append(tr("Rendering of %1 finished in %2").arg(m_dest, QTime(0, 0, seconds).toString("hh:mm:ss"))); // body
|
||||
args.append(tr("Rendering of %1 finished in %2").arg(m_dest, QTime(0, 0, seconds).toString(QLatin1String("hh:mm:ss")))); // body
|
||||
args.append(QByteArray()); // app icon
|
||||
QStringList actionList;
|
||||
args.append(actionList); // actions
|
||||
@@ -379,7 +379,7 @@ void RenderJob::slotIsOver(QProcess::ExitStatus status, bool isWritable)
|
||||
}
|
||||
if (m_enablelog) m_logstream << "Rendering of " << m_dest << " finished" << endl;
|
||||
qDebug() << "Rendering of " << m_dest << " finished";
|
||||
if (!m_dualpass && m_player != "-") {
|
||||
if (!m_dualpass && m_player != QLatin1String("-")) {
|
||||
if (m_enablelog) m_logstream << "Starting player" << endl;
|
||||
QStringList args;
|
||||
args << m_dest;
|
||||
|
||||
@@ -66,6 +66,10 @@ macro_log_feature(Nepomuk_FOUND
|
||||
"http://nepomuk.semanticdesktop.org"
|
||||
)
|
||||
|
||||
find_package(NepomukCore QUIET)
|
||||
set_package_properties(NepomukCore PROPERTIES DESCRIPTION "The Nepomuk Core libraries" URL "http://www.kde.org" TYPE RECOMMENDED PURPOSE "Support for the Nepomuk semantic desktop system")
|
||||
|
||||
|
||||
macro_log_feature(QJSON_FOUND
|
||||
"QJson"
|
||||
"Qt-based library that maps JSON data to QVariant objects"
|
||||
@@ -89,6 +93,7 @@ add_subdirectory(onmonitoritems)
|
||||
add_subdirectory(scopes)
|
||||
add_subdirectory(simplekeyframes)
|
||||
add_subdirectory(stopmotion)
|
||||
add_subdirectory(widgets)
|
||||
|
||||
if(QJSON_FOUND)
|
||||
add_subdirectory(onmonitoritems/rotoscoping)
|
||||
@@ -106,20 +111,15 @@ list(APPEND kdenlive_SRCS
|
||||
KoSliderCombo.cpp
|
||||
abstractclipitem.cpp
|
||||
abstractgroupitem.cpp
|
||||
abstractmonitor.cpp
|
||||
archivewidget.cpp
|
||||
choosecolorwidget.cpp
|
||||
clipdurationdialog.cpp
|
||||
clipitem.cpp
|
||||
clipmanager.cpp
|
||||
clipproperties.cpp
|
||||
cliptranscode.cpp
|
||||
clipstabilize.cpp
|
||||
colorpickerwidget.cpp
|
||||
colorplaneexport.cpp
|
||||
colortools.cpp
|
||||
complexparameter.cpp
|
||||
cornerswidget.cpp
|
||||
customruler.cpp
|
||||
customtrackscene.cpp
|
||||
customtrackview.cpp
|
||||
@@ -127,7 +127,6 @@ list(APPEND kdenlive_SRCS
|
||||
docclipbase.cpp
|
||||
documentchecker.cpp
|
||||
documentvalidator.cpp
|
||||
doubleparameterwidget.cpp
|
||||
dragvalue.cpp
|
||||
dvdwizard.cpp
|
||||
dvdwizardchapters.cpp
|
||||
@@ -135,13 +134,11 @@ list(APPEND kdenlive_SRCS
|
||||
dvdwizardvob.cpp
|
||||
effectslist.cpp
|
||||
effectslistview.cpp
|
||||
effectslistwidget.cpp
|
||||
effectstackedit.cpp
|
||||
encodingprofilesdialog.cpp
|
||||
folderprojectitem.cpp
|
||||
gentime.cpp
|
||||
geometryval.cpp
|
||||
geometrywidget.cpp
|
||||
graphicsscenerectmove.cpp
|
||||
guide.cpp
|
||||
headertrack.cpp
|
||||
@@ -151,16 +148,13 @@ list(APPEND kdenlive_SRCS
|
||||
keyframeedit.cpp
|
||||
keyframehelper.cpp
|
||||
kis_cubic_curve.cpp
|
||||
kis_curve_widget.cpp
|
||||
kthumb.cpp
|
||||
managecapturesdialog.cpp
|
||||
markerdialog.cpp
|
||||
mltdevicecapture.cpp
|
||||
monitor.cpp
|
||||
monitoreditwidget.cpp
|
||||
monitormanager.cpp
|
||||
monitorscene.cpp
|
||||
noteswidget.cpp
|
||||
parameterplotter.cpp
|
||||
positionedit.cpp
|
||||
profilesdialog.cpp
|
||||
@@ -170,7 +164,6 @@ list(APPEND kdenlive_SRCS
|
||||
projectsettings.cpp
|
||||
recmonitor.cpp
|
||||
renderer.cpp
|
||||
renderwidget.cpp
|
||||
slideshowclip.cpp
|
||||
smallruler.cpp
|
||||
spacerdialog.cpp
|
||||
@@ -179,7 +172,6 @@ list(APPEND kdenlive_SRCS
|
||||
timecode.cpp
|
||||
timecodedisplay.cpp
|
||||
titledocument.cpp
|
||||
titlewidget.cpp
|
||||
trackdialog.cpp
|
||||
tracksconfigdialog.cpp
|
||||
trackview.cpp
|
||||
@@ -190,84 +182,84 @@ list(APPEND kdenlive_SRCS
|
||||
)
|
||||
|
||||
kde4_add_ui_files(kdenlive_UIS
|
||||
widgets/addtrack_ui.ui
|
||||
widgets/archivewidget_ui.ui
|
||||
widgets/audiospectrum_ui.ui
|
||||
widgets/backupdialog_ui.ui
|
||||
widgets/bezierspline_ui.ui
|
||||
widgets/boolval_ui.ui
|
||||
widgets/clipdurationdialog_ui.ui
|
||||
widgets/clipproperties_ui.ui
|
||||
widgets/cliptranscode_ui.ui
|
||||
widgets/collapsiblewidget_ui.ui
|
||||
widgets/clipstabilize_ui.ui
|
||||
widgets/colorclip_ui.ui
|
||||
widgets/colorplaneexport_ui.ui
|
||||
widgets/configcapture_ui.ui
|
||||
widgets/configenv_ui.ui
|
||||
widgets/configjogshuttle_ui.ui
|
||||
widgets/configmisc_ui.ui
|
||||
widgets/configproject_ui.ui
|
||||
widgets/configsdl_ui.ui
|
||||
widgets/configtimeline_ui.ui
|
||||
widgets/configtranscode_ui.ui
|
||||
widgets/dvdwizardchapters_ui.ui
|
||||
widgets/dvdwizardmenu_ui.ui
|
||||
widgets/dvdwizardstatus_ui.ui
|
||||
widgets/dvdwizardvob_ui.ui
|
||||
widgets/effectlist_ui.ui
|
||||
widgets/effectstack_ui.ui
|
||||
widgets/effectstack2_ui.ui
|
||||
widgets/freesound_ui.ui
|
||||
widgets/geometryval_ui.ui
|
||||
widgets/geometrywidget_ui.ui
|
||||
widgets/histogram_ui.ui
|
||||
widgets/keyframedialog_ui.ui
|
||||
widgets/keyframeeditor_ui.ui
|
||||
widgets/keyframewidget_ui.ui
|
||||
widgets/listval_ui.ui
|
||||
widgets/managecaptures_ui.ui
|
||||
widgets/manageencodingprofile_ui.ui
|
||||
widgets/markerdialog_ui.ui
|
||||
widgets/missingclips_ui.ui
|
||||
widgets/monitoreditwidget_ui.ui
|
||||
widgets/profiledialog_ui.ui
|
||||
widgets/projectsettings_ui.ui
|
||||
widgets/recmonitor_ui.ui
|
||||
widgets/renderwidget_ui.ui
|
||||
widgets/rgbparade_ui.ui
|
||||
widgets/saveprofile_ui.ui
|
||||
widgets/slideshowclip_ui.ui
|
||||
widgets/smconfig_ui.ui
|
||||
widgets/spacerdialog_ui.ui
|
||||
widgets/spectrogram_ui.ui
|
||||
widgets/stopmotion_ui.ui
|
||||
widgets/templateclip_ui.ui
|
||||
widgets/timeline_ui.ui
|
||||
widgets/timelinebuttons_ui.ui
|
||||
widgets/titlewidget_ui.ui
|
||||
widgets/trackheader_ui.ui
|
||||
widgets/tracksconfigdialog_ui.ui
|
||||
widgets/transitionsettings_ui.ui
|
||||
widgets/unicodedialog_ui.ui
|
||||
widgets/urlval_ui.ui
|
||||
widgets/vectorscope_ui.ui
|
||||
widgets/waveform_ui.ui
|
||||
widgets/wipeval_ui.ui
|
||||
widgets/wizardcapture_ui.ui
|
||||
widgets/wizardcheck_ui.ui
|
||||
widgets/wizardextra_ui.ui
|
||||
widgets/wizardmltcheck_ui.ui
|
||||
widgets/wizardstandard_ui.ui
|
||||
widgets/keywordval_ui.ui
|
||||
widgets/fontval_ui.ui
|
||||
widgets/cutjobdialog_ui.ui
|
||||
widgets/scenecutdialog_ui.ui
|
||||
widgets/importkeyframesdialog_ui.ui
|
||||
ui/addtrack_ui.ui
|
||||
ui/archivewidget_ui.ui
|
||||
ui/audiospectrum_ui.ui
|
||||
ui/backupdialog_ui.ui
|
||||
ui/bezierspline_ui.ui
|
||||
ui/boolval_ui.ui
|
||||
ui/clipdurationdialog_ui.ui
|
||||
ui/clipproperties_ui.ui
|
||||
ui/cliptranscode_ui.ui
|
||||
ui/collapsiblewidget_ui.ui
|
||||
ui/clipstabilize_ui.ui
|
||||
ui/colorclip_ui.ui
|
||||
ui/colorplaneexport_ui.ui
|
||||
ui/configcapture_ui.ui
|
||||
ui/configenv_ui.ui
|
||||
ui/configjogshuttle_ui.ui
|
||||
ui/configmisc_ui.ui
|
||||
ui/configproject_ui.ui
|
||||
ui/configsdl_ui.ui
|
||||
ui/configtimeline_ui.ui
|
||||
ui/configtranscode_ui.ui
|
||||
ui/dvdwizardchapters_ui.ui
|
||||
ui/dvdwizardmenu_ui.ui
|
||||
ui/dvdwizardstatus_ui.ui
|
||||
ui/dvdwizardvob_ui.ui
|
||||
ui/effectlist_ui.ui
|
||||
ui/effectstack_ui.ui
|
||||
ui/effectstack2_ui.ui
|
||||
ui/freesound_ui.ui
|
||||
ui/geometryval_ui.ui
|
||||
ui/geometrywidget_ui.ui
|
||||
ui/histogram_ui.ui
|
||||
ui/keyframedialog_ui.ui
|
||||
ui/keyframeeditor_ui.ui
|
||||
ui/keyframewidget_ui.ui
|
||||
ui/listval_ui.ui
|
||||
ui/managecaptures_ui.ui
|
||||
ui/manageencodingprofile_ui.ui
|
||||
ui/markerdialog_ui.ui
|
||||
ui/missingclips_ui.ui
|
||||
ui/monitoreditwidget_ui.ui
|
||||
ui/profiledialog_ui.ui
|
||||
ui/projectsettings_ui.ui
|
||||
ui/recmonitor_ui.ui
|
||||
ui/renderwidget_ui.ui
|
||||
ui/rgbparade_ui.ui
|
||||
ui/saveprofile_ui.ui
|
||||
ui/slideshowclip_ui.ui
|
||||
ui/smconfig_ui.ui
|
||||
ui/spacerdialog_ui.ui
|
||||
ui/spectrogram_ui.ui
|
||||
ui/stopmotion_ui.ui
|
||||
ui/templateclip_ui.ui
|
||||
ui/timeline_ui.ui
|
||||
ui/timelinebuttons_ui.ui
|
||||
ui/titlewidget_ui.ui
|
||||
ui/trackheader_ui.ui
|
||||
ui/tracksconfigdialog_ui.ui
|
||||
ui/transitionsettings_ui.ui
|
||||
ui/unicodewidget_ui.ui
|
||||
ui/urlval_ui.ui
|
||||
ui/vectorscope_ui.ui
|
||||
ui/waveform_ui.ui
|
||||
ui/wipeval_ui.ui
|
||||
ui/wizardcapture_ui.ui
|
||||
ui/wizardcheck_ui.ui
|
||||
ui/wizardextra_ui.ui
|
||||
ui/wizardmltcheck_ui.ui
|
||||
ui/wizardstandard_ui.ui
|
||||
ui/keywordval_ui.ui
|
||||
ui/fontval_ui.ui
|
||||
ui/cutjobdialog_ui.ui
|
||||
ui/scenecutdialog_ui.ui
|
||||
ui/importkeyframesdialog_ui.ui
|
||||
)
|
||||
|
||||
if(OPENGL_FOUND)
|
||||
list(APPEND kdenlive_SRCS videoglwidget.cpp)
|
||||
list(APPEND kdenlive_SRCS widgets/videoglwidget.cpp)
|
||||
endif(OPENGL_FOUND)
|
||||
|
||||
if(BUILD_JogShuttle)
|
||||
@@ -284,7 +276,7 @@ qt4_add_dbus_adaptor(kdenlive_SRCS
|
||||
mainwindow.h
|
||||
MainWindow
|
||||
)
|
||||
qt4_add_resources(kdenlive_SRCS widgets/resources.qrc)
|
||||
qt4_add_resources(kdenlive_SRCS ui/resources.qrc)
|
||||
kde4_add_executable(kdenlive
|
||||
${kdenlive_SRCS}
|
||||
${kdenlive_UIS}
|
||||
@@ -303,6 +295,8 @@ include_directories(
|
||||
${KDE4_INCLUDES} # Adds Qt include directories too.
|
||||
${LIBMLT_INCLUDE_DIR}
|
||||
${LIBMLTPLUS_INCLUDE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lib/external
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lib
|
||||
)
|
||||
|
||||
|
||||
@@ -328,6 +322,7 @@ target_link_libraries(kdenlive
|
||||
${LIBMLTPLUS_LIBRARY}
|
||||
${CMAKE_DL_LIBS}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
kiss_fft
|
||||
)
|
||||
|
||||
if(Q_WS_X11)
|
||||
@@ -344,11 +339,17 @@ if(SDL_FOUND)
|
||||
target_link_libraries(kdenlive ${SDL_LIBRARY})
|
||||
endif(SDL_FOUND)
|
||||
|
||||
if(Nepomuk_FOUND)
|
||||
add_definitions(-DUSE_NEPOMUK)
|
||||
include_directories(${NEPOMUK_INCLUDES})
|
||||
target_link_libraries(kdenlive ${NEPOMUK_LIBRARIES})
|
||||
endif(Nepomuk_FOUND)
|
||||
if(NepomukCore_FOUND)
|
||||
add_definitions(-DUSE_NEPOMUKCORE)
|
||||
include_directories(${NEPOMUK_CORE_INCLUDE_DIR})
|
||||
target_link_libraries(kdenlive ${NEPOMUK_CORE_LIBRARY})
|
||||
else()
|
||||
if(Nepomuk_FOUND)
|
||||
add_definitions(-DUSE_NEPOMUK)
|
||||
include_directories(${NEPOMUK_INCLUDES})
|
||||
target_link_libraries(kdenlive ${NEPOMUK_LIBRARIES})
|
||||
endif(Nepomuk_FOUND)
|
||||
endif()
|
||||
|
||||
if(QJSON_FOUND)
|
||||
add_definitions(-DUSE_QJSON)
|
||||
@@ -364,6 +365,9 @@ endif(BUILD_V4L)
|
||||
|
||||
if(BUILD_JogShuttle)
|
||||
add_definitions(-DUSE_JOGSHUTTLE)
|
||||
target_link_libraries(kdenlive
|
||||
media_ctrl
|
||||
)
|
||||
endif(BUILD_JogShuttle)
|
||||
|
||||
install(TARGETS kdenlive DESTINATION ${BIN_INSTALL_DIR})
|
||||
@@ -381,5 +385,5 @@ install(FILES
|
||||
kdenlivetranscodingrc
|
||||
DESTINATION ${CONFIG_INSTALL_DIR}
|
||||
)
|
||||
kde4_install_icons(${ICON_INSTALL_DIR})
|
||||
add_subdirectory(icons)
|
||||
install(FILES kdenlive.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
*
|
||||
* @param parent parent QWidget
|
||||
*/
|
||||
KoSliderCombo(QWidget *parent = 0);
|
||||
explicit KoSliderCombo(QWidget *parent = 0);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "kdenlivesettings.h"
|
||||
|
||||
#include <KDebug>
|
||||
#include <KLocale>
|
||||
#include <KLocalizedString>
|
||||
#include <KGlobalSettings>
|
||||
|
||||
#include <QPainter>
|
||||
@@ -32,15 +32,17 @@
|
||||
#include <QParallelAnimationGroup>
|
||||
|
||||
AbstractClipItem::AbstractClipItem(const ItemInfo &info, const QRectF& rect, double fps) :
|
||||
QObject(),
|
||||
QGraphicsRectItem(rect),
|
||||
m_info(info),
|
||||
m_editedKeyframe(-1),
|
||||
m_selectedKeyframe(0),
|
||||
m_keyframeFactor(1),
|
||||
m_keyframeOffset(0),
|
||||
m_fps(fps),
|
||||
m_isMainSelectedClip(false)
|
||||
QObject()
|
||||
, QGraphicsRectItem(rect)
|
||||
, m_info(info)
|
||||
, m_editedKeyframe(-1)
|
||||
, m_selectedKeyframe(0)
|
||||
, m_keyframeFactor(1)
|
||||
, m_keyframeOffset(0)
|
||||
, m_keyframeDefault(0)
|
||||
, m_visibleParam(0)
|
||||
, m_fps(fps)
|
||||
, m_isMainSelectedClip(false)
|
||||
{
|
||||
setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
|
||||
#if QT_VERSION >= 0x040600
|
||||
@@ -58,6 +60,7 @@ void AbstractClipItem::closeAnimation()
|
||||
#if QT_VERSION >= 0x040600
|
||||
if (!isEnabled()) return;
|
||||
setEnabled(false);
|
||||
setFlag(QGraphicsItem::ItemIsSelectable, false);
|
||||
if (!(KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::SimpleAnimationEffects)) {
|
||||
// animation disabled
|
||||
deleteLater();
|
||||
@@ -119,7 +122,7 @@ GenTime AbstractClipItem::cropDuration() const
|
||||
return m_info.cropDuration;
|
||||
}
|
||||
|
||||
void AbstractClipItem::setCropStart(GenTime pos)
|
||||
void AbstractClipItem::setCropStart(const GenTime &pos)
|
||||
{
|
||||
m_info.cropStart = pos;
|
||||
}
|
||||
@@ -140,7 +143,7 @@ void AbstractClipItem::resizeStart(int posx, bool hasSizeLimit, bool /*emitChang
|
||||
GenTime durationDiff = GenTime(posx, m_fps) - m_info.startPos;
|
||||
if (durationDiff == GenTime()) return;
|
||||
|
||||
if (type() == AVWIDGET && hasSizeLimit && (cropStart() + durationDiff < GenTime())) {
|
||||
if (type() == AVWidget && hasSizeLimit && (cropStart() + durationDiff < GenTime())) {
|
||||
durationDiff = GenTime() - cropStart();
|
||||
} else if (durationDiff >= cropDuration()) {
|
||||
return;
|
||||
@@ -151,7 +154,7 @@ void AbstractClipItem::resizeStart(int posx, bool hasSizeLimit, bool /*emitChang
|
||||
|
||||
// set to true if crop from start is negative (possible for color clips, images as they have no size limit)
|
||||
bool negCropStart = false;
|
||||
if (type() == AVWIDGET) {
|
||||
if (type() == AVWidget) {
|
||||
m_info.cropStart += durationDiff;
|
||||
if (m_info.cropStart < GenTime())
|
||||
negCropStart = true;
|
||||
@@ -165,7 +168,7 @@ void AbstractClipItem::resizeStart(int posx, bool hasSizeLimit, bool /*emitChang
|
||||
//kDebug() << "////// WARNING, DIFF IN XPOS: " << pos().x() << " == " << m_info.startPos.frames(m_fps);
|
||||
GenTime diff = m_info.startPos - GenTime(posx, m_fps);
|
||||
|
||||
if (type() == AVWIDGET)
|
||||
if (type() == AVWidget)
|
||||
m_info.cropStart += diff;
|
||||
|
||||
m_info.cropDuration -= diff;
|
||||
@@ -190,7 +193,7 @@ void AbstractClipItem::resizeStart(int posx, bool hasSizeLimit, bool /*emitChang
|
||||
setRect(0, 0, (m_cropDuration - diff).frames(m_fps) - 0.02, rect().height());
|
||||
setPos((m_startPos + diff).frames(m_fps), pos().y());
|
||||
m_startPos += diff;
|
||||
if (type() == AVWIDGET) m_cropStart += diff;
|
||||
if (type() == AVWidget) m_cropStart += diff;
|
||||
m_cropDuration = m_cropDuration - diff;
|
||||
break;
|
||||
}
|
||||
@@ -258,7 +261,7 @@ GenTime AbstractClipItem::maxDuration() const
|
||||
return m_maxDuration;
|
||||
}
|
||||
|
||||
void AbstractClipItem::drawKeyFrames(QPainter *painter, bool limitedKeyFrames)
|
||||
void AbstractClipItem::drawKeyFrames(QPainter *painter, const QTransform &transformation, bool limitedKeyFrames)
|
||||
{
|
||||
if (m_keyframes.count() < 1)
|
||||
return;
|
||||
@@ -276,13 +279,13 @@ void AbstractClipItem::drawKeyFrames(QPainter *painter, bool limitedKeyFrames)
|
||||
x2 = br.right();
|
||||
if (limitedKeyFrames) {
|
||||
QMap<int, int>::const_iterator end = m_keyframes.constEnd();
|
||||
end--;
|
||||
--end;
|
||||
x2 = x1 + maxw * (end.key() - start);
|
||||
x1 += maxw * (m_keyframes.constBegin().key() - start);
|
||||
}
|
||||
y1 = br.bottom() - (m_keyframeDefault - m_keyframeOffset) * maxh;
|
||||
QLineF l(x1, y1, x2, y1);
|
||||
QLineF l2 = painter->worldTransform().map(l);
|
||||
QLineF l2 = transformation.map(l);
|
||||
painter->setPen(QColor(168, 168, 168, 180));
|
||||
painter->drawLine(l2);
|
||||
painter->setPen(QColor(108, 108, 108, 180));
|
||||
@@ -303,7 +306,7 @@ void AbstractClipItem::drawKeyFrames(QPainter *painter, bool limitedKeyFrames)
|
||||
// make sure line begins with clip beginning
|
||||
if (!limitedKeyFrames && i.key() != start) {
|
||||
QLineF l(br.x(), y1, x1, y1);
|
||||
l2 = painter->worldTransform().map(l);
|
||||
l2 = transformation.map(l);
|
||||
painter->drawLine(l2);
|
||||
}
|
||||
while (i != m_keyframes.constEnd()) {
|
||||
@@ -323,7 +326,7 @@ void AbstractClipItem::drawKeyFrames(QPainter *painter, bool limitedKeyFrames)
|
||||
y2 = br.bottom() - (i.value() - m_keyframeOffset) * maxh;
|
||||
}
|
||||
QLineF l(x1, y1, x2, y2);
|
||||
l2 = painter->worldTransform().map(l);
|
||||
l2 = transformation.map(l);
|
||||
painter->drawLine(l2);
|
||||
if (active) {
|
||||
const QRectF frame(l2.x1() - 3, l2.y1() - 3, 6, 6);
|
||||
@@ -336,7 +339,7 @@ void AbstractClipItem::drawKeyFrames(QPainter *painter, bool limitedKeyFrames)
|
||||
// make sure line ends at clip end
|
||||
if (!limitedKeyFrames && x1 != br.right()) {
|
||||
QLineF l(x1, y1, br.right(), y1);
|
||||
painter->drawLine(painter->worldTransform().map(l));
|
||||
painter->drawLine(transformation.map(l));
|
||||
}
|
||||
|
||||
if (active && m_keyframes.count() > 1) {
|
||||
@@ -354,11 +357,9 @@ int AbstractClipItem::mouseOverKeyFrames(QPointF pos, double maxOffset)
|
||||
double maxh = br.height() / 100.0 * m_keyframeFactor;
|
||||
if (m_keyframes.count() > 0) {
|
||||
QMap<int, int>::const_iterator i = m_keyframes.constBegin();
|
||||
double x1;
|
||||
double y1;
|
||||
while (i != m_keyframes.constEnd()) {
|
||||
x1 = br.x() + maxw * (i.key() - cropStart().frames(m_fps));
|
||||
y1 = br.bottom() - (i.value() - m_keyframeOffset) * maxh;
|
||||
double x1 = br.x() + maxw * (i.key() - cropStart().frames(m_fps));
|
||||
double y1 = br.bottom() - (i.value() - m_keyframeOffset) * maxh;
|
||||
if (qAbs(pos.x() - x1) < maxOffset && qAbs(pos.y() - y1) < 10) {
|
||||
setToolTip('[' + QString::number((GenTime(i.key(), m_fps) - cropStart()).seconds(), 'f', 2) + i18n("seconds") + ", " + QString::number(i.value(), 'f', 1) + ']');
|
||||
return i.key();
|
||||
@@ -446,6 +447,21 @@ int AbstractClipItem::keyFrameNumber() const
|
||||
return m_keyframes.count();
|
||||
}
|
||||
|
||||
int AbstractClipItem::checkForSingleKeyframe()
|
||||
{
|
||||
// Check if we have only one keyframe
|
||||
if (!m_keyframes.isEmpty() && m_keyframes.count() == 1) {
|
||||
int min = (int) cropStart().frames(m_fps);
|
||||
int max = (int)(cropStart() + cropDuration()).frames(m_fps) - 1;
|
||||
if (m_keyframes.contains(min)) {
|
||||
// Add keyframe at end of clip to allow inserting a new keframe in between
|
||||
m_keyframes[max] = m_keyframes.value(min);
|
||||
return m_keyframes.value(min);
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int AbstractClipItem::addKeyFrame(const GenTime &pos, const double value)
|
||||
{
|
||||
QRectF br = sceneBoundingRect();
|
||||
@@ -529,3 +545,5 @@ bool AbstractClipItem::isMainSelectedClip()
|
||||
return m_isMainSelectedClip;
|
||||
}
|
||||
|
||||
|
||||
#include "abstractclipitem.moc"
|
||||
|
||||
@@ -49,6 +49,7 @@ public:
|
||||
* @param pos new Position
|
||||
* @param value new Value */
|
||||
void updateKeyFramePos(const GenTime &pos, const double value);
|
||||
int checkForSingleKeyframe();
|
||||
int addKeyFrame(const GenTime &pos, const double value);
|
||||
bool hasKeyFrames() const;
|
||||
int editedKeyFramePos() const;
|
||||
@@ -66,7 +67,7 @@ public:
|
||||
bool isItemLocked() const;
|
||||
void closeAnimation();
|
||||
|
||||
virtual OPERATIONTYPE operationMode(QPointF pos) = 0;
|
||||
virtual OperationType operationMode(const QPointF &pos) = 0;
|
||||
virtual GenTime startPos() const ;
|
||||
virtual void setTrack(int track);
|
||||
virtual GenTime endPos() const ;
|
||||
@@ -91,7 +92,7 @@ public:
|
||||
virtual double fps() const;
|
||||
virtual void updateFps(double fps);
|
||||
virtual GenTime maxDuration() const;
|
||||
virtual void setCropStart(GenTime pos);
|
||||
virtual void setCropStart(const GenTime &pos);
|
||||
|
||||
/** @brief Set this clip as the main selected clip (or not). */
|
||||
void setMainSelectedClip(bool selected);
|
||||
@@ -126,9 +127,9 @@ protected:
|
||||
* "simplekeyframe" type, the effect always starts on clip start and ends on clip end. With the
|
||||
* "keyframe" type, the effect starts on the first keyframe and ends on the last keyframe
|
||||
*/
|
||||
void drawKeyFrames(QPainter *painter, bool limitedKeyFrames);
|
||||
void drawKeyFrames(QPainter *painter, const QTransform &transformation, bool limitedKeyFrames);
|
||||
int mouseOverKeyFrames(QPointF pos, double maxOffset);
|
||||
virtual void mousePressEvent(QGraphicsSceneMouseEvent * event);
|
||||
void mousePressEvent(QGraphicsSceneMouseEvent * event);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
|
||||
|
||||
AbstractGroupItem::AbstractGroupItem(double /* fps */) :
|
||||
QObject(),
|
||||
QGraphicsItemGroup()
|
||||
QObject(),
|
||||
QGraphicsItemGroup()
|
||||
{
|
||||
setZValue(1);
|
||||
setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
|
||||
@@ -48,7 +48,7 @@ AbstractGroupItem::AbstractGroupItem(double /* fps */) :
|
||||
|
||||
int AbstractGroupItem::type() const
|
||||
{
|
||||
return GROUPWIDGET;
|
||||
return GroupWidget;
|
||||
}
|
||||
|
||||
int AbstractGroupItem::track() const
|
||||
@@ -57,14 +57,14 @@ int AbstractGroupItem::track() const
|
||||
int topTrack = -1;
|
||||
QList<QGraphicsItem *> children = childItems();
|
||||
for (int i = 0; i < children.count(); ++i) {
|
||||
if (children.at(i)->type() == GROUPWIDGET) {
|
||||
children.append(children.at(i)->childItems());
|
||||
continue;
|
||||
}
|
||||
if (children.at(i)->type() == GroupWidget) {
|
||||
children.append(children.at(i)->childItems());
|
||||
continue;
|
||||
}
|
||||
AbstractClipItem *item = static_cast <AbstractClipItem *>(children.at(i));
|
||||
if (item && (topTrack == -1 || topTrack > item->track())) {
|
||||
topTrack = item->track();
|
||||
}
|
||||
topTrack = item->track();
|
||||
}
|
||||
}
|
||||
return topTrack;
|
||||
}
|
||||
@@ -92,26 +92,31 @@ CustomTrackScene* AbstractGroupItem::projectScene()
|
||||
return NULL;
|
||||
}
|
||||
|
||||
QPainterPath AbstractGroupItem::clipGroupShape(QPointF offset) const
|
||||
QPainterPath AbstractGroupItem::clipGroupSpacerShape(const QPointF &offset) const
|
||||
{
|
||||
return groupShape(AVWIDGET, offset);
|
||||
return spacerGroupShape(AVWidget, offset);
|
||||
}
|
||||
|
||||
QPainterPath AbstractGroupItem::transitionGroupShape(QPointF offset) const
|
||||
QPainterPath AbstractGroupItem::clipGroupShape(const QPointF &offset) const
|
||||
{
|
||||
return groupShape(TRANSITIONWIDGET, offset);
|
||||
return groupShape(AVWidget, offset);
|
||||
}
|
||||
|
||||
QPainterPath AbstractGroupItem::groupShape(GRAPHICSRECTITEM type, QPointF offset) const
|
||||
QPainterPath AbstractGroupItem::transitionGroupShape(const QPointF &offset) const
|
||||
{
|
||||
return groupShape(TransitionWidget, offset);
|
||||
}
|
||||
|
||||
QPainterPath AbstractGroupItem::groupShape(GraphicsRectItem type, const QPointF &offset) const
|
||||
{
|
||||
QPainterPath path;
|
||||
QList<QGraphicsItem *> children = childItems();
|
||||
for (int i = 0; i < children.count(); i++) {
|
||||
for (int i = 0; i < children.count(); ++i) {
|
||||
if (children.at(i)->type() == (int)type) {
|
||||
QRectF r(children.at(i)->sceneBoundingRect());
|
||||
r.translate(offset);
|
||||
path.addRect(r);
|
||||
} else if (children.at(i)->type() == GROUPWIDGET) {
|
||||
} else if (children.at(i)->type() == GroupWidget) {
|
||||
QList<QGraphicsItem *> subchildren = children.at(i)->childItems();
|
||||
for (int j = 0; j < subchildren.count(); j++) {
|
||||
if (subchildren.at(j)->type() == (int)type) {
|
||||
@@ -125,6 +130,31 @@ QPainterPath AbstractGroupItem::groupShape(GRAPHICSRECTITEM type, QPointF offset
|
||||
return path;
|
||||
}
|
||||
|
||||
QPainterPath AbstractGroupItem::spacerGroupShape(GraphicsRectItem type, const QPointF &offset) const
|
||||
{
|
||||
QPainterPath path;
|
||||
QList<QGraphicsItem *> children = childItems();
|
||||
for (int i = 0; i < children.count(); ++i) {
|
||||
if (children.at(i)->type() == (int)type) {
|
||||
QRectF r(children.at(i)->sceneBoundingRect());
|
||||
r.translate(offset);
|
||||
r.setRight(scene()->width());
|
||||
path.addRect(r);
|
||||
} else if (children.at(i)->type() == GroupWidget) {
|
||||
QList<QGraphicsItem *> subchildren = children.at(i)->childItems();
|
||||
for (int j = 0; j < subchildren.count(); j++) {
|
||||
if (subchildren.at(j)->type() == (int)type) {
|
||||
QRectF r(subchildren.at(j)->sceneBoundingRect());
|
||||
r.translate(offset);
|
||||
r.setRight(scene()->width());
|
||||
path.addRect(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
void AbstractGroupItem::addItem(QGraphicsItem * item)
|
||||
{
|
||||
addToGroup(item);
|
||||
@@ -182,42 +212,42 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
|
||||
int xpos = projectScene()->getSnapPointForPos((int)(start.x() + newPos.x() - pos().x()), KdenliveSettings::snaptopoints());
|
||||
|
||||
xpos = qMax(xpos, 0);
|
||||
//kDebug()<<"GRP XPOS:"<<xpos<<", START:"<<start.x()<<",NEW:"<<newPos.x()<<"; SCENE:"<<scenePos().x()<<",POS:"<<pos().x();
|
||||
//kDebug()<<"GRP XPOS:"<<xpos<<", START:"<<start.x()<<",NEW:"<<newPos.x()<<"; SCENE:"<<scenePos().x()<<",POS:"<<pos().x();
|
||||
newPos.setX((int)(pos().x() + xpos - (int) start.x()));
|
||||
QStringList lockedTracks = property("locked_tracks").toStringList();
|
||||
QStringList lockedTracks = property("locked_tracks").toStringList();
|
||||
int proposedTrack = (property("y_absolute").toInt() + newPos.y()) / trackHeight;
|
||||
// Check if top item is a clip or a transition
|
||||
int offset = 0;
|
||||
int topTrack = -1;
|
||||
QList<int> groupTracks;
|
||||
QList<int> groupTracks;
|
||||
QList<QGraphicsItem *> children = childItems();
|
||||
for (int i = 0; i < children.count(); i++) {
|
||||
for (int i = 0; i < children.count(); ++i) {
|
||||
int currentTrack = 0;
|
||||
if (children.at(i)->type() == AVWIDGET || children.at(i)->type() == TRANSITIONWIDGET) {
|
||||
currentTrack = static_cast <AbstractClipItem*> (children.at(i))->track();
|
||||
if (!groupTracks.contains(currentTrack)) groupTracks.append(currentTrack);
|
||||
}
|
||||
else if (children.at(i)->type() == GROUPWIDGET) {
|
||||
currentTrack = static_cast <AbstractGroupItem*> (children.at(i))->track();
|
||||
}
|
||||
else continue;
|
||||
if (children.at(i)->type() == AVWIDGET) {
|
||||
if (children.at(i)->type() == AVWidget || children.at(i)->type() == TransitionWidget) {
|
||||
currentTrack = static_cast <AbstractClipItem*> (children.at(i))->track();
|
||||
if (!groupTracks.contains(currentTrack)) groupTracks.append(currentTrack);
|
||||
}
|
||||
else if (children.at(i)->type() == GroupWidget) {
|
||||
currentTrack = static_cast <AbstractGroupItem*> (children.at(i))->track();
|
||||
}
|
||||
else continue;
|
||||
if (children.at(i)->type() == AVWidget) {
|
||||
if (topTrack == -1 || currentTrack <= topTrack) {
|
||||
offset = 0;
|
||||
topTrack = currentTrack;
|
||||
}
|
||||
} else if (children.at(i)->type() == TRANSITIONWIDGET) {
|
||||
} else if (children.at(i)->type() == TransitionWidget) {
|
||||
if (topTrack == -1 || currentTrack < topTrack) {
|
||||
offset = (int)(trackHeight / 3 * 2 - 1);
|
||||
topTrack = currentTrack;
|
||||
}
|
||||
} else if (children.at(i)->type() == GROUPWIDGET) {
|
||||
} else if (children.at(i)->type() == GroupWidget) {
|
||||
QList<QGraphicsItem *> subchildren = children.at(i)->childItems();
|
||||
bool clipGroup = false;
|
||||
for (int j = 0; j < subchildren.count(); j++) {
|
||||
if (subchildren.at(j)->type() == AVWIDGET || subchildren.at(j)->type() == TRANSITIONWIDGET) {
|
||||
int subTrack = static_cast <AbstractClipItem*> (subchildren.at(j))->track();
|
||||
if (!groupTracks.contains(subTrack)) groupTracks.append(subTrack);
|
||||
if (subchildren.at(j)->type() == AVWidget || subchildren.at(j)->type() == TransitionWidget) {
|
||||
int subTrack = static_cast <AbstractClipItem*> (subchildren.at(j))->track();
|
||||
if (!groupTracks.contains(subTrack)) groupTracks.append(subTrack);
|
||||
clipGroup = true;
|
||||
}
|
||||
}
|
||||
@@ -236,22 +266,22 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
|
||||
}
|
||||
// Check no clip in the group goes outside of existing tracks
|
||||
int maximumTrack = projectScene()->tracksCount() - 1;
|
||||
int groupHeight = 0;
|
||||
for (int i = 0; i < groupTracks.count(); i++) {
|
||||
int offset = groupTracks.at(i) - topTrack;
|
||||
if (offset > groupHeight) groupHeight = offset;
|
||||
}
|
||||
maximumTrack -= groupHeight;
|
||||
int groupHeight = 0;
|
||||
for (int i = 0; i < groupTracks.count(); ++i) {
|
||||
int offset = groupTracks.at(i) - topTrack;
|
||||
if (offset > groupHeight) groupHeight = offset;
|
||||
}
|
||||
maximumTrack -= groupHeight;
|
||||
proposedTrack = qMin(proposedTrack, maximumTrack);
|
||||
proposedTrack = qMax(proposedTrack, 0);
|
||||
int groupOffset = proposedTrack - topTrack;
|
||||
if (!lockedTracks.isEmpty()) {
|
||||
for (int i = 0; i < groupTracks.count(); i++) {
|
||||
if (lockedTracks.contains(QString::number(groupTracks.at(i) + groupOffset))) {
|
||||
return pos();
|
||||
}
|
||||
}
|
||||
}
|
||||
int groupOffset = proposedTrack - topTrack;
|
||||
if (!lockedTracks.isEmpty()) {
|
||||
for (int i = 0; i < groupTracks.count(); ++i) {
|
||||
if (lockedTracks.contains(QString::number(groupTracks.at(i) + groupOffset))) {
|
||||
return pos();
|
||||
}
|
||||
}
|
||||
}
|
||||
newPos.setY((int)((proposedTrack) * trackHeight) + offset);
|
||||
//if (newPos == start) return start;
|
||||
|
||||
@@ -262,12 +292,12 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
|
||||
|
||||
QList<QGraphicsItem*> collidingItems;
|
||||
QPainterPath shape;
|
||||
if (projectScene()->editMode() == NORMALEDIT) {
|
||||
if (projectScene()->editMode() == NormalEdit) {
|
||||
shape = clipGroupShape(newPos - pos());
|
||||
collidingItems = scene()->items(shape, Qt::IntersectsItemShape);
|
||||
collidingItems.removeAll(this);
|
||||
for (int i = 0; i < children.count(); i++) {
|
||||
if (children.at(i)->type() == GROUPWIDGET) {
|
||||
for (int i = 0; i < children.count(); ++i) {
|
||||
if (children.at(i)->type() == GroupWidget) {
|
||||
QList<QGraphicsItem *> subchildren = children.at(i)->childItems();
|
||||
for (int j = 0; j < subchildren.count(); j++) {
|
||||
collidingItems.removeAll(subchildren.at(j));
|
||||
@@ -279,9 +309,9 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
|
||||
if (!collidingItems.isEmpty()) {
|
||||
bool forwardMove = xpos > start.x();
|
||||
int offset = 0;
|
||||
for (int i = 0; i < collidingItems.count(); i++) {
|
||||
for (int i = 0; i < collidingItems.count(); ++i) {
|
||||
QGraphicsItem *collision = collidingItems.at(i);
|
||||
if (collision->type() == AVWIDGET) {
|
||||
if (collision->type() == AVWidget) {
|
||||
// Collision
|
||||
if (newPos.y() != pos().y()) {
|
||||
// Track change results in collision, restore original position
|
||||
@@ -312,8 +342,8 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
|
||||
// If there is still a collision after our position adjust, restore original pos
|
||||
collidingItems = scene()->items(clipGroupShape(newPos - pos()), Qt::IntersectsItemShape);
|
||||
collidingItems.removeAll(this);
|
||||
for (int i = 0; i < children.count(); i++) {
|
||||
if (children.at(i)->type() == GROUPWIDGET) {
|
||||
for (int i = 0; i < children.count(); ++i) {
|
||||
if (children.at(i)->type() == GroupWidget) {
|
||||
QList<QGraphicsItem *> subchildren = children.at(i)->childItems();
|
||||
for (int j = 0; j < subchildren.count(); j++) {
|
||||
collidingItems.removeAll(subchildren.at(j));
|
||||
@@ -321,17 +351,17 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
|
||||
}
|
||||
collidingItems.removeAll(children.at(i));
|
||||
}
|
||||
for (int i = 0; i < collidingItems.count(); i++)
|
||||
if (collidingItems.at(i)->type() == AVWIDGET) return pos();
|
||||
for (int i = 0; i < collidingItems.count(); ++i)
|
||||
if (collidingItems.at(i)->type() == AVWidget) return pos();
|
||||
}
|
||||
}
|
||||
|
||||
if (projectScene()->editMode() == NORMALEDIT) {
|
||||
if (projectScene()->editMode() == NormalEdit) {
|
||||
shape = transitionGroupShape(newPos - pos());
|
||||
collidingItems = scene()->items(shape, Qt::IntersectsItemShape);
|
||||
collidingItems.removeAll(this);
|
||||
for (int i = 0; i < children.count(); i++) {
|
||||
if (children.at(i)->type() == GROUPWIDGET) {
|
||||
for (int i = 0; i < children.count(); ++i) {
|
||||
if (children.at(i)->type() == GroupWidget) {
|
||||
QList<QGraphicsItem *> subchildren = children.at(i)->childItems();
|
||||
for (int j = 0; j < subchildren.count(); j++) {
|
||||
collidingItems.removeAll(subchildren.at(j));
|
||||
@@ -344,9 +374,9 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
|
||||
else {
|
||||
bool forwardMove = xpos > start.x();
|
||||
int offset = 0;
|
||||
for (int i = 0; i < collidingItems.count(); i++) {
|
||||
for (int i = 0; i < collidingItems.count(); ++i) {
|
||||
QGraphicsItem *collision = collidingItems.at(i);
|
||||
if (collision->type() == TRANSITIONWIDGET) {
|
||||
if (collision->type() == TransitionWidget) {
|
||||
// Collision
|
||||
if (newPos.y() != pos().y()) {
|
||||
// Track change results in collision, restore original position
|
||||
@@ -376,11 +406,11 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
|
||||
}
|
||||
// If there is still a collision after our position adjust, restore original pos
|
||||
collidingItems = scene()->items(transitionGroupShape(newPos - pos()), Qt::IntersectsItemShape);
|
||||
for (int i = 0; i < children.count(); i++) {
|
||||
for (int i = 0; i < children.count(); ++i) {
|
||||
collidingItems.removeAll(children.at(i));
|
||||
}
|
||||
for (int i = 0; i < collidingItems.count(); i++)
|
||||
if (collidingItems.at(i)->type() == TRANSITIONWIDGET) return pos();
|
||||
for (int i = 0; i < collidingItems.count(); ++i)
|
||||
if (collidingItems.at(i)->type() == TransitionWidget) return pos();
|
||||
}
|
||||
}
|
||||
return newPos;
|
||||
@@ -400,12 +430,12 @@ void AbstractGroupItem::dropEvent(QGraphicsSceneDragDropEvent * event)
|
||||
QPointF dropPos = event->scenePos();
|
||||
QList<QGraphicsItem *> selection = scene()->items(dropPos);
|
||||
AbstractClipItem *dropChild = NULL;
|
||||
for (int i = 0; i < selection.count(); i++) {
|
||||
if (selection.at(i)->type() == AVWIDGET) {
|
||||
for (int i = 0; i < selection.count(); ++i) {
|
||||
if (selection.at(i)->type() == AVWidget) {
|
||||
dropChild = (AbstractClipItem *) selection.at(i);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (view) view->slotAddGroupEffect(e, this, dropChild);
|
||||
}
|
||||
|
||||
@@ -427,15 +457,15 @@ void AbstractGroupItem::mousePressEvent(QGraphicsSceneMouseEvent * event)
|
||||
// User want to do a rectangle selection, so ignore the event to pass it to the view
|
||||
event->ignore();
|
||||
} else {
|
||||
QList <QGraphicsItem *>list = scene()->items(event->scenePos());
|
||||
// only allow group move if we click over an item in the group
|
||||
foreach(const QGraphicsItem *item, list) {
|
||||
if (item->type() == TRANSITIONWIDGET || item->type() == AVWIDGET) {
|
||||
QGraphicsItem::mousePressEvent(event);
|
||||
return;
|
||||
}
|
||||
}
|
||||
event->ignore();
|
||||
QList <QGraphicsItem *>list = scene()->items(event->scenePos());
|
||||
// only allow group move if we click over an item in the group
|
||||
foreach(const QGraphicsItem *item, list) {
|
||||
if (item->type() == TransitionWidget || item->type() == AVWidget) {
|
||||
QGraphicsItem::mousePressEvent(event);
|
||||
return;
|
||||
}
|
||||
}
|
||||
event->ignore();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -450,7 +480,7 @@ void AbstractGroupItem::resizeStart(int diff)
|
||||
int itemcount = 0;
|
||||
for (int i = 0; i < children.count(); ++i) {
|
||||
AbstractClipItem *item = static_cast <AbstractClipItem *>(children.at(i));
|
||||
if (item && item->type() == AVWIDGET) {
|
||||
if (item && item->type() == AVWidget) {
|
||||
items << item;
|
||||
if (info)
|
||||
m_resizeInfos << item->info();
|
||||
@@ -477,7 +507,7 @@ void AbstractGroupItem::resizeEnd(int diff)
|
||||
int itemcount = 0;
|
||||
for (int i = 0; i < children.count(); ++i) {
|
||||
AbstractClipItem *item = static_cast <AbstractClipItem *>(children.at(i));
|
||||
if (item && item->type() == AVWIDGET) {
|
||||
if (item && item->type() == AVWidget) {
|
||||
items << item;
|
||||
if (info)
|
||||
m_resizeInfos << item->info();
|
||||
@@ -510,7 +540,7 @@ GenTime AbstractGroupItem::duration()
|
||||
GenTime start = GenTime(-1.0);
|
||||
GenTime end = GenTime();
|
||||
for (int i = 0; i < children.count(); ++i) {
|
||||
if (children.at(i)->type() != GROUPWIDGET) {
|
||||
if (children.at(i)->type() != GroupWidget) {
|
||||
AbstractClipItem *item = static_cast <AbstractClipItem *>(children.at(i));
|
||||
if (item) {
|
||||
if (start < GenTime() || item->startPos() < start)
|
||||
@@ -524,3 +554,5 @@ GenTime AbstractGroupItem::duration()
|
||||
}
|
||||
return end - start;
|
||||
}
|
||||
|
||||
#include "abstractgroupitem.moc"
|
||||
|
||||
@@ -40,8 +40,9 @@ public:
|
||||
void addItem(QGraphicsItem * item);
|
||||
void removeItem(QGraphicsItem * item);
|
||||
int track() const;
|
||||
QPainterPath clipGroupShape(QPointF offset) const;
|
||||
QPainterPath transitionGroupShape(QPointF offset) const;
|
||||
QPainterPath clipGroupShape(const QPointF &offset) const;
|
||||
QPainterPath clipGroupSpacerShape(const QPointF &offset) const;
|
||||
QPainterPath transitionGroupShape(const QPointF &offset) const;
|
||||
void setItemLocked(bool locked);
|
||||
bool isItemLocked() const;
|
||||
// ItemInfo info() const;
|
||||
@@ -70,7 +71,8 @@ protected:
|
||||
|
||||
private:
|
||||
void fixItemRect();
|
||||
QPainterPath groupShape(GRAPHICSRECTITEM type, QPointF offset) const;
|
||||
QPainterPath groupShape(GraphicsRectItem type, const QPointF &offset) const;
|
||||
QPainterPath spacerGroupShape(GraphicsRectItem type, const QPointF &offset) const;
|
||||
/** Stores the original info of the items beeing resized. */
|
||||
QList <ItemInfo> m_resizeInfos;
|
||||
};
|
||||
|
||||
@@ -24,14 +24,17 @@
|
||||
|
||||
|
||||
BezierSplineEditor::BezierSplineEditor(QWidget* parent) :
|
||||
QWidget(parent),
|
||||
m_mode(ModeNormal),
|
||||
m_zoomLevel(0),
|
||||
m_gridLines(3),
|
||||
m_showAllHandles(true),
|
||||
m_pixmapCache(NULL),
|
||||
m_pixmapIsDirty(true),
|
||||
m_currentPointIndex(-1)
|
||||
QWidget(parent)
|
||||
, m_mode(ModeNormal)
|
||||
, m_zoomLevel(0)
|
||||
, m_gridLines(3)
|
||||
, m_showAllHandles(true)
|
||||
, m_pixmapCache(NULL)
|
||||
, m_pixmapIsDirty(true)
|
||||
, m_currentPointIndex(-1)
|
||||
, m_currentPointType(PTypeP)
|
||||
, m_grabOffsetX(0)
|
||||
, m_grabOffsetY(0)
|
||||
{
|
||||
setMouseTracking(true);
|
||||
setAutoFillBackground(false);
|
||||
@@ -42,11 +45,10 @@ BezierSplineEditor::BezierSplineEditor(QWidget* parent) :
|
||||
|
||||
BezierSplineEditor::~BezierSplineEditor()
|
||||
{
|
||||
if (m_pixmapCache)
|
||||
delete m_pixmapCache;
|
||||
delete m_pixmapCache;
|
||||
}
|
||||
|
||||
CubicBezierSpline BezierSplineEditor::spline()
|
||||
CubicBezierSpline BezierSplineEditor::spline() const
|
||||
{
|
||||
return m_spline;
|
||||
}
|
||||
@@ -104,11 +106,13 @@ void BezierSplineEditor::slotZoomOut()
|
||||
|
||||
void BezierSplineEditor::setShowAllHandles(bool show)
|
||||
{
|
||||
m_showAllHandles = show;
|
||||
update();
|
||||
if (m_showAllHandles != show) {
|
||||
m_showAllHandles = show;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
int BezierSplineEditor::gridLines()
|
||||
int BezierSplineEditor::gridLines() const
|
||||
{
|
||||
return m_gridLines;
|
||||
}
|
||||
@@ -459,7 +463,7 @@ void BezierSplineEditor::leaveEvent(QEvent* event)
|
||||
QWidget::leaveEvent(event);
|
||||
}
|
||||
|
||||
int BezierSplineEditor::nearestPointInRange(QPointF p, int wWidth, int wHeight, BezierSplineEditor::point_types* sel)
|
||||
int BezierSplineEditor::nearestPointInRange(const QPointF &p, int wWidth, int wHeight, BezierSplineEditor::point_types* sel)
|
||||
{
|
||||
double nearestDistanceSquared = 1000;
|
||||
point_types selectedPoint = PTypeP;
|
||||
|
||||
@@ -29,10 +29,10 @@ class BezierSplineEditor : public QWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BezierSplineEditor(QWidget* parent = 0);
|
||||
virtual ~BezierSplineEditor();
|
||||
explicit BezierSplineEditor(QWidget* parent = 0);
|
||||
~BezierSplineEditor();
|
||||
|
||||
CubicBezierSpline spline();
|
||||
CubicBezierSpline spline() const;
|
||||
void setSpline(const CubicBezierSpline &spline);
|
||||
|
||||
/** @brief Returns the selected point or else BPoint. */
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
void updateCurrentPoint(const BPoint &p, bool final = true);
|
||||
|
||||
/** @brief Number of lines used in grid. */
|
||||
int gridLines();
|
||||
int gridLines() const;
|
||||
|
||||
/** @brief Sets the number of grid lines to draw (in one direction) to @param lines. */
|
||||
void setGridLines(int lines);
|
||||
@@ -100,7 +100,7 @@ private:
|
||||
* @param sel Is filled with the type of the closest point (h1, p, h2)
|
||||
*
|
||||
* If no point is near enough -1 is returned. */
|
||||
int nearestPointInRange(QPointF p, int wWidth, int wHeight, point_types *sel);
|
||||
int nearestPointInRange(const QPointF &p, int wWidth, int wHeight, point_types *sel);
|
||||
|
||||
signals:
|
||||
void modified();
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include <KIcon>
|
||||
#include <KLocale>
|
||||
#include <KLocalizedString>
|
||||
|
||||
|
||||
BezierSplineWidget::BezierSplineWidget(const QString& spline, QWidget* parent) :
|
||||
@@ -38,13 +38,13 @@ BezierSplineWidget::BezierSplineWidget(const QString& spline, QWidget* parent) :
|
||||
m_ui.setupUi(widget);
|
||||
layout->addWidget(widget);
|
||||
|
||||
m_ui.buttonLinkHandles->setIcon(KIcon("insert-link"));
|
||||
m_ui.buttonZoomIn->setIcon(KIcon("zoom-in"));
|
||||
m_ui.buttonZoomOut->setIcon(KIcon("zoom-out"));
|
||||
m_ui.buttonGridChange->setIcon(KIcon("view-grid"));
|
||||
m_ui.buttonLinkHandles->setIcon(KIcon(QLatin1String("insert-link")));
|
||||
m_ui.buttonZoomIn->setIcon(KIcon(QLatin1String("zoom-in")));
|
||||
m_ui.buttonZoomOut->setIcon(KIcon(QLatin1String("zoom-out")));
|
||||
m_ui.buttonGridChange->setIcon(KIcon(QLatin1String("view-grid")));
|
||||
m_ui.buttonShowPixmap->setIcon(QIcon(QPixmap::fromImage(ColorTools::rgbCurvePlane(QSize(16, 16), ColorTools::COL_Luma, 0.8))));
|
||||
m_ui.buttonResetSpline->setIcon(KIcon("view-refresh"));
|
||||
m_ui.buttonShowAllHandles->setIcon(KIcon("draw-bezier-curves"));
|
||||
m_ui.buttonResetSpline->setIcon(KIcon(QLatin1String("view-refresh")));
|
||||
m_ui.buttonShowAllHandles->setIcon(KIcon(QLatin1String("draw-bezier-curves")));
|
||||
m_ui.widgetPoint->setEnabled(false);
|
||||
|
||||
m_pX = new DragValue(i18n("In"), 0, 3, 0, 1, -1, QString(), false, this);
|
||||
@@ -74,14 +74,14 @@ BezierSplineWidget::BezierSplineWidget(const QString& spline, QWidget* parent) :
|
||||
m_edit.setSpline(s);
|
||||
|
||||
connect(&m_edit, SIGNAL(modified()), this, SIGNAL(modified()));
|
||||
connect(&m_edit, SIGNAL(currentPoint(const BPoint&)), this, SLOT(slotUpdatePointEntries(const BPoint&)));
|
||||
connect(&m_edit, SIGNAL(currentPoint(BPoint)), this, SLOT(slotUpdatePointEntries(BPoint)));
|
||||
|
||||
connect(m_pX, SIGNAL(valueChanged(double, bool)), this, SLOT(slotUpdatePointP(double, bool)));
|
||||
connect(m_pY, SIGNAL(valueChanged(double,bool)), this, SLOT(slotUpdatePointP(double, bool)));
|
||||
connect(m_h1X, SIGNAL(valueChanged(double,bool)), this, SLOT(slotUpdatePointH1(double, bool)));
|
||||
connect(m_h1Y, SIGNAL(valueChanged(double,bool)), this, SLOT(slotUpdatePointH1(double, bool)));
|
||||
connect(m_h2X, SIGNAL(valueChanged(double,bool)), this, SLOT(slotUpdatePointH2(double, bool)));
|
||||
connect(m_h2Y, SIGNAL(valueChanged(double,bool)), this, SLOT(slotUpdatePointH2(double, bool)));
|
||||
connect(m_pX, SIGNAL(valueChanged(double,bool)), this, SLOT(slotUpdatePointP(double,bool)));
|
||||
connect(m_pY, SIGNAL(valueChanged(double,bool)), this, SLOT(slotUpdatePointP(double,bool)));
|
||||
connect(m_h1X, SIGNAL(valueChanged(double,bool)), this, SLOT(slotUpdatePointH1(double,bool)));
|
||||
connect(m_h1Y, SIGNAL(valueChanged(double,bool)), this, SLOT(slotUpdatePointH1(double,bool)));
|
||||
connect(m_h2X, SIGNAL(valueChanged(double,bool)), this, SLOT(slotUpdatePointH2(double,bool)));
|
||||
connect(m_h2Y, SIGNAL(valueChanged(double,bool)), this, SLOT(slotUpdatePointH2(double,bool)));
|
||||
|
||||
connect(m_ui.buttonLinkHandles, SIGNAL(toggled(bool)), this, SLOT(slotSetHandlesLinked(bool)));
|
||||
connect(m_ui.buttonZoomIn, SIGNAL(clicked()), &m_edit, SLOT(slotZoomIn()));
|
||||
@@ -97,7 +97,7 @@ BezierSplineWidget::BezierSplineWidget(const QString& spline, QWidget* parent) :
|
||||
m_ui.buttonShowAllHandles->setChecked(KdenliveSettings::bezier_showallhandles());
|
||||
}
|
||||
|
||||
QString BezierSplineWidget::spline()
|
||||
QString BezierSplineWidget::spline() const
|
||||
{
|
||||
return m_edit.spline().toString();
|
||||
}
|
||||
@@ -119,14 +119,16 @@ void BezierSplineWidget::slotGridChange()
|
||||
|
||||
void BezierSplineWidget::slotShowPixmap(bool show)
|
||||
{
|
||||
m_showPixmap = show;
|
||||
KdenliveSettings::setBezier_showpixmap(show);
|
||||
if (show && (int)m_mode < 6)
|
||||
m_edit.setPixmap(QPixmap::fromImage(ColorTools::rgbCurvePlane(m_edit.size(), (ColorTools::ColorsRGB)((int)m_mode), 1, palette().background().color().rgb())));
|
||||
else if (show && m_mode == ModeHue)
|
||||
m_edit.setPixmap(QPixmap::fromImage(ColorTools::hsvCurvePlane(m_edit.size(), QColor::fromHsv(200, 200, 200), ColorTools::COM_H, ColorTools::COM_H)));
|
||||
else
|
||||
m_edit.setPixmap(QPixmap());
|
||||
if (m_showPixmap != show) {
|
||||
m_showPixmap = show;
|
||||
KdenliveSettings::setBezier_showpixmap(show);
|
||||
if (show && (int)m_mode < 6)
|
||||
m_edit.setPixmap(QPixmap::fromImage(ColorTools::rgbCurvePlane(m_edit.size(), static_cast<ColorTools::ColorsRGB>(m_mode), 1, palette().background().color().rgb())));
|
||||
else if (show && m_mode == ModeHue)
|
||||
m_edit.setPixmap(QPixmap::fromImage(ColorTools::hsvCurvePlane(m_edit.size(), QColor::fromHsv(200, 200, 200), ColorTools::COM_H, ColorTools::COM_H)));
|
||||
else
|
||||
m_edit.setPixmap(QPixmap());
|
||||
}
|
||||
}
|
||||
|
||||
void BezierSplineWidget::slotUpdatePointEntries(const BPoint &p)
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "beziersplineeditor.h"
|
||||
#include "ui_bezierspline_ui.h"
|
||||
|
||||
#include <QtCore>
|
||||
#include <QWidget>
|
||||
|
||||
class DragValue;
|
||||
@@ -37,7 +36,7 @@ public:
|
||||
explicit BezierSplineWidget(const QString &spline, QWidget* parent = 0);
|
||||
|
||||
/** @brief Returns the current spline. */
|
||||
QString spline();
|
||||
QString spline() const;
|
||||
|
||||
/** The curvemodes refer to the usage of the spline.
|
||||
* As this widget is currently only used for frei0r.curves the modes are the channels this filter accepts. */
|
||||
|
||||
@@ -27,7 +27,7 @@ BPoint::BPoint() :
|
||||
{
|
||||
}
|
||||
|
||||
BPoint::BPoint(QPointF handle1, QPointF point, QPointF handle2) :
|
||||
BPoint::BPoint(const QPointF &handle1, const QPointF &point, const QPointF &handle2) :
|
||||
h1(handle1),
|
||||
p(point),
|
||||
h2(handle2)
|
||||
@@ -52,7 +52,7 @@ bool BPoint::operator==(const BPoint& point) const
|
||||
point.h2 == h2;
|
||||
}
|
||||
|
||||
void BPoint::setP(QPointF point, bool updateHandles)
|
||||
void BPoint::setP(const QPointF &point, bool updateHandles)
|
||||
{
|
||||
QPointF offset = point - p;
|
||||
p = point;
|
||||
@@ -62,7 +62,7 @@ void BPoint::setP(QPointF point, bool updateHandles)
|
||||
}
|
||||
}
|
||||
|
||||
void BPoint::setH1(QPointF handle1)
|
||||
void BPoint::setH1(const QPointF &handle1)
|
||||
{
|
||||
h1 = handle1;
|
||||
if (handlesLinked) {
|
||||
@@ -73,7 +73,7 @@ void BPoint::setH1(QPointF handle1)
|
||||
}
|
||||
}
|
||||
|
||||
void BPoint::setH2(QPointF handle2)
|
||||
void BPoint::setH2(const QPointF &handle2)
|
||||
{
|
||||
h2 = handle2;
|
||||
if (handlesLinked) {
|
||||
|
||||
@@ -31,7 +31,7 @@ public:
|
||||
/** @brief Sets the point to -1, -1 to mark it as unusable (until point + handles have proper values) */
|
||||
BPoint();
|
||||
/** @brief Sets up according to the params. Linking detecting is done using autoSetLinked(). */
|
||||
BPoint(QPointF handle1, QPointF point, QPointF handle2);
|
||||
BPoint(const QPointF &handle1, const QPointF &point, const QPointF &handle2);
|
||||
|
||||
/** @brief Returns h1 if i = 0, p if i = 1, h2 if i = 2. */
|
||||
QPointF &operator[](int i);
|
||||
@@ -41,17 +41,17 @@ public:
|
||||
|
||||
/** @brief Sets p to @param point.
|
||||
* @param updateHandles (default = true) Whether to make sure the handles keep their position relative to p. */
|
||||
void setP(QPointF point, bool updateHandles = true);
|
||||
void setP(const QPointF &point, bool updateHandles = true);
|
||||
|
||||
/** @brief Sets h1 to @param handle1.
|
||||
*
|
||||
* If handlesLinked is true h2 is updated. */
|
||||
void setH1(QPointF handle1);
|
||||
void setH1(const QPointF &handle1);
|
||||
|
||||
/** @brief Sets h2 to @param handle2.
|
||||
*
|
||||
* If handlesLinked is true h1 is updated. */
|
||||
void setH2(QPointF handle2);
|
||||
void setH2(const QPointF &handle2);
|
||||
void keepInRange(qreal xMin, qreal xMax);
|
||||
|
||||
/** @brief Sets handlesLinked to true if the handles are in a linked state (line through h1, p, h2) otherwise to false. */
|
||||
|
||||
@@ -48,12 +48,12 @@ void CubicBezierSpline::fromString(const QString& spline)
|
||||
{
|
||||
m_points.clear();
|
||||
|
||||
QStringList bpoints = spline.split('|');
|
||||
const QStringList bpoints = spline.split(QLatin1Char('|'));
|
||||
foreach(const QString &bpoint, bpoints) {
|
||||
QStringList points = bpoint.split('#');
|
||||
const QStringList points = bpoint.split(QLatin1Char('#'));
|
||||
QList <QPointF> values;
|
||||
foreach(const QString &point, points) {
|
||||
QStringList xy = point.split(';');
|
||||
QStringList xy = point.split(QLatin1Char(';'));
|
||||
if (xy.count() == 2)
|
||||
values.append(QPointF(xy.at(0).toDouble(), xy.at(1).toDouble()));
|
||||
}
|
||||
@@ -71,11 +71,11 @@ QString CubicBezierSpline::toString() const
|
||||
QStringList spline;
|
||||
QLocale locale;
|
||||
foreach(const BPoint &p, m_points) {
|
||||
spline << QString("%1;%2#%3;%4#%5;%6").arg(locale.toString(p.h1.x())).arg(locale.toString(p.h1.y()))
|
||||
spline << QString::fromLatin1("%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("|");
|
||||
return spline.join(QLatin1String("|"));
|
||||
}
|
||||
|
||||
int CubicBezierSpline::setPoint(int ix, const BPoint& point)
|
||||
@@ -86,7 +86,7 @@ int CubicBezierSpline::setPoint(int ix, const BPoint& point)
|
||||
return indexOf(point); // in case it changed
|
||||
}
|
||||
|
||||
QList <BPoint> CubicBezierSpline::points()
|
||||
QList <BPoint> CubicBezierSpline::points() const
|
||||
{
|
||||
return m_points;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class CubicBezierSpline : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CubicBezierSpline(QObject* parent = 0);
|
||||
explicit CubicBezierSpline(QObject* parent = 0);
|
||||
CubicBezierSpline(const CubicBezierSpline &spline, QObject* parent = 0);
|
||||
CubicBezierSpline& operator=(const CubicBezierSpline &spline);
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
QString toString() const;
|
||||
|
||||
/** @brief Returns a list of the points defining the spline. */
|
||||
QList <BPoint> points();
|
||||
QList <BPoint> points() const;
|
||||
|
||||
/** @brief Sets the point at index @param ix to @param point and returns its index (it might have changed during validation). */
|
||||
int setPoint(int ix, const BPoint &point);
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#include <QWheelEvent>
|
||||
|
||||
ClipDurationDialog::ClipDurationDialog(AbstractClipItem *clip, Timecode tc, GenTime min, GenTime max, QWidget * parent):
|
||||
ClipDurationDialog::ClipDurationDialog(AbstractClipItem *clip, const Timecode &tc, const GenTime &min, const GenTime &max, QWidget * parent):
|
||||
QDialog(parent),
|
||||
m_clip(clip),
|
||||
m_min(min),
|
||||
@@ -47,14 +47,14 @@ ClipDurationDialog::ClipDurationDialog(AbstractClipItem *clip, Timecode tc, GenT
|
||||
crop_end_box->addWidget(m_cropEnd);
|
||||
|
||||
bool allowCrop = true;
|
||||
if (clip->type() == AVWIDGET) {
|
||||
if (clip->type() == AVWidget) {
|
||||
ClipItem *item = static_cast <ClipItem *>(clip);
|
||||
int t = item->clipType();
|
||||
if (t == COLOR || t == IMAGE || t == TEXT)
|
||||
const int t = item->clipType();
|
||||
if (t == Color || t == Image || t == Text)
|
||||
allowCrop = false;
|
||||
}
|
||||
|
||||
if (!allowCrop || clip->type() == TRANSITIONWIDGET) {
|
||||
if (!allowCrop || clip->type() == TransitionWidget) {
|
||||
m_cropStart->setHidden(true);
|
||||
crop_label->hide();
|
||||
m_cropEnd->setHidden(true),
|
||||
|
||||
@@ -37,7 +37,7 @@ class ClipDurationDialog : public QDialog, public Ui::ClipDurationDialog_UI
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ClipDurationDialog(AbstractClipItem *clip, Timecode tc, GenTime min, GenTime max, QWidget * parent = 0);
|
||||
explicit ClipDurationDialog(AbstractClipItem *clip, const Timecode &tc, const GenTime &min, const GenTime &max, QWidget * parent = 0);
|
||||
~ClipDurationDialog();
|
||||
GenTime startPos() const;
|
||||
GenTime cropStart() const;
|
||||
|
||||
643
src/clipitem.cpp
643
src/clipitem.cpp
File diff suppressed because it is too large
Load Diff
@@ -46,7 +46,7 @@ class ClipItem : public AbstractClipItem
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ClipItem(DocClipBase *clip, ItemInfo info, double fps, double speed, int strobe, int frame_width, bool generateThumbs = true);
|
||||
ClipItem(DocClipBase *clip, const ItemInfo &info, double fps, double speed, int strobe, int frame_width, bool generateThumbs = true);
|
||||
virtual ~ ClipItem();
|
||||
virtual void paint(QPainter *painter,
|
||||
const QStyleOptionGraphicsItem *option,
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
virtual int type() const;
|
||||
void resizeStart(int posx, bool size = true, bool emitChange = true);
|
||||
void resizeEnd(int posx, bool emitChange = true);
|
||||
OPERATIONTYPE operationMode(QPointF pos);
|
||||
OperationType operationMode(const QPointF &pos);
|
||||
static int itemHeight();
|
||||
const QString clipProducer() const;
|
||||
int clipType() const;
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
void setClipName(const QString &name);
|
||||
QDomElement xml() const;
|
||||
QDomElement itemXml() const;
|
||||
ClipItem *clone(ItemInfo info) const;
|
||||
ClipItem *clone(const ItemInfo &info) const;
|
||||
const EffectsList effectList() const;
|
||||
void setFadeOut(int pos);
|
||||
void setFadeIn(int pos);
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
EffectsParameterList addEffect(QDomElement effect, bool animate = true);
|
||||
|
||||
/** @brief Deletes the effect with id @param index. */
|
||||
void deleteEffect(QString index);
|
||||
void deleteEffect(const QString &index);
|
||||
|
||||
/** @brief Gets the number of effects in this clip. */
|
||||
int effectsCount();
|
||||
@@ -138,15 +138,19 @@ public:
|
||||
void initEffect(QDomElement effect, int diff = 0, int offset = 0);
|
||||
|
||||
/** @brief Gets all keyframes.
|
||||
* @param index Number of the effect
|
||||
* @param index Index of the effect
|
||||
* @return a list of strings of keyframes (one string per param) */
|
||||
QStringList keyframes(const int index);
|
||||
|
||||
/** @brief Adjust all geometry keyframes.
|
||||
* @param index Index of the effect */
|
||||
void resizeGeometries(const int index, int width, int height, int previousDuration, int start, int duration);
|
||||
|
||||
/** @brief Sets params with keyframes and updates the visible keyframes.
|
||||
* @param ix Number of the effect
|
||||
* @param keyframes a list of strings of keyframes (one string per param), which should be used */
|
||||
void setKeyframes(const int ix, const QStringList keyframes);
|
||||
void setEffectList(const EffectsList effectList);
|
||||
void setKeyframes(const int ix, const QStringList &keyframes);
|
||||
void setEffectList(const EffectsList &effectList);
|
||||
void setSpeed(const double speed, int strobe);
|
||||
double speed() const;
|
||||
int strobe() const;
|
||||
@@ -157,10 +161,11 @@ public:
|
||||
int hasEffect(const QString &tag, const QString &id) const;
|
||||
|
||||
/** @brief Adjust keyframes to the new clip. */
|
||||
const QString adjustKeyframes(QString keyframes, int offset);
|
||||
const QString adjustKeyframes(const QString &keyframes, int offset);
|
||||
/** @brief Makes sure all keyframes are in the clip's cropped duration.
|
||||
* @param cutPos the frame number where the new clip starts
|
||||
* @return Whether or not changes were made */
|
||||
bool checkKeyFrames();
|
||||
bool checkKeyFrames(int width, int height, int previousDuration, int cutPos = -1);
|
||||
QPixmap startThumb() const;
|
||||
QPixmap endThumb() const;
|
||||
void setVideoOnly(bool force);
|
||||
@@ -175,7 +180,7 @@ public:
|
||||
bool updateNormalKeyframes(QDomElement parameter, ItemInfo oldInfo);
|
||||
|
||||
/** @brief Adjusts effects after a clip duration change. */
|
||||
QMap<int, QDomElement> adjustEffectsToDuration(int width, int height, ItemInfo oldInfo);
|
||||
QMap<int, QDomElement> adjustEffectsToDuration(int width, int height, const ItemInfo &oldInfo);
|
||||
|
||||
/** Returns the necessary (audio, video, general) producer.
|
||||
* @param track Track of the requested producer
|
||||
@@ -192,18 +197,18 @@ public:
|
||||
|
||||
protected:
|
||||
//virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * event);
|
||||
virtual void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
|
||||
virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
|
||||
virtual void dropEvent(QGraphicsSceneDragDropEvent *event);
|
||||
void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
|
||||
void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
|
||||
void dropEvent(QGraphicsSceneDragDropEvent *event);
|
||||
//virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *);
|
||||
//virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *);
|
||||
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
|
||||
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
|
||||
|
||||
private:
|
||||
DocClipBase *m_clip;
|
||||
ItemInfo m_speedIndependantInfo;
|
||||
QString m_producer;
|
||||
CLIPTYPE m_clipType;
|
||||
ClipType m_clipType;
|
||||
QString m_clipName;
|
||||
QString m_effectNames;
|
||||
int m_startFade;
|
||||
@@ -211,6 +216,7 @@ private:
|
||||
bool m_audioOnly;
|
||||
bool m_videoOnly;
|
||||
QColor m_baseColor;
|
||||
QColor m_paintColor;
|
||||
|
||||
QPixmap m_startPix;
|
||||
QPixmap m_endPix;
|
||||
@@ -245,16 +251,16 @@ private slots:
|
||||
void slotGotAudioData();
|
||||
void slotPrepareAudioThumb(double pixelForOneFrame, int startpixel, int endpixel, int channels, int pixelHeight);
|
||||
void animate(qreal value);
|
||||
void slotSetStartThumb(QImage img);
|
||||
void slotSetEndThumb(QImage img);
|
||||
void slotThumbReady(int frame, QImage img);
|
||||
void slotSetStartThumb(const QImage &img);
|
||||
void slotSetEndThumb(const QImage &img);
|
||||
void slotThumbReady(int frame, const QImage &img);
|
||||
/** @brief The thumbnailer has finished to cache all required thumbs. */
|
||||
void slotGotThumbsCache();
|
||||
|
||||
public slots:
|
||||
void slotFetchThumbs();
|
||||
void slotSetStartThumb(const QPixmap pix);
|
||||
void slotSetEndThumb(const QPixmap pix);
|
||||
void slotSetStartThumb(const QPixmap &pix);
|
||||
void slotSetEndThumb(const QPixmap &pix);
|
||||
void slotUpdateRange();
|
||||
|
||||
signals:
|
||||
|
||||
@@ -60,11 +60,11 @@ ClipManager::ClipManager(KdenliveDoc *doc) :
|
||||
m_clipIdCounter = 1;
|
||||
m_folderIdCounter = 1;
|
||||
m_modifiedTimer.setInterval(1500);
|
||||
connect(&m_fileWatcher, SIGNAL(dirty(const QString &)), this, SLOT(slotClipModified(const QString &)));
|
||||
connect(&m_fileWatcher, SIGNAL(deleted(const QString &)), this, SLOT(slotClipMissing(const QString &)));
|
||||
connect(&m_fileWatcher, SIGNAL(dirty(QString)), this, SLOT(slotClipModified(QString)));
|
||||
connect(&m_fileWatcher, SIGNAL(deleted(QString)), this, SLOT(slotClipMissing(QString)));
|
||||
|
||||
// Seems like a dirty signal is emitted anyways when a watched file is created, so don't react twice.
|
||||
//connect(&m_fileWatcher, SIGNAL(created(const QString &)), this, SLOT(slotClipAvailable(const QString &)));
|
||||
//connect(&m_fileWatcher, SIGNAL(created(QString)), this, SLOT(slotClipAvailable(QString)));
|
||||
connect(&m_modifiedTimer, SIGNAL(timeout()), this, SLOT(slotProcessModifiedClips()));
|
||||
|
||||
#if KDE_IS_VERSION(4,5,0)
|
||||
@@ -123,7 +123,7 @@ void ClipManager::clearCache()
|
||||
#endif
|
||||
}
|
||||
|
||||
void ClipManager::slotRequestThumbs(const QString id, QList <int> frames)
|
||||
void ClipManager::slotRequestThumbs(const QString &id, const QList <int>& frames)
|
||||
{
|
||||
m_thumbsMutex.lock();
|
||||
foreach (int frame, frames) {
|
||||
@@ -176,34 +176,34 @@ void ClipManager::slotGetThumbs()
|
||||
m_processingThumbId = i.key();
|
||||
QList<int> values = m_requestedThumbs.values(m_processingThumbId);
|
||||
m_requestedThumbs.remove(m_processingThumbId);
|
||||
if (m_processingThumbId.startsWith("?")) {
|
||||
// if id starts with ?, it means the request comes from a clip property widget
|
||||
thumbType = 2;
|
||||
m_processingThumbId.remove(0, 1);
|
||||
}
|
||||
if (m_processingThumbId.startsWith("#")) {
|
||||
// if id starts with #, it means the request comes from project tree
|
||||
thumbType = 1;
|
||||
m_processingThumbId.remove(0, 1);
|
||||
}
|
||||
if (m_processingThumbId.startsWith("?")) {
|
||||
// if id starts with ?, it means the request comes from a clip property widget
|
||||
thumbType = 2;
|
||||
m_processingThumbId.remove(0, 1);
|
||||
}
|
||||
if (m_processingThumbId.startsWith("#")) {
|
||||
// if id starts with #, it means the request comes from project tree
|
||||
thumbType = 1;
|
||||
m_processingThumbId.remove(0, 1);
|
||||
}
|
||||
m_thumbsMutex.unlock();
|
||||
qSort(values);
|
||||
DocClipBase *clip = getClipById(m_processingThumbId);
|
||||
if (!clip) continue;
|
||||
max = m_requestedThumbs.size() + values.count();
|
||||
int pos;
|
||||
int pos;
|
||||
while (!values.isEmpty() && clip->thumbProducer() && !m_abortThumb) {
|
||||
pos = values.takeFirst();
|
||||
switch (thumbType) {
|
||||
case 1:
|
||||
clip->thumbProducer()->getGenericThumb(pos, SubProjectItem::itemDefaultHeight(), thumbType);
|
||||
break;
|
||||
case 2:
|
||||
clip->thumbProducer()->getGenericThumb(pos, 180, thumbType);
|
||||
break;
|
||||
default:
|
||||
clip->thumbProducer()->getThumb(pos);
|
||||
}
|
||||
pos = values.takeFirst();
|
||||
switch (thumbType) {
|
||||
case 1:
|
||||
clip->thumbProducer()->getGenericThumb(pos, SubProjectItem::itemDefaultHeight(), thumbType);
|
||||
break;
|
||||
case 2:
|
||||
clip->thumbProducer()->getGenericThumb(pos, 180, thumbType);
|
||||
break;
|
||||
default:
|
||||
clip->thumbProducer()->getThumb(pos);
|
||||
}
|
||||
done++;
|
||||
if (max > 3) emit displayMessage(i18n("Loading thumbnails"), 100 * done / max);
|
||||
}
|
||||
@@ -227,7 +227,7 @@ void ClipManager::checkAudioThumbs()
|
||||
}
|
||||
|
||||
m_thumbsMutex.lock();
|
||||
for (int i = 0; i < m_clipList.count(); i++) {
|
||||
for (int i = 0; i < m_clipList.count(); ++i) {
|
||||
DocClipBase *clip = m_clipList.at(i);
|
||||
if (clip->hasAudioThumb() && !clip->audioThumbCreated())
|
||||
m_audioThumbsQueue.append(m_clipList.at(i)->getId());
|
||||
@@ -264,17 +264,17 @@ void ClipManager::slotGetAudioThumbs()
|
||||
if (hash.isEmpty()) continue;
|
||||
QString audioPath = projectFolder() + "/thumbs/" + hash + ".thumb";
|
||||
double lengthInFrames = clip->duration().frames(m_doc->fps());
|
||||
int frequency = 0;
|
||||
int channels = 0;
|
||||
QString data = clip->getProperty("frequency");
|
||||
if (!data.isEmpty()) frequency = data.toInt();
|
||||
if (frequency <= 0) frequency = 48000;
|
||||
data = clip->getProperty("channels");
|
||||
if (!data.isEmpty()) channels = data.toInt();
|
||||
if (channels <= 0) channels = 2;
|
||||
int arrayWidth = 20;
|
||||
int frequency = 0;
|
||||
int channels = 0;
|
||||
QString data = clip->getProperty("frequency");
|
||||
if (!data.isEmpty()) frequency = data.toInt();
|
||||
if (frequency <= 0) frequency = 48000;
|
||||
data = clip->getProperty("channels");
|
||||
if (!data.isEmpty()) channels = data.toInt();
|
||||
if (channels <= 0) channels = 2;
|
||||
int arrayWidth = 20;
|
||||
double frame = 0.0;
|
||||
int maxVolume = 0;
|
||||
int maxVolume = 0;
|
||||
audioByteArray storeIn;
|
||||
QFile f(audioPath);
|
||||
if (QFileInfo(audioPath).size() > 0 && f.open(QIODevice::ReadOnly)) {
|
||||
@@ -294,9 +294,9 @@ void ClipManager::slotGetAudioThumbs()
|
||||
h3 = 0;
|
||||
for (int c = 0; c < channels; c++) {
|
||||
QByteArray audioArray(arrayWidth, '\x00');
|
||||
for (int i = 0; i < arrayWidth; i++) {
|
||||
for (int i = 0; i < arrayWidth; ++i) {
|
||||
audioArray[i] = channelarray.at(h2 + h3 + i);
|
||||
if (audioArray.at(i) > maxVolume) maxVolume = audioArray.at(i);
|
||||
if (audioArray.at(i) > maxVolume) maxVolume = audioArray.at(i);
|
||||
}
|
||||
h3 += arrayWidth;
|
||||
storeIn[z][c] = audioArray;
|
||||
@@ -304,11 +304,11 @@ void ClipManager::slotGetAudioThumbs()
|
||||
h2 += h1;
|
||||
}
|
||||
if (!m_abortAudioThumb) {
|
||||
clip->setProperty("audio_max", QString::number(maxVolume - 64));
|
||||
clip->updateAudioThumbnail(storeIn);
|
||||
}
|
||||
clip->setProperty("audio_max", QString::number(maxVolume - 64));
|
||||
clip->updateAudioThumbnail(storeIn);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!f.open(QIODevice::WriteOnly)) {
|
||||
kDebug() << "++++++++ ERROR WRITING TO FILE: " << audioPath;
|
||||
@@ -335,12 +335,11 @@ void ClipManager::slotGetAudioThumbs()
|
||||
}
|
||||
|
||||
int last_val = 0;
|
||||
int val = 0;
|
||||
double framesPerSecond = mlt_producer_get_fps(producer.get_producer());
|
||||
Mlt::Frame *mlt_frame;
|
||||
|
||||
for (int z = (int) frame; z < (int)(frame + lengthInFrames) && producer.is_valid() && !m_abortAudioThumb; z++) {
|
||||
val = (int)((z - frame) / (frame + lengthInFrames) * 100.0);
|
||||
int val = (int)((z - frame) / (frame + lengthInFrames) * 100.0);
|
||||
if (last_val != val && val > 1) {
|
||||
setThumbsProgress(i18n("Creating audio thumbnail for %1", url.fileName()), val);
|
||||
last_val = val;
|
||||
@@ -353,18 +352,18 @@ void ClipManager::slotGetAudioThumbs()
|
||||
for (int c = 0; c < channels; c++) {
|
||||
QByteArray audioArray;
|
||||
audioArray.resize(arrayWidth);
|
||||
for (int i = 0; i < audioArray.size(); i++) {
|
||||
double pcmval = *(pcm + c + i * samples / audioArray.size());
|
||||
if (pcmval >= 0) {
|
||||
pcmval = sqrt(pcmval) / 2.83 + 64;
|
||||
audioArray[i] = pcmval;
|
||||
if (pcmval > maxVolume) maxVolume = pcmval;
|
||||
}
|
||||
else {
|
||||
pcmval = -sqrt(-pcmval) / 2.83 + 64;
|
||||
audioArray[i] = pcmval;
|
||||
if (-pcmval > maxVolume) maxVolume = -pcmval;
|
||||
}
|
||||
for (int i = 0; i < audioArray.size(); ++i) {
|
||||
double pcmval = *(pcm + c + i * samples / audioArray.size());
|
||||
if (pcmval >= 0) {
|
||||
pcmval = sqrt(pcmval) / 2.83 + 64;
|
||||
audioArray[i] = pcmval;
|
||||
if (pcmval > maxVolume) maxVolume = pcmval;
|
||||
}
|
||||
else {
|
||||
pcmval = -sqrt(-pcmval) / 2.83 + 64;
|
||||
audioArray[i] = pcmval;
|
||||
if (-pcmval > maxVolume) maxVolume = -pcmval;
|
||||
}
|
||||
}
|
||||
f.write(audioArray);
|
||||
storeIn[z][c] = audioArray;
|
||||
@@ -380,7 +379,7 @@ void ClipManager::slotGetAudioThumbs()
|
||||
f.remove();
|
||||
} else {
|
||||
clip->updateAudioThumbnail(storeIn);
|
||||
clip->setProperty("audio_max", QString::number(maxVolume - 64));
|
||||
clip->setProperty("audio_max", QString::number(maxVolume - 64));
|
||||
}
|
||||
}
|
||||
m_processingAudioThumbId.clear();
|
||||
@@ -404,7 +403,7 @@ QMap <QString, QString> ClipManager::documentFolderList() const
|
||||
void ClipManager::addClip(DocClipBase *clip)
|
||||
{
|
||||
m_clipList.append(clip);
|
||||
if (clip->clipType() != COLOR && clip->clipType() != SLIDESHOW && !clip->fileURL().isEmpty()) {
|
||||
if (clip->clipType() != Color && clip->clipType() != SlideShow && !clip->fileURL().isEmpty()) {
|
||||
// listen for file change
|
||||
//kDebug() << "// LISTEN FOR: " << clip->fileURL().path();
|
||||
m_fileWatcher.addFile(clip->fileURL().path());
|
||||
@@ -420,7 +419,7 @@ void ClipManager::slotDeleteClips(QStringList ids)
|
||||
QUndoCommand *delClips = new QUndoCommand();
|
||||
delClips->setText(i18np("Delete clip", "Delete clips", ids.size()));
|
||||
|
||||
for (int i = 0; i < ids.size(); i++) {
|
||||
for (int i = 0; i < ids.size(); ++i) {
|
||||
DocClipBase *clip = getClipById(ids.at(i));
|
||||
if (clip) {
|
||||
new AddClipCommand(m_doc, clip->toXML(), ids.at(i), false, delClips);
|
||||
@@ -431,10 +430,10 @@ void ClipManager::slotDeleteClips(QStringList ids)
|
||||
|
||||
void ClipManager::deleteClip(const QString &clipId)
|
||||
{
|
||||
for (int i = 0; i < m_clipList.count(); i++) {
|
||||
for (int i = 0; i < m_clipList.count(); ++i) {
|
||||
if (m_clipList.at(i)->getId() == clipId) {
|
||||
DocClipBase *clip = m_clipList.takeAt(i);
|
||||
if (clip->clipType() != COLOR && clip->clipType() != SLIDESHOW && !clip->fileURL().isEmpty()) {
|
||||
DocClipBase *clip = m_clipList.takeAt(i);
|
||||
if (clip->clipType() != Color && clip->clipType() != SlideShow && !clip->fileURL().isEmpty()) {
|
||||
//if (m_clipList.at(i)->clipType() == IMAGE || m_clipList.at(i)->clipType() == AUDIO || (m_clipList.at(i)->clipType() == TEXT && !m_clipList.at(i)->fileURL().isEmpty())) {
|
||||
// listen for file change
|
||||
m_fileWatcher.removeFile(clip->fileURL().path());
|
||||
@@ -455,7 +454,7 @@ DocClipBase *ClipManager::getClipById(QString clipId)
|
||||
{
|
||||
//kDebug() << "++++ CLIP MAN, LOOKING FOR CLIP ID: " << clipId;
|
||||
clipId = clipId.section('_', 0, 0);
|
||||
for (int i = 0; i < m_clipList.count(); i++) {
|
||||
for (int i = 0; i < m_clipList.count(); ++i) {
|
||||
if (m_clipList.at(i)->getId() == clipId) {
|
||||
//kDebug() << "++++ CLIP MAN, FOUND FOR CLIP ID: " << clipId;
|
||||
return m_clipList.at(i);
|
||||
@@ -464,12 +463,12 @@ DocClipBase *ClipManager::getClipById(QString clipId)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const QList <DocClipBase *> ClipManager::getClipByResource(QString resource)
|
||||
const QList <DocClipBase *> ClipManager::getClipByResource(const QString &resource)
|
||||
{
|
||||
QList <DocClipBase *> list;
|
||||
QString clipResource;
|
||||
QString proxyResource;
|
||||
for (int i = 0; i < m_clipList.count(); i++) {
|
||||
for (int i = 0; i < m_clipList.count(); ++i) {
|
||||
clipResource = m_clipList.at(i)->getProperty("resource");
|
||||
proxyResource = m_clipList.at(i)->getProperty("proxy");
|
||||
if (clipResource.isEmpty()) clipResource = m_clipList.at(i)->getProperty("colour");
|
||||
@@ -483,14 +482,14 @@ const QList <DocClipBase *> ClipManager::getClipByResource(QString resource)
|
||||
|
||||
void ClipManager::clearUnusedProducers()
|
||||
{
|
||||
for (int i = 0; i < m_clipList.count(); i++) {
|
||||
for (int i = 0; i < m_clipList.count(); ++i) {
|
||||
if (m_clipList.at(i)->numReferences() == 0) m_clipList.at(i)->deleteProducers();
|
||||
}
|
||||
}
|
||||
|
||||
void ClipManager::resetProducersList(const QList <Mlt::Producer *> prods, bool displayRatioChanged, bool fpsChanged)
|
||||
{
|
||||
for (int i = 0; i < m_clipList.count(); i++) {
|
||||
for (int i = 0; i < m_clipList.count(); ++i) {
|
||||
if (m_clipList.at(i)->numReferences() > 0 || displayRatioChanged || fpsChanged) {
|
||||
m_clipList.at(i)->deleteProducers();
|
||||
}
|
||||
@@ -498,7 +497,7 @@ void ClipManager::resetProducersList(const QList <Mlt::Producer *> prods, bool d
|
||||
QString id;
|
||||
Mlt::Producer *prod;
|
||||
QStringList brokenClips;
|
||||
for (int i = 0; i < prods.count(); i++) {
|
||||
for (int i = 0; i < prods.count(); ++i) {
|
||||
prod = prods.at(i);
|
||||
id = prod->get("id");
|
||||
if (id.contains('_')) id = id.section('_', 0, 0);
|
||||
@@ -527,7 +526,7 @@ void ClipManager::slotAddClip(KIO::Job *job, const KUrl &, const KUrl &dst)
|
||||
slotAddClipList(KUrl::List () << dst, data);
|
||||
}
|
||||
|
||||
void ClipManager::slotAddClipList(const KUrl::List urls, QMap <QString, QString> data)
|
||||
void ClipManager::slotAddClipList(const KUrl::List &urls, const QMap <QString, QString> &data)
|
||||
{
|
||||
QUndoCommand *addClips = new QUndoCommand();
|
||||
// Update list of removable volumes
|
||||
@@ -540,23 +539,23 @@ void ClipManager::slotAddClipList(const KUrl::List urls, QMap <QString, QString>
|
||||
continue;
|
||||
}
|
||||
if (isOnRemovableDevice(file)) {
|
||||
int answer = KMessageBox::warningYesNoCancel(kapp->activeWindow(), i18n("Clip <b>%1</b><br /> is on a removable device, will not be available when device is unplugged", file.path()), i18n("File on a Removable Device"), KGuiItem(i18n("Copy file to project folder")), KGuiItem(i18n("Continue")), KStandardGuiItem::cancel(), QString("copyFilesToProjectFolder"));
|
||||
if (answer == KMessageBox::Cancel) continue;
|
||||
else if (answer == KMessageBox::Yes) {
|
||||
// Copy files to project folder
|
||||
QString sourcesFolder = m_doc->projectFolder().path(KUrl::AddTrailingSlash) + "clips/";
|
||||
KIO::NetAccess::mkdir(sourcesFolder, kapp->activeWindow());
|
||||
//KIO::filesize_t m_requestedSize;
|
||||
KIO::CopyJob *copyjob = KIO::copy (file, KUrl(sourcesFolder));
|
||||
//TODO: for some reason, passing metadata does not work...
|
||||
copyjob->addMetaData("group", data.value("group"));
|
||||
copyjob->addMetaData("groupId", data.value("groupId"));
|
||||
copyjob->addMetaData("comment", data.value("comment"));
|
||||
copyjob->ui()->setWindow(kapp->activeWindow());
|
||||
connect(copyjob, SIGNAL(copyingDone(KIO::Job *, const KUrl &, const KUrl &, time_t, bool, bool)), this, SLOT(slotAddClip(KIO::Job *, const KUrl &, const KUrl &)));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
int answer = KMessageBox::warningYesNoCancel(kapp->activeWindow(), i18n("Clip <b>%1</b><br /> is on a removable device, will not be available when device is unplugged", file.path()), i18n("File on a Removable Device"), KGuiItem(i18n("Copy file to project folder")), KGuiItem(i18n("Continue")), KStandardGuiItem::cancel(), QString("copyFilesToProjectFolder"));
|
||||
if (answer == KMessageBox::Cancel) continue;
|
||||
else if (answer == KMessageBox::Yes) {
|
||||
// Copy files to project folder
|
||||
QString sourcesFolder = m_doc->projectFolder().path(KUrl::AddTrailingSlash) + "clips/";
|
||||
KIO::NetAccess::mkdir(sourcesFolder, kapp->activeWindow());
|
||||
//KIO::filesize_t m_requestedSize;
|
||||
KIO::CopyJob *copyjob = KIO::copy (file, KUrl(sourcesFolder));
|
||||
//TODO: for some reason, passing metadata does not work...
|
||||
copyjob->addMetaData("group", data.value("group"));
|
||||
copyjob->addMetaData("groupId", data.value("groupId"));
|
||||
copyjob->addMetaData("comment", data.value("comment"));
|
||||
copyjob->ui()->setWindow(kapp->activeWindow());
|
||||
connect(copyjob, SIGNAL(copyingDone(KIO::Job*,KUrl,KUrl,time_t,bool,bool)), this, SLOT(slotAddClip(KIO::Job*,KUrl,KUrl)));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
kDebug() << "Adding clip: " << file.path();
|
||||
QDomDocument doc;
|
||||
QDomElement prod = doc.createElement("producer");
|
||||
@@ -570,11 +569,11 @@ void ClipManager::slotAddClipList(const KUrl::List urls, QMap <QString, QString>
|
||||
prod.setAttribute("groupid", data.value("groupId"));
|
||||
}
|
||||
if (data.contains("video_index")) prod.setAttribute("video_index", data.value("video_index"));
|
||||
if (data.contains("audio_index")) prod.setAttribute("audio_index", data.value("audio_index"));
|
||||
|
||||
if (data.contains("audio_index")) prod.setAttribute("audio_index", data.value("audio_index"));
|
||||
|
||||
KMimeType::Ptr type = KMimeType::findByUrl(file);
|
||||
if (type->name().startsWith("image/")) {
|
||||
prod.setAttribute("type", (int) IMAGE);
|
||||
prod.setAttribute("type", (int) Image);
|
||||
prod.setAttribute("in", 0);
|
||||
prod.setAttribute("out", m_doc->getFramePos(KdenliveSettings::image_duration()) - 1);
|
||||
if (KdenliveSettings::autoimagetransparency()) prod.setAttribute("transparency", 1);
|
||||
@@ -583,7 +582,12 @@ void ClipManager::slotAddClipList(const KUrl::List urls, QMap <QString, QString>
|
||||
KFileMetaInfo metaInfo(file.path(), QString("image/jpeg"), KFileMetaInfo::TechnicalInfo);
|
||||
const QHash<QString, KFileMetaInfoItem> metaInfoItems = metaInfo.items();
|
||||
foreach(const KFileMetaInfoItem & metaInfoItem, metaInfoItems) {
|
||||
prod.setAttribute("meta.attr." + metaInfoItem.name().section('#', 1), metaInfoItem.value().toString());
|
||||
QDomElement meta = doc.createElement("metaproperty");
|
||||
meta.setAttribute("name", "meta.attr." + metaInfoItem.name().section('#', 1));
|
||||
QDomText value = doc.createTextNode(metaInfoItem.value().toString());
|
||||
meta.setAttribute("tool", "KDE Metadata");
|
||||
meta.appendChild(value);
|
||||
prod.appendChild(meta);
|
||||
}
|
||||
}
|
||||
} else if (type->is("application/x-kdenlivetitle")) {
|
||||
@@ -592,10 +596,10 @@ void ClipManager::slotAddClipList(const KUrl::List urls, QMap <QString, QString>
|
||||
QFile txtfile(file.path());
|
||||
if (txtfile.open(QIODevice::ReadOnly) && txtdoc.setContent(&txtfile)) {
|
||||
txtfile.close();
|
||||
prod.setAttribute("type", (int) TEXT);
|
||||
prod.setAttribute("type", (int) Text);
|
||||
// extract embeded images
|
||||
QDomNodeList items = txtdoc.elementsByTagName("content");
|
||||
for (int i = 0; i < items.count() ; i++) {
|
||||
for (int i = 0; i < items.count() ; ++i) {
|
||||
QDomElement content = items.item(i).toElement();
|
||||
if (content.hasAttribute("base64")) {
|
||||
QString titlesFolder = m_doc->projectFolder().path(KUrl::AddTrailingSlash) + "titles/";
|
||||
@@ -608,20 +612,20 @@ void ClipManager::slotAddClipList(const KUrl::List urls, QMap <QString, QString>
|
||||
}
|
||||
prod.setAttribute("transparency", 1);
|
||||
prod.setAttribute("in", 0);
|
||||
if (!txtdoc.documentElement().hasAttribute("out")) {
|
||||
prod.setAttribute("out", m_doc->getFramePos(KdenliveSettings::title_duration()) - 1);
|
||||
txtdoc.documentElement().setAttribute("out", m_doc->getFramePos(KdenliveSettings::title_duration()) - 1);
|
||||
}
|
||||
else {
|
||||
int out = txtdoc.documentElement().attribute("out").toInt();
|
||||
if (out >= 0)
|
||||
prod.setAttribute("out", out);
|
||||
else {
|
||||
prod.setAttribute("out", m_doc->getFramePos(KdenliveSettings::title_duration()) - 1);
|
||||
txtdoc.documentElement().setAttribute("out", m_doc->getFramePos(KdenliveSettings::title_duration()) - 1);
|
||||
}
|
||||
}
|
||||
QString titleData = txtdoc.toString();
|
||||
if (!txtdoc.documentElement().hasAttribute("out")) {
|
||||
prod.setAttribute("out", m_doc->getFramePos(KdenliveSettings::title_duration()) - 1);
|
||||
txtdoc.documentElement().setAttribute("out", m_doc->getFramePos(KdenliveSettings::title_duration()) - 1);
|
||||
}
|
||||
else {
|
||||
int out = txtdoc.documentElement().attribute("out").toInt();
|
||||
if (out >= 0)
|
||||
prod.setAttribute("out", out);
|
||||
else {
|
||||
prod.setAttribute("out", m_doc->getFramePos(KdenliveSettings::title_duration()) - 1);
|
||||
txtdoc.documentElement().setAttribute("out", m_doc->getFramePos(KdenliveSettings::title_duration()) - 1);
|
||||
}
|
||||
}
|
||||
QString titleData = txtdoc.toString();
|
||||
prod.setAttribute("xmldata", titleData);
|
||||
} else
|
||||
txtfile.close();
|
||||
@@ -636,7 +640,7 @@ void ClipManager::slotAddClipList(const KUrl::List urls, QMap <QString, QString>
|
||||
}
|
||||
}
|
||||
|
||||
void ClipManager::slotAddClipFile(const KUrl &url, QMap <QString, QString> data)
|
||||
void ClipManager::slotAddClipFile(const KUrl &url, const QMap <QString, QString> &data)
|
||||
{
|
||||
slotAddClipList(KUrl::List(url), data);
|
||||
}
|
||||
@@ -646,7 +650,7 @@ void ClipManager::slotAddXmlClipFile(const QString &name, const QDomElement &xml
|
||||
QDomDocument doc;
|
||||
doc.appendChild(doc.importNode(xml, true));
|
||||
QDomElement prod = doc.documentElement();
|
||||
prod.setAttribute("type", (int) PLAYLIST);
|
||||
prod.setAttribute("type", (int) Playlist);
|
||||
uint id = m_clipIdCounter++;
|
||||
prod.setAttribute("id", QString::number(id));
|
||||
prod.setAttribute("name", name);
|
||||
@@ -658,14 +662,14 @@ void ClipManager::slotAddXmlClipFile(const QString &name, const QDomElement &xml
|
||||
m_doc->commandStack()->push(command);
|
||||
}
|
||||
|
||||
void ClipManager::slotAddColorClipFile(const QString &name, const QString &color, QString duration, const QString &group, const QString &groupId)
|
||||
void ClipManager::slotAddColorClipFile(const QString &name, const QString &color, const QString &duration, const QString &group, const QString &groupId)
|
||||
{
|
||||
QDomDocument doc;
|
||||
QDomElement prod = doc.createElement("producer");
|
||||
doc.appendChild(prod);
|
||||
prod.setAttribute("mlt_service", "colour");
|
||||
prod.setAttribute("colour", color);
|
||||
prod.setAttribute("type", (int) COLOR);
|
||||
prod.setAttribute("type", (int) Color);
|
||||
uint id = m_clipIdCounter++;
|
||||
prod.setAttribute("id", QString::number(id));
|
||||
prod.setAttribute("in", "0");
|
||||
@@ -689,7 +693,7 @@ void ClipManager::slotAddSlideshowClipFile(QMap <QString, QString> properties, c
|
||||
prod.setAttribute(i.key(), i.value());
|
||||
++i;
|
||||
}
|
||||
prod.setAttribute("type", (int) SLIDESHOW);
|
||||
prod.setAttribute("type", (int) SlideShow);
|
||||
uint id = m_clipIdCounter++;
|
||||
if (!group.isEmpty()) {
|
||||
prod.setAttribute("groupname", group);
|
||||
@@ -715,7 +719,7 @@ void ClipManager::slotAddTextClipFile(const QString &titleName, int duration, co
|
||||
prod.setAttribute("groupname", group);
|
||||
prod.setAttribute("groupid", groupId);
|
||||
}
|
||||
prod.setAttribute("type", (int) TEXT);
|
||||
prod.setAttribute("type", (int) Text);
|
||||
prod.setAttribute("transparency", "1");
|
||||
prod.setAttribute("in", "0");
|
||||
prod.setAttribute("out", duration - 1);
|
||||
@@ -736,7 +740,7 @@ void ClipManager::slotAddTextTemplateClip(QString titleName, const KUrl &path, c
|
||||
prod.setAttribute("groupname", group);
|
||||
prod.setAttribute("groupid", groupId);
|
||||
}
|
||||
prod.setAttribute("type", (int) TEXT);
|
||||
prod.setAttribute("type", (int) Text);
|
||||
prod.setAttribute("transparency", "1");
|
||||
prod.setAttribute("in", "0");
|
||||
|
||||
@@ -745,13 +749,13 @@ void ClipManager::slotAddTextTemplateClip(QString titleName, const KUrl &path, c
|
||||
QFile txtfile(path.path());
|
||||
if (txtfile.open(QIODevice::ReadOnly) && titledoc.setContent(&txtfile)) {
|
||||
txtfile.close();
|
||||
if (titledoc.documentElement().hasAttribute("duration")) {
|
||||
duration = titledoc.documentElement().attribute("duration").toInt();
|
||||
}
|
||||
if (titledoc.documentElement().hasAttribute("duration")) {
|
||||
duration = titledoc.documentElement().attribute("duration").toInt();
|
||||
}
|
||||
else {
|
||||
// keep some time for backwards compatibility - 26/12/12
|
||||
duration = titledoc.documentElement().attribute("out").toInt();
|
||||
}
|
||||
// keep some time for backwards compatibility - 26/12/12
|
||||
duration = titledoc.documentElement().attribute("out").toInt();
|
||||
}
|
||||
} else txtfile.close();
|
||||
|
||||
if (duration == 0) duration = m_doc->getFramePos(KdenliveSettings::title_duration());
|
||||
@@ -808,20 +812,20 @@ QDomElement ClipManager::groupsXml() const
|
||||
QDomDocument doc;
|
||||
QDomElement groups = doc.createElement("groups");
|
||||
doc.appendChild(groups);
|
||||
for (int i = 0; i < m_groupsList.count(); i++) {
|
||||
for (int i = 0; i < m_groupsList.count(); ++i) {
|
||||
QDomElement group = doc.createElement("group");
|
||||
groups.appendChild(group);
|
||||
QList <QGraphicsItem *> children = m_groupsList.at(i)->childItems();
|
||||
for (int j = 0; j < children.count(); j++) {
|
||||
if (children.at(j)->type() == AVWIDGET || children.at(j)->type() == TRANSITIONWIDGET) {
|
||||
if (children.at(j)->type() == AVWidget || children.at(j)->type() == TransitionWidget) {
|
||||
AbstractClipItem *item = static_cast <AbstractClipItem *>(children.at(j));
|
||||
ItemInfo info = item->info();
|
||||
if (item->type() == AVWIDGET) {
|
||||
if (item->type() == AVWidget) {
|
||||
QDomElement clip = doc.createElement("clipitem");
|
||||
clip.setAttribute("track", info.track);
|
||||
clip.setAttribute("position", info.startPos.frames(m_doc->fps()));
|
||||
group.appendChild(clip);
|
||||
} else if (item->type() == TRANSITIONWIDGET) {
|
||||
} else if (item->type() == TransitionWidget) {
|
||||
QDomElement clip = doc.createElement("transitionitem");
|
||||
clip.setAttribute("track", info.track);
|
||||
clip.setAttribute("position", info.startPos.frames(m_doc->fps()));
|
||||
@@ -838,7 +842,7 @@ void ClipManager::slotClipModified(const QString &path)
|
||||
{
|
||||
//kDebug() << "// CLIP: " << path << " WAS MODIFIED";
|
||||
const QList <DocClipBase *> list = getClipByResource(path);
|
||||
for (int i = 0; i < list.count(); i++) {
|
||||
for (int i = 0; i < list.count(); ++i) {
|
||||
DocClipBase *clip = list.at(i);
|
||||
if (clip != NULL) {
|
||||
QString id = clip->getId();
|
||||
@@ -870,7 +874,7 @@ void ClipManager::slotClipMissing(const QString &path)
|
||||
{
|
||||
// kDebug() << "// CLIP: " << path << " WAS MISSING";
|
||||
const QList <DocClipBase *> list = getClipByResource(path);
|
||||
for (int i = 0; i < list.count(); i++) {
|
||||
for (int i = 0; i < list.count(); ++i) {
|
||||
DocClipBase *clip = list.at(i);
|
||||
if (clip != NULL) emit missingClip(clip->getId());
|
||||
}
|
||||
@@ -880,7 +884,7 @@ void ClipManager::slotClipAvailable(const QString &path)
|
||||
{
|
||||
// kDebug() << "// CLIP: " << path << " WAS ADDED";
|
||||
const QList <DocClipBase *> list = getClipByResource(path);
|
||||
for (int i = 0; i < list.count(); i++) {
|
||||
for (int i = 0; i < list.count(); ++i) {
|
||||
DocClipBase *clip = list.at(i);
|
||||
if (clip != NULL) emit availableClip(clip->getId());
|
||||
}
|
||||
@@ -924,7 +928,7 @@ void ClipManager::listRemovableVolumes()
|
||||
continue;
|
||||
|
||||
Solid::StorageDrive *drive = driveDevice.as<Solid::StorageDrive>();
|
||||
if (!drive->isRemovable()) continue;
|
||||
if (!drive->isRemovable()) continue;
|
||||
|
||||
// check for StorageVolume
|
||||
Solid::Device volumeDevice;
|
||||
@@ -955,7 +959,7 @@ void ClipManager::listRemovableVolumes()
|
||||
|
||||
bool ClipManager::isOnRemovableDevice(const KUrl &url)
|
||||
{
|
||||
SolidVolumeInfo volume;
|
||||
//SolidVolumeInfo volume;
|
||||
QString path = url.path(KUrl::RemoveTrailingSlash);
|
||||
int volumeMatch = 0;
|
||||
|
||||
@@ -969,7 +973,7 @@ bool ClipManager::isOnRemovableDevice(const KUrl &url)
|
||||
if (length > volumeMatch)
|
||||
{
|
||||
volumeMatch = v.path.length();
|
||||
volume = v;
|
||||
//volume = v;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -977,14 +981,16 @@ bool ClipManager::isOnRemovableDevice(const KUrl &url)
|
||||
return volumeMatch;
|
||||
}
|
||||
|
||||
void ClipManager::projectTreeThumbReady(const QString &id, int frame, QImage img, int type)
|
||||
void ClipManager::projectTreeThumbReady(const QString &id, int frame, const QImage &img, int type)
|
||||
{
|
||||
switch (type) {
|
||||
case 2:
|
||||
emit gotClipPropertyThumbnail(id, img);
|
||||
break;
|
||||
default:
|
||||
emit thumbReady(id, frame, img);
|
||||
case 2:
|
||||
emit gotClipPropertyThumbnail(id, img);
|
||||
break;
|
||||
default:
|
||||
emit thumbReady(id, frame, img);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#include "clipmanager.moc"
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#ifndef CLIPMANAGER_H
|
||||
#define CLIPMANAGER_H
|
||||
|
||||
#include <qdom.h>
|
||||
#include <QtXml/qdom.h>
|
||||
#include <QPixmap>
|
||||
#include <QObject>
|
||||
#include <QTimer>
|
||||
@@ -58,7 +58,6 @@ class SolidVolumeInfo
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
QString path; // mount path of volume, with trailing slash
|
||||
QString uuid; // UUID as from Solid
|
||||
QString label; // volume label (think of CDs)
|
||||
@@ -71,7 +70,7 @@ public:
|
||||
namespace Mlt
|
||||
{
|
||||
class Producer;
|
||||
};
|
||||
}
|
||||
|
||||
class ClipManager: public QObject
|
||||
{
|
||||
@@ -88,21 +87,21 @@ Q_OBJECT public:
|
||||
* @param url file to add
|
||||
* @param group name of the group to insert the file in (can be empty)
|
||||
* @param groupId id of the group (if any) */
|
||||
void slotAddClipFile(const KUrl &url, QMap <QString, QString> data);
|
||||
void slotAddClipFile(const KUrl &url, const QMap<QString, QString> &data);
|
||||
|
||||
/** @brief Adds a list of files to the project.
|
||||
* @param urls files to add
|
||||
* @param group name of the group to insert the files in (can be empty)
|
||||
* @param groupId id of the group (if any)
|
||||
* It checks for duplicated items and asks to the user for instructions. */
|
||||
void slotAddClipList(const KUrl::List urls, QMap <QString, QString> data);
|
||||
void slotAddClipList(const KUrl::List &urls, const QMap<QString, QString> &data);
|
||||
void slotAddTextClipFile(const QString &titleName, int out, const QString &xml, const QString &group, const QString &groupId);
|
||||
void slotAddTextTemplateClip(QString titleName, const KUrl &path, const QString &group, const QString &groupId);
|
||||
void slotAddXmlClipFile(const QString &name, const QDomElement &xml, const QString &group, const QString &groupId);
|
||||
void slotAddColorClipFile(const QString &name, const QString &color, QString duration, const QString &group, const QString &groupId);
|
||||
void slotAddColorClipFile(const QString &name, const QString &color, const QString &duration, const QString &group, const QString &groupId);
|
||||
void slotAddSlideshowClipFile(QMap <QString, QString> properties, const QString &group, const QString &groupId);
|
||||
DocClipBase *getClipById(QString clipId);
|
||||
const QList <DocClipBase *> getClipByResource(QString resource);
|
||||
const QList <DocClipBase *> getClipByResource(const QString &resource);
|
||||
void slotDeleteClips(QStringList ids);
|
||||
void setThumbsProgress(const QString &message, int progress);
|
||||
void checkAudioThumbs();
|
||||
@@ -125,7 +124,7 @@ Q_OBJECT public:
|
||||
int clipsCount() const;
|
||||
/** @brief remove a clip id from the queue list. */
|
||||
void stopThumbs(const QString &id);
|
||||
void projectTreeThumbReady(const QString &id, int frame, QImage img, int type);
|
||||
void projectTreeThumbReady(const QString &id, int frame, const QImage &img, int type);
|
||||
|
||||
#if KDE_IS_VERSION(4,5,0)
|
||||
KImageCache* pixmapCache;
|
||||
@@ -133,7 +132,7 @@ Q_OBJECT public:
|
||||
|
||||
public slots:
|
||||
/** @brief Request creation of a clip thumbnail for specified frames. */
|
||||
void slotRequestThumbs(const QString id, QList <int> frames);
|
||||
void slotRequestThumbs(const QString &id, const QList<int> &frames);
|
||||
|
||||
private slots:
|
||||
/** A clip was externally modified, monitor for more changes and prepare for reload */
|
||||
@@ -193,10 +192,10 @@ signals:
|
||||
void modifiedClip(const QString &);
|
||||
void missingClip(const QString &);
|
||||
void availableClip(const QString &);
|
||||
void checkAllClips(bool displayRatioChanged, bool fpsChanged, QStringList brokenClips);
|
||||
void checkAllClips(bool displayRatioChanged, bool fpsChanged, const QStringList &brokenClips);
|
||||
void displayMessage(const QString &, int);
|
||||
void thumbReady(const QString &id, int, QImage);
|
||||
void gotClipPropertyThumbnail(const QString &id, QImage);
|
||||
void thumbReady(const QString &id, int, const QImage&);
|
||||
void gotClipPropertyThumbnail(const QString &id, const QImage&);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -33,12 +33,18 @@
|
||||
#include <KRun>
|
||||
|
||||
#ifdef USE_NEPOMUK
|
||||
#if KDE_IS_VERSION(4,6,0)
|
||||
#include <Nepomuk/Variant>
|
||||
#include <Nepomuk/Resource>
|
||||
#include <Nepomuk/ResourceManager>
|
||||
#include <Nepomuk/Vocabulary/NIE>
|
||||
#if KDE_IS_VERSION(4,6,0)
|
||||
#include <Nepomuk/Variant>
|
||||
#include <Nepomuk/Resource>
|
||||
#include <Nepomuk/ResourceManager>
|
||||
#include <Nepomuk/Vocabulary/NIE>
|
||||
#endif
|
||||
#endif
|
||||
#ifdef USE_NEPOMUKCORE
|
||||
#include <Nepomuk2/Variant>
|
||||
#include <Nepomuk2/Resource>
|
||||
#include <Nepomuk2/ResourceManager>
|
||||
#include <Nepomuk2/Vocabulary/NIE>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -56,14 +62,15 @@ static const int METATAB = 6;
|
||||
static const int ADVANCEDTAB = 7;
|
||||
|
||||
|
||||
ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidget * parent) :
|
||||
QDialog(parent),
|
||||
m_clip(clip),
|
||||
m_tc(tc),
|
||||
m_fps(fps),
|
||||
m_count(0),
|
||||
m_clipNeedsRefresh(false),
|
||||
m_clipNeedsReLoad(false)
|
||||
ClipProperties::ClipProperties(DocClipBase *clip, const Timecode &tc, double fps, QWidget * parent) :
|
||||
QDialog(parent)
|
||||
, m_clip(clip)
|
||||
, m_tc(tc)
|
||||
, m_fps(fps)
|
||||
, m_count(0)
|
||||
, m_clipNeedsRefresh(false)
|
||||
, m_clipNeedsReLoad(false)
|
||||
, m_proxyContainer(NULL)
|
||||
{
|
||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
setFont(KGlobalSettings::toolBarFont());
|
||||
@@ -84,7 +91,7 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
|
||||
|
||||
// New display aspect ratio support
|
||||
if (props.contains("force_aspect_num") && props.value("force_aspect_num").toInt() > 0 &&
|
||||
props.contains("force_aspect_den") && props.value("force_aspect_den").toInt() > 0) {
|
||||
props.contains("force_aspect_den") && props.value("force_aspect_den").toInt() > 0) {
|
||||
m_view.clip_force_ar->setChecked(true);
|
||||
m_view.clip_ar_num->setEnabled(true);
|
||||
m_view.clip_ar_den->setEnabled(true);
|
||||
@@ -196,12 +203,45 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
|
||||
connect(m_view.clip_full_luma, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
|
||||
|
||||
// Check for Metadata
|
||||
QMap<QString, QString> meta = m_clip->metadata();
|
||||
QMap<QString, QString>::const_iterator i = meta.constBegin();
|
||||
QMap<QString, QStringList> meta = m_clip->metadata();
|
||||
QMap<QString, QStringList>::const_iterator i = meta.constBegin();
|
||||
while (i != meta.constEnd()) {
|
||||
QTreeWidgetItem *metaitem = new QTreeWidgetItem(m_view.metadata_list);
|
||||
QStringList values = i.value();
|
||||
QString parentName;
|
||||
QString iconName;
|
||||
if (values.count() > 1 && !values.at(1).isEmpty()) {
|
||||
parentName = values.at(1);
|
||||
} else {
|
||||
if (KdenliveSettings::ffmpegpath().endsWith("avconv")) {
|
||||
parentName = i18n("Libav");
|
||||
iconName = "meta_libav.png";
|
||||
}
|
||||
else {
|
||||
parentName = i18n("FFmpeg");
|
||||
iconName = "meta_ffmpeg.png";
|
||||
}
|
||||
}
|
||||
QTreeWidgetItem *parent = NULL;
|
||||
QList <QTreeWidgetItem *> matches = m_view.metadata_list->findItems(parentName, Qt::MatchExactly);
|
||||
if (!matches.isEmpty()) {
|
||||
parent = matches.at(0);
|
||||
} else {
|
||||
if (parentName == "Magic Lantern")
|
||||
iconName = "meta_magiclantern.png";
|
||||
parent = new QTreeWidgetItem(m_view.metadata_list, QStringList() << parentName);
|
||||
if (!iconName.isEmpty()) {
|
||||
KIcon icon(KStandardDirs::locate("appdata", iconName));
|
||||
parent->setIcon(0, icon);
|
||||
}
|
||||
}
|
||||
QTreeWidgetItem *metaitem = NULL;
|
||||
if (parent) {
|
||||
metaitem = new QTreeWidgetItem(parent);
|
||||
parent->setExpanded(true);
|
||||
}
|
||||
else metaitem = new QTreeWidgetItem(m_view.metadata_list);
|
||||
metaitem->setText(0, i.key()); //i18n(i.key().section('.', 2, 3).toUtf8().data()));
|
||||
metaitem->setText(1, i.value());
|
||||
metaitem->setText(1, values.at(0));
|
||||
++i;
|
||||
}
|
||||
|
||||
@@ -225,7 +265,7 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
|
||||
new QTreeWidgetItem(m_view.clip_aproperties, QStringList() << i18n("Frequency") << props.value("frequency"));
|
||||
|
||||
|
||||
CLIPTYPE t = m_clip->clipType();
|
||||
ClipType t = m_clip->clipType();
|
||||
|
||||
if (props.contains("proxy") && props.value("proxy") != "-") {
|
||||
KFileItem f(KFileItem::Unknown, KFileItem::Unknown, KUrl(props.value("proxy")), true);
|
||||
@@ -241,11 +281,11 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
|
||||
l->addWidget(pb);
|
||||
connect(pb, SIGNAL(clicked()), this, SLOT(slotDeleteProxy()));
|
||||
m_proxyContainer->setLayout(l);
|
||||
if (t == IMAGE) {
|
||||
if (t == Image) {
|
||||
m_view.tab_image->layout()->addWidget(line);
|
||||
m_view.tab_image->layout()->addWidget(m_proxyContainer);
|
||||
}
|
||||
else if (t == AUDIO) {
|
||||
else if (t == Audio) {
|
||||
m_view.tab_audio->layout()->addWidget(line);
|
||||
m_view.tab_audio->layout()->addWidget(m_proxyContainer);
|
||||
}
|
||||
@@ -255,18 +295,18 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
|
||||
}
|
||||
}
|
||||
|
||||
if (t != AUDIO && t != AV) {
|
||||
if (t != Audio && t != AV) {
|
||||
m_view.clip_force_aindex->setEnabled(false);
|
||||
}
|
||||
|
||||
if (t != VIDEO && t != AV) {
|
||||
if (t != Video && t != AV) {
|
||||
m_view.clip_force_vindex->setEnabled(false);
|
||||
}
|
||||
|
||||
if (t == PLAYLIST)
|
||||
m_view.tabWidget->setTabText(VIDEOTAB, i18n("Playlist"));
|
||||
if (t == Playlist)
|
||||
m_view.tabWidget->setTabText(VIDEOTAB, i18n("Playlist"));
|
||||
|
||||
if (t == IMAGE) {
|
||||
if (t == Image) {
|
||||
m_view.tabWidget->removeTab(SLIDETAB);
|
||||
m_view.tabWidget->removeTab(COLORTAB);
|
||||
m_view.tabWidget->removeTab(AUDIOTAB);
|
||||
@@ -277,9 +317,10 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
|
||||
m_view.image_transparency->setChecked(props.value("transparency").toInt());
|
||||
connect(m_view.image_transparency, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
|
||||
int width = 180.0 * KdenliveSettings::project_display_ratio();
|
||||
if (width % 2 == 1) width++;
|
||||
if (width % 2 == 1)
|
||||
width++;
|
||||
m_view.clip_thumb->setPixmap(QPixmap(url.path()).scaled(QSize(width, 180), Qt::KeepAspectRatio));
|
||||
} else if (t == COLOR) {
|
||||
} else if (t == Color) {
|
||||
m_view.clip_path->setEnabled(false);
|
||||
m_view.tabWidget->removeTab(METATAB);
|
||||
m_view.tabWidget->removeTab(IMAGETAB);
|
||||
@@ -289,8 +330,8 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
|
||||
m_view.clip_thumb->setHidden(true);
|
||||
m_view.clip_color->setColor(QColor('#' + props.value("colour").right(8).left(6)));
|
||||
connect(m_view.clip_color, SIGNAL(changed(QColor)), this, SLOT(slotModified()));
|
||||
} else if (t == SLIDESHOW) {
|
||||
if (url.fileName().startsWith(".all.")) {
|
||||
} else if (t == SlideShow) {
|
||||
if (url.fileName().startsWith(QLatin1String(".all."))) {
|
||||
// the image sequence is defined by mimetype
|
||||
m_view.clip_path->setText(url.directory());
|
||||
} else {
|
||||
@@ -334,7 +375,7 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
|
||||
m_view.animation->setCurrentIndex(0);
|
||||
QString path = props.value("resource");
|
||||
QString ext = path.section('.', -1);
|
||||
for (int i = 0; i < m_view.image_type->count(); i++) {
|
||||
for (int i = 0; i < m_view.image_type->count(); ++i) {
|
||||
if (m_view.image_type->itemData(i).toString() == ext) {
|
||||
m_view.image_type->setCurrentIndex(i);
|
||||
break;
|
||||
@@ -400,7 +441,7 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
|
||||
connect(m_view.slide_luma, SIGNAL(stateChanged(int)), this, SLOT(slotEnableLumaFile(int)));
|
||||
connect(m_view.image_type, SIGNAL(currentIndexChanged(int)), this, SLOT(parseFolder()));
|
||||
|
||||
} else if (t != AUDIO) {
|
||||
} else if (t != Audio) {
|
||||
m_view.tabWidget->removeTab(IMAGETAB);
|
||||
m_view.tabWidget->removeTab(SLIDETAB);
|
||||
m_view.tabWidget->removeTab(COLORTAB);
|
||||
@@ -411,11 +452,12 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
|
||||
m_view.clip_aproperties->setItemDelegate(del2);
|
||||
m_view.clip_aproperties->setStyleSheet(QString("QTreeWidget { background-color: transparent;}"));
|
||||
m_view.clip_vproperties->setStyleSheet(QString("QTreeWidget { background-color: transparent;}"));
|
||||
loadVideoProperties(props);
|
||||
loadVideoProperties(props);
|
||||
|
||||
m_view.clip_thumb->setMinimumSize(180 * KdenliveSettings::project_display_ratio(), 180);
|
||||
m_view.clip_thumb->setMinimumSize(180 * KdenliveSettings::project_display_ratio(), 180);
|
||||
|
||||
if (t == IMAGE || t == VIDEO || t == PLAYLIST) m_view.tabWidget->removeTab(AUDIOTAB);
|
||||
if (t == Image || t == Video || t == Playlist)
|
||||
m_view.tabWidget->removeTab(AUDIOTAB);
|
||||
} else {
|
||||
m_view.tabWidget->removeTab(IMAGETAB);
|
||||
m_view.tabWidget->removeTab(SLIDETAB);
|
||||
@@ -424,7 +466,7 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
|
||||
m_view.clip_thumb->setHidden(true);
|
||||
}
|
||||
|
||||
if (t != SLIDESHOW && t != COLOR) {
|
||||
if (t != SlideShow && t != Color) {
|
||||
KFileItem f(KFileItem::Unknown, KFileItem::Unknown, url, true);
|
||||
m_view.clip_filesize->setText(KIO::convertSize(f.size()));
|
||||
} else {
|
||||
@@ -433,8 +475,9 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
|
||||
}
|
||||
m_view.clip_duration->setInputMask(tc.mask());
|
||||
m_view.clip_duration->setText(tc.getTimecode(m_clip->duration()));
|
||||
if (t != IMAGE && t != COLOR && t != TEXT) m_view.clip_duration->setReadOnly(true);
|
||||
else {
|
||||
if (t != Image && t != Color && t != Text) {
|
||||
m_view.clip_duration->setReadOnly(true);
|
||||
} else {
|
||||
connect(m_view.clip_duration, SIGNAL(editingFinished()), this, SLOT(slotCheckMaxLength()));
|
||||
connect(m_view.clip_duration, SIGNAL(textChanged(QString)), this, SLOT(slotModified()));
|
||||
}
|
||||
@@ -457,9 +500,9 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
|
||||
m_view.analysis_save->setIcon(KIcon("document-save-as"));
|
||||
m_view.analysis_save->setToolTip(i18n("Save analysis data"));
|
||||
|
||||
// Check for Nepomuk metadata
|
||||
// Check for Nepomuk metadata
|
||||
#ifdef USE_NEPOMUK
|
||||
#if KDE_IS_VERSION(4,6,0)
|
||||
#if KDE_IS_VERSION(4,6,0)
|
||||
if (!url.isEmpty()) {
|
||||
Nepomuk::ResourceManager::instance()->init();
|
||||
Nepomuk::Resource res( url.path() );
|
||||
@@ -469,19 +512,38 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
|
||||
m_view.clip_license->setText(i18n("License: %1", res.property(Nepomuk::Vocabulary::NIE::license()).toString()));
|
||||
if (ltype.startsWith("http")) {
|
||||
m_view.clip_license->setUrl(ltype);
|
||||
connect(m_view.clip_license, SIGNAL(leftClickedUrl(const QString &)), this, SLOT(slotOpenUrl(const QString &)));
|
||||
connect(m_view.clip_license, SIGNAL(leftClickedUrl(QString)), this, SLOT(slotOpenUrl(QString)));
|
||||
}
|
||||
}
|
||||
else m_view.clip_license->setHidden(true);
|
||||
}
|
||||
else m_view.clip_license->setHidden(true);
|
||||
#else
|
||||
#else
|
||||
m_view.clip_license->setHidden(true);
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#ifdef USE_NEPOMUKCORE
|
||||
|
||||
if (!url.isEmpty()) {
|
||||
Nepomuk2::ResourceManager::instance()->init();
|
||||
Nepomuk2::Resource res( url.path() );
|
||||
// Check if file has a license
|
||||
if (res.hasProperty(Nepomuk2::Vocabulary::NIE::license())) {
|
||||
QString ltype = res.property(Nepomuk2::Vocabulary::NIE::licenseType()).toString();
|
||||
m_view.clip_license->setText(i18n("License: %1", res.property(Nepomuk2::Vocabulary::NIE::license()).toString()));
|
||||
if (ltype.startsWith("http")) {
|
||||
m_view.clip_license->setUrl(ltype);
|
||||
connect(m_view.clip_license, SIGNAL(leftClickedUrl(QString)), this, SLOT(slotOpenUrl(QString)));
|
||||
}
|
||||
}
|
||||
else m_view.clip_license->setHidden(true);
|
||||
}
|
||||
else m_view.clip_license->setHidden(true);
|
||||
#else
|
||||
m_view.clip_license->setHidden(true);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
slotFillMarkersList(m_clip);
|
||||
slotUpdateAnalysisData(m_clip);
|
||||
|
||||
@@ -490,7 +552,7 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
|
||||
connect(m_view.marker_delete, SIGNAL(clicked()), this, SLOT(slotDeleteMarker()));
|
||||
connect(m_view.marker_save, SIGNAL(clicked()), this, SLOT(slotSaveMarkers()));
|
||||
connect(m_view.marker_load, SIGNAL(clicked()), this, SLOT(slotLoadMarkers()));
|
||||
connect(m_view.markers_list, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(slotEditMarker()));
|
||||
connect(m_view.markers_list, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(slotEditMarker()));
|
||||
|
||||
connect(m_view.analysis_delete, SIGNAL(clicked()), this, SLOT(slotDeleteAnalysis()));
|
||||
connect(m_view.analysis_save, SIGNAL(clicked()), this, SLOT(slotSaveAnalysis()));
|
||||
@@ -499,12 +561,16 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
|
||||
connect(this, SIGNAL(accepted()), this, SLOT(slotApplyProperties()));
|
||||
connect(m_view.buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), this, SLOT(slotApplyProperties()));
|
||||
m_view.buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
|
||||
|
||||
m_view.metadata_list->resizeColumnToContents(0);
|
||||
m_view.clip_vproperties->resizeColumnToContents(0);
|
||||
m_view.clip_aproperties->resizeColumnToContents(0);
|
||||
adjustSize();
|
||||
}
|
||||
|
||||
|
||||
// Used for multiple clips editing
|
||||
ClipProperties::ClipProperties(QList <DocClipBase *>cliplist, Timecode tc, QMap <QString, QString> commonproperties, QWidget * parent) :
|
||||
ClipProperties::ClipProperties(const QList <DocClipBase *> &cliplist, const Timecode &tc, const QMap <QString, QString> &commonproperties, QWidget * parent) :
|
||||
QDialog(parent),
|
||||
m_clip(NULL),
|
||||
m_tc(tc),
|
||||
@@ -638,7 +704,9 @@ ClipProperties::ClipProperties(QList <DocClipBase *>cliplist, Timecode tc, QMap
|
||||
if (commonproperties.value("out").toInt() > 0) {
|
||||
m_view.clip_force_out->setChecked(true);
|
||||
m_view.clip_out->setText(m_tc.getTimecodeFromFrames(commonproperties.value("out").toInt()));
|
||||
} else m_view.clip_out->setText(KdenliveSettings::image_duration());
|
||||
} else {
|
||||
m_view.clip_out->setText(KdenliveSettings::image_duration());
|
||||
}
|
||||
} else {
|
||||
m_view.clip_force_out->setHidden(true);
|
||||
m_view.clip_out->setHidden(true);
|
||||
@@ -648,47 +716,48 @@ ClipProperties::ClipProperties(QList <DocClipBase *>cliplist, Timecode tc, QMap
|
||||
ClipProperties::~ClipProperties()
|
||||
{
|
||||
QAbstractItemDelegate *del1 = m_view.clip_vproperties->itemDelegate();
|
||||
if (del1) delete del1;
|
||||
delete del1;
|
||||
QAbstractItemDelegate *del2 = m_view.clip_aproperties->itemDelegate();
|
||||
if (del2) delete del2;
|
||||
delete del2;
|
||||
}
|
||||
|
||||
|
||||
void ClipProperties::loadVideoProperties(QMap <QString, QString> props)
|
||||
void ClipProperties::loadVideoProperties(const QMap <QString, QString> &props)
|
||||
{
|
||||
m_view.clip_vproperties->clear();
|
||||
if (props.contains("videocodec"))
|
||||
new QTreeWidgetItem(m_view.clip_vproperties, QStringList() << i18n("Video codec") << props.value("videocodec"));
|
||||
new QTreeWidgetItem(m_view.clip_vproperties, QStringList() << i18n("Video codec") << props.value("videocodec"));
|
||||
else if (props.contains("videocodecid"))
|
||||
new QTreeWidgetItem(m_view.clip_vproperties, QStringList() << i18n("Video codec") << props.value("videocodecid"));
|
||||
new QTreeWidgetItem(m_view.clip_vproperties, QStringList() << i18n("Video codec") << props.value("videocodecid"));
|
||||
|
||||
if (props.contains("frame_size"))
|
||||
new QTreeWidgetItem(m_view.clip_vproperties, QStringList() << i18n("Frame size") << props.value("frame_size"));
|
||||
new QTreeWidgetItem(m_view.clip_vproperties, QStringList() << i18n("Frame size") << props.value("frame_size"));
|
||||
|
||||
if (props.contains("fps")) {
|
||||
new QTreeWidgetItem(m_view.clip_vproperties, QStringList() << i18n("Frame rate") << props.value("fps"));
|
||||
new QTreeWidgetItem(m_view.clip_vproperties, QStringList() << i18n("Frame rate") << props.value("fps"));
|
||||
if (!m_view.clip_framerate->isEnabled()) m_view.clip_framerate->setValue(props.value("fps").toDouble());
|
||||
}
|
||||
|
||||
if (props.contains("progressive")) {
|
||||
int scanning = props.value("progressive").toInt();
|
||||
int scanning = props.value("progressive").toInt();
|
||||
QString txt = scanning == 1 ? i18n("Progressive") : i18n("Interlaced");
|
||||
new QTreeWidgetItem(m_view.clip_vproperties, QStringList() << i18n("Scanning") << txt);
|
||||
}
|
||||
|
||||
|
||||
if (props.contains("aspect_ratio"))
|
||||
new QTreeWidgetItem(m_view.clip_vproperties, QStringList() << i18n("Pixel aspect ratio") << props.value("aspect_ratio"));
|
||||
new QTreeWidgetItem(m_view.clip_vproperties, QStringList() << i18n("Pixel aspect ratio") << props.value("aspect_ratio"));
|
||||
|
||||
if (props.contains("pix_fmt"))
|
||||
new QTreeWidgetItem(m_view.clip_vproperties, QStringList() << i18n("Pixel format") << props.value("pix_fmt"));
|
||||
new QTreeWidgetItem(m_view.clip_vproperties, QStringList() << i18n("Pixel format") << props.value("pix_fmt"));
|
||||
|
||||
if (props.contains("colorspace"))
|
||||
new QTreeWidgetItem(m_view.clip_vproperties, QStringList() << i18n("Colorspace") << ProfilesDialog::getColorspaceDescription(props.value("colorspace").toInt()));
|
||||
new QTreeWidgetItem(m_view.clip_vproperties, QStringList() << i18n("Colorspace") << ProfilesDialog::getColorspaceDescription(props.value("colorspace").toInt()));
|
||||
}
|
||||
|
||||
void ClipProperties::slotGotThumbnail(const QString &id, QImage img)
|
||||
void ClipProperties::slotGotThumbnail(const QString &id, const QImage &img)
|
||||
{
|
||||
if (id != m_clip->getId()) return;
|
||||
if (id != m_clip->getId())
|
||||
return;
|
||||
QPixmap framedPix(img.width(), img.height());
|
||||
framedPix.fill(Qt::transparent);
|
||||
QPainter p(&framedPix);
|
||||
@@ -706,21 +775,24 @@ void ClipProperties::slotApplyProperties()
|
||||
if (m_clip != NULL) {
|
||||
QMap <QString, QString> props = properties();
|
||||
emit applyNewClipProperties(m_clip->getId(), m_clip->currentProperties(props), props, needsTimelineRefresh(), needsTimelineReload());
|
||||
QTimer::singleShot(1000, this, SLOT(slotReloadVideoProperties()));
|
||||
if (props.contains("force_aspect_num")) QTimer::singleShot(1000, this, SLOT(slotReloadVideoThumb()));
|
||||
QTimer::singleShot(1000, this, SLOT(slotReloadVideoProperties()));
|
||||
if (props.contains("force_aspect_num"))
|
||||
QTimer::singleShot(1000, this, SLOT(slotReloadVideoThumb()));
|
||||
}
|
||||
m_view.buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
|
||||
}
|
||||
|
||||
void ClipProperties::slotReloadVideoProperties()
|
||||
{
|
||||
if (m_clip == NULL) return;
|
||||
if (m_clip == NULL)
|
||||
return;
|
||||
loadVideoProperties(m_clip->properties());
|
||||
}
|
||||
|
||||
void ClipProperties::slotReloadVideoThumb()
|
||||
{
|
||||
if (m_clip == NULL) return;
|
||||
if (m_clip == NULL)
|
||||
return;
|
||||
emit requestThumb(QString('?' + m_clip->getId()), QList<int>() << m_clip->getClipThumbFrame());
|
||||
}
|
||||
|
||||
@@ -771,10 +843,10 @@ void ClipProperties::slotUpdateAnalysisData(DocClipBase *clip)
|
||||
m_view.analysis_box->setHidden(analysis.isEmpty());
|
||||
QMap<QString, QString>::const_iterator i = analysis.constBegin();
|
||||
while (i != analysis.constEnd()) {
|
||||
QStringList itemtext;
|
||||
itemtext << i.key() << i.value();
|
||||
(void) new QTreeWidgetItem(m_view.analysis_list, itemtext);
|
||||
++i;
|
||||
QStringList itemtext;
|
||||
itemtext << i.key() << i.value();
|
||||
(void) new QTreeWidgetItem(m_view.analysis_list, itemtext);
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -788,7 +860,7 @@ void ClipProperties::slotFillMarkersList(DocClipBase *clip)
|
||||
QStringList itemtext;
|
||||
itemtext << time << marks.at(count).comment();
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem(m_view.markers_list, itemtext);
|
||||
item->setData(0, Qt::DecorationRole, CommentedTime::markerColor(marks.at(count).markerType()));
|
||||
item->setData(0, Qt::DecorationRole, CommentedTime::markerColor(marks.at(count).markerType()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -796,10 +868,10 @@ void ClipProperties::slotAddMarker()
|
||||
{
|
||||
CommentedTime marker(GenTime(), i18n("Marker"));
|
||||
QPointer<MarkerDialog> d = new MarkerDialog(m_clip, marker,
|
||||
m_tc, i18n("Add Marker"), this);
|
||||
m_tc, i18n("Add Marker"), this);
|
||||
if (d->exec() == QDialog::Accepted) {
|
||||
QList <CommentedTime> markers;
|
||||
markers << d->newMarker();
|
||||
QList <CommentedTime> markers;
|
||||
markers << d->newMarker();
|
||||
emit addMarkers(m_clip->getId(), markers);
|
||||
}
|
||||
delete d;
|
||||
@@ -822,8 +894,8 @@ void ClipProperties::slotEditMarker()
|
||||
if (pos < 0 || pos > marks.count() - 1) return;
|
||||
MarkerDialog d(m_clip, marks.at(pos), m_tc, i18n("Edit Marker"), this);
|
||||
if (d.exec() == QDialog::Accepted) {
|
||||
QList <CommentedTime> markers;
|
||||
markers << d.newMarker();
|
||||
QList <CommentedTime> markers;
|
||||
markers << d.newMarker();
|
||||
emit addMarkers(m_clip->getId(), markers);
|
||||
}
|
||||
}
|
||||
@@ -832,12 +904,12 @@ void ClipProperties::slotDeleteMarker()
|
||||
{
|
||||
QList < CommentedTime > marks = m_clip->commentedSnapMarkers();
|
||||
QList < CommentedTime > toDelete;
|
||||
for (int i = 0; i < marks.count(); i++) {
|
||||
if (m_view.markers_list->topLevelItem(i)->isSelected()) {
|
||||
CommentedTime marker = marks.at(i);
|
||||
marker.setMarkerType(-1);
|
||||
toDelete << marker;
|
||||
}
|
||||
for (int i = 0; i < marks.count(); ++i) {
|
||||
if (m_view.markers_list->topLevelItem(i)->isSelected()) {
|
||||
CommentedTime marker = marks.at(i);
|
||||
marker.setMarkerType(-1);
|
||||
toDelete << marker;
|
||||
}
|
||||
}
|
||||
emit addMarkers(m_clip->getId(), toDelete);
|
||||
}
|
||||
@@ -850,8 +922,9 @@ void ClipProperties::slotDeleteAnalysis()
|
||||
|
||||
void ClipProperties::slotSaveAnalysis()
|
||||
{
|
||||
QString url = KFileDialog::getSaveFileName(KUrl("kfiledialog:///projectfolder"), "text/plain", this, i18n("Save Analysis Data"));
|
||||
if (url.isEmpty()) return;
|
||||
const QString url = KFileDialog::getSaveFileName(KUrl("kfiledialog:///projectfolder"), "text/plain", this, i18n("Save Analysis Data"));
|
||||
if (url.isEmpty())
|
||||
return;
|
||||
KSharedConfigPtr config = KSharedConfig::openConfig(url, KConfig::SimpleConfig);
|
||||
KConfigGroup analysisConfig(config, "Analysis");
|
||||
QTreeWidgetItem *current = m_view.analysis_list->currentItem();
|
||||
@@ -860,16 +933,17 @@ void ClipProperties::slotSaveAnalysis()
|
||||
|
||||
void ClipProperties::slotLoadAnalysis()
|
||||
{
|
||||
QString url = KFileDialog::getOpenFileName(KUrl("kfiledialog:///projectfolder"), "text/plain", this, i18n("Open Analysis Data"));
|
||||
if (url.isEmpty()) return;
|
||||
const QString url = KFileDialog::getOpenFileName(KUrl("kfiledialog:///projectfolder"), "text/plain", this, i18n("Open Analysis Data"));
|
||||
if (url.isEmpty())
|
||||
return;
|
||||
KSharedConfigPtr config = KSharedConfig::openConfig(url, KConfig::SimpleConfig);
|
||||
KConfigGroup transConfig(config, "Analysis");
|
||||
// read the entries
|
||||
QMap< QString, QString > profiles = transConfig.entryMap();
|
||||
QMapIterator<QString, QString> i(profiles);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
emit editAnalysis(m_clip->getId(), i.key(), i.value());
|
||||
i.next();
|
||||
emit editAnalysis(m_clip->getId(), i.key(), i.value());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -878,12 +952,11 @@ const QString &ClipProperties::clipId() const
|
||||
return m_clip->getId();
|
||||
}
|
||||
|
||||
|
||||
QMap <QString, QString> ClipProperties::properties()
|
||||
{
|
||||
QMap <QString, QString> props;
|
||||
QLocale locale;
|
||||
CLIPTYPE t = UNKNOWN;
|
||||
ClipType t = Unknown;
|
||||
if (m_clip != NULL) {
|
||||
t = m_clip->clipType();
|
||||
m_old_props = m_clip->properties();
|
||||
@@ -893,7 +966,7 @@ QMap <QString, QString> ClipProperties::properties()
|
||||
int aspectDenominator = m_view.clip_ar_den->value();
|
||||
if (m_view.clip_force_ar->isChecked()) {
|
||||
if (aspectNumerator != m_old_props.value("force_aspect_num").toInt() ||
|
||||
aspectDenominator != m_old_props.value("force_aspect_den").toInt()) {
|
||||
aspectDenominator != m_old_props.value("force_aspect_den").toInt()) {
|
||||
props["force_aspect_num"] = QString::number(aspectNumerator);
|
||||
props["force_aspect_den"] = QString::number(aspectDenominator);
|
||||
props["force_aspect_ratio"].clear();
|
||||
@@ -1004,7 +1077,7 @@ QMap <QString, QString> ClipProperties::properties()
|
||||
if (m_old_props.value("description") != m_view.clip_description->text())
|
||||
props["description"] = m_view.clip_description->text();
|
||||
|
||||
if (t == COLOR) {
|
||||
if (t == Color) {
|
||||
QString new_color = m_view.clip_color->color().name();
|
||||
if (new_color != QString('#' + m_old_props.value("colour").right(8).left(6))) {
|
||||
m_clipNeedsRefresh = true;
|
||||
@@ -1014,7 +1087,7 @@ QMap <QString, QString> ClipProperties::properties()
|
||||
if (duration != m_clip->duration().frames(m_fps)) {
|
||||
props["out"] = QString::number(duration - 1);
|
||||
}
|
||||
} else if (t == IMAGE) {
|
||||
} else if (t == Image) {
|
||||
if ((int) m_view.image_transparency->isChecked() != m_old_props.value("transparency").toInt()) {
|
||||
props["transparency"] = QString::number((int)m_view.image_transparency->isChecked());
|
||||
//m_clipNeedsRefresh = true;
|
||||
@@ -1023,7 +1096,7 @@ QMap <QString, QString> ClipProperties::properties()
|
||||
if (duration != m_clip->duration().frames(m_fps)) {
|
||||
props["out"] = QString::number(duration - 1);
|
||||
}
|
||||
} else if (t == SLIDESHOW) {
|
||||
} else if (t == SlideShow) {
|
||||
QString value = QString::number((int) m_view.slide_loop->isChecked());
|
||||
if (m_old_props.value("loop") != value) props["loop"] = value;
|
||||
value = QString::number((int) m_view.slide_crop->isChecked());
|
||||
@@ -1125,31 +1198,31 @@ void ClipProperties::parseFolder(bool reloadThumb)
|
||||
QStringList result = dir.entryList(QDir::Files);
|
||||
|
||||
if (!isMime) {
|
||||
int offset = 0;
|
||||
QString path = m_view.clip_path->text();
|
||||
if (path.contains('?')) {
|
||||
// New MLT syntax
|
||||
offset = m_view.clip_path->text().section(':', -1).toInt();
|
||||
path = path.section('?', 0, 0);
|
||||
}
|
||||
QString filter = KUrl(path).fileName();
|
||||
QString ext = filter.section('.', -1);
|
||||
filter = filter.section('%', 0, -2);
|
||||
QString regexp = '^' + filter + "\\d+\\." + ext + '$';
|
||||
QRegExp rx(regexp);
|
||||
QStringList entries;
|
||||
int ix;
|
||||
foreach(const QString & path, result) {
|
||||
if (rx.exactMatch(path)) {
|
||||
if (offset > 0) {
|
||||
// make sure our image is in the range we want (> begin)
|
||||
ix = path.section(filter, 1).section('.', 0, 0).toInt();
|
||||
if (ix < offset) continue;
|
||||
}
|
||||
entries << path;
|
||||
}
|
||||
}
|
||||
result = entries;
|
||||
int offset = 0;
|
||||
QString path = m_view.clip_path->text();
|
||||
if (path.contains('?')) {
|
||||
// New MLT syntax
|
||||
offset = m_view.clip_path->text().section(':', -1).toInt();
|
||||
path = path.section('?', 0, 0);
|
||||
}
|
||||
QString filter = KUrl(path).fileName();
|
||||
QString ext = filter.section('.', -1);
|
||||
filter = filter.section('%', 0, -2);
|
||||
QString regexp = '^' + filter + "\\d+\\." + ext + '$';
|
||||
QRegExp rx(regexp);
|
||||
QStringList entries;
|
||||
int ix;
|
||||
foreach(const QString & path, result) {
|
||||
if (rx.exactMatch(path)) {
|
||||
if (offset > 0) {
|
||||
// make sure our image is in the range we want (> begin)
|
||||
ix = path.section(filter, 1).section('.', 0, 0).toInt();
|
||||
if (ix < offset) continue;
|
||||
}
|
||||
entries << path;
|
||||
}
|
||||
}
|
||||
result = entries;
|
||||
}
|
||||
|
||||
m_count = result.count();
|
||||
@@ -1165,19 +1238,20 @@ void ClipProperties::parseFolder(bool reloadThumb)
|
||||
QMap <QString, QString> props = m_clip->properties();
|
||||
m_view.clip_duration->setText(m_tc.getTimecodeFromFrames(props.value("ttl").toInt() * m_count));
|
||||
if (reloadThumb) {
|
||||
int width = 180.0 * KdenliveSettings::project_display_ratio();
|
||||
if (width % 2 == 1) width++;
|
||||
QString filePath = m_view.clip_path->text();
|
||||
if (isMime) filePath.append(extension);
|
||||
QPixmap pix = m_clip->thumbProducer()->getImage(KUrl(filePath), 1, width, 180);
|
||||
m_view.clip_thumb->setPixmap(pix);
|
||||
int width = 180.0 * KdenliveSettings::project_display_ratio();
|
||||
if (width % 2 == 1) width++;
|
||||
QString filePath = m_view.clip_path->text();
|
||||
if (isMime) filePath.append(extension);
|
||||
QPixmap pix = m_clip->thumbProducer()->getImage(KUrl(filePath), 1, width, 180);
|
||||
m_view.clip_thumb->setPixmap(pix);
|
||||
}
|
||||
}
|
||||
|
||||
void ClipProperties::slotCheckMaxLength()
|
||||
{
|
||||
if (m_clip->maxDuration() == GenTime()) return;
|
||||
int duration = m_tc.getFrameCount(m_view.clip_duration->text());
|
||||
if (m_clip->maxDuration() == GenTime())
|
||||
return;
|
||||
const int duration = m_tc.getFrameCount(m_view.clip_duration->text());
|
||||
if (duration > m_clip->maxDuration().frames(m_fps)) {
|
||||
m_view.clip_duration->setText(m_tc.getTimecode(m_clip->maxDuration()));
|
||||
}
|
||||
@@ -1185,7 +1259,7 @@ void ClipProperties::slotCheckMaxLength()
|
||||
|
||||
void ClipProperties::slotUpdateDurationFormat(int ix)
|
||||
{
|
||||
bool framesFormat = ix == 1;
|
||||
bool framesFormat = (ix == 1);
|
||||
if (framesFormat) {
|
||||
// switching to frames count, update widget
|
||||
m_view.slide_duration_frames->setValue(m_tc.getFrameCount(m_view.slide_duration->text()));
|
||||
@@ -1207,10 +1281,11 @@ void ClipProperties::slotUpdateDurationFormat(int ix)
|
||||
|
||||
void ClipProperties::slotDeleteProxy()
|
||||
{
|
||||
QString proxy = m_clip->getProperty("proxy");
|
||||
if (proxy.isEmpty()) return;
|
||||
emit deleteProxy(proxy);
|
||||
if (m_proxyContainer) delete m_proxyContainer;
|
||||
const QString proxy = m_clip->getProperty("proxy");
|
||||
if (proxy.isEmpty())
|
||||
return;
|
||||
emit deleteProxy(proxy);
|
||||
delete m_proxyContainer;
|
||||
}
|
||||
|
||||
void ClipProperties::slotOpenUrl(const QString &url)
|
||||
|
||||
@@ -32,11 +32,14 @@ class PropertiesViewDelegate : public QStyledItemDelegate
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
PropertiesViewDelegate(QWidget *parent) : QStyledItemDelegate(parent) {
|
||||
m_height = parent->fontMetrics().height() * 1.5;
|
||||
PropertiesViewDelegate(QWidget *parent)
|
||||
: QStyledItemDelegate(parent)
|
||||
{
|
||||
m_height = parent->fontMetrics().height() * 1.2;
|
||||
}
|
||||
virtual QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const {
|
||||
return QSize(10, m_height);
|
||||
protected:
|
||||
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const {
|
||||
return QSize(QStyledItemDelegate::sizeHint(option, index).width(), m_height);
|
||||
}
|
||||
private:
|
||||
int m_height;
|
||||
@@ -47,8 +50,8 @@ class ClipProperties : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidget * parent = 0);
|
||||
ClipProperties(QList <DocClipBase *>cliplist, Timecode tc, QMap <QString, QString> commonproperties, QWidget * parent);
|
||||
ClipProperties(DocClipBase *clip, const Timecode &tc, double fps, QWidget * parent = 0);
|
||||
ClipProperties(const QList<DocClipBase *> &cliplist, const Timecode &tc, const QMap<QString, QString> &commonproperties, QWidget * parent);
|
||||
virtual ~ClipProperties();
|
||||
QMap <QString, QString> properties();
|
||||
const QString &clipId() const;
|
||||
@@ -76,7 +79,7 @@ private slots:
|
||||
void slotSaveMarkers();
|
||||
void slotLoadMarkers();
|
||||
void slotDeleteAnalysis();
|
||||
void slotGotThumbnail(const QString &id, QImage img);
|
||||
void slotGotThumbnail(const QString &id, const QImage &img);
|
||||
void slotSaveAnalysis();
|
||||
void slotLoadAnalysis();
|
||||
void slotReloadVideoProperties();
|
||||
@@ -96,16 +99,16 @@ private:
|
||||
bool m_clipNeedsReLoad;
|
||||
/** Frame with proxy info / delete button */
|
||||
QFrame* m_proxyContainer;
|
||||
void loadVideoProperties(QMap <QString, QString> props);
|
||||
void loadVideoProperties(const QMap<QString, QString> &props);
|
||||
|
||||
signals:
|
||||
void addMarkers(const QString &, QList <CommentedTime>);
|
||||
void deleteProxy(const QString);
|
||||
void applyNewClipProperties(const QString, QMap <QString, QString> , QMap <QString, QString> , bool, bool);
|
||||
void addMarkers(const QString &, const QList <CommentedTime>&);
|
||||
void deleteProxy(const QString&);
|
||||
void applyNewClipProperties(const QString&, const QMap <QString, QString> &, const QMap <QString, QString> &, bool, bool);
|
||||
void saveMarkers(const QString &id);
|
||||
void loadMarkers(const QString &id);
|
||||
void editAnalysis(const QString &id, const QString &name, const QString &value);
|
||||
void requestThumb(const QString id, QList <int> frames);
|
||||
void requestThumb(const QString &id, const QList <int>& frames);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
|
||||
#include "clipstabilize.h"
|
||||
#include "doubleparameterwidget.h"
|
||||
#include "widgets/doubleparameterwidget.h"
|
||||
|
||||
#include <KDebug>
|
||||
#include <mlt++/Mlt.h>
|
||||
@@ -33,16 +33,16 @@
|
||||
#include <QSlider>
|
||||
#include <KFileDialog>
|
||||
|
||||
ClipStabilize::ClipStabilize(const QString &dest, int count, const QString &filterName,QWidget * parent) :
|
||||
QDialog(parent),
|
||||
m_filtername(filterName),
|
||||
m_count(count),
|
||||
vbox(NULL)
|
||||
ClipStabilize::ClipStabilize(const QStringList &urls, const QString &filterName,QWidget * parent) :
|
||||
QDialog(parent),
|
||||
m_filtername(filterName),
|
||||
m_urls(urls),
|
||||
vbox(NULL)
|
||||
{
|
||||
setFont(KGlobalSettings::toolBarFont());
|
||||
setupUi(this);
|
||||
setWindowTitle(i18n("Stabilize Clip"));
|
||||
auto_add->setText(i18np("Add clip to project", "Add clips to project", count));
|
||||
auto_add->setText(i18np("Add clip to project", "Add clips to project", urls.count()));
|
||||
auto_add->setChecked(KdenliveSettings::add_new_clip());
|
||||
|
||||
QPalette p = palette();
|
||||
@@ -53,81 +53,82 @@ ClipStabilize::ClipStabilize(const QString &dest, int count, const QString &filt
|
||||
QColor light_bg = scheme.shade(KColorScheme::LightShade);
|
||||
|
||||
QString stylesheet(QString("QProgressBar:horizontal {border: 1px solid %1;border-radius:0px;border-top-left-radius: 4px;border-bottom-left-radius: 4px;border-right: 0px;background:%4;padding: 0px;text-align:left center}\
|
||||
QProgressBar:horizontal#dragOnly {background: %1} QProgressBar:horizontal:hover#dragOnly {background: %3} QProgressBar:horizontal:hover {border: 1px solid %3;border-right: 0px;}\
|
||||
QProgressBar::chunk:horizontal {background: %1;} QProgressBar::chunk:horizontal:hover {background: %3;}\
|
||||
QProgressBar:horizontal[inTimeline=\"true\"] { border: 1px solid %2;border-right: 0px;background: %4;padding: 0px;text-align:left center } QProgressBar::chunk:horizontal[inTimeline=\"true\"] {background: %2;}\
|
||||
QAbstractSpinBox#dragBox {border: 1px solid %1;border-top-right-radius: 4px;border-bottom-right-radius: 4px;padding-right:0px;} QAbstractSpinBox::down-button#dragBox {width:0px;padding:0px;}\
|
||||
QAbstractSpinBox::up-button#dragBox {width:0px;padding:0px;} QAbstractSpinBox[inTimeline=\"true\"]#dragBox { border: 1px solid %2;} QAbstractSpinBox:hover#dragBox {border: 1px solid %3;} ")
|
||||
.arg(dark_bg.name()).arg(selected_bg.name()).arg(hover_bg.name()).arg(light_bg.name()));
|
||||
setStyleSheet(stylesheet);
|
||||
QProgressBar:horizontal#dragOnly {background: %1} QProgressBar:horizontal:hover#dragOnly {background: %3} QProgressBar:horizontal:hover {border: 1px solid %3;border-right: 0px;}\
|
||||
QProgressBar::chunk:horizontal {background: %1;} QProgressBar::chunk:horizontal:hover {background: %3;}\
|
||||
QProgressBar:horizontal[inTimeline=\"true\"] { border: 1px solid %2;border-right: 0px;background: %4;padding: 0px;text-align:left center } QProgressBar::chunk:horizontal[inTimeline=\"true\"] {background: %2;}\
|
||||
QAbstractSpinBox#dragBox {border: 1px solid %1;border-top-right-radius: 4px;border-bottom-right-radius: 4px;padding-right:0px;} QAbstractSpinBox::down-button#dragBox {width:0px;padding:0px;}\
|
||||
QAbstractSpinBox::up-button#dragBox {width:0px;padding:0px;} QAbstractSpinBox[inTimeline=\"true\"]#dragBox { border: 1px solid %2;} QAbstractSpinBox:hover#dragBox {border: 1px solid %3;} ")
|
||||
.arg(dark_bg.name()).arg(selected_bg.name()).arg(hover_bg.name()).arg(light_bg.name()));
|
||||
setStyleSheet(stylesheet);
|
||||
|
||||
if (m_count == 1) {
|
||||
QString newFile = dest;
|
||||
newFile.append(".mlt");
|
||||
KUrl dest(newFile);
|
||||
dest_url->setMode(KFile::File);
|
||||
dest_url->setUrl(KUrl(newFile));
|
||||
dest_url->fileDialog()->setOperationMode(KFileDialog::Saving);
|
||||
} else {
|
||||
label_dest->setText(i18n("Destination folder"));
|
||||
dest_url->setMode(KFile::Directory);
|
||||
dest_url->setUrl(KUrl(dest));
|
||||
dest_url->fileDialog()->setOperationMode(KFileDialog::Saving);
|
||||
}
|
||||
if (m_urls.count() == 1) {
|
||||
QString newFile = m_urls.first();
|
||||
newFile.append(".mlt");
|
||||
KUrl dest(newFile);
|
||||
dest_url->setMode(KFile::File);
|
||||
dest_url->setUrl(KUrl(newFile));
|
||||
dest_url->fileDialog()->setOperationMode(KFileDialog::Saving);
|
||||
|
||||
if (m_filtername=="videostab"){
|
||||
QStringList ls;
|
||||
ls << "shutterangle,type,int,value,0,min,0,max,180,tooltip,Angle that Images could be maximum rotated";
|
||||
fillParameters(ls);
|
||||
}else if (m_filtername=="videostab2"){
|
||||
// Some default params have to be set:
|
||||
m_fixedParams << "algo=1" << "relative=1";
|
||||
QStringList ls;
|
||||
ls << "accuracy,type,int,value,8,min,1,max,10,tooltip,Accuracy of Shakiness detection";
|
||||
ls << "shakiness,type,int,value,4,min,1,max,10,tooltip,How shaky is the Video";
|
||||
ls << "stepsize,type,int,value,6,min,0,max,100,tooltip,Stepsize of Detection process minimum around";
|
||||
//ls << "algo,type,bool,value,1,min,0,max,1,tooltip,0 = Bruteforce 1 = small measurement fields";
|
||||
ls << "mincontrast,type,double,value,0.3,min,0,max,1,factor,1,decimals,2,tooltip,Below this Contrast Field is discarded";
|
||||
//ls << "show,type,int,value,0,min,0,max,2,tooltip,0 = draw nothing. 1 or 2 show fields and transforms";
|
||||
ls << "smoothing,type,int,value,10,min,0,max,100,tooltip,number of frames for lowpass filtering";
|
||||
ls << "maxshift,type,int,value,-1,min,-1,max,1000,tooltip,max number of pixels to shift";
|
||||
ls << "maxangle,type,int,value,-1,min,-1,max,1000,tooltip,max anglen to rotate (in rad)";
|
||||
ls << "crop,type,bool,value,0,min,0,max,1,tooltip,0 = keep border 1 = black background";
|
||||
//ls << "invert,type,bool,value,0,min,0,max,1,tooltip,invert transform";
|
||||
//ls << "relative,type,bool,value,1,min,0,max,1,tooltip,0 = absolute transform 1= relative";
|
||||
ls << "zoom,type,int,value,0,min,-500,max,500,tooltip,additional zoom during transform";
|
||||
ls << "optzoom,type,bool,value,1,min,0,max,1,tooltip,use optimal zoom (calulated from transforms)";
|
||||
ls << "sharpen,type,double,value,0.8,min,0,max,1,decimals,1,tooltip,sharpen transformed image";
|
||||
fillParameters(ls);
|
||||
} else {
|
||||
label_dest->setText(i18n("Destination folder"));
|
||||
dest_url->setMode(KFile::Directory);
|
||||
dest_url->setUrl(KUrl(KUrl(m_urls.first()).directory()));
|
||||
dest_url->fileDialog()->setOperationMode(KFileDialog::Saving);
|
||||
}
|
||||
|
||||
}
|
||||
if (m_filtername=="videostab"){
|
||||
QStringList ls;
|
||||
ls << "shutterangle,type,int,value,0,min,0,max,180,tooltip,Angle that Images could be maximum rotated";
|
||||
fillParameters(ls);
|
||||
}else if (m_filtername=="videostab2"){
|
||||
// Some default params have to be set:
|
||||
m_fixedParams << "algo=1" << "relative=1";
|
||||
QStringList ls;
|
||||
ls << "accuracy,type,int,value,8,min,1,max,10,tooltip,Accuracy of Shakiness detection";
|
||||
ls << "shakiness,type,int,value,4,min,1,max,10,tooltip,How shaky is the Video";
|
||||
ls << "stepsize,type,int,value,6,min,0,max,100,tooltip,Stepsize of Detection process minimum around";
|
||||
//ls << "algo,type,bool,value,1,min,0,max,1,tooltip,0 = Bruteforce 1 = small measurement fields";
|
||||
ls << "mincontrast,type,double,value,0.3,min,0,max,1,factor,1,decimals,2,tooltip,Below this Contrast Field is discarded";
|
||||
//ls << "show,type,int,value,0,min,0,max,2,tooltip,0 = draw nothing. 1 or 2 show fields and transforms";
|
||||
ls << "smoothing,type,int,value,10,min,0,max,100,tooltip,number of frames for lowpass filtering";
|
||||
ls << "maxshift,type,int,value,-1,min,-1,max,1000,tooltip,max number of pixels to shift";
|
||||
ls << "maxangle,type,double,value,-1,min,-1,max,3.14,decimals,2,tooltip,max angle to rotate (in rad)";
|
||||
ls << "crop,type,bool,value,0,min,0,max,1,tooltip,0 = keep border 1 = black background";
|
||||
//ls << "invert,type,bool,value,0,min,0,max,1,tooltip,invert transform";
|
||||
//ls << "relative,type,bool,value,1,min,0,max,1,tooltip,0 = absolute transform 1= relative";
|
||||
ls << "zoom,type,int,value,0,min,-500,max,500,tooltip,additional zoom during transform";
|
||||
ls << "optzoom,type,bool,value,1,min,0,max,1,tooltip,use optimal zoom (calulated from transforms)";
|
||||
ls << "sharpen,type,double,value,0.8,min,0,max,1,decimals,1,tooltip,sharpen transformed image";
|
||||
fillParameters(ls);
|
||||
|
||||
//connect(buttonBox,SIGNAL(rejected()), this, SLOT(slotAbortStabilize()));
|
||||
}
|
||||
|
||||
vbox=new QVBoxLayout(optionsbox);
|
||||
QHashIterator<QString,QHash<QString,QString> > hi(m_ui_params);
|
||||
while(hi.hasNext()){
|
||||
hi.next();
|
||||
QHash<QString,QString> val=hi.value();
|
||||
if (val["type"]=="int" || val["type"]=="double"){
|
||||
DoubleParameterWidget *dbl=new DoubleParameterWidget(hi.key(), val["value"].toDouble(),
|
||||
val["min"].toDouble(),val["max"].toDouble(),val["value"].toDouble(),
|
||||
"",0/*id*/,""/*suffix*/,val["decimals"]!=""?val["decimals"].toInt():0,this);
|
||||
dbl->setObjectName(hi.key());
|
||||
dbl->setToolTip(val["tooltip"]);
|
||||
connect(dbl,SIGNAL(valueChanged(double)),this,SLOT(slotUpdateParams()));
|
||||
vbox->addWidget(dbl);
|
||||
}else if (val["type"]=="bool"){
|
||||
QCheckBox *ch=new QCheckBox(hi.key(),this);
|
||||
ch->setCheckState(val["value"] == "0" ? Qt::Unchecked : Qt::Checked);
|
||||
ch->setObjectName(hi.key());
|
||||
connect(ch, SIGNAL(stateChanged(int)) , this,SLOT(slotUpdateParams()));
|
||||
ch->setToolTip(val["tooltip"]);
|
||||
vbox->addWidget(ch);
|
||||
|
||||
}
|
||||
}
|
||||
adjustSize();
|
||||
connect(buttonBox->button(QDialogButtonBox::Ok),SIGNAL(clicked()), this, SLOT(slotValidate()));
|
||||
|
||||
vbox=new QVBoxLayout(optionsbox);
|
||||
QHashIterator<QString,QHash<QString,QString> > hi(m_ui_params);
|
||||
while(hi.hasNext()){
|
||||
hi.next();
|
||||
QHash<QString,QString> val=hi.value();
|
||||
if (val["type"]=="int" || val["type"]=="double"){
|
||||
DoubleParameterWidget *dbl=new DoubleParameterWidget(hi.key(), val["value"].toDouble(),
|
||||
val["min"].toDouble(),val["max"].toDouble(),val["value"].toDouble(),
|
||||
"",0/*id*/,""/*suffix*/,val["decimals"]!=""?val["decimals"].toInt():0,this);
|
||||
dbl->setObjectName(hi.key());
|
||||
dbl->setToolTip(val["tooltip"]);
|
||||
connect(dbl,SIGNAL(valueChanged(double)),this,SLOT(slotUpdateParams()));
|
||||
vbox->addWidget(dbl);
|
||||
}else if (val["type"]=="bool"){
|
||||
QCheckBox *ch=new QCheckBox(hi.key(),this);
|
||||
ch->setCheckState(val["value"] == "0" ? Qt::Unchecked : Qt::Checked);
|
||||
ch->setObjectName(hi.key());
|
||||
connect(ch, SIGNAL(stateChanged(int)) , this,SLOT(slotUpdateParams()));
|
||||
ch->setToolTip(val["tooltip"]);
|
||||
vbox->addWidget(ch);
|
||||
|
||||
}
|
||||
}
|
||||
adjustSize();
|
||||
}
|
||||
|
||||
ClipStabilize::~ClipStabilize()
|
||||
@@ -165,7 +166,7 @@ QStringList ClipStabilize::params()
|
||||
|
||||
QString ClipStabilize::destination() const
|
||||
{
|
||||
if (m_count == 1)
|
||||
if (m_urls.count() == 1)
|
||||
return dest_url->url().path();
|
||||
else
|
||||
return dest_url->url().path(KUrl::AddTrailingSlash);
|
||||
@@ -234,7 +235,7 @@ void ClipStabilize::slotStartStabilize()
|
||||
|
||||
void ClipStabilize::slotUpdateParams()
|
||||
{
|
||||
for (int i=0;i<vbox->count();i++){
|
||||
for (int i=0;i<vbox->count();++i){
|
||||
QWidget* w=vbox->itemAt(i)->widget();
|
||||
QString name=w->objectName();
|
||||
if (!name.isEmpty() && m_ui_params.contains(name)){
|
||||
@@ -274,6 +275,27 @@ void ClipStabilize::fillParameters(QStringList lst)
|
||||
|
||||
}
|
||||
|
||||
void ClipStabilize::slotValidate()
|
||||
{
|
||||
if (m_urls.count() == 1) {
|
||||
if (QFile::exists(dest_url->url().path())) {
|
||||
if (KMessageBox::questionYesNo(this, i18n("File %1 already exists.\nDo you want to overwrite it?", dest_url->url().path() )) == KMessageBox::No) return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
KUrl folder(dest_url->url());
|
||||
QStringList existingFiles;
|
||||
foreach(const QString &path, m_urls) {
|
||||
KUrl dest = folder;
|
||||
dest.addPath(KUrl(path).fileName());
|
||||
if (QFile::exists(dest.path() + ".mlt")) existingFiles.append(dest.path() + ".mlt");
|
||||
}
|
||||
if (!existingFiles.isEmpty()) {
|
||||
if (KMessageBox::warningContinueCancelList(this, i18n("The stabilize job will overwrite the following files:"), existingFiles) == KMessageBox::Cancel) return;
|
||||
}
|
||||
}
|
||||
accept();
|
||||
}
|
||||
|
||||
#include "clipstabilize.moc"
|
||||
|
||||
|
||||
@@ -26,23 +26,14 @@
|
||||
#include "ui_clipstabilize_ui.h"
|
||||
|
||||
#include <KUrl>
|
||||
#include <QProcess>
|
||||
#include <QFuture>
|
||||
|
||||
class QTimer;
|
||||
namespace Mlt{
|
||||
class Profile;
|
||||
class Playlist;
|
||||
class Consumer;
|
||||
class Filter;
|
||||
};
|
||||
|
||||
class ClipStabilize : public QDialog, public Ui::ClipStabilize_UI
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ClipStabilize(const QString &dest, int count, const QString &filterName,QWidget * parent = 0);
|
||||
explicit ClipStabilize(const QStringList &urls, const QString &filterName,QWidget * parent = 0);
|
||||
~ClipStabilize();
|
||||
/** @brief Should the generated clip be added to current project. */
|
||||
bool autoAddClip() const;
|
||||
@@ -57,17 +48,18 @@ public:
|
||||
private slots:
|
||||
void slotStartStabilize();
|
||||
void slotUpdateParams();
|
||||
void slotValidate();
|
||||
|
||||
private:
|
||||
QString m_filtername;
|
||||
int m_count;
|
||||
QStringList m_urls;
|
||||
QHash<QString,QHash<QString,QString> > m_ui_params;
|
||||
QVBoxLayout *vbox;
|
||||
void fillParameters(QStringList);
|
||||
QStringList m_fixedParams;
|
||||
|
||||
signals:
|
||||
void addClip(KUrl url);
|
||||
void addClip(const KUrl &url);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
#include <KFileDialog>
|
||||
|
||||
|
||||
ClipTranscode::ClipTranscode(KUrl::List urls, const QString ¶ms, const QStringList &postParams, const QString &description, bool automaticMode, QWidget * parent) :
|
||||
QDialog(parent), m_urls(urls), m_duration(0), m_automaticMode(automaticMode), m_postParams(postParams)
|
||||
ClipTranscode::ClipTranscode(const KUrl::List &urls, const QString ¶ms, const QStringList &postParams, const QString &description, bool automaticMode, QWidget * parent) :
|
||||
QDialog(parent), m_urls(urls), m_duration(0), m_automaticMode(automaticMode), m_postParams(postParams)
|
||||
{
|
||||
setFont(KGlobalSettings::toolBarFont());
|
||||
setupUi(this);
|
||||
@@ -43,7 +43,7 @@ ClipTranscode::ClipTranscode(KUrl::List urls, const QString ¶ms, const QStri
|
||||
log_text->setHidden(true);
|
||||
setWindowTitle(i18n("Transcode Clip"));
|
||||
if (m_automaticMode) {
|
||||
auto_add->setHidden(true);
|
||||
auto_add->setHidden(true);
|
||||
}
|
||||
auto_add->setText(i18np("Add clip to project", "Add clips to project", m_urls.count()));
|
||||
auto_add->setChecked(KdenliveSettings::add_new_clip());
|
||||
@@ -57,7 +57,7 @@ ClipTranscode::ClipTranscode(KUrl::List urls, const QString ¶ms, const QStri
|
||||
dest_url->setUrl(dest);
|
||||
dest_url->fileDialog()->setOperationMode(KFileDialog::Saving);
|
||||
urls_list->setHidden(true);
|
||||
connect(source_url, SIGNAL(textChanged(const QString &)), this, SLOT(slotUpdateParams()));
|
||||
connect(source_url, SIGNAL(textChanged(QString)), this, SLOT(slotUpdateParams()));
|
||||
} else {
|
||||
label_source->setHidden(true);
|
||||
source_url->setHidden(true);
|
||||
@@ -65,7 +65,7 @@ ClipTranscode::ClipTranscode(KUrl::List urls, const QString ¶ms, const QStri
|
||||
dest_url->setMode(KFile::Directory);
|
||||
dest_url->setUrl(KUrl(m_urls.at(0).directory()));
|
||||
dest_url->fileDialog()->setOperationMode(KFileDialog::Saving);
|
||||
for (int i = 0; i < m_urls.count(); i++)
|
||||
for (int i = 0; i < m_urls.count(); ++i)
|
||||
urls_list->addItem(m_urls.at(i).path());
|
||||
}
|
||||
if (!params.isEmpty()) {
|
||||
@@ -96,7 +96,7 @@ ClipTranscode::ClipTranscode(KUrl::List urls, const QString ¶ms, const QStri
|
||||
|
||||
m_transcodeProcess.setProcessChannelMode(QProcess::MergedChannels);
|
||||
connect(&m_transcodeProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(slotShowTranscodeInfo()));
|
||||
connect(&m_transcodeProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(slotTranscodeFinished(int, QProcess::ExitStatus)));
|
||||
connect(&m_transcodeProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(slotTranscodeFinished(int,QProcess::ExitStatus)));
|
||||
|
||||
ffmpeg_params->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 5);
|
||||
|
||||
@@ -127,7 +127,7 @@ void ClipTranscode::slotStartTransCode()
|
||||
QStringList parameters;
|
||||
QString destination;
|
||||
QString params = ffmpeg_params->toPlainText().simplified();
|
||||
if (m_urls.count() > 0 && urls_list->count() > 0) {
|
||||
if (!m_urls.isEmpty() && urls_list->count() > 0) {
|
||||
// We are processing multiple clips
|
||||
source_url->setUrl(m_urls.takeFirst());
|
||||
destination = dest_url->url().path(KUrl::AddTrailingSlash) + source_url->url().fileName();
|
||||
@@ -144,27 +144,27 @@ void ClipTranscode::slotStartTransCode()
|
||||
parameters << "-i" << s_url;
|
||||
if (QFile::exists(destination + extension)) {
|
||||
if (KMessageBox::questionYesNo(this, i18n("File %1 already exists.\nDo you want to overwrite it?", destination + extension)) == KMessageBox::No) {
|
||||
// Abort operation
|
||||
if (m_automaticMode) {
|
||||
// inform caller that we aborted
|
||||
emit transcodedClip(source_url->url(), KUrl());
|
||||
close();
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Abort operation
|
||||
if (m_automaticMode) {
|
||||
// inform caller that we aborted
|
||||
emit transcodedClip(source_url->url(), KUrl());
|
||||
close();
|
||||
}
|
||||
return;
|
||||
}
|
||||
parameters << "-y";
|
||||
}
|
||||
|
||||
bool replaceVfParams = false;
|
||||
foreach(QString s, params.split(' ')) {
|
||||
if (replaceVfParams) {
|
||||
s= m_postParams.at(1);
|
||||
replaceVfParams = false;
|
||||
}
|
||||
if (replaceVfParams) {
|
||||
s= m_postParams.at(1);
|
||||
replaceVfParams = false;
|
||||
}
|
||||
parameters << s.replace("%1", destination);
|
||||
if (s == "-vf") {
|
||||
replaceVfParams = true;
|
||||
}
|
||||
if (s == "-vf") {
|
||||
replaceVfParams = true;
|
||||
}
|
||||
}
|
||||
|
||||
buttonBox->button(QDialogButtonBox::Abort)->setText(i18n("Abort"));
|
||||
@@ -229,7 +229,7 @@ void ClipTranscode::slotTranscodeFinished(int exitCode, QProcess::ExitStatus exi
|
||||
QString extension = params.section("%1", 1, 1).section(' ', 0, 0);
|
||||
url = KUrl(dest_url->url().path(KUrl::AddTrailingSlash) + source_url->url().fileName() + extension);
|
||||
} else url = dest_url->url();
|
||||
if (m_automaticMode) emit transcodedClip(source_url->url(), url);
|
||||
if (m_automaticMode) emit transcodedClip(source_url->url(), url);
|
||||
else emit addClip(url);
|
||||
}
|
||||
if (urls_list->count() > 0 && m_urls.count() > 0) {
|
||||
@@ -261,7 +261,7 @@ void ClipTranscode::slotTranscodeFinished(int exitCode, QProcess::ExitStatus exi
|
||||
//Refill url list in case user wants to transcode to another format
|
||||
if (urls_list->count() > 0) {
|
||||
m_urls.clear();
|
||||
for (int i = 0; i < urls_list->count(); i++)
|
||||
for (int i = 0; i < urls_list->count(); ++i)
|
||||
m_urls << urls_list->item(i)->text();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class ClipTranscode : public QDialog, public Ui::ClipTranscode_UI
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ClipTranscode(KUrl::List urls, const QString ¶ms, const QStringList &postParams, const QString &description, bool automaticMode = false, QWidget * parent = 0);
|
||||
ClipTranscode(const KUrl::List &urls, const QString ¶ms, const QStringList &postParams, const QString &description, bool automaticMode = false, QWidget * parent = 0);
|
||||
~ClipTranscode();
|
||||
|
||||
public slots:
|
||||
@@ -63,8 +63,8 @@ private:
|
||||
#endif
|
||||
|
||||
signals:
|
||||
void addClip(KUrl url);
|
||||
void transcodedClip(KUrl source, KUrl result);
|
||||
void addClip(const KUrl &url);
|
||||
void transcodedClip(const KUrl &source, const KUrl &result);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <math.h>
|
||||
#include <QImage>
|
||||
#include <QPainter>
|
||||
#include <KLocale>
|
||||
#include "histogramgenerator.h"
|
||||
|
||||
HistogramGenerator::HistogramGenerator()
|
||||
@@ -19,7 +20,7 @@ HistogramGenerator::HistogramGenerator()
|
||||
}
|
||||
|
||||
QImage HistogramGenerator::calculateHistogram(const QSize ¶deSize, const QImage &image, const int &components,
|
||||
HistogramGenerator::Rec rec, const bool &unscaled, const uint &accelFactor) const
|
||||
HistogramGenerator::Rec rec, bool unscaled, uint accelFactor) const
|
||||
{
|
||||
if (paradeSize.height() <= 0 || paradeSize.width() <= 0 || image.width() <= 0 || image.height() <= 0) {
|
||||
return QImage();
|
||||
@@ -44,7 +45,7 @@ QImage HistogramGenerator::calculateHistogram(const QSize ¶deSize, const QIm
|
||||
const uint ww = paradeSize.width();
|
||||
const uint wh = paradeSize.height();
|
||||
const uint byteCount = iw*ih;
|
||||
const uint stepsize = 4*accelFactor;
|
||||
const uint stepsize = image.depth() / 8 *accelFactor;
|
||||
|
||||
const uchar *bits = image.bits();
|
||||
QRgb *col;
|
||||
@@ -130,7 +131,7 @@ QImage HistogramGenerator::calculateHistogram(const QSize ¶deSize, const QIm
|
||||
}
|
||||
|
||||
QImage HistogramGenerator::drawComponent(const int *y, const QSize &size, const float &scaling, const QColor &color,
|
||||
const bool &unscaled, const uint &max) const
|
||||
bool unscaled, uint max) const
|
||||
{
|
||||
QImage component(max, size.height(), QImage::Format_ARGB32);
|
||||
component.fill(qRgba(0, 0, 0, 0));
|
||||
@@ -159,7 +160,7 @@ QImage HistogramGenerator::drawComponent(const int *y, const QSize &size, const
|
||||
}
|
||||
|
||||
void HistogramGenerator::drawComponentFull(QPainter *davinci, const int *y, const float &scaling, const QRect &rect,
|
||||
const QColor &color, const int &textSpace, const bool &unscaled, const uint &max) const
|
||||
const QColor &color, int textSpace, bool unscaled, uint max) const
|
||||
{
|
||||
QImage component = drawComponent(y, rect.size() - QSize(0, textSpace), scaling, color, unscaled, max);
|
||||
davinci->drawImage(rect.topLeft(), component);
|
||||
@@ -183,9 +184,9 @@ void HistogramGenerator::drawComponentFull(QPainter *davinci, const int *y, cons
|
||||
const int dist = 40;
|
||||
const int cw = component.width();
|
||||
|
||||
davinci->drawText(0, textY, "min");
|
||||
davinci->drawText(0, textY, i18n("min"));
|
||||
davinci->drawText(dist, textY, QString::number(min, 'f', 0));
|
||||
|
||||
davinci->drawText(cw-dist-30, textY, "max");
|
||||
davinci->drawText(cw-dist-30, textY, i18n("max"));
|
||||
davinci->drawText(cw-30, textY, QString::number(maxVal, 'f', 0));
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ class QSize;
|
||||
class HistogramGenerator : public QObject
|
||||
{
|
||||
public:
|
||||
HistogramGenerator();
|
||||
explicit HistogramGenerator();
|
||||
|
||||
/** Recommendation to use.
|
||||
See http://www.poynton.com/ColorFAQ.html for details. */
|
||||
@@ -33,12 +33,12 @@ public:
|
||||
components are OR-ed HistogramGenerator::Components flags and decide with components (Y, R, G, B) to paint.
|
||||
unscaled = true leaves the width at 256 if the widget is wider (to avoid scaling). */
|
||||
QImage calculateHistogram(const QSize ¶deSize, const QImage &image, const int &components, const HistogramGenerator::Rec rec,
|
||||
const bool &unscaled, const uint &accelFactor = 1) const;
|
||||
bool unscaled, uint accelFactor = 1) const;
|
||||
|
||||
QImage drawComponent(const int *y, const QSize &size, const float &scaling, const QColor &color, const bool &unscaled, const uint &max) const;
|
||||
QImage drawComponent(const int *y, const QSize &size, const float &scaling, const QColor &color, bool unscaled, uint max) const;
|
||||
|
||||
void drawComponentFull(QPainter *davinci, const int *y, const float &scaling, const QRect &rect,
|
||||
const QColor &color, const int &textSpace, const bool &unscaled, const uint &max) const;
|
||||
const QColor &color, int textSpace, bool unscaled, uint max) const;
|
||||
|
||||
enum Components { ComponentY = 1<<0, ComponentR = 1<<1, ComponentG = 1<<2, ComponentB = 1<<3, ComponentSum = 1<<4 };
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
|
||||
#include "rgbparadegenerator.h"
|
||||
|
||||
#include <KLocalizedString>
|
||||
|
||||
#include <QColor>
|
||||
#include <QPainter>
|
||||
#include <QPoint>
|
||||
#include <QTime>
|
||||
|
||||
#define CHOP255(a) ((255) < (a) ? (255) : (a))
|
||||
#define CHOP1255(a) ((a) < (1) ? (1) : ((a) > (255) ? (255) : (a)))
|
||||
@@ -37,8 +37,8 @@ RGBParadeGenerator::RGBParadeGenerator()
|
||||
}
|
||||
|
||||
QImage RGBParadeGenerator::calculateRGBParade(const QSize ¶deSize, const QImage &image,
|
||||
const RGBParadeGenerator::PaintMode paintMode, const bool &drawAxis,
|
||||
const bool &drawGradientRef, const uint &accelFactor)
|
||||
const RGBParadeGenerator::PaintMode paintMode, bool drawAxis,
|
||||
bool drawGradientRef, uint accelFactor)
|
||||
{
|
||||
Q_ASSERT(accelFactor >= 1);
|
||||
|
||||
@@ -80,7 +80,7 @@ QImage RGBParadeGenerator::calculateRGBParade(const QSize ¶deSize, const QIm
|
||||
const float wPrediv = (float)(partW-1)/(iw-1);
|
||||
|
||||
StructRGB paradeVals[partW][256];
|
||||
for (uint i = 0; i < partW; i++) {
|
||||
for (uint i = 0; i < partW; ++i) {
|
||||
for (uint j = 0; j < 256; j++) {
|
||||
paradeVals[i][j].r = 0;
|
||||
paradeVals[i][j].g = 0;
|
||||
@@ -89,7 +89,7 @@ QImage RGBParadeGenerator::calculateRGBParade(const QSize ¶deSize, const QIm
|
||||
}
|
||||
|
||||
const uchar *bits = image.bits();
|
||||
const uint stepsize = 4*accelFactor;
|
||||
const uint stepsize = image.depth() / 8 *accelFactor;
|
||||
|
||||
for (uint i = 0, x = 0; i < byteCount; i += stepsize) {
|
||||
col = (QRgb *)bits;
|
||||
@@ -121,7 +121,7 @@ QImage RGBParadeGenerator::calculateRGBParade(const QSize ¶deSize, const QIm
|
||||
const uint offset2 = 2*partW + 2*offset;
|
||||
switch(paintMode) {
|
||||
case PaintMode_RGB:
|
||||
for (uint i = 0; i < partW; i++) {
|
||||
for (uint i = 0; i < partW; ++i) {
|
||||
for (uint j = 0; j < 256; j++) {
|
||||
unscaled.setPixel(i, j, qRgba(255,10,10, CHOP255(gain*paradeVals[i][j].r)));
|
||||
unscaled.setPixel(i+offset1, j, qRgba(10,255,10, CHOP255(gain*paradeVals[i][j].g)));
|
||||
@@ -130,7 +130,7 @@ QImage RGBParadeGenerator::calculateRGBParade(const QSize ¶deSize, const QIm
|
||||
}
|
||||
break;
|
||||
default:
|
||||
for (uint i = 0; i < partW; i++) {
|
||||
for (uint i = 0; i < partW; ++i) {
|
||||
for (uint j = 0; j < 256; j++) {
|
||||
unscaled.setPixel(i, j, qRgba(255,255,255, CHOP255(gain*paradeVals[i][j].r)));
|
||||
unscaled.setPixel(i+offset1, j, qRgba(255,255,255, CHOP255(gain*paradeVals[i][j].g)));
|
||||
@@ -147,7 +147,7 @@ QImage RGBParadeGenerator::calculateRGBParade(const QSize ¶deSize, const QIm
|
||||
|
||||
if (drawAxis) {
|
||||
QRgb opx;
|
||||
for (uint i = 0; i <= 10; i++) {
|
||||
for (uint i = 0; i <= 10; ++i) {
|
||||
dy = (float)i/10 * (partH-1);
|
||||
for (uint x = 0; x < ww-distRight; x++) {
|
||||
opx = parade.pixel(x, dy);
|
||||
@@ -169,19 +169,19 @@ QImage RGBParadeGenerator::calculateRGBParade(const QSize ¶deSize, const QIm
|
||||
|
||||
// Show numerical minimum
|
||||
if (minR == 0) { davinci.setPen(colHighlight); } else { davinci.setPen(colSoft); }
|
||||
davinci.drawText(0, wh, "min: ");
|
||||
davinci.drawText(0, wh, i18n("min: "));
|
||||
if (minG == 0) { davinci.setPen(colHighlight); } else { davinci.setPen(colSoft); }
|
||||
davinci.drawText(partW + offset, wh, "min: ");
|
||||
davinci.drawText(partW + offset, wh, i18n("min: "));
|
||||
if (minB == 0) { davinci.setPen(colHighlight); } else { davinci.setPen(colSoft); }
|
||||
davinci.drawText(2*partW + 2*offset, wh, "min: ");
|
||||
davinci.drawText(2*partW + 2*offset, wh, i18n("min: "));
|
||||
|
||||
// Show numerical maximum
|
||||
if (maxR == 255) { davinci.setPen(colHighlight); } else { davinci.setPen(colSoft); }
|
||||
davinci.drawText(0, wh-20, "max: ");
|
||||
davinci.drawText(0, wh-20, i18n("max: "));
|
||||
if (maxG == 255) { davinci.setPen(colHighlight); } else { davinci.setPen(colSoft); }
|
||||
davinci.drawText(partW + offset, wh-20, "max: ");
|
||||
davinci.drawText(partW + offset, wh-20, i18n("max: "));
|
||||
if (maxB == 255) { davinci.setPen(colHighlight); } else { davinci.setPen(colSoft); }
|
||||
davinci.drawText(2*partW + 2*offset, wh-20, "max: ");
|
||||
davinci.drawText(2*partW + 2*offset, wh-20, i18n("max: "));
|
||||
|
||||
davinci.setPen(colLight);
|
||||
davinci.drawText(d, wh, QString::number(minR, 'f', 0));
|
||||
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
|
||||
RGBParadeGenerator();
|
||||
QImage calculateRGBParade(const QSize ¶deSize, const QImage &image, const RGBParadeGenerator::PaintMode paintMode,
|
||||
const bool &drawAxis, const bool &drawGradientRef, const uint &accelFactor = 1);
|
||||
bool drawAxis, bool drawGradientRef, uint accelFactor = 1);
|
||||
|
||||
static const QColor colHighlight;
|
||||
static const QColor colLight;
|
||||
|
||||
@@ -118,7 +118,7 @@ QPoint VectorscopeGenerator::mapToCircle(const QSize &targetSize, const QPointF
|
||||
QImage VectorscopeGenerator::calculateVectorscope(const QSize &vectorscopeSize, const QImage &image, const float &gain,
|
||||
const VectorscopeGenerator::PaintMode &paintMode,
|
||||
const VectorscopeGenerator::ColorSpace &colorSpace,
|
||||
const bool &, const uint &accelFactor) const
|
||||
bool, uint accelFactor) const
|
||||
{
|
||||
if (vectorscopeSize.width() <= 0 || vectorscopeSize.height() <= 0 || image.width() <= 0 || image.height() <= 0) {
|
||||
// Invalid size
|
||||
@@ -138,11 +138,11 @@ QImage VectorscopeGenerator::calculateVectorscope(const QSize &vectorscopeSize,
|
||||
QPoint pt;
|
||||
QRgb px;
|
||||
|
||||
const int stepsize = 4 * accelFactor;
|
||||
const int stepsize = image.depth() / 8 * accelFactor;
|
||||
|
||||
// Just an average for the number of image pixels per scope pixel.
|
||||
// NOTE: byteCount() has to be replaced by (img.bytesPerLine()*img.height()) for Qt 4.5 to compile, see: http://doc.trolltech.org/4.6/qimage.html#bytesPerLine
|
||||
double avgPxPerPx = (double) 4*(image.bytesPerLine()*image.height())/scope.size().width()/scope.size().height()/accelFactor;
|
||||
double avgPxPerPx = (double) image.depth() / 8 *(image.bytesPerLine()*image.height())/scope.size().width()/scope.size().height()/accelFactor;
|
||||
|
||||
for (int i = 0; i < (image.bytesPerLine()*image.height()); i+= stepsize) {
|
||||
QRgb *col = (QRgb *) bits;
|
||||
@@ -260,3 +260,5 @@ QImage VectorscopeGenerator::calculateVectorscope(const QSize &vectorscopeSize,
|
||||
}
|
||||
return scope;
|
||||
}
|
||||
|
||||
#include "vectorscopegenerator.moc"
|
||||
|
||||
@@ -30,13 +30,13 @@ public:
|
||||
QImage calculateVectorscope(const QSize &vectorscopeSize, const QImage &image, const float &gain,
|
||||
const VectorscopeGenerator::PaintMode &paintMode,
|
||||
const VectorscopeGenerator::ColorSpace &colorSpace,
|
||||
const bool&, const uint &accelFactor = 1) const;
|
||||
bool, uint accelFactor = 1) const;
|
||||
|
||||
QPoint mapToCircle(const QSize &targetSize, const QPointF &point) const;
|
||||
static const float scaling;
|
||||
|
||||
signals:
|
||||
void signalCalculationFinished(QImage image, const uint &ms);
|
||||
void signalCalculationFinished(const QImage &image, uint ms);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include <QColor>
|
||||
#include <QImage>
|
||||
#include <QPainter>
|
||||
#include <QSize>
|
||||
@@ -29,7 +28,7 @@ WaveformGenerator::~WaveformGenerator()
|
||||
}
|
||||
|
||||
QImage WaveformGenerator::calculateWaveform(const QSize &waveformSize, const QImage &image, WaveformGenerator::PaintMode paintMode,
|
||||
const bool &drawAxis, WaveformGenerator::Rec rec, const uint &accelFactor)
|
||||
bool drawAxis, WaveformGenerator::Rec rec, uint accelFactor)
|
||||
{
|
||||
Q_ASSERT(accelFactor >= 1);
|
||||
|
||||
@@ -57,7 +56,7 @@ QImage WaveformGenerator::calculateWaveform(const QSize &waveformSize, const QIm
|
||||
const uint byteCount = iw*ih;
|
||||
|
||||
uint waveValues[waveformSize.width()][waveformSize.height()];
|
||||
for (int i = 0; i < waveformSize.width(); i++) {
|
||||
for (int i = 0; i < waveformSize.width(); ++i) {
|
||||
for (int j = 0; j < waveformSize.height(); j++) {
|
||||
waveValues[i][j] = 0;
|
||||
}
|
||||
@@ -76,8 +75,9 @@ QImage WaveformGenerator::calculateWaveform(const QSize &waveformSize, const QIm
|
||||
const float wPrediv = (float)(ww-1)/(iw-1);
|
||||
|
||||
const uchar *bits = image.bits();
|
||||
const int bpp = image.depth() / 8;
|
||||
|
||||
for (uint i = 0, x = 0; i < byteCount; i += 4) {
|
||||
for (uint i = 0, x = 0; i < byteCount; i += bpp) {
|
||||
|
||||
Q_ASSERT(bits < image.bits() + byteCount);
|
||||
|
||||
@@ -96,20 +96,20 @@ QImage WaveformGenerator::calculateWaveform(const QSize &waveformSize, const QIm
|
||||
dx = x*wPrediv;
|
||||
waveValues[(int)dx][(int)dy]++;
|
||||
|
||||
bits += 4;
|
||||
x += 4;
|
||||
bits += bpp;
|
||||
x += bpp;
|
||||
if (x > iw) {
|
||||
x -= iw;
|
||||
if (accelFactor > 1) {
|
||||
bits += 4*iw*(accelFactor-1);
|
||||
i += 4*iw*(accelFactor-1);
|
||||
bits += bpp*iw*(accelFactor-1);
|
||||
i += bpp*iw*(accelFactor-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (paintMode) {
|
||||
case PaintMode_Green:
|
||||
for (int i = 0; i < waveformSize.width(); i++) {
|
||||
for (int i = 0; i < waveformSize.width(); ++i) {
|
||||
for (int j = 0; j < waveformSize.height(); j++) {
|
||||
// Logarithmic scale. Needs fine tuning by hand, but looks great.
|
||||
wave.setPixel(i, waveformSize.height()-j-1, qRgba(CHOP255(52*log(0.1*gain*waveValues[i][j])),
|
||||
@@ -120,14 +120,14 @@ QImage WaveformGenerator::calculateWaveform(const QSize &waveformSize, const QIm
|
||||
}
|
||||
break;
|
||||
case PaintMode_Yellow:
|
||||
for (int i = 0; i < waveformSize.width(); i++) {
|
||||
for (int i = 0; i < waveformSize.width(); ++i) {
|
||||
for (int j = 0; j < waveformSize.height(); j++) {
|
||||
wave.setPixel(i, waveformSize.height()-j-1, qRgba(255,242,0, CHOP255(gain*waveValues[i][j])));
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
for (int i = 0; i < waveformSize.width(); i++) {
|
||||
for (int i = 0; i < waveformSize.width(); ++i) {
|
||||
for (int j = 0; j < waveformSize.height(); j++) {
|
||||
wave.setPixel(i, waveformSize.height()-j-1, qRgba(255,255,255, CHOP255(2*gain*waveValues[i][j])));
|
||||
}
|
||||
@@ -140,7 +140,7 @@ QImage WaveformGenerator::calculateWaveform(const QSize &waveformSize, const QIm
|
||||
QRgb opx;
|
||||
davinci.setPen(qRgba(150,255,200,32));
|
||||
davinci.setCompositionMode(QPainter::CompositionMode_Overlay);
|
||||
for (uint i = 0; i <= 10; i++) {
|
||||
for (uint i = 0; i <= 10; ++i) {
|
||||
dy = (float)i/10 * (wh-1);
|
||||
for (uint x = 0; x < ww; x++) {
|
||||
opx = wave.pixel(x, dy);
|
||||
@@ -158,3 +158,5 @@ QImage WaveformGenerator::calculateWaveform(const QSize &waveformSize, const QIm
|
||||
return wave;
|
||||
}
|
||||
#undef CHOP255
|
||||
|
||||
#include "waveformgenerator.moc"
|
||||
|
||||
@@ -27,7 +27,7 @@ public:
|
||||
~WaveformGenerator();
|
||||
|
||||
QImage calculateWaveform(const QSize &waveformSize, const QImage &image, WaveformGenerator::PaintMode paintMode,
|
||||
const bool &drawAxis, const WaveformGenerator::Rec rec, const uint &accelFactor = 1);
|
||||
bool drawAxis, const WaveformGenerator::Rec rec, uint accelFactor = 1);
|
||||
|
||||
//signals:
|
||||
//void signalCalculationFinished(QImage image, const uint &ms);
|
||||
|
||||
@@ -69,21 +69,21 @@ ColorPlaneExport::~ColorPlaneExport()
|
||||
|
||||
///// Helper functions /////
|
||||
|
||||
void ColorPlaneExport::enableSliderScaling(const bool &enable)
|
||||
void ColorPlaneExport::enableSliderScaling(bool enable)
|
||||
{
|
||||
sliderScaling->setEnabled(enable);
|
||||
lblScaling->setEnabled(enable);
|
||||
lblScaleNr->setEnabled(enable);
|
||||
}
|
||||
|
||||
void ColorPlaneExport::enableSliderColor(const bool &enable)
|
||||
void ColorPlaneExport::enableSliderColor(bool enable)
|
||||
{
|
||||
sliderColor->setEnabled(enable);
|
||||
lblSliderName->setEnabled(enable);
|
||||
lblColNr->setEnabled(enable);
|
||||
}
|
||||
|
||||
void ColorPlaneExport::enableCbVariant(const bool &enable)
|
||||
void ColorPlaneExport::enableCbVariant(bool enable)
|
||||
{
|
||||
cbVariant->setEnabled(enable);
|
||||
lblVariant->setEnabled(enable);
|
||||
@@ -123,7 +123,7 @@ void ColorPlaneExport::slotUpdateDisplays()
|
||||
break;
|
||||
}
|
||||
|
||||
lblSize->setText(i18n("%1 px", QVariant(tResX->text()).toInt()*QVariant(tResY->text()).toInt()));
|
||||
lblSize->setText(i18n("%1 px", tResX->text().toInt()*tResY->text().toInt()));
|
||||
}
|
||||
|
||||
void ColorPlaneExport::slotValidate()
|
||||
@@ -275,3 +275,5 @@ void ColorPlaneExport::slotColormodeChanged()
|
||||
this->update();
|
||||
slotUpdateDisplays();
|
||||
}
|
||||
|
||||
#include "colorplaneexport.moc"
|
||||
|
||||
@@ -34,10 +34,9 @@ private:
|
||||
ColorTools *m_colorTools;
|
||||
float m_scaling;
|
||||
float m_Y;
|
||||
void enableSliderScaling(const bool &enable);
|
||||
void enableSliderColor(const bool &enable);
|
||||
void enableCbVariant(const bool &enable);
|
||||
|
||||
void enableSliderScaling(bool enable);
|
||||
void enableSliderColor(bool enable);
|
||||
void enableCbVariant(bool enable);
|
||||
|
||||
private slots:
|
||||
void slotValidate();
|
||||
|
||||
@@ -369,3 +369,5 @@ QImage ColorTools::hsvCurvePlane(const QSize &size, const QColor &baseColor,
|
||||
|
||||
|
||||
|
||||
|
||||
#include "colortools.moc"
|
||||
|
||||
@@ -28,7 +28,6 @@ set(kdenlive_SRCS
|
||||
commands/movegroupcommand.cpp
|
||||
commands/movetransitioncommand.cpp
|
||||
commands/razorclipcommand.cpp
|
||||
commands/razorgroupcommand.cpp
|
||||
commands/rebuildgroupcommand.cpp
|
||||
commands/refreshmonitorcommand.cpp
|
||||
commands/resizeclipcommand.cpp
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "addclipcommand.h"
|
||||
#include "kdenlivedoc.h"
|
||||
|
||||
#include <KLocale>
|
||||
#include <KLocalizedString>
|
||||
|
||||
AddClipCommand::AddClipCommand(KdenliveDoc *doc, const QDomElement &xml, const QString &id, bool doIt, QUndoCommand * parent) :
|
||||
QUndoCommand(parent),
|
||||
@@ -39,14 +39,18 @@ AddClipCommand::AddClipCommand(KdenliveDoc *doc, const QDomElement &xml, const Q
|
||||
void AddClipCommand::undo()
|
||||
{
|
||||
kDebug() << "---- undoing action";
|
||||
if (m_doIt) m_doc->deleteClip(m_id);
|
||||
else m_doc->addClip(m_xml, m_id);
|
||||
if (m_doIt)
|
||||
m_doc->deleteClip(m_id);
|
||||
else
|
||||
m_doc->addClip(m_xml, m_id);
|
||||
}
|
||||
// virtual
|
||||
void AddClipCommand::redo()
|
||||
{
|
||||
kDebug() << "---- redoing action";
|
||||
if (m_doIt) m_doc->addClip(m_xml, m_id);
|
||||
else m_doc->deleteClip(m_id);
|
||||
if (m_doIt)
|
||||
m_doc->addClip(m_xml, m_id);
|
||||
else
|
||||
m_doc->deleteClip(m_id);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@ class AddClipCommand : public QUndoCommand
|
||||
public:
|
||||
AddClipCommand(KdenliveDoc *doc, const QDomElement &xml, const QString &id, bool doIt, QUndoCommand * parent = 0);
|
||||
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
void undo();
|
||||
void redo();
|
||||
|
||||
private:
|
||||
KdenliveDoc *m_doc;
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
#include "addclipcutcommand.h"
|
||||
#include "projectlist.h"
|
||||
|
||||
#include <KLocale>
|
||||
#include <KLocalizedString>
|
||||
|
||||
AddClipCutCommand::AddClipCutCommand(ProjectList *list, const QString &id, int in, int out, const QString desc, bool newItem, bool remove, QUndoCommand * parent) :
|
||||
AddClipCutCommand::AddClipCutCommand(ProjectList *list, const QString &id, int in, int out, const QString& desc, bool newItem, bool remove, QUndoCommand * parent) :
|
||||
QUndoCommand(parent),
|
||||
m_list(list),
|
||||
m_id(id),
|
||||
@@ -39,13 +39,17 @@ AddClipCutCommand::AddClipCutCommand(ProjectList *list, const QString &id, int i
|
||||
// virtual
|
||||
void AddClipCutCommand::undo()
|
||||
{
|
||||
if (m_remove) m_list->addClipCut(m_id, m_in, m_out, m_desc, m_newItem);
|
||||
else m_list->removeClipCut(m_id, m_in, m_out);
|
||||
if (m_remove)
|
||||
m_list->addClipCut(m_id, m_in, m_out, m_desc, m_newItem);
|
||||
else
|
||||
m_list->removeClipCut(m_id, m_in, m_out);
|
||||
}
|
||||
// virtual
|
||||
void AddClipCutCommand::redo()
|
||||
{
|
||||
if (m_remove) m_list->removeClipCut(m_id, m_in, m_out);
|
||||
else m_list->addClipCut(m_id, m_in, m_out, m_desc, m_newItem);
|
||||
if (m_remove)
|
||||
m_list->removeClipCut(m_id, m_in, m_out);
|
||||
else
|
||||
m_list->addClipCut(m_id, m_in, m_out, m_desc, m_newItem);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,10 +29,10 @@ class ProjectList;
|
||||
class AddClipCutCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
AddClipCutCommand(ProjectList *list, const QString &id, int in, int out, const QString desc, bool newItem, bool remove, QUndoCommand * parent = 0);
|
||||
AddClipCutCommand(ProjectList *list, const QString &id, int in, int out, const QString &desc, bool newItem, bool remove, QUndoCommand * parent = 0);
|
||||
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
void undo();
|
||||
void redo();
|
||||
|
||||
private:
|
||||
ProjectList *m_list;
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
#include "addeffectcommand.h"
|
||||
#include "customtrackview.h"
|
||||
|
||||
#include <KLocale>
|
||||
#include <KLocalizedString>
|
||||
|
||||
AddEffectCommand::AddEffectCommand(CustomTrackView *view, const int track, GenTime pos, QDomElement effect, bool doIt, QUndoCommand * parent) :
|
||||
AddEffectCommand::AddEffectCommand(CustomTrackView *view, const int track, const GenTime &pos, const QDomElement &effect, bool doIt, QUndoCommand * parent) :
|
||||
QUndoCommand(parent),
|
||||
m_view(view),
|
||||
m_track(track),
|
||||
@@ -32,11 +32,16 @@ AddEffectCommand::AddEffectCommand(CustomTrackView *view, const int track, GenTi
|
||||
m_doIt(doIt)
|
||||
{
|
||||
QString effectName;
|
||||
QDomElement namenode = m_effect.firstChildElement("name");
|
||||
if (!namenode.isNull()) effectName = i18n(namenode.text().toUtf8().data());
|
||||
else effectName = i18n("effect");
|
||||
if (doIt) setText(i18n("Add %1", effectName));
|
||||
else setText(i18n("Delete %1", effectName));
|
||||
QDomElement namenode = m_effect.firstChildElement(QLatin1String("name"));
|
||||
if (!namenode.isNull())
|
||||
effectName = i18n(namenode.text().toUtf8().data());
|
||||
else
|
||||
effectName = i18n("effect");
|
||||
|
||||
if (doIt)
|
||||
setText(i18n("Add %1", effectName));
|
||||
else
|
||||
setText(i18n("Delete %1", effectName));
|
||||
}
|
||||
|
||||
|
||||
@@ -44,15 +49,19 @@ AddEffectCommand::AddEffectCommand(CustomTrackView *view, const int track, GenTi
|
||||
void AddEffectCommand::undo()
|
||||
{
|
||||
kDebug() << "---- undoing action";
|
||||
if (m_doIt) m_view->deleteEffect(m_track, m_pos, m_effect);
|
||||
else m_view->addEffect(m_track, m_pos, m_effect);
|
||||
if (m_doIt)
|
||||
m_view->deleteEffect(m_track, m_pos, m_effect);
|
||||
else
|
||||
m_view->addEffect(m_track, m_pos, m_effect);
|
||||
}
|
||||
// virtual
|
||||
void AddEffectCommand::redo()
|
||||
{
|
||||
kDebug() << "---- redoing action";
|
||||
if (m_doIt) m_view->addEffect(m_track, m_pos, m_effect);
|
||||
else m_view->deleteEffect(m_track, m_pos, m_effect);
|
||||
if (m_doIt)
|
||||
m_view->addEffect(m_track, m_pos, m_effect);
|
||||
else
|
||||
m_view->deleteEffect(m_track, m_pos, m_effect);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -31,10 +31,10 @@ class CustomTrackView;
|
||||
class AddEffectCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
AddEffectCommand(CustomTrackView *view, const int track, GenTime pos, QDomElement effect, bool doIt, QUndoCommand * parent = 0);
|
||||
AddEffectCommand(CustomTrackView *view, const int track, const GenTime &pos, const QDomElement &effect, bool doIt, QUndoCommand * parent = 0);
|
||||
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
void undo();
|
||||
void redo();
|
||||
|
||||
private:
|
||||
CustomTrackView *m_view;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "addextradatacommand.h"
|
||||
#include "customtrackview.h"
|
||||
|
||||
#include <KLocale>
|
||||
#include <KLocalizedString>
|
||||
|
||||
AddExtraDataCommand::AddExtraDataCommand(CustomTrackView *view, const QString&id, const QString&key, const QString &oldData, const QString &newData, QUndoCommand * parent) :
|
||||
QUndoCommand(parent),
|
||||
@@ -29,8 +29,10 @@ AddExtraDataCommand::AddExtraDataCommand(CustomTrackView *view, const QString&id
|
||||
m_key(key),
|
||||
m_id(id)
|
||||
{
|
||||
if (m_newData.isEmpty()) setText(i18n("Delete data"));
|
||||
else setText(i18n("Add data"));
|
||||
if (m_newData.isEmpty())
|
||||
setText(i18n("Delete data"));
|
||||
else
|
||||
setText(i18n("Add data"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -19,13 +19,7 @@
|
||||
#define EXTRADATACOMMAND_H
|
||||
|
||||
#include <QUndoCommand>
|
||||
#include <QGraphicsView>
|
||||
#include <QPointF>
|
||||
#include <QDomElement>
|
||||
#include <KDebug>
|
||||
|
||||
#include "gentime.h"
|
||||
#include "definitions.h"
|
||||
class CustomTrackView;
|
||||
|
||||
|
||||
@@ -33,8 +27,8 @@ class AddExtraDataCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
AddExtraDataCommand(CustomTrackView *view, const QString&id, const QString&key, const QString &oldData, const QString &newData, QUndoCommand * parent = 0);
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
void undo();
|
||||
void redo();
|
||||
|
||||
private:
|
||||
CustomTrackView *m_view;
|
||||
|
||||
@@ -21,30 +21,36 @@
|
||||
#include "addfoldercommand.h"
|
||||
#include "projectlist.h"
|
||||
|
||||
#include <KLocale>
|
||||
#include <KLocalizedString>
|
||||
|
||||
AddFolderCommand::AddFolderCommand(ProjectList *view, const QString folderName, const QString &clipId, bool doIt, QUndoCommand *parent) :
|
||||
AddFolderCommand::AddFolderCommand(ProjectList *view, const QString &folderName, const QString &clipId, bool doIt, QUndoCommand *parent) :
|
||||
QUndoCommand(parent),
|
||||
m_view(view),
|
||||
m_name(folderName),
|
||||
m_id(clipId),
|
||||
m_doIt(doIt)
|
||||
{
|
||||
if (doIt) setText(i18n("Add folder"));
|
||||
else setText(i18n("Delete folder"));
|
||||
if (doIt)
|
||||
setText(i18n("Add folder"));
|
||||
else
|
||||
setText(i18n("Delete folder"));
|
||||
}
|
||||
|
||||
// virtual
|
||||
void AddFolderCommand::undo()
|
||||
{
|
||||
if (m_doIt) m_view->slotAddFolder(m_name, m_id, true);
|
||||
else m_view->slotAddFolder(m_name, m_id, false);
|
||||
if (m_doIt)
|
||||
m_view->slotAddFolder(m_name, m_id, true);
|
||||
else
|
||||
m_view->slotAddFolder(m_name, m_id, false);
|
||||
}
|
||||
// virtual
|
||||
void AddFolderCommand::redo()
|
||||
{
|
||||
if (m_doIt) m_view->slotAddFolder(m_name, m_id, false);
|
||||
else m_view->slotAddFolder(m_name, m_id, true);
|
||||
if (m_doIt)
|
||||
m_view->slotAddFolder(m_name, m_id, false);
|
||||
else
|
||||
m_view->slotAddFolder(m_name, m_id, true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -28,10 +28,10 @@ class ProjectList;
|
||||
class AddFolderCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
AddFolderCommand(ProjectList *view, const QString folderName, const QString &clipId, bool doIt, QUndoCommand *parent = 0);
|
||||
AddFolderCommand(ProjectList *view, const QString &folderName, const QString &clipId, bool doIt, QUndoCommand *parent = 0);
|
||||
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
void undo();
|
||||
void redo();
|
||||
|
||||
private:
|
||||
ProjectList *m_view;
|
||||
|
||||
@@ -19,21 +19,23 @@
|
||||
#include "addmarkercommand.h"
|
||||
#include "customtrackview.h"
|
||||
|
||||
#include <KLocale>
|
||||
#include <KLocalizedString>
|
||||
|
||||
AddMarkerCommand::AddMarkerCommand(CustomTrackView *view, const CommentedTime oldMarker, const CommentedTime newMarker, const QString &id, QUndoCommand * parent) :
|
||||
AddMarkerCommand::AddMarkerCommand(CustomTrackView *view, const CommentedTime &oldMarker, const CommentedTime &newMarker, const QString &id, QUndoCommand * parent) :
|
||||
QUndoCommand(parent),
|
||||
m_view(view),
|
||||
m_oldMarker(oldMarker),
|
||||
m_newMarker(newMarker),
|
||||
m_id(id)
|
||||
{
|
||||
if (m_newMarker.markerType() < 0) setText(i18n("Delete marker"));
|
||||
else if (m_oldMarker.comment().isEmpty()) setText(i18n("Add marker"));
|
||||
else setText(i18n("Edit marker"));
|
||||
if (m_newMarker.markerType() < 0)
|
||||
setText(i18n("Delete marker"));
|
||||
else if (m_oldMarker.comment().isEmpty())
|
||||
setText(i18n("Add marker"));
|
||||
else
|
||||
setText(i18n("Edit marker"));
|
||||
}
|
||||
|
||||
|
||||
// virtual
|
||||
void AddMarkerCommand::undo()
|
||||
{
|
||||
|
||||
@@ -19,10 +19,6 @@
|
||||
#define MARKERCOMMAND_H
|
||||
|
||||
#include <QUndoCommand>
|
||||
#include <QGraphicsView>
|
||||
#include <QPointF>
|
||||
#include <QDomElement>
|
||||
#include <KDebug>
|
||||
|
||||
#include "gentime.h"
|
||||
#include "definitions.h"
|
||||
@@ -32,9 +28,9 @@ class CustomTrackView;
|
||||
class AddMarkerCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
AddMarkerCommand(CustomTrackView *view, const CommentedTime oldMarker, const CommentedTime newMarker, const QString &id, QUndoCommand * parent = 0);
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
AddMarkerCommand(CustomTrackView *view, const CommentedTime &oldMarker, const CommentedTime &newMarker, const QString &id, QUndoCommand * parent = 0);
|
||||
void undo();
|
||||
void redo();
|
||||
|
||||
private:
|
||||
CustomTrackView *m_view;
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
#include "addtimelineclipcommand.h"
|
||||
#include "customtrackview.h"
|
||||
|
||||
#include <KLocale>
|
||||
#include <KLocalizedString>
|
||||
|
||||
AddTimelineClipCommand::AddTimelineClipCommand(CustomTrackView *view, QDomElement xml, const QString &clipId, ItemInfo info, EffectsList effects, bool overwrite, bool push, bool doIt, bool doRemove, QUndoCommand * parent) :
|
||||
AddTimelineClipCommand::AddTimelineClipCommand(CustomTrackView *view, const QDomElement &xml, const QString &clipId, const ItemInfo &info, const EffectsList &effects, bool overwrite, bool push, bool doIt, bool doRemove, QUndoCommand * parent) :
|
||||
QUndoCommand(parent),
|
||||
m_view(view),
|
||||
m_clipInfo(info),
|
||||
@@ -43,15 +43,19 @@ AddTimelineClipCommand::AddTimelineClipCommand(CustomTrackView *view, QDomElemen
|
||||
// virtual
|
||||
void AddTimelineClipCommand::undo()
|
||||
{
|
||||
if (!m_remove) m_view->deleteClip(m_clipInfo);
|
||||
else m_view->addClip(m_xml, m_clipId, m_clipInfo, m_effects, m_overwrite, m_push);
|
||||
if (!m_remove)
|
||||
m_view->deleteClip(m_clipInfo);
|
||||
else
|
||||
m_view->addClip(m_xml, m_clipId, m_clipInfo, m_effects, m_overwrite, m_push);
|
||||
}
|
||||
// virtual
|
||||
void AddTimelineClipCommand::redo()
|
||||
{
|
||||
if (m_doIt) {
|
||||
if (!m_remove) m_view->addClip(m_xml, m_clipId, m_clipInfo, m_effects, m_overwrite, m_push);
|
||||
else m_view->deleteClip(m_clipInfo);
|
||||
if (!m_remove)
|
||||
m_view->addClip(m_xml, m_clipId, m_clipInfo, m_effects, m_overwrite, m_push);
|
||||
else
|
||||
m_view->deleteClip(m_clipInfo);
|
||||
}
|
||||
m_doIt = true;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#define TIMELINECLIPCOMMAND_H
|
||||
|
||||
#include <QUndoCommand>
|
||||
#include <QDomElement>
|
||||
#include <KDebug>
|
||||
|
||||
#include "gentime.h"
|
||||
@@ -34,9 +33,9 @@ class CustomTrackView;
|
||||
class AddTimelineClipCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
AddTimelineClipCommand(CustomTrackView *view, QDomElement xml, const QString &clipId, ItemInfo info, EffectsList effects, bool overwrite, bool push, bool doIt, bool doRemove, QUndoCommand * parent = 0);
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
AddTimelineClipCommand(CustomTrackView *view, const QDomElement &xml, const QString &clipId, const ItemInfo &info, const EffectsList &effects, bool overwrite, bool push, bool doIt, bool doRemove, QUndoCommand * parent = 0);
|
||||
void undo();
|
||||
void redo();
|
||||
|
||||
private:
|
||||
CustomTrackView *m_view;
|
||||
|
||||
@@ -21,17 +21,19 @@
|
||||
#include "addtrackcommand.h"
|
||||
#include "customtrackview.h"
|
||||
|
||||
#include <KLocale>
|
||||
|
||||
AddTrackCommand::AddTrackCommand(CustomTrackView *view, int ix, TrackInfo info, bool addTrack, QUndoCommand * parent) :
|
||||
#include <KLocalizedString>
|
||||
#include <KDebug>
|
||||
AddTrackCommand::AddTrackCommand(CustomTrackView *view, int ix, const TrackInfo &info, bool addTrack, QUndoCommand * parent) :
|
||||
QUndoCommand(parent),
|
||||
m_view(view),
|
||||
m_ix(ix),
|
||||
m_addTrack(addTrack),
|
||||
m_info(info)
|
||||
{
|
||||
if (addTrack) setText(i18n("Add track"));
|
||||
else setText(i18n("Delete track"));
|
||||
if (addTrack)
|
||||
setText(i18n("Add track"));
|
||||
else
|
||||
setText(i18n("Delete track"));
|
||||
}
|
||||
|
||||
|
||||
@@ -39,14 +41,18 @@ AddTrackCommand::AddTrackCommand(CustomTrackView *view, int ix, TrackInfo info,
|
||||
void AddTrackCommand::undo()
|
||||
{
|
||||
// kDebug()<<"---- undoing action";
|
||||
if (m_addTrack) m_view->removeTrack(m_ix);
|
||||
else m_view->addTrack(m_info, m_ix);
|
||||
if (m_addTrack)
|
||||
m_view->removeTrack(m_ix);
|
||||
else
|
||||
m_view->addTrack(m_info, m_ix);
|
||||
}
|
||||
// virtual
|
||||
void AddTrackCommand::redo()
|
||||
{
|
||||
kDebug() << "---- redoing action";
|
||||
if (m_addTrack) m_view->addTrack(m_info, m_ix);
|
||||
else m_view->removeTrack(m_ix);
|
||||
if (m_addTrack)
|
||||
m_view->addTrack(m_info, m_ix);
|
||||
else
|
||||
m_view->removeTrack(m_ix);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,10 +22,6 @@
|
||||
#define ADDTRACKCOMMAND_H
|
||||
|
||||
#include <QUndoCommand>
|
||||
#include <QGraphicsView>
|
||||
#include <QPointF>
|
||||
|
||||
#include <KDebug>
|
||||
#include "definitions.h"
|
||||
|
||||
class CustomTrackView;
|
||||
@@ -33,9 +29,9 @@ class CustomTrackView;
|
||||
class AddTrackCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
AddTrackCommand(CustomTrackView *view, int ix, TrackInfo info, bool addTrack, QUndoCommand * parent = 0);
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
AddTrackCommand(CustomTrackView *view, int ix, const TrackInfo &info, bool addTrack, QUndoCommand * parent = 0);
|
||||
void undo();
|
||||
void redo();
|
||||
|
||||
private:
|
||||
CustomTrackView *m_view;
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
#include "addtransitioncommand.h"
|
||||
#include "customtrackview.h"
|
||||
|
||||
#include <KLocale>
|
||||
#include <KLocalizedString>
|
||||
|
||||
AddTransitionCommand::AddTransitionCommand(CustomTrackView *view, ItemInfo info, int transitiontrack, QDomElement params, bool remove, bool doIt, QUndoCommand * parent) :
|
||||
AddTransitionCommand::AddTransitionCommand(CustomTrackView *view, const ItemInfo &info, int transitiontrack, const QDomElement ¶ms, bool remove, bool doIt, QUndoCommand * parent) :
|
||||
QUndoCommand(parent),
|
||||
m_view(view),
|
||||
m_info(info),
|
||||
@@ -30,27 +30,36 @@ AddTransitionCommand::AddTransitionCommand(CustomTrackView *view, ItemInfo info,
|
||||
m_doIt(doIt),
|
||||
m_remove(remove)
|
||||
{
|
||||
if (m_remove) setText(i18n("Delete transition from clip"));
|
||||
else setText(i18n("Add transition to clip"));
|
||||
if (m_remove)
|
||||
setText(i18n("Delete transition from clip"));
|
||||
else
|
||||
setText(i18n("Add transition to clip"));
|
||||
|
||||
if (parent) {
|
||||
// command has a parent, so there are several operations ongoing, do not refresh monitor
|
||||
m_refresh = false;
|
||||
} else m_refresh = true;
|
||||
} else {
|
||||
m_refresh = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// virtual
|
||||
void AddTransitionCommand::undo()
|
||||
{
|
||||
if (m_remove) m_view->addTransition(m_info, m_track, m_params, m_refresh);
|
||||
else m_view->deleteTransition(m_info, m_track, m_params, m_refresh);
|
||||
if (m_remove)
|
||||
m_view->addTransition(m_info, m_track, m_params, m_refresh);
|
||||
else
|
||||
m_view->deleteTransition(m_info, m_track, m_params, m_refresh);
|
||||
}
|
||||
// virtual
|
||||
void AddTransitionCommand::redo()
|
||||
{
|
||||
if (m_doIt) {
|
||||
if (m_remove) m_view->deleteTransition(m_info, m_track, m_params, m_refresh);
|
||||
else m_view->addTransition(m_info, m_track, m_params, m_refresh);
|
||||
if (m_remove)
|
||||
m_view->deleteTransition(m_info, m_track, m_params, m_refresh);
|
||||
else
|
||||
m_view->addTransition(m_info, m_track, m_params, m_refresh);
|
||||
}
|
||||
m_doIt = true;
|
||||
}
|
||||
|
||||
@@ -19,10 +19,7 @@
|
||||
#define ADDTRANSITIONCOMMAND_H
|
||||
|
||||
#include <QUndoCommand>
|
||||
#include <QGraphicsView>
|
||||
#include <QPointF>
|
||||
#include <QDomElement>
|
||||
#include <KDebug>
|
||||
|
||||
#include "gentime.h"
|
||||
#include "definitions.h"
|
||||
@@ -32,9 +29,9 @@ class CustomTrackView;
|
||||
class AddTransitionCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
AddTransitionCommand(CustomTrackView *view, ItemInfo info, int transitiontrack, QDomElement params, bool remove, bool doIt, QUndoCommand * parent = 0);
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
AddTransitionCommand(CustomTrackView *view, const ItemInfo &info, int transitiontrack, const QDomElement ¶ms, bool remove, bool doIt, QUndoCommand * parent = 0);
|
||||
void undo();
|
||||
void redo();
|
||||
|
||||
private:
|
||||
CustomTrackView *m_view;
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
#include "changecliptypecommand.h"
|
||||
#include "customtrackview.h"
|
||||
|
||||
#include <KLocale>
|
||||
#include <KLocalizedString>
|
||||
#include <KDebug>
|
||||
|
||||
ChangeClipTypeCommand::ChangeClipTypeCommand(CustomTrackView *view, const int track, const GenTime &pos, bool videoOnly, bool audioOnly, bool originalVideo, bool originalAudio, QUndoCommand * parent) :
|
||||
QUndoCommand(parent),
|
||||
|
||||
@@ -22,10 +22,6 @@
|
||||
#define CHANGECLIPTYPECOMMAND_H
|
||||
|
||||
#include <QUndoCommand>
|
||||
#include <QGraphicsView>
|
||||
#include <QPointF>
|
||||
|
||||
#include <KDebug>
|
||||
#include "definitions.h"
|
||||
|
||||
class GenTime;
|
||||
@@ -35,8 +31,8 @@ class ChangeClipTypeCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
ChangeClipTypeCommand(CustomTrackView *view, const int track, const GenTime &pos, bool videoOnly, bool audioOnly, bool originalVideo, bool originalAudio, QUndoCommand * parent = 0);
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
void undo();
|
||||
void redo();
|
||||
|
||||
private:
|
||||
CustomTrackView *m_view;
|
||||
|
||||
@@ -21,22 +21,22 @@
|
||||
#include "changeeffectstatecommand.h"
|
||||
#include "customtrackview.h"
|
||||
|
||||
#include <KLocale>
|
||||
#include <KLocalizedString>
|
||||
|
||||
ChangeEffectStateCommand::ChangeEffectStateCommand(CustomTrackView *view, const int track, GenTime pos, QList <int> effectIndexes, bool disable, bool refreshEffectStack, bool doIt, QUndoCommand *parent) :
|
||||
QUndoCommand(parent),
|
||||
m_view(view),
|
||||
m_track(track),
|
||||
m_effectIndexes(effectIndexes),
|
||||
m_pos(pos),
|
||||
m_disable(disable),
|
||||
m_doIt(doIt),
|
||||
m_refreshEffectStack(refreshEffectStack)
|
||||
ChangeEffectStateCommand::ChangeEffectStateCommand(CustomTrackView *view, const int track, const GenTime& pos, const QList <int>& effectIndexes, bool disable, bool refreshEffectStack, bool doIt, QUndoCommand *parent) :
|
||||
QUndoCommand(parent),
|
||||
m_view(view),
|
||||
m_track(track),
|
||||
m_effectIndexes(effectIndexes),
|
||||
m_pos(pos),
|
||||
m_disable(disable),
|
||||
m_doIt(doIt),
|
||||
m_refreshEffectStack(refreshEffectStack)
|
||||
{
|
||||
if (disable)
|
||||
setText(i18np("Disable effect", "Disable effects", effectIndexes.count()));
|
||||
if (disable)
|
||||
setText(i18np("Disable effect", "Disable effects", effectIndexes.count()));
|
||||
else
|
||||
setText(i18np("Enable effect", "Enable effects", effectIndexes.count()));
|
||||
setText(i18np("Enable effect", "Enable effects", effectIndexes.count()));
|
||||
}
|
||||
|
||||
// virtual
|
||||
@@ -47,7 +47,8 @@ void ChangeEffectStateCommand::undo()
|
||||
// virtual
|
||||
void ChangeEffectStateCommand::redo()
|
||||
{
|
||||
if (m_doIt) m_view->updateEffectState(m_track, m_pos, m_effectIndexes, m_disable, m_refreshEffectStack);
|
||||
if (m_doIt)
|
||||
m_view->updateEffectState(m_track, m_pos, m_effectIndexes, m_disable, m_refreshEffectStack);
|
||||
m_doIt = true;
|
||||
m_refreshEffectStack = true;
|
||||
}
|
||||
|
||||
@@ -22,19 +22,17 @@
|
||||
#define CHANGEEFFECTSTATECOMMAND_H
|
||||
|
||||
#include <QUndoCommand>
|
||||
#include <KDebug>
|
||||
#include <gentime.h>
|
||||
#include <QDomElement>
|
||||
|
||||
class CustomTrackView;
|
||||
|
||||
class ChangeEffectStateCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
ChangeEffectStateCommand(CustomTrackView *view, const int track, GenTime pos, QList <int> effectIndexes, bool disable, bool refreshEffectStack, bool doIt, QUndoCommand *parent = 0);
|
||||
ChangeEffectStateCommand(CustomTrackView *view, const int track, const GenTime &pos, const QList <int>& effectIndexes, bool disable, bool refreshEffectStack, bool doIt, QUndoCommand *parent = 0);
|
||||
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
void undo();
|
||||
void redo();
|
||||
|
||||
private:
|
||||
CustomTrackView *m_view;
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
#include "changespeedcommand.h"
|
||||
#include "customtrackview.h"
|
||||
|
||||
#include <KLocale>
|
||||
#include <KLocalizedString>
|
||||
|
||||
ChangeSpeedCommand::ChangeSpeedCommand(CustomTrackView *view, ItemInfo info, ItemInfo speedIndependantInfo, double old_speed, double new_speed, int old_strobe, int new_strobe, const QString &clipId, QUndoCommand * parent) :
|
||||
ChangeSpeedCommand::ChangeSpeedCommand(CustomTrackView *view, const ItemInfo &info, const ItemInfo &speedIndependantInfo, double old_speed, double new_speed, int old_strobe, int new_strobe, const QString &clipId, QUndoCommand * parent) :
|
||||
QUndoCommand(parent),
|
||||
m_view(view),
|
||||
m_clipInfo(info),
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
#define CHANGESPEEDCOMMAND_H
|
||||
|
||||
#include <QUndoCommand>
|
||||
#include <QGraphicsView>
|
||||
#include <KDebug>
|
||||
|
||||
#include "gentime.h"
|
||||
#include "definitions.h"
|
||||
@@ -33,9 +31,9 @@ class CustomTrackView;
|
||||
class ChangeSpeedCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
ChangeSpeedCommand(CustomTrackView *view, ItemInfo info, ItemInfo speedIndependantInfo, double old_speed, double new_speed, int old_strobe, int new_strobe, const QString &clipId, QUndoCommand * parent = 0);
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
ChangeSpeedCommand(CustomTrackView *view, const ItemInfo &info, const ItemInfo &speedIndependantInfo, double old_speed, double new_speed, int old_strobe, int new_strobe, const QString &clipId, QUndoCommand * parent = 0);
|
||||
void undo();
|
||||
void redo();
|
||||
|
||||
private:
|
||||
CustomTrackView *m_view;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "customtrackview.h"
|
||||
|
||||
|
||||
ConfigTracksCommand::ConfigTracksCommand(CustomTrackView* view, QList< TrackInfo > oldInfos, QList< TrackInfo > newInfos, QUndoCommand* parent) :
|
||||
ConfigTracksCommand::ConfigTracksCommand(CustomTrackView* view, const QList<TrackInfo> &oldInfos, const QList<TrackInfo> &newInfos, QUndoCommand* parent) :
|
||||
QUndoCommand(parent),
|
||||
m_view(view),
|
||||
m_oldInfos(oldInfos),
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
#define CONFIGTRACKSCOMMAND_H
|
||||
|
||||
#include <QUndoCommand>
|
||||
#include <QGraphicsView>
|
||||
#include <QPointF>
|
||||
|
||||
#include "definitions.h"
|
||||
|
||||
@@ -31,9 +29,9 @@ class CustomTrackView;
|
||||
class ConfigTracksCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
ConfigTracksCommand(CustomTrackView *view, QList <TrackInfo> oldInfos, QList <TrackInfo> newInfos, QUndoCommand * parent = 0);
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
ConfigTracksCommand(CustomTrackView *view, const QList <TrackInfo> &oldInfos, const QList <TrackInfo> &newInfos, QUndoCommand * parent = 0);
|
||||
void undo();
|
||||
void redo();
|
||||
|
||||
private:
|
||||
CustomTrackView *m_view;
|
||||
|
||||
@@ -20,9 +20,10 @@
|
||||
#include "editclipcommand.h"
|
||||
#include "projectlist.h"
|
||||
|
||||
#include <KLocale>
|
||||
#include <KLocalizedString>
|
||||
#include <KDebug>
|
||||
|
||||
EditClipCommand::EditClipCommand(ProjectList *list, const QString &id, QMap <QString, QString> oldparams, QMap <QString, QString> newparams, bool doIt, QUndoCommand * parent) :
|
||||
EditClipCommand::EditClipCommand(ProjectList *list, const QString &id, const QMap <QString, QString> &oldparams, const QMap <QString, QString> &newparams, bool doIt, QUndoCommand * parent) :
|
||||
QUndoCommand(parent),
|
||||
m_list(list),
|
||||
m_oldparams(oldparams),
|
||||
@@ -44,7 +45,8 @@ void EditClipCommand::undo()
|
||||
void EditClipCommand::redo()
|
||||
{
|
||||
kDebug() << "---- redoing action";
|
||||
if (m_doIt) m_list->slotUpdateClipProperties(m_id, m_newparams);
|
||||
if (m_doIt)
|
||||
m_list->slotUpdateClipProperties(m_id, m_newparams);
|
||||
m_doIt = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,18 +22,17 @@
|
||||
#define EDITCLIPCOMMAND_H
|
||||
|
||||
#include <QUndoCommand>
|
||||
#include <KDebug>
|
||||
#include <QDomElement>
|
||||
#include <QMap>
|
||||
|
||||
class ProjectList;
|
||||
|
||||
class EditClipCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
EditClipCommand(ProjectList *list, const QString &id, QMap <QString, QString> oldparams, QMap <QString, QString> newparams, bool doIt, QUndoCommand * parent = 0);
|
||||
EditClipCommand(ProjectList *list, const QString &id, const QMap <QString, QString> &oldparams, const QMap <QString, QString> &newparams, bool doIt, QUndoCommand * parent = 0);
|
||||
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
void undo();
|
||||
void redo();
|
||||
|
||||
private:
|
||||
ProjectList *m_list;
|
||||
|
||||
@@ -20,9 +20,10 @@
|
||||
#include "editclipcutcommand.h"
|
||||
#include "projectlist.h"
|
||||
|
||||
#include <KLocale>
|
||||
#include <KLocalizedString>
|
||||
#include <KDebug>
|
||||
|
||||
EditClipCutCommand::EditClipCutCommand(ProjectList *list, const QString &id, const QPoint oldZone, const QPoint newZone, const QString &oldComment, const QString &newComment, bool doIt, QUndoCommand * parent) :
|
||||
EditClipCutCommand::EditClipCutCommand(ProjectList *list, const QString &id, const QPoint &oldZone, const QPoint &newZone, const QString &oldComment, const QString &newComment, bool doIt, QUndoCommand * parent) :
|
||||
QUndoCommand(parent),
|
||||
m_list(list),
|
||||
m_id(id),
|
||||
@@ -46,7 +47,8 @@ void EditClipCutCommand::undo()
|
||||
void EditClipCutCommand::redo()
|
||||
{
|
||||
kDebug() << "---- redoing action";
|
||||
if (m_doIt) m_list->doUpdateClipCut(m_id, m_oldZone, m_newZone, m_newComment);
|
||||
if (m_doIt)
|
||||
m_list->doUpdateClipCut(m_id, m_oldZone, m_newZone, m_newComment);
|
||||
m_doIt = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,17 +24,15 @@
|
||||
#include <QUndoCommand>
|
||||
#include <QPoint>
|
||||
|
||||
#include <KDebug>
|
||||
|
||||
class ProjectList;
|
||||
|
||||
class EditClipCutCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
EditClipCutCommand(ProjectList *list, const QString &id, const QPoint oldZone, const QPoint newZone, const QString &oldComment, const QString &newComment, bool doIt, QUndoCommand * parent = 0);
|
||||
EditClipCutCommand(ProjectList *list, const QString &id, const QPoint &oldZone, const QPoint &newZone, const QString &oldComment, const QString &newComment, bool doIt, QUndoCommand * parent = 0);
|
||||
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
void undo();
|
||||
void redo();
|
||||
|
||||
private:
|
||||
ProjectList *m_list;
|
||||
|
||||
@@ -20,24 +20,26 @@
|
||||
|
||||
#include "editeffectcommand.h"
|
||||
#include "customtrackview.h"
|
||||
#include <KDebug>
|
||||
#include <KLocalizedString>
|
||||
|
||||
#include <KLocale>
|
||||
|
||||
EditEffectCommand::EditEffectCommand(CustomTrackView *view, const int track, GenTime pos, QDomElement oldeffect, QDomElement effect, int stackPos, bool refreshEffectStack, bool doIt, QUndoCommand *parent) :
|
||||
QUndoCommand(parent),
|
||||
m_view(view),
|
||||
m_track(track),
|
||||
m_oldeffect(oldeffect),
|
||||
m_effect(effect),
|
||||
m_pos(pos),
|
||||
m_stackPos(stackPos),
|
||||
m_doIt(doIt),
|
||||
m_refreshEffectStack(refreshEffectStack)
|
||||
EditEffectCommand::EditEffectCommand(CustomTrackView *view, const int track, const GenTime &pos, const QDomElement &oldeffect, const QDomElement &effect, int stackPos, bool refreshEffectStack, bool doIt, QUndoCommand *parent) :
|
||||
QUndoCommand(parent),
|
||||
m_view(view),
|
||||
m_track(track),
|
||||
m_oldeffect(oldeffect),
|
||||
m_effect(effect),
|
||||
m_pos(pos),
|
||||
m_stackPos(stackPos),
|
||||
m_doIt(doIt),
|
||||
m_refreshEffectStack(refreshEffectStack)
|
||||
{
|
||||
QString effectName;
|
||||
QDomElement namenode = effect.firstChildElement("name");
|
||||
if (!namenode.isNull()) effectName = i18n(namenode.text().toUtf8().data());
|
||||
else effectName = i18n("effect");
|
||||
QDomElement namenode = effect.firstChildElement(QLatin1String("name"));
|
||||
if (!namenode.isNull())
|
||||
effectName = i18n(namenode.text().toUtf8().data());
|
||||
else
|
||||
effectName = i18n("effect");
|
||||
setText(i18n("Edit effect %1", effectName));
|
||||
}
|
||||
|
||||
@@ -50,10 +52,14 @@ int EditEffectCommand::id() const
|
||||
// virtual
|
||||
bool EditEffectCommand::mergeWith(const QUndoCommand * other)
|
||||
{
|
||||
if (other->id() != id()) return false;
|
||||
if (m_track != static_cast<const EditEffectCommand*>(other)->m_track) return false;
|
||||
if (m_stackPos != static_cast<const EditEffectCommand*>(other)->m_stackPos) return false;
|
||||
if (m_pos != static_cast<const EditEffectCommand*>(other)->m_pos) return false;
|
||||
if (other->id() != id())
|
||||
return false;
|
||||
if (m_track != static_cast<const EditEffectCommand*>(other)->m_track)
|
||||
return false;
|
||||
if (m_stackPos != static_cast<const EditEffectCommand*>(other)->m_stackPos)
|
||||
return false;
|
||||
if (m_pos != static_cast<const EditEffectCommand*>(other)->m_pos)
|
||||
return false;
|
||||
m_effect = static_cast<const EditEffectCommand*>(other)->m_effect.cloneNode().toElement();
|
||||
return true;
|
||||
}
|
||||
@@ -67,7 +73,7 @@ void EditEffectCommand::undo()
|
||||
void EditEffectCommand::redo()
|
||||
{
|
||||
if (m_doIt) {
|
||||
m_view->updateEffect(m_track, m_pos, m_effect, m_refreshEffectStack);
|
||||
m_view->updateEffect(m_track, m_pos, m_effect, m_refreshEffectStack);
|
||||
}
|
||||
m_doIt = true;
|
||||
m_refreshEffectStack = true;
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#define EDITEFFECTCOMMAND_H
|
||||
|
||||
#include <QUndoCommand>
|
||||
#include <KDebug>
|
||||
#include <gentime.h>
|
||||
#include <QDomElement>
|
||||
|
||||
@@ -31,12 +30,12 @@ class CustomTrackView;
|
||||
class EditEffectCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
EditEffectCommand(CustomTrackView *view, const int track, GenTime pos, QDomElement oldeffect, QDomElement effect, int stackPos, bool refreshEffectStack, bool doIt, QUndoCommand *parent = 0);
|
||||
EditEffectCommand(CustomTrackView *view, const int track, const GenTime &pos, const QDomElement &oldeffect, const QDomElement &effect, int stackPos, bool refreshEffectStack, bool doIt, QUndoCommand *parent = 0);
|
||||
|
||||
virtual int id() const;
|
||||
virtual bool mergeWith(const QUndoCommand * command);
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
void undo();
|
||||
void redo();
|
||||
|
||||
private:
|
||||
CustomTrackView *m_view;
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
#include "editfoldercommand.h"
|
||||
#include "projectlist.h"
|
||||
|
||||
#include <KLocale>
|
||||
#include <KLocalizedString>
|
||||
|
||||
EditFolderCommand::EditFolderCommand(ProjectList *view, const QString newfolderName, const QString oldfolderName, const QString &clipId, bool doIt, QUndoCommand *parent) :
|
||||
EditFolderCommand::EditFolderCommand(ProjectList *view, const QString &newfolderName, const QString &oldfolderName, const QString &clipId, bool doIt, QUndoCommand *parent) :
|
||||
QUndoCommand(parent),
|
||||
m_view(view),
|
||||
m_name(newfolderName),
|
||||
|
||||
@@ -28,10 +28,10 @@ class ProjectList;
|
||||
class EditFolderCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
EditFolderCommand(ProjectList *view, const QString newfolderName, const QString oldfolderName, const QString &clipId, bool doIt, QUndoCommand *parent = 0);
|
||||
EditFolderCommand(ProjectList *view, const QString &newfolderName, const QString &oldfolderName, const QString &clipId, bool doIt, QUndoCommand *parent = 0);
|
||||
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
void undo();
|
||||
void redo();
|
||||
|
||||
private:
|
||||
ProjectList *m_view;
|
||||
|
||||
@@ -19,27 +19,29 @@
|
||||
#include "editguidecommand.h"
|
||||
#include "customtrackview.h"
|
||||
|
||||
#include <KLocale>
|
||||
#include <KLocalizedString>
|
||||
|
||||
EditGuideCommand::EditGuideCommand(CustomTrackView *view, const GenTime oldPos, const QString &oldcomment, const GenTime pos, const QString &comment, bool doIt, QUndoCommand * parent) :
|
||||
QUndoCommand(parent),
|
||||
m_view(view),
|
||||
m_oldcomment(oldcomment),
|
||||
m_comment(comment),
|
||||
m_oldPos(oldPos),
|
||||
m_pos(pos),
|
||||
m_doIt(doIt)
|
||||
EditGuideCommand::EditGuideCommand(CustomTrackView *view, const GenTime &oldPos, const QString &oldcomment, const GenTime &pos, const QString &comment, bool doIt, QUndoCommand * parent) :
|
||||
QUndoCommand(parent),
|
||||
m_view(view),
|
||||
m_oldcomment(oldcomment),
|
||||
m_comment(comment),
|
||||
m_oldPos(oldPos),
|
||||
m_pos(pos),
|
||||
m_doIt(doIt)
|
||||
{
|
||||
if (m_oldcomment.isEmpty()) {
|
||||
setText(i18n("Add guide"));
|
||||
m_oldPos = GenTime(-1);
|
||||
setText(i18n("Add guide"));
|
||||
m_oldPos = GenTime(-1);
|
||||
}
|
||||
else if (m_oldPos == m_pos) setText(i18n("Edit guide"));
|
||||
else if (m_pos < GenTime() && m_comment.isEmpty()) setText(i18n("Delete guide"));
|
||||
else setText(i18n("Move guide"));
|
||||
else if (m_oldPos == m_pos)
|
||||
setText(i18n("Edit guide"));
|
||||
else if (m_pos < GenTime() && m_comment.isEmpty())
|
||||
setText(i18n("Delete guide"));
|
||||
else
|
||||
setText(i18n("Move guide"));
|
||||
}
|
||||
|
||||
|
||||
// virtual
|
||||
void EditGuideCommand::undo()
|
||||
{
|
||||
|
||||
@@ -19,10 +19,6 @@
|
||||
#define GUIDECOMMAND_H
|
||||
|
||||
#include <QUndoCommand>
|
||||
#include <QGraphicsView>
|
||||
#include <QPointF>
|
||||
#include <QDomElement>
|
||||
#include <KDebug>
|
||||
|
||||
#include "gentime.h"
|
||||
#include "definitions.h"
|
||||
@@ -32,9 +28,9 @@ class CustomTrackView;
|
||||
class EditGuideCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
EditGuideCommand(CustomTrackView *view, const GenTime oldPos, const QString &oldcomment, const GenTime pos, const QString &comment, bool doIt, QUndoCommand * parent = 0);
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
EditGuideCommand(CustomTrackView *view, const GenTime &oldPos, const QString &oldcomment, const GenTime &pos, const QString &comment, bool doIt, QUndoCommand * parent = 0);
|
||||
void undo();
|
||||
void redo();
|
||||
|
||||
private:
|
||||
CustomTrackView *m_view;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user