mirror of
https://invent.kde.org/multimedia/kdenlive
synced 2025-12-06 16:29:58 +01:00
Compare commits
267 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f0072e81e | ||
|
|
1209aa73f6 | ||
|
|
022bd7997c | ||
|
|
fdd7c8009e | ||
|
|
9cbc0bee24 | ||
|
|
83ec01298c | ||
|
|
eae5b982e1 | ||
|
|
1dd98a7192 | ||
|
|
00779bb588 | ||
|
|
bfbfd81fd8 | ||
|
|
193e2ef6b8 | ||
|
|
c59d91bd42 | ||
|
|
2d0ecef61f | ||
|
|
537e37a167 | ||
|
|
336e36b6e9 | ||
|
|
c3508f3e9c | ||
|
|
5a5914957e | ||
|
|
3c9669bae8 | ||
|
|
dbcf08fcce | ||
|
|
23c57780f7 | ||
|
|
513ed94084 | ||
|
|
3f52582763 | ||
|
|
8ca0eed20d | ||
|
|
b35e1a3dba | ||
|
|
01c741d54f | ||
|
|
1b81912437 | ||
|
|
c50a0a2041 | ||
|
|
73e88501a8 | ||
|
|
fee0b75196 | ||
|
|
2d345d27d2 | ||
|
|
33fe961d18 | ||
|
|
4d45d7ad45 | ||
|
|
34353faca5 | ||
|
|
8592b9b6ae | ||
|
|
0ff236168b | ||
|
|
a387d600f8 | ||
|
|
7173aa98d8 | ||
|
|
bcf08c498f | ||
|
|
eac1b3327b | ||
|
|
b67d828f7e | ||
|
|
fd20099d8c | ||
|
|
1a606184fc | ||
|
|
7772670696 | ||
|
|
2d112ee988 | ||
|
|
2a124c65bd | ||
|
|
7779799363 | ||
|
|
60080ee350 | ||
|
|
d0f65b8150 | ||
|
|
e29a82b194 | ||
|
|
e6e33563c2 | ||
|
|
678e5dcf4e | ||
|
|
eec276a118 | ||
|
|
afe7756540 | ||
|
|
6674bfdc17 | ||
|
|
289fc73853 | ||
|
|
eb06619a0a | ||
|
|
a75037c6a1 | ||
|
|
793e8d2bbb | ||
|
|
76ea18353d | ||
|
|
e7dc0a1b1e | ||
|
|
a4fa666c8a | ||
|
|
e29c652911 | ||
|
|
6d7549d66e | ||
|
|
45e05743ec | ||
|
|
99f57e63b9 | ||
|
|
2914c46076 | ||
|
|
9a6ceaf6e8 | ||
|
|
adb49a05e6 | ||
|
|
ca2c886d9c | ||
|
|
b5f15b5511 | ||
|
|
f79ea4599e | ||
|
|
cf1c2d258e | ||
|
|
513a2ac48f | ||
|
|
61338f46e0 | ||
|
|
86573f5af7 | ||
|
|
f7e5022a6c | ||
|
|
571306d08f | ||
|
|
0a09501e0c | ||
|
|
7f33dc7172 | ||
|
|
a7bf8b62a6 | ||
|
|
9f99f99144 | ||
|
|
5fd529c9d1 | ||
|
|
98af63466c | ||
|
|
26b741520f | ||
|
|
966f5b5631 | ||
|
|
f7e377c7d1 | ||
|
|
a26ff7a60e | ||
|
|
3b9ad419df | ||
|
|
f3b1d93fb4 | ||
|
|
810073d69e | ||
|
|
b9dbc28d11 | ||
|
|
603b5a8542 | ||
|
|
a34e364e31 | ||
|
|
05f20eda70 | ||
|
|
23f7586ada | ||
|
|
d969e21a43 | ||
|
|
b8c84bfc3a | ||
|
|
37e4286e80 | ||
|
|
1981be1b0a | ||
|
|
5f071d35e3 | ||
|
|
5f4485e01b | ||
|
|
2eb09035ea | ||
|
|
5c2ad19df0 | ||
|
|
a76b021066 | ||
|
|
3e33dd74fd | ||
|
|
cb1c225356 | ||
|
|
242b34a2e1 | ||
|
|
2c77d2db7e | ||
|
|
e7e8e21ba3 | ||
|
|
b1d191ee26 | ||
|
|
8b8f66a146 | ||
|
|
638515b2f6 | ||
|
|
63eb21e781 | ||
|
|
d243276781 | ||
|
|
6f2a8ed39e | ||
|
|
ca829270a3 | ||
|
|
a67e13aa59 | ||
|
|
28218f3054 | ||
|
|
68f5ff3168 | ||
|
|
7e99d96c22 | ||
|
|
5f3bb4eeb8 | ||
|
|
31001d60c9 | ||
|
|
18796c1016 | ||
|
|
65be8a5a31 | ||
|
|
5e2cb0f4e6 | ||
|
|
f22f080db6 | ||
|
|
0415de1eed | ||
|
|
c89f6b3879 | ||
|
|
5bb198126e | ||
|
|
38628dd8a1 | ||
|
|
2747a209dc | ||
|
|
519dce4464 | ||
|
|
8ed5bce13f | ||
|
|
629b0cb6de | ||
|
|
45b0b4dc6c | ||
|
|
0478cf276a | ||
|
|
f3bca8009f | ||
|
|
08614d7be6 | ||
|
|
74d4a56cea | ||
|
|
b4cd8e5882 | ||
|
|
96d873bb2b | ||
|
|
8ca44cc603 | ||
|
|
4dd620b9c3 | ||
|
|
910e49c805 | ||
|
|
0097caf273 | ||
|
|
f2e2aa0b76 | ||
|
|
f663bdd328 | ||
|
|
ab3b5e2ca7 | ||
|
|
2af433083b | ||
|
|
bf992aef55 | ||
|
|
b378528894 | ||
|
|
dca8b03ba3 | ||
|
|
142e3e41d6 | ||
|
|
a01e37d60c | ||
|
|
5eaf1c602a | ||
|
|
f7573287d1 | ||
|
|
5948ee0151 | ||
|
|
b4633f1d6b | ||
|
|
fe5586ec6d | ||
|
|
31012828bb | ||
|
|
7c9855c7b5 | ||
|
|
952681475b | ||
|
|
10d1c827c1 | ||
|
|
066d37fc43 | ||
|
|
1efbcfc92a | ||
|
|
2e654bcec3 | ||
|
|
06a8be51bc | ||
|
|
ce50b7deb5 | ||
|
|
ffd37b37a2 | ||
|
|
32813818d1 | ||
|
|
81e7614799 | ||
|
|
256767b764 | ||
|
|
e467a6a777 | ||
|
|
b67fb9481a | ||
|
|
c6b1beff20 | ||
|
|
8c96562a49 | ||
|
|
c030d42f97 | ||
|
|
6e93ff5fe7 | ||
|
|
029d2db59a | ||
|
|
95c1b91921 | ||
|
|
ed31bc0d0d | ||
|
|
fc8ccb61a4 | ||
|
|
a121e94dd9 | ||
|
|
6c8b8a6e03 | ||
|
|
f43ef86a0f | ||
|
|
2abbfe2ef0 | ||
|
|
0438a0682c | ||
|
|
12cd43cfd4 | ||
|
|
8afe094faa | ||
|
|
c3cc3abc21 | ||
|
|
e5752ab314 | ||
|
|
a84ecc52ea | ||
|
|
1ddbf38fad | ||
|
|
88fab6e0fd | ||
|
|
8c55aa37ab | ||
|
|
2dd1db6676 | ||
|
|
bc55890a55 | ||
|
|
ed37f7bad2 | ||
|
|
39465e1126 | ||
|
|
cabd83dcf4 | ||
|
|
79634a597c | ||
|
|
d06b38d7e6 | ||
|
|
f50634a4de | ||
|
|
a44e4ced83 | ||
|
|
0088750869 | ||
|
|
bc95cc02c1 | ||
|
|
aa58692458 | ||
|
|
77b5c4becd | ||
|
|
bea3e057f8 | ||
|
|
3701617d75 | ||
|
|
b3ee29e687 | ||
|
|
9256029a01 | ||
|
|
cfedab39f0 | ||
|
|
43dcc8bcec | ||
|
|
2e19960808 | ||
|
|
456efd6445 | ||
|
|
fe9248af58 | ||
|
|
28406cbc78 | ||
|
|
fde4c3affb | ||
|
|
382b731ef8 | ||
|
|
bc24dd0547 | ||
|
|
3c9c2762bc | ||
|
|
798becb879 | ||
|
|
00118ecfed | ||
|
|
3e0341727e | ||
|
|
195ea6b6ef | ||
|
|
3ac7926509 | ||
|
|
e687ac0352 | ||
|
|
a0d3941b85 | ||
|
|
0ec4289e12 | ||
|
|
61c33cd043 | ||
|
|
62fc36de3a | ||
|
|
599909d0e4 | ||
|
|
1cb68ab635 | ||
|
|
5937575100 | ||
|
|
e5e694dff0 | ||
|
|
d850307c9a | ||
|
|
4f4107b7ed | ||
|
|
50451496ba | ||
|
|
9b72f1df9f | ||
|
|
10246b5d17 | ||
|
|
b3ef3d6bba | ||
|
|
20dce6e949 | ||
|
|
ffaffc8d31 | ||
|
|
10ad1edcda | ||
|
|
77d8cca359 | ||
|
|
4db534e109 | ||
|
|
5257097d15 | ||
|
|
eb19dab9a3 | ||
|
|
81ffc86247 | ||
|
|
0021e7d518 | ||
|
|
6b24f25d50 | ||
|
|
6b9c3cb660 | ||
|
|
09efe0bca0 | ||
|
|
fc88c34243 | ||
|
|
37b8773983 | ||
|
|
4fa2235ac5 | ||
|
|
a010eb0e39 | ||
|
|
c5b60ba999 | ||
|
|
cde2d7e3db | ||
|
|
65d0c1f96a | ||
|
|
6fbcf1b7dd | ||
|
|
4c60e68058 | ||
|
|
b1f3c36559 | ||
|
|
97571645de | ||
|
|
051ddbf0d5 | ||
|
|
419d8e22c7 |
@@ -1,47 +1,48 @@
|
||||
project(kdenlive)
|
||||
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(MLT_MIN_MAJOR_VERSION 0)
|
||||
set(MLT_MIN_MINOR_VERSION 8)
|
||||
set(MLT_MIN_PATCH_VERSION 8)
|
||||
set(MLT_MIN_VERSION ${MLT_MIN_MAJOR_VERSION}.${MLT_MIN_MINOR_VERSION}.${MLT_MIN_PATCH_VERSION})
|
||||
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}\"")
|
||||
if(NOT RELEASE_BUILD)
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/.git)
|
||||
# Probably a Git workspace: determine the revision.
|
||||
find_package(Git)
|
||||
if(GIT_FOUND)
|
||||
set(KDENLIVE_VERSION_STRING "${KDENLIVE_VERSION}")
|
||||
if(NOT RELEASE_BUILD AND EXISTS ${CMAKE_SOURCE_DIR}/.git)
|
||||
# Probably a Git workspace; determine the revision.
|
||||
find_package(Git QUIET)
|
||||
if(GIT_FOUND)
|
||||
exec_program(${GIT_EXECUTABLE}
|
||||
${CMAKE_SOURCE_DIR}
|
||||
ARGS "describe --tags"
|
||||
OUTPUT_VARIABLE KDENLIVE_GIT_REVISION
|
||||
RETURN_VALUE TAG_RESULT
|
||||
)
|
||||
# git describe --tags failed; maybe the repository was checked with depth=1.
|
||||
if(NOT ${TAG_RESULT} EQUAL 0)
|
||||
exec_program(${GIT_EXECUTABLE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
ARGS "describe --tags"
|
||||
${CMAKE_SOURCE_DIR}
|
||||
ARGS "describe --always"
|
||||
OUTPUT_VARIABLE KDENLIVE_GIT_REVISION
|
||||
RETURN_VALUE TAG_RESULT
|
||||
)
|
||||
# git describe --tags failed, for example it fails if repo was checked with depth=1
|
||||
if(NOT ${TAG_RESULT} EQUAL 0)
|
||||
exec_program(${GIT_EXECUTABLE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
ARGS "describe --always"
|
||||
OUTPUT_VARIABLE KDENLIVE_GIT_REVISION
|
||||
)
|
||||
endif(NOT ${TAG_RESULT} EQUAL 0)
|
||||
message("Current Kdenlive Git revision is ${KDENLIVE_GIT_REVISION}")
|
||||
set(VERSION "\"${KDENLIVE_VERSION} (rev. ${KDENLIVE_GIT_REVISION})\"")
|
||||
else(GIT_FOUND)
|
||||
message("Could not determine the Git revision")
|
||||
endif(GIT_FOUND)
|
||||
endif(EXISTS ${PROJECT_SOURCE_DIR}/.git)
|
||||
endif(NOT RELEASE_BUILD)
|
||||
endif()
|
||||
message(STATUS "Kdenlive Git revision: ${KDENLIVE_GIT_REVISION}")
|
||||
set(KDENLIVE_VERSION_STRING "${KDENLIVE_VERSION} (rev. ${KDENLIVE_GIT_REVISION})")
|
||||
else()
|
||||
message(STATUS "Kdenlive Git revision could not be determined")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(CheckIncludeFiles)
|
||||
check_include_files(malloc.h HAVE_MALLOC_H)
|
||||
@@ -63,17 +64,15 @@ macro_log_feature(KDE4_FOUND
|
||||
find_package(Qt4 ${QT_MIN_VERSION} REQUIRED)
|
||||
|
||||
# Search MLT package.
|
||||
find_package(LIBMLT ${LIBMLT_MIN_VERSION} REQUIRED)
|
||||
if(LIBMLT_VERSION VERSION_LESS ${LIBMLT_MIN_VERSION})
|
||||
set(LIBMLT_FOUND FALSE)
|
||||
endif(LIBMLT_VERSION VERSION_LESS ${LIBMLT_MIN_VERSION})
|
||||
macro_log_feature(LIBMLT_FOUND
|
||||
find_package(MLT ${MLT_MIN_VERSION} REQUIRED)
|
||||
macro_log_feature(MLT_FOUND
|
||||
"MLT"
|
||||
"Multimedia framework and video playout server for TV broadcasting"
|
||||
"http://mltframework.org"
|
||||
TRUE
|
||||
${LIBMLT_MIN_VERSION}
|
||||
${MLT_MIN_VERSION}
|
||||
)
|
||||
set(MLT_PREFIX ${MLT_ROOT_DIR})
|
||||
|
||||
add_subdirectory(data)
|
||||
macro_optional_add_subdirectory(doc)
|
||||
|
||||
41
ChangeLog
41
ChangeLog
@@ -1,3 +1,44 @@
|
||||
0.9.7
|
||||
* Add support for a custom suffix for FFmpeg binaries (mostly for packagers)
|
||||
|
||||
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)
|
||||
|
||||
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.
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
#
|
||||
# Find the MLT includes and libraries.
|
||||
#
|
||||
|
||||
include(FindPkgConfig)
|
||||
pkg_check_modules(MLT mlt++)
|
||||
add_definitions(-DMLT_PREFIX=\\\"\"${MLT_PREFIX}\"\\\")
|
||||
|
||||
find_path(LIBMLT_INCLUDE_DIR
|
||||
NAMES framework/mlt.h
|
||||
PATHS
|
||||
${MLT_INCLUDEDIR}/mlt
|
||||
${MLT_PREFIX}/include/mlt
|
||||
/usr/local/include/mlt
|
||||
/usr/include/mlt
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
find_library(LIBMLT_LIBRARY
|
||||
NAMES mlt
|
||||
PATHS
|
||||
${MLT_LIBDIR}
|
||||
${MLT_PREFIX}/lib
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
find_path(LIBMLTPLUS_INCLUDE_DIR
|
||||
NAMES mlt++/Mlt.h
|
||||
PATHS
|
||||
${MLT_INCLUDEDIR}
|
||||
${MLT_PREFIX}/include
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
find_library(LIBMLTPLUS_LIBRARY
|
||||
NAMES mlt++
|
||||
PATHS
|
||||
${MLT_LIBDIR}
|
||||
${MLT_PREFIX}/lib
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
if(LIBMLT_LIBRARY AND LIBMLT_INCLUDE_DIR)
|
||||
set(LIBMLT_FOUND 1)
|
||||
set(LIBMLT_LIBRARIES ${LIBMLT_LIBRARY})
|
||||
else(LIBMLT_LIBRARY AND LIBMLT_INCLUDE_DIR)
|
||||
set(LIBMLT_FOUND 0)
|
||||
endif(LIBMLT_LIBRARY AND LIBMLT_INCLUDE_DIR)
|
||||
|
||||
if(LIBMLT_FOUND AND LIBMLTPLUS_LIBRARY AND LIBMLTPLUS_INCLUDE_DIR)
|
||||
set(LIBMLT_FOUND 1)
|
||||
set(LIBMLTPLUS_LIBRARIES ${LIBMLTPLUS_LIBRARY})
|
||||
else(LIBMLT_FOUND AND LIBMLTPLUS_LIBRARY AND LIBMLTPLUS_INCLUDE_DIR)
|
||||
set(LIBMLT_FOUND 0)
|
||||
endif(LIBMLT_FOUND AND LIBMLTPLUS_LIBRARY AND LIBMLTPLUS_INCLUDE_DIR)
|
||||
|
||||
if(LIBMLT_FOUND)
|
||||
set(LIBMLT_VERSION ${MLT_VERSION})
|
||||
if(NOT LIBMLT_FIND_QUIETLY)
|
||||
message(STATUS "Found MLT++: ${LIBMLTPLUS_LIBRARY}")
|
||||
endif(NOT LIBMLT_FIND_QUIETLY)
|
||||
else(LIBMLT_FOUND)
|
||||
if(LIBMLT_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find MLT++")
|
||||
endif(LIBMLT_FIND_REQUIRED)
|
||||
endif(LIBMLT_FOUND)
|
||||
59
cmake/modules/FindMLT.cmake
Normal file
59
cmake/modules/FindMLT.cmake
Normal file
@@ -0,0 +1,59 @@
|
||||
# - Find the MLT includes and libraries
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_MLT QUIET mlt++)
|
||||
|
||||
find_path(MLT_INCLUDE_DIR
|
||||
NAMES framework/mlt.h
|
||||
HINTS
|
||||
${PC_MLT_INCLUDEDIR}
|
||||
${PC_MLT_PREFIX}/include
|
||||
PATHS
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
PATH_SUFFIXES mlt
|
||||
)
|
||||
|
||||
find_library(MLT_LIBRARIES
|
||||
NAMES mlt
|
||||
HINTS
|
||||
${PC_MLT_LIBDIR}
|
||||
${PC_MLT_PREFIX}/lib
|
||||
PATHS
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
)
|
||||
|
||||
find_path(MLTPP_INCLUDE_DIR
|
||||
NAMES mlt++/Mlt.h
|
||||
HINTS
|
||||
${PC_MLT_INCLUDEDIR}
|
||||
${PC_MLT_PREFIX}/include
|
||||
PATHS
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
)
|
||||
|
||||
find_library(MLTPP_LIBRARIES
|
||||
NAMES mlt++
|
||||
HINTS
|
||||
${PC_MLT_LIBDIR}
|
||||
${PC_MLT_PREFIX}/lib
|
||||
PATHS
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
)
|
||||
|
||||
get_filename_component(MLT_ROOT_DIR ${MLTPP_INCLUDE_DIR} PATH)
|
||||
|
||||
if(PC_MLT_VERSION)
|
||||
set(MLT_VERSION_STRING ${PC_MLT_VERSION})
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(MLT
|
||||
REQUIRED_VARS MLT_LIBRARIES MLTPP_LIBRARIES MLT_INCLUDE_DIR MLTPP_INCLUDE_DIR
|
||||
VERSION_VAR MLT_VERSION_STRING
|
||||
)
|
||||
|
||||
mark_as_advanced(MLT_INCLUDE_DIR MLT_LIBRARIES MLTPP_INCLUDE_DIR MLTPP_LIBRARIES)
|
||||
@@ -1,7 +1,14 @@
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#cmakedefine VERSION @VERSION@
|
||||
#define KDENLIVE_VERSION "@KDENLIVE_VERSION_STRING@"
|
||||
|
||||
#define MLT_PREFIX "@MLT_PREFIX@"
|
||||
#define MLT_MIN_MAJOR_VERSION @MLT_MIN_MAJOR_VERSION@
|
||||
#define MLT_MIN_MINOR_VERSION @MLT_MIN_MINOR_VERSION@
|
||||
#define MLT_MIN_PATCH_VERSION @MLT_MIN_PATCH_VERSION@
|
||||
|
||||
#define FFMPEG_SUFFIX "@FFMPEG_SUFFIX@"
|
||||
|
||||
#cmakedefine HAVE_MALLOC_H 1
|
||||
#cmakedefine HAVE_PTHREAD_H 1
|
||||
|
||||
@@ -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
|
||||
|
||||
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">
|
||||
|
||||
@@ -54,7 +54,9 @@
|
||||
</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"
|
||||
<profile name="MPEG-4/AAC" 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=aac ab=%audiobitrate+'k' ar=44100 vcodec=mpeg4 minrate=0 vb=%bitrate+'k' aspect=%dar mbd=2 trellis=1 mv4=1 pass=%passes" />
|
||||
<profile name="MPEG-4/MP3" 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>
|
||||
|
||||
@@ -90,7 +92,7 @@
|
||||
</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"
|
||||
<profile name="WebM" bitrates="200,400,600,800,1000,2000,4000,6000,8000,10000,12000,18000,25000" 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>
|
||||
|
||||
|
||||
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
@@ -32,7 +32,7 @@
|
||||
#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");
|
||||
@@ -57,11 +57,11 @@ KUrl SamplePlugin::generatedClip(const QString &renderer, const QString &generat
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -73,47 +73,47 @@ KUrl SamplePlugin::generatedClip(const QString &renderer, const QString &generat
|
||||
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("MLT_NO_VDPAU", "1");
|
||||
generatorProcess.setProcessEnvironment(env);
|
||||
#else
|
||||
QStringList env = QProcess::systemEnvironment();
|
||||
env << "MLT_NO_VDPAU=1";
|
||||
generatorProcess.setEnvironment(env);
|
||||
QStringList env = QProcess::systemEnvironment();
|
||||
env << "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 << "noise:" << "in=0" << QString("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 << 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);
|
||||
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 = 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 = generatorProcess.readAllStandardError();
|
||||
KMessageBox::sorry(kapp->activeWindow(), i18n("Failed to generate clip:\n%1", error, i18n("Generator Failed")));
|
||||
}
|
||||
}
|
||||
delete d;
|
||||
@@ -121,3 +121,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);
|
||||
};
|
||||
|
||||
|
||||
@@ -69,11 +69,12 @@ int main(int argc, char **argv)
|
||||
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("consumer:");
|
||||
QUrl desturl = QUrl::fromEncoded(args.takeFirst().toUtf8());
|
||||
QString dest = desturl.path();
|
||||
bool dualpass = false;
|
||||
@@ -99,6 +100,14 @@ int main(int argc, char **argv)
|
||||
args.removeAll("pass=1");
|
||||
doerase = erase;
|
||||
}
|
||||
|
||||
// Decode metadata
|
||||
for (int i = 0; i < args.count(); ++i) {
|
||||
if (args.at(i).startsWith("meta.attr")) {
|
||||
QString data = args.at(i);
|
||||
args.replace(i, data.section('=', 0, 0) + "=\"" + QUrl::fromPercentEncoding(data.section('=', 1).toUtf8()) + "\"");
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
class SleepThread : QThread
|
||||
{
|
||||
public:
|
||||
virtual void run() {};
|
||||
virtual void run() {}
|
||||
static void msleep(unsigned long msecs) {
|
||||
QThread::msleep(msecs);
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
@@ -302,8 +302,8 @@ void RenderJob::initKdenliveDbusInterface()
|
||||
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&)));
|
||||
connect(m_kdenliveinterface, SIGNAL(abortRenderJob(QString)),
|
||||
this, SLOT(slotAbort(QString)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,20 +11,19 @@ endif(APPLE)
|
||||
macro_optional_find_package(Nepomuk)
|
||||
macro_optional_find_package(QJSON)
|
||||
|
||||
option(WITH_V4L "Build capture support with Video4Linux" ON)
|
||||
option(WITH_JogShuttle "Build Jog/Shuttle support" ON)
|
||||
|
||||
set(FFMPEG_SUFFIX "" CACHE STRING "FFmpeg custom suffix")
|
||||
|
||||
|
||||
if(WITH_V4L)
|
||||
# This can be changed to support FreeBSD as soon as we move to a newer V4L2
|
||||
# header.
|
||||
find_package(LibV4L2)
|
||||
macro_log_feature(LIBV4L2_FOUND "libv4l" "Collection of video4linux support libraries" "http://hansdegoede.livejournal.com, http://linuxtv.org/hg/~hgoede/libv4l/" FALSE "" "Required for better webcam support")
|
||||
if(LIBV4L2_FOUND)
|
||||
set(BUILD_V4L TRUE)
|
||||
endif(LIBV4L2_FOUND)
|
||||
endif(WITH_V4L)
|
||||
macro_optional_find_package(LibV4L2)
|
||||
macro_log_feature(LIBV4L2_FOUND
|
||||
"libv4l"
|
||||
"Collection of video4linux support libraries"
|
||||
"http://freecode.com/projects/libv4l"
|
||||
FALSE
|
||||
""
|
||||
"Required for better webcam support"
|
||||
)
|
||||
|
||||
if(WITH_JogShuttle)
|
||||
check_include_files(linux/input.h HAVE_LINUX_INPUT_H)
|
||||
@@ -66,6 +65,9 @@ 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"
|
||||
@@ -75,7 +77,6 @@ macro_log_feature(QJSON_FOUND
|
||||
"Required to build the rotoscoping filter and for Freesound.org queries"
|
||||
)
|
||||
|
||||
|
||||
add_subdirectory(beziercurve)
|
||||
add_subdirectory(colorcorrection)
|
||||
add_subdirectory(commands)
|
||||
@@ -95,9 +96,9 @@ if(QJSON_FOUND)
|
||||
add_subdirectory(rotoscoping)
|
||||
endif(QJSON_FOUND)
|
||||
|
||||
if(BUILD_V4L)
|
||||
if(LIBV4L2_FOUND)
|
||||
add_subdirectory(v4l)
|
||||
endif(BUILD_V4L)
|
||||
endif()
|
||||
|
||||
list(APPEND kdenlive_SRCS
|
||||
main.cpp
|
||||
@@ -249,7 +250,7 @@ kde4_add_ui_files(kdenlive_UIS
|
||||
widgets/trackheader_ui.ui
|
||||
widgets/tracksconfigdialog_ui.ui
|
||||
widgets/transitionsettings_ui.ui
|
||||
widgets/unicodedialog_ui.ui
|
||||
widgets/unicodewidget_ui.ui
|
||||
widgets/urlval_ui.ui
|
||||
widgets/vectorscope_ui.ui
|
||||
widgets/waveform_ui.ui
|
||||
@@ -301,11 +302,10 @@ add_definitions(${KDE4_DEFINITIONS})
|
||||
include_directories(
|
||||
${CMAKE_BINARY_DIR}
|
||||
${KDE4_INCLUDES} # Adds Qt include directories too.
|
||||
${LIBMLT_INCLUDE_DIR}
|
||||
${LIBMLTPLUS_INCLUDE_DIR}
|
||||
${MLT_INCLUDE_DIR}
|
||||
${MLTPP_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
|
||||
# Adds Qt definitions and include directories, and sets QT_LIBRARIES according
|
||||
# to the components requested in find_package().
|
||||
include(${QT_USE_FILE})
|
||||
@@ -324,8 +324,8 @@ target_link_libraries(kdenlive
|
||||
${KDE4_KROSSUI_LIBS}
|
||||
${KDE4_SOLID_LIBS}
|
||||
${QT_LIBRARIES}
|
||||
${LIBMLT_LIBRARY}
|
||||
${LIBMLTPLUS_LIBRARY}
|
||||
${MLT_LIBRARIES}
|
||||
${MLTPP_LIBRARIES}
|
||||
${CMAKE_DL_LIBS}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
)
|
||||
@@ -344,11 +344,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(NepomukWidgets_FOUND)
|
||||
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)
|
||||
@@ -356,11 +362,11 @@ if(QJSON_FOUND)
|
||||
target_link_libraries(kdenlive ${QJSON_LIBRARIES})
|
||||
endif(QJSON_FOUND)
|
||||
|
||||
if(BUILD_V4L)
|
||||
if(LIBV4L2_FOUND)
|
||||
include_directories(${LIBV4L2_INCLUDE_DIR})
|
||||
target_link_libraries(kdenlive ${LIBV4L2_LIBRARY})
|
||||
target_link_libraries(kdenlive ${LIBV4L2_LIBRARY})
|
||||
add_definitions(-DUSE_V4L)
|
||||
endif(BUILD_V4L)
|
||||
endif()
|
||||
|
||||
if(BUILD_JogShuttle)
|
||||
add_definitions(-DUSE_JOGSHUTTLE)
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
*
|
||||
* @param parent parent QWidget
|
||||
*/
|
||||
KoSliderCombo(QWidget *parent = 0);
|
||||
explicit KoSliderCombo(QWidget *parent = 0);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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) {
|
||||
@@ -446,6 +449,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 +547,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);
|
||||
@@ -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,21 +92,26 @@ CustomTrackScene* AbstractGroupItem::projectScene()
|
||||
return NULL;
|
||||
}
|
||||
|
||||
QPainterPath AbstractGroupItem::clipGroupShape(QPointF offset) const
|
||||
QPainterPath AbstractGroupItem::clipGroupSpacerShape(const QPointF &offset) const
|
||||
{
|
||||
return spacerGroupShape(AVWIDGET, offset);
|
||||
}
|
||||
|
||||
QPainterPath AbstractGroupItem::clipGroupShape(const QPointF &offset) const
|
||||
{
|
||||
return groupShape(AVWIDGET, offset);
|
||||
}
|
||||
|
||||
QPainterPath AbstractGroupItem::transitionGroupShape(QPointF offset) const
|
||||
QPainterPath AbstractGroupItem::transitionGroupShape(const QPointF &offset) const
|
||||
{
|
||||
return groupShape(TRANSITIONWIDGET, offset);
|
||||
}
|
||||
|
||||
QPainterPath AbstractGroupItem::groupShape(GRAPHICSRECTITEM type, QPointF offset) const
|
||||
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);
|
||||
@@ -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,25 +212,25 @@ 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 || 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;
|
||||
@@ -216,8 +246,8 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
|
||||
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);
|
||||
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;
|
||||
|
||||
@@ -266,7 +296,7 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
|
||||
shape = clipGroupShape(newPos - pos());
|
||||
collidingItems = scene()->items(shape, Qt::IntersectsItemShape);
|
||||
collidingItems.removeAll(this);
|
||||
for (int i = 0; i < children.count(); i++) {
|
||||
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++) {
|
||||
@@ -279,7 +309,7 @@ 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) {
|
||||
// Collision
|
||||
@@ -312,7 +342,7 @@ 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++) {
|
||||
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++) {
|
||||
@@ -321,7 +351,7 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
|
||||
}
|
||||
collidingItems.removeAll(children.at(i));
|
||||
}
|
||||
for (int i = 0; i < collidingItems.count(); i++)
|
||||
for (int i = 0; i < collidingItems.count(); ++i)
|
||||
if (collidingItems.at(i)->type() == AVWIDGET) return pos();
|
||||
}
|
||||
}
|
||||
@@ -330,7 +360,7 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
|
||||
shape = transitionGroupShape(newPos - pos());
|
||||
collidingItems = scene()->items(shape, Qt::IntersectsItemShape);
|
||||
collidingItems.removeAll(this);
|
||||
for (int i = 0; i < children.count(); i++) {
|
||||
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++) {
|
||||
@@ -344,7 +374,7 @@ 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) {
|
||||
// Collision
|
||||
@@ -376,10 +406,10 @@ 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++)
|
||||
for (int i = 0; i < collidingItems.count(); ++i)
|
||||
if (collidingItems.at(i)->type() == TRANSITIONWIDGET) return pos();
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -41,8 +41,7 @@ AbstractMonitor::AbstractMonitor(Kdenlive::MONITORID id, MonitorManager *manager
|
||||
|
||||
AbstractMonitor::~AbstractMonitor()
|
||||
{
|
||||
if (videoSurface)
|
||||
delete videoSurface;
|
||||
delete videoSurface;
|
||||
}
|
||||
|
||||
void AbstractMonitor::createVideoSurface()
|
||||
@@ -180,3 +179,5 @@ void VideoSurface::paintEvent(QPaintEvent *event)
|
||||
emit refreshMonitor();
|
||||
}
|
||||
|
||||
|
||||
#include "abstractmonitor.moc"
|
||||
|
||||
@@ -26,9 +26,7 @@
|
||||
#include <QVector>
|
||||
#include <QWidget>
|
||||
#include <QImage>
|
||||
#include <QPainter>
|
||||
#include <QFrame>
|
||||
#include <QTimer>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -43,10 +41,16 @@ Q_OBJECT public:
|
||||
* @param name A unique identifier for this renderer
|
||||
* @param winid The parent widget identifier (required for SDL display). Set to 0 for OpenGL rendering
|
||||
* @param profile The MLT profile used for the renderer (default one will be used if empty). */
|
||||
explicit AbstractRender(Kdenlive::MONITORID name, QWidget *parent = 0):QObject(parent), sendFrameForAnalysis(false), analyseAudio(false), m_name(name) {};
|
||||
explicit AbstractRender(Kdenlive::MONITORID name, QWidget *parent = 0)
|
||||
: QObject(parent),
|
||||
sendFrameForAnalysis(false),
|
||||
analyseAudio(false),
|
||||
m_name(name)
|
||||
{
|
||||
}
|
||||
|
||||
/** @brief Destroy the MLT Renderer. */
|
||||
virtual ~AbstractRender() {};
|
||||
virtual ~AbstractRender() {}
|
||||
|
||||
/** @brief This property is used to decide if the renderer should convert it's frames to QImage for use in other Kdenlive widgets. */
|
||||
bool sendFrameForAnalysis;
|
||||
@@ -54,7 +58,7 @@ Q_OBJECT public:
|
||||
/** @brief This property is used to decide if the renderer should send audio data for monitoring. */
|
||||
bool analyseAudio;
|
||||
|
||||
const QString &name() const {return m_name;};
|
||||
const QString &name() const {return m_name;}
|
||||
|
||||
/** @brief Someone needs us to send again a frame. */
|
||||
virtual void sendFrameUpdate() = 0;
|
||||
@@ -64,10 +68,10 @@ private:
|
||||
|
||||
signals:
|
||||
/** @brief The renderer refreshed the current frame. */
|
||||
void frameUpdated(QImage);
|
||||
void frameUpdated(const QImage &);
|
||||
|
||||
/** @brief This signal contains the audio of the current frame. */
|
||||
void audioSamplesSignal(QVector<int16_t>,int,int,int);
|
||||
void audioSamplesSignal(const QVector<int16_t>&,int,int,int);
|
||||
};
|
||||
|
||||
|
||||
@@ -91,7 +95,7 @@ class AbstractMonitor : public QWidget
|
||||
Q_OBJECT
|
||||
public:
|
||||
AbstractMonitor(Kdenlive::MONITORID id, MonitorManager *manager, QWidget *parent = 0);
|
||||
Kdenlive::MONITORID id() {return m_id;};
|
||||
Kdenlive::MONITORID id() {return m_id;}
|
||||
virtual ~AbstractMonitor();
|
||||
virtual AbstractRender *abstractRender() = 0;
|
||||
bool isActive() const;
|
||||
|
||||
@@ -41,22 +41,24 @@
|
||||
#include "projectsettings.h"
|
||||
|
||||
|
||||
ArchiveWidget::ArchiveWidget(QString projectName, QDomDocument doc, QList <DocClipBase*> list, QStringList luma_list, QWidget * parent) :
|
||||
QDialog(parent),
|
||||
m_requestedSize(0),
|
||||
m_copyJob(NULL),
|
||||
m_name(projectName.section('.', 0, -2)),
|
||||
m_doc(doc),
|
||||
m_abortArchive(false),
|
||||
m_extractMode(false),
|
||||
m_extractArchive(NULL),
|
||||
m_missingClips(0)
|
||||
ArchiveWidget::ArchiveWidget(const QString &projectName, const QDomDocument &doc, const QList <DocClipBase*> &list, const QStringList &luma_list, QWidget * parent) :
|
||||
QDialog(parent)
|
||||
, m_requestedSize(0)
|
||||
, m_copyJob(NULL)
|
||||
, m_name(projectName.section('.', 0, -2))
|
||||
, m_doc(doc)
|
||||
, m_temp(NULL)
|
||||
, m_abortArchive(false)
|
||||
, m_extractMode(false)
|
||||
, m_progressTimer(NULL)
|
||||
, m_extractArchive(NULL)
|
||||
, m_missingClips(0)
|
||||
{
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
setupUi(this);
|
||||
setWindowTitle(i18n("Archive Project"));
|
||||
archive_url->setUrl(KUrl(QDir::homePath()));
|
||||
connect(archive_url, SIGNAL(textChanged (const QString &)), this, SLOT(slotCheckSpace()));
|
||||
connect(archive_url, SIGNAL(textChanged(QString)), this, SLOT(slotCheckSpace()));
|
||||
connect(this, SIGNAL(archivingFinished(bool)), this, SLOT(slotArchivingFinished(bool)));
|
||||
connect(this, SIGNAL(archiveProgress(int)), this, SLOT(slotArchivingProgress(int)));
|
||||
connect(proxy_only, SIGNAL(stateChanged(int)), this, SLOT(slotProxyOnly(int)));
|
||||
@@ -115,7 +117,7 @@ ArchiveWidget::ArchiveWidget(QString projectName, QDomDocument doc, QList <DocCl
|
||||
QMap <QString, QString>playlistUrls;
|
||||
QMap <QString, QString>proxyUrls;
|
||||
|
||||
for (int i = 0; i < list.count(); i++) {
|
||||
for (int i = 0; i < list.count(); ++i) {
|
||||
DocClipBase *clip = list.at(i);
|
||||
CLIPTYPE t = clip->clipType();
|
||||
QString id = clip->getId();
|
||||
@@ -182,7 +184,7 @@ ArchiveWidget::ArchiveWidget(QString projectName, QDomDocument doc, QList <DocCl
|
||||
|
||||
// Hide unused categories, add item count
|
||||
int total = 0;
|
||||
for (int i = 0; i < files_list->topLevelItemCount(); i++) {
|
||||
for (int i = 0; i < files_list->topLevelItemCount(); ++i) {
|
||||
QTreeWidgetItem *parentItem = files_list->topLevelItem(i);
|
||||
int items = parentItem->childCount();
|
||||
if (items == 0) {
|
||||
@@ -206,7 +208,7 @@ ArchiveWidget::ArchiveWidget(QString projectName, QDomDocument doc, QList <DocCl
|
||||
buttonBox->button(QDialogButtonBox::Apply)->setText(i18n("Archive"));
|
||||
connect(buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), this, SLOT(slotStartArchiving()));
|
||||
buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
|
||||
|
||||
|
||||
slotCheckSpace();
|
||||
}
|
||||
|
||||
@@ -219,8 +221,12 @@ ArchiveWidget::ArchiveWidget(const KUrl &url, QWidget * parent):
|
||||
//setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
setupUi(this);
|
||||
m_progressTimer = new QTimer;
|
||||
m_progressTimer->setInterval(800);
|
||||
m_progressTimer->setSingleShot(false);
|
||||
connect(m_progressTimer, SIGNAL(timeout()), this, SLOT(slotExtractProgress()));
|
||||
connect(this, SIGNAL(extractingFinished()), this, SLOT(slotExtractingFinished()));
|
||||
connect(this, SIGNAL(showMessage(const QString &, const QString &)), this, SLOT(slotDisplayMessage(const QString &, const QString &)));
|
||||
connect(this, SIGNAL(showMessage(QString,QString)), this, SLOT(slotDisplayMessage(QString,QString)));
|
||||
|
||||
compressed_archive->setHidden(true);
|
||||
proxy_only->setHidden(true);
|
||||
@@ -239,7 +245,8 @@ ArchiveWidget::ArchiveWidget(const KUrl &url, QWidget * parent):
|
||||
|
||||
ArchiveWidget::~ArchiveWidget()
|
||||
{
|
||||
if (m_extractArchive) delete m_extractArchive;
|
||||
delete m_extractArchive;
|
||||
delete m_progressTimer;
|
||||
}
|
||||
|
||||
void ArchiveWidget::slotDisplayMessage(const QString &icon, const QString &text)
|
||||
@@ -274,7 +281,7 @@ void ArchiveWidget::openArchiveForExtraction()
|
||||
// Check that it is a kdenlive project archive
|
||||
bool isProjectArchive = false;
|
||||
QStringList files = m_extractArchive->directory()->entries();
|
||||
for (int i = 0; i < files.count(); i++) {
|
||||
for (int i = 0; i < files.count(); ++i) {
|
||||
if (files.at(i).endsWith(".kdenlive")) {
|
||||
m_projectName = files.at(i);
|
||||
isProjectArchive = true;
|
||||
@@ -285,6 +292,7 @@ void ArchiveWidget::openArchiveForExtraction()
|
||||
if (!isProjectArchive) {
|
||||
emit showMessage("dialog-close", i18n("File %1\n is not an archived Kdenlive project", m_extractUrl.path()));
|
||||
groupBox->setEnabled(false);
|
||||
buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
|
||||
return;
|
||||
}
|
||||
buttonBox->button(QDialogButtonBox::Apply)->setEnabled(true);
|
||||
@@ -317,7 +325,7 @@ bool ArchiveWidget::closeAccepted()
|
||||
}
|
||||
|
||||
|
||||
void ArchiveWidget::generateItems(QTreeWidgetItem *parentItem, QStringList items)
|
||||
void ArchiveWidget::generateItems(QTreeWidgetItem *parentItem, const QStringList& items)
|
||||
{
|
||||
QStringList filesList;
|
||||
QString fileName;
|
||||
@@ -335,14 +343,13 @@ void ArchiveWidget::generateItems(QTreeWidgetItem *parentItem, QStringList items
|
||||
if (slideUrl.fileName().startsWith(".all.")) {
|
||||
// mimetype slideshow (for example *.png)
|
||||
QStringList filters;
|
||||
QString extension;
|
||||
// TODO: improve jpeg image detection with extension like jpeg, requires change in MLT image producers
|
||||
filters << "*." + slideUrl.fileName().section('.', -1);
|
||||
dir.setNameFilters(filters);
|
||||
QFileInfoList resultList = dir.entryInfoList(QDir::Files);
|
||||
QStringList slideImages;
|
||||
qint64 totalSize = 0;
|
||||
for (int i = 0; i < resultList.count(); i++) {
|
||||
for (int i = 0; i < resultList.count(); ++i) {
|
||||
totalSize += resultList.at(i).size();
|
||||
slideImages << resultList.at(i).absoluteFilePath();
|
||||
}
|
||||
@@ -399,7 +406,7 @@ void ArchiveWidget::generateItems(QTreeWidgetItem *parentItem, QStringList items
|
||||
}
|
||||
}
|
||||
|
||||
void ArchiveWidget::generateItems(QTreeWidgetItem *parentItem, QMap <QString, QString> items)
|
||||
void ArchiveWidget::generateItems(QTreeWidgetItem *parentItem, const QMap <QString, QString>& items)
|
||||
{
|
||||
QStringList filesList;
|
||||
QString fileName;
|
||||
@@ -421,14 +428,13 @@ void ArchiveWidget::generateItems(QTreeWidgetItem *parentItem, QMap <QString, QS
|
||||
if (slideUrl.fileName().startsWith(".all.")) {
|
||||
// mimetype slideshow (for example *.png)
|
||||
QStringList filters;
|
||||
QString extension;
|
||||
// TODO: improve jpeg image detection with extension like jpeg, requires change in MLT image producers
|
||||
filters << "*." + slideUrl.fileName().section('.', -1);
|
||||
dir.setNameFilters(filters);
|
||||
QFileInfoList resultList = dir.entryInfoList(QDir::Files);
|
||||
QStringList slideImages;
|
||||
qint64 totalSize = 0;
|
||||
for (int i = 0; i < resultList.count(); i++) {
|
||||
for (int i = 0; i < resultList.count(); ++i) {
|
||||
totalSize += resultList.at(i).size();
|
||||
slideImages << resultList.at(i).absoluteFilePath();
|
||||
}
|
||||
@@ -532,7 +538,7 @@ bool ArchiveWidget::slotStartArchiving(bool firstPass)
|
||||
int items = 0;
|
||||
|
||||
// We parse all files going into one folder, then start the copy job
|
||||
for (int i = 0; i < files_list->topLevelItemCount(); i++) {
|
||||
for (int i = 0; i < files_list->topLevelItemCount(); ++i) {
|
||||
parentItem = files_list->topLevelItem(i);
|
||||
if (parentItem->isDisabled()) {
|
||||
parentItem->setExpanded(false);
|
||||
@@ -602,15 +608,15 @@ bool ArchiveWidget::slotStartArchiving(bool firstPass)
|
||||
KUrl startJobDst = i.value();
|
||||
m_duplicateFiles.remove(startJobSrc);
|
||||
KIO::CopyJob *job = KIO::copyAs(startJobSrc, startJobDst, KIO::HideProgressInfo);
|
||||
connect(job, SIGNAL(result(KJob *)), this, SLOT(slotArchivingFinished(KJob *)));
|
||||
connect(job, SIGNAL(processedSize(KJob *, qulonglong)), this, SLOT(slotArchivingProgress(KJob *, qulonglong)));
|
||||
connect(job, SIGNAL(result(KJob*)), this, SLOT(slotArchivingFinished(KJob*)));
|
||||
connect(job, SIGNAL(processedSize(KJob*,qulonglong)), this, SLOT(slotArchivingProgress(KJob*,qulonglong)));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isArchive) {
|
||||
m_foldersList.append(destPath);
|
||||
for (int i = 0; i < files.count(); i++) {
|
||||
for (int i = 0; i < files.count(); ++i) {
|
||||
m_filesList.insert(files.at(i).path(), destPath + files.at(i).fileName());
|
||||
}
|
||||
slotArchivingFinished();
|
||||
@@ -621,8 +627,8 @@ bool ArchiveWidget::slotStartArchiving(bool firstPass)
|
||||
else {
|
||||
KIO::NetAccess::mkdir(destUrl, this);
|
||||
m_copyJob = KIO::copy (files, destUrl, KIO::HideProgressInfo);
|
||||
connect(m_copyJob, SIGNAL(result(KJob *)), this, SLOT(slotArchivingFinished(KJob *)));
|
||||
connect(m_copyJob, SIGNAL(processedSize(KJob *, qulonglong)), this, SLOT(slotArchivingProgress(KJob *, qulonglong)));
|
||||
connect(m_copyJob, SIGNAL(result(KJob*)), this, SLOT(slotArchivingFinished(KJob*)));
|
||||
connect(m_copyJob, SIGNAL(processedSize(KJob*,qulonglong)), this, SLOT(slotArchivingProgress(KJob*,qulonglong)));
|
||||
}
|
||||
if (firstPass) {
|
||||
progressBar->setValue(0);
|
||||
@@ -658,7 +664,7 @@ void ArchiveWidget::slotArchivingFinished(KJob *job, bool finished)
|
||||
archive_url->setEnabled(true);
|
||||
proxy_only->setEnabled(true);
|
||||
compressed_archive->setEnabled(true);
|
||||
for (int i = 0; i < files_list->topLevelItemCount(); i++) {
|
||||
for (int i = 0; i < files_list->topLevelItemCount(); ++i) {
|
||||
files_list->topLevelItem(i)->setDisabled(false);
|
||||
for (int j = 0; j < files_list->topLevelItem(i)->childCount(); j++)
|
||||
files_list->topLevelItem(i)->child(j)->setDisabled(false);
|
||||
@@ -678,7 +684,7 @@ bool ArchiveWidget::processProjectFile()
|
||||
QTreeWidgetItem *item;
|
||||
bool isArchive = compressed_archive->isChecked();
|
||||
|
||||
for (int i = 0; i < files_list->topLevelItemCount(); i++) {
|
||||
for (int i = 0; i < files_list->topLevelItemCount(); ++i) {
|
||||
QTreeWidgetItem *parentItem = files_list->topLevelItem(i);
|
||||
if (parentItem->childCount() > 0) {
|
||||
destUrl = KUrl(archive_url->url().path(KUrl::AddTrailingSlash) + parentItem->data(0, Qt::UserRole).toString());
|
||||
@@ -714,7 +720,7 @@ bool ArchiveWidget::processProjectFile()
|
||||
|
||||
// process kdenlive producers
|
||||
QDomNodeList prods = mlt.elementsByTagName("kdenlive_producer");
|
||||
for (int i = 0; i < prods.count(); i++) {
|
||||
for (int i = 0; i < prods.count(); ++i) {
|
||||
QDomElement e = prods.item(i).toElement();
|
||||
if (e.isNull()) continue;
|
||||
if (e.hasAttribute("resource")) {
|
||||
@@ -731,7 +737,7 @@ bool ArchiveWidget::processProjectFile()
|
||||
|
||||
// process mlt producers
|
||||
prods = mlt.elementsByTagName("producer");
|
||||
for (int i = 0; i < prods.count(); i++) {
|
||||
for (int i = 0; i < prods.count(); ++i) {
|
||||
QDomElement e = prods.item(i).toElement();
|
||||
if (e.isNull()) continue;
|
||||
QString src = EffectsList::property(e, "resource");
|
||||
@@ -746,7 +752,7 @@ bool ArchiveWidget::processProjectFile()
|
||||
// process mlt transitions (for luma files)
|
||||
prods = mlt.elementsByTagName("transition");
|
||||
QString attribute;
|
||||
for (int i = 0; i < prods.count(); i++) {
|
||||
for (int i = 0; i < prods.count(); ++i) {
|
||||
QDomElement e = prods.item(i).toElement();
|
||||
if (e.isNull()) continue;
|
||||
attribute = "resource";
|
||||
@@ -824,9 +830,13 @@ void ArchiveWidget::createArchive()
|
||||
}
|
||||
|
||||
// Add project file
|
||||
archive.addLocalFile(m_temp->fileName(), m_name + ".kdenlive");
|
||||
bool result = archive.close();
|
||||
delete m_temp;
|
||||
bool result = false;
|
||||
if (m_temp) {
|
||||
archive.addLocalFile(m_temp->fileName(), m_name + ".kdenlive");
|
||||
result = archive.close();
|
||||
delete m_temp;
|
||||
m_temp = 0;
|
||||
}
|
||||
emit archivingFinished(result);
|
||||
}
|
||||
|
||||
@@ -844,7 +854,7 @@ void ArchiveWidget::slotArchivingFinished(bool result)
|
||||
archive_url->setEnabled(true);
|
||||
proxy_only->setEnabled(true);
|
||||
compressed_archive->setEnabled(true);
|
||||
for (int i = 0; i < files_list->topLevelItemCount(); i++) {
|
||||
for (int i = 0; i < files_list->topLevelItemCount(); ++i) {
|
||||
files_list->topLevelItem(i)->setDisabled(false);
|
||||
for (int j = 0; j < files_list->topLevelItem(i)->childCount(); j++)
|
||||
files_list->topLevelItem(i)->child(j)->setDisabled(false);
|
||||
@@ -867,10 +877,6 @@ void ArchiveWidget::slotStartExtracting()
|
||||
KIO::NetAccess::mkdir(archive_url->url().path(KUrl::RemoveTrailingSlash), this);
|
||||
slotDisplayMessage("system-run", i18n("Extracting..."));
|
||||
buttonBox->button(QDialogButtonBox::Apply)->setText(i18n("Abort"));
|
||||
m_progressTimer = new QTimer;
|
||||
m_progressTimer->setInterval(800);
|
||||
m_progressTimer->setSingleShot(false);
|
||||
connect(m_progressTimer, SIGNAL(timeout()), this, SLOT(slotExtractProgress()));
|
||||
m_archiveThread = QtConcurrent::run(this, &ArchiveWidget::doExtracting);
|
||||
m_progressTimer->start();
|
||||
}
|
||||
@@ -897,7 +903,7 @@ void ArchiveWidget::doExtracting()
|
||||
emit extractingFinished();
|
||||
}
|
||||
|
||||
QString ArchiveWidget::extractedProjectFile()
|
||||
QString ArchiveWidget::extractedProjectFile() const
|
||||
{
|
||||
return archive_url->url().path(KUrl::AddTrailingSlash) + m_projectName;
|
||||
}
|
||||
@@ -905,7 +911,6 @@ QString ArchiveWidget::extractedProjectFile()
|
||||
void ArchiveWidget::slotExtractingFinished()
|
||||
{
|
||||
m_progressTimer->stop();
|
||||
delete m_progressTimer;
|
||||
// Process project file
|
||||
QFile file(extractedProjectFile());
|
||||
bool error = false;
|
||||
@@ -949,7 +954,7 @@ void ArchiveWidget::slotProxyOnly(int onlyProxy)
|
||||
QTreeWidgetItem *parentItem = NULL;
|
||||
|
||||
// Build list of existing proxy ids
|
||||
for (int i = 0; i < files_list->topLevelItemCount(); i++) {
|
||||
for (int i = 0; i < files_list->topLevelItemCount(); ++i) {
|
||||
parentItem = files_list->topLevelItem(i);
|
||||
if (parentItem->data(0, Qt::UserRole).toString() == "proxy") break;
|
||||
}
|
||||
@@ -960,7 +965,7 @@ void ArchiveWidget::slotProxyOnly(int onlyProxy)
|
||||
}
|
||||
|
||||
// Parse all items to disable original clips for existing proxies
|
||||
for (int i = 0; i < proxyIdList.count(); i++) {
|
||||
for (int i = 0; i < proxyIdList.count(); ++i) {
|
||||
QString id = proxyIdList.at(i);
|
||||
if (id.isEmpty()) continue;
|
||||
for (int j = 0; j < files_list->topLevelItemCount(); j++) {
|
||||
@@ -979,7 +984,7 @@ void ArchiveWidget::slotProxyOnly(int onlyProxy)
|
||||
}
|
||||
else {
|
||||
// Archive all clips
|
||||
for (int i = 0; i < files_list->topLevelItemCount(); i++) {
|
||||
for (int i = 0; i < files_list->topLevelItemCount(); ++i) {
|
||||
QTreeWidgetItem *parentItem = files_list->topLevelItem(i);
|
||||
int items = parentItem->childCount();
|
||||
for (int j = 0; j < items; j++) {
|
||||
@@ -990,7 +995,7 @@ void ArchiveWidget::slotProxyOnly(int onlyProxy)
|
||||
|
||||
// Calculate requested size
|
||||
int total = 0;
|
||||
for (int i = 0; i < files_list->topLevelItemCount(); i++) {
|
||||
for (int i = 0; i < files_list->topLevelItemCount(); ++i) {
|
||||
QTreeWidgetItem *parentItem = files_list->topLevelItem(i);
|
||||
int items = parentItem->childCount();
|
||||
int itemsCount = 0;
|
||||
@@ -1010,3 +1015,5 @@ void ArchiveWidget::slotProxyOnly(int onlyProxy)
|
||||
slotCheckSpace();
|
||||
}
|
||||
|
||||
|
||||
#include "archivewidget.moc"
|
||||
|
||||
@@ -53,12 +53,12 @@ class ArchiveWidget : public QDialog, public Ui::ArchiveWidget_UI
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ArchiveWidget(QString projectName, QDomDocument doc, QList <DocClipBase*> list, QStringList luma_list, QWidget * parent = 0);
|
||||
ArchiveWidget(const QString &projectName, const QDomDocument &doc, const QList <DocClipBase*> &list, const QStringList &luma_list, QWidget * parent = 0);
|
||||
// Constructor for extracting widget
|
||||
explicit ArchiveWidget(const KUrl &url, QWidget * parent = 0);
|
||||
~ArchiveWidget();
|
||||
|
||||
QString extractedProjectFile();
|
||||
QString extractedProjectFile() const;
|
||||
|
||||
private slots:
|
||||
void slotCheckSpace();
|
||||
@@ -107,9 +107,9 @@ private:
|
||||
#endif
|
||||
|
||||
/** @brief Generate tree widget subitems from a string list of urls. */
|
||||
void generateItems(QTreeWidgetItem *parentItem, QStringList items);
|
||||
void generateItems(QTreeWidgetItem *parentItem, const QStringList &items);
|
||||
/** @brief Generate tree widget subitems from a map of clip ids / urls. */
|
||||
void generateItems(QTreeWidgetItem *parentItem, QMap <QString, QString> items);
|
||||
void generateItems(QTreeWidgetItem *parentItem, const QMap<QString, QString> &items);
|
||||
/** @brief Replace urls in project file. */
|
||||
bool processProjectFile();
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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(), (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());
|
||||
}
|
||||
}
|
||||
|
||||
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()));
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
@@ -68,7 +68,7 @@ static QColor stringToColor(QString strColor)
|
||||
return color;
|
||||
}
|
||||
|
||||
static QString colorToString(QColor color, bool alpha)
|
||||
static QString colorToString(const QColor &color, bool alpha)
|
||||
{
|
||||
QString colorStr;
|
||||
QTextStream stream(&colorStr);
|
||||
@@ -78,18 +78,16 @@ static QString colorToString(QColor color, bool alpha)
|
||||
stream.setFieldAlignment(QTextStream::AlignRight);
|
||||
stream.setPadChar('0');
|
||||
stream << color.red() << color.green() << color.blue();
|
||||
if(alpha)
|
||||
{
|
||||
if (alpha) {
|
||||
stream << color.alpha();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// MLT always wants 0xRRGGBBAA format
|
||||
stream << "ff";
|
||||
}
|
||||
return colorStr;
|
||||
}
|
||||
|
||||
ChooseColorWidget::ChooseColorWidget(QString text, QString color, bool alphaEnabled, QWidget *parent) :
|
||||
ChooseColorWidget::ChooseColorWidget(const QString &text, const QString &color, bool alphaEnabled, QWidget *parent) :
|
||||
QWidget(parent)
|
||||
{
|
||||
QHBoxLayout *layout = new QHBoxLayout(this);
|
||||
@@ -116,12 +114,12 @@ ChooseColorWidget::ChooseColorWidget(QString text, QString color, bool alphaEnab
|
||||
rightSideLayout->addWidget(picker, 0, Qt::AlignRight);
|
||||
|
||||
connect(picker, SIGNAL(colorPicked(QColor)), this, SLOT(setColor(QColor)));
|
||||
connect(picker, SIGNAL(displayMessage(const QString&, int)), this, SIGNAL(displayMessage(const QString&, int)));
|
||||
connect(picker, SIGNAL(displayMessage(QString,int)), this, SIGNAL(displayMessage(QString,int)));
|
||||
connect(picker, SIGNAL(disableCurrentFilter(bool)), this, SIGNAL(disableCurrentFilter(bool)));
|
||||
connect(m_button, SIGNAL(changed(QColor)), this, SIGNAL(modified()));
|
||||
}
|
||||
|
||||
QString ChooseColorWidget::getColor()
|
||||
QString ChooseColorWidget::getColor() const
|
||||
{
|
||||
bool alphaChannel = false;
|
||||
#if KDE_IS_VERSION(4,5,0)
|
||||
@@ -130,7 +128,7 @@ QString ChooseColorWidget::getColor()
|
||||
return colorToString(m_button->color(), alphaChannel);
|
||||
}
|
||||
|
||||
void ChooseColorWidget::setColor(QColor color)
|
||||
void ChooseColorWidget::setColor(const QColor& color)
|
||||
{
|
||||
m_button->setColor(color);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#ifndef CHOOSECOLORWIDGET_H
|
||||
#define CHOOSECOLORWIDGET_H
|
||||
|
||||
#include <QtCore>
|
||||
#include <QWidget>
|
||||
|
||||
class KColorButton;
|
||||
@@ -40,17 +39,17 @@ public:
|
||||
* @param text (optional) What the color will be used for
|
||||
* @param color (optional) initial color
|
||||
* @param alphaEnabled (optional) Should transparent colors be enabled */
|
||||
explicit ChooseColorWidget(QString text = QString(), QString color = "0xffffffff", bool alphaEnabled = false, QWidget* parent = 0);
|
||||
explicit ChooseColorWidget(const QString &text = QString(), const QString &color = "0xffffffff", bool alphaEnabled = false, QWidget* parent = 0);
|
||||
|
||||
/** @brief Gets the choosen color. */
|
||||
QString getColor();
|
||||
QString getColor() const;
|
||||
|
||||
private:
|
||||
KColorButton *m_button;
|
||||
|
||||
private slots:
|
||||
/** @brief Updates the different color choosing options to have all selected @param color. */
|
||||
void setColor(QColor color);
|
||||
void setColor(const QColor &color);
|
||||
|
||||
signals:
|
||||
/** @brief Emitted whenever a different color was choosen. */
|
||||
|
||||
@@ -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),
|
||||
@@ -49,7 +49,7 @@ ClipDurationDialog::ClipDurationDialog(AbstractClipItem *clip, Timecode tc, GenT
|
||||
bool allowCrop = true;
|
||||
if (clip->type() == AVWIDGET) {
|
||||
ClipItem *item = static_cast <ClipItem *>(clip);
|
||||
int t = item->clipType();
|
||||
const int t = item->clipType();
|
||||
if (t == COLOR || t == IMAGE || t == TEXT)
|
||||
allowCrop = false;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
577
src/clipitem.cpp
577
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,12 +197,12 @@ 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;
|
||||
@@ -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;
|
||||
@@ -353,18 +353,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 +380,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();
|
||||
@@ -420,7 +420,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,9 +431,9 @@ 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);
|
||||
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
|
||||
@@ -455,7 +455,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 +464,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 +483,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 +498,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 +527,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 +540,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,8 +570,8 @@ 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);
|
||||
@@ -583,7 +583,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")) {
|
||||
@@ -595,7 +600,7 @@ void ClipManager::slotAddClipList(const KUrl::List urls, QMap <QString, QString>
|
||||
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 +613,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 +641,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);
|
||||
}
|
||||
@@ -658,7 +663,7 @@ 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");
|
||||
@@ -745,13 +750,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,7 +813,7 @@ 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();
|
||||
@@ -838,7 +843,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 +875,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 +885,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 +929,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;
|
||||
@@ -977,14 +982,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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -40,6 +40,12 @@
|
||||
#include <Nepomuk/Vocabulary/NIE>
|
||||
#endif
|
||||
#endif
|
||||
#ifdef USE_NEPOMUKCORE
|
||||
#include <Nepomuk2/Variant>
|
||||
#include <Nepomuk2/Resource>
|
||||
#include <Nepomuk2/ResourceManager>
|
||||
#include <Nepomuk2/Vocabulary/NIE>
|
||||
#endif
|
||||
|
||||
|
||||
#include <QDir>
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -264,7 +304,7 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
|
||||
}
|
||||
|
||||
if (t == PLAYLIST)
|
||||
m_view.tabWidget->setTabText(VIDEOTAB, i18n("Playlist"));
|
||||
m_view.tabWidget->setTabText(VIDEOTAB, i18n("Playlist"));
|
||||
|
||||
if (t == IMAGE) {
|
||||
m_view.tabWidget->removeTab(SLIDETAB);
|
||||
@@ -277,7 +317,8 @@ 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) {
|
||||
m_view.clip_path->setEnabled(false);
|
||||
@@ -290,7 +331,7 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
|
||||
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.")) {
|
||||
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;
|
||||
@@ -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);
|
||||
@@ -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,8 +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 (!url.isEmpty()) {
|
||||
Nepomuk::ResourceManager::instance()->init();
|
||||
@@ -469,7 +513,7 @@ 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);
|
||||
@@ -478,10 +522,32 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
|
||||
#else
|
||||
m_view.clip_license->setHidden(true);
|
||||
#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 +556,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 +565,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 +708,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 +720,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 +779,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 +847,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 +864,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 +872,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 +898,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 +908,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 +926,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 +937,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,7 +956,6 @@ const QString &ClipProperties::clipId() const
|
||||
return m_clip->getId();
|
||||
}
|
||||
|
||||
|
||||
QMap <QString, QString> ClipProperties::properties()
|
||||
{
|
||||
QMap <QString, QString> props;
|
||||
@@ -893,7 +970,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();
|
||||
@@ -1125,31 +1202,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 +1242,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 +1263,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 +1285,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);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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,7 +26,6 @@
|
||||
#include "ui_clipstabilize_ui.h"
|
||||
|
||||
#include <KUrl>
|
||||
#include <QProcess>
|
||||
#include <QFuture>
|
||||
|
||||
class QTimer;
|
||||
@@ -35,14 +34,14 @@ namespace Mlt{
|
||||
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 +56,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);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -19,7 +19,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 +44,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 +130,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 +159,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);
|
||||
|
||||
@@ -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 };
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -29,7 +29,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 +57,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 +76,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 +97,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 +121,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 +141,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 +159,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);
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include <QWidget>
|
||||
#include <QFrame>
|
||||
|
||||
class QSpinBox;
|
||||
class QFrame;
|
||||
#ifdef Q_WS_X11
|
||||
#include <X11/Xlib.h>
|
||||
@@ -36,10 +35,10 @@ class MyFrame : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MyFrame(QWidget* parent = 0);
|
||||
explicit MyFrame(QWidget* parent = 0);
|
||||
|
||||
protected:
|
||||
virtual void hideEvent ( QHideEvent * event );
|
||||
void hideEvent ( QHideEvent * event );
|
||||
|
||||
signals:
|
||||
void getColor();
|
||||
@@ -59,14 +58,14 @@ class ColorPickerWidget : public QWidget
|
||||
|
||||
public:
|
||||
/** @brief Sets up the widget. */
|
||||
ColorPickerWidget(QWidget *parent = 0);
|
||||
explicit ColorPickerWidget(QWidget *parent = 0);
|
||||
/** @brief Makes sure the event filter is removed. */
|
||||
virtual ~ColorPickerWidget();
|
||||
|
||||
protected:
|
||||
virtual void mousePressEvent(QMouseEvent *event);
|
||||
virtual void mouseReleaseEvent(QMouseEvent *event);
|
||||
virtual void mouseMoveEvent(QMouseEvent *event);
|
||||
void mousePressEvent(QMouseEvent *event);
|
||||
void mouseReleaseEvent(QMouseEvent *event);
|
||||
void mouseMoveEvent(QMouseEvent *event);
|
||||
bool eventFilter(QObject *object, QEvent *event);
|
||||
|
||||
private:
|
||||
@@ -96,7 +95,7 @@ private slots:
|
||||
void slotGetAverageColor();
|
||||
|
||||
signals:
|
||||
void colorPicked(QColor);
|
||||
void colorPicked(const QColor&);
|
||||
void displayMessage(const QString&, int);
|
||||
/** @brief When user wants to pick a color, it's better to disable filter so we get proper color values. */
|
||||
void disableCurrentFilter(bool);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include <KLocale>
|
||||
|
||||
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;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#include <KLocale>
|
||||
|
||||
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),
|
||||
@@ -33,10 +33,15 @@ AddEffectCommand::AddEffectCommand(CustomTrackView *view, const int track, GenTi
|
||||
{
|
||||
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));
|
||||
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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -23,28 +23,34 @@
|
||||
|
||||
#include <KLocale>
|
||||
|
||||
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;
|
||||
|
||||
@@ -21,19 +21,21 @@
|
||||
|
||||
#include <KLocale>
|
||||
|
||||
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;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#include <KLocale>
|
||||
|
||||
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;
|
||||
|
||||
@@ -22,16 +22,18 @@
|
||||
#include "customtrackview.h"
|
||||
|
||||
#include <KLocale>
|
||||
|
||||
AddTrackCommand::AddTrackCommand(CustomTrackView *view, int ix, TrackInfo info, bool addTrack, QUndoCommand * parent) :
|
||||
#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;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include <KLocale>
|
||||
|
||||
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;
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "customtrackview.h"
|
||||
|
||||
#include <KLocale>
|
||||
#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;
|
||||
|
||||
@@ -23,20 +23,20 @@
|
||||
|
||||
#include <KLocale>
|
||||
|
||||
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;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#include <KLocale>
|
||||
|
||||
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;
|
||||
|
||||
@@ -21,8 +21,9 @@
|
||||
#include "projectlist.h"
|
||||
|
||||
#include <KLocale>
|
||||
#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;
|
||||
|
||||
@@ -21,8 +21,9 @@
|
||||
#include "projectlist.h"
|
||||
|
||||
#include <KLocale>
|
||||
#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;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user