Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
05ad207e
Commit
05ad207e
authored
Mar 05, 2020
by
Jean-Baptiste Mardelle
Browse files
Introduce category for compositions that should have default length on insertion.
Related to
#549
parent
72c7ad1f
Pipeline
#16008
passed with stage
in 13 minutes and 51 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
data/transitions/dissolve.xml
View file @
05ad207e
<!DOCTYPE kpartgui>
<transition
tag=
"luma"
id=
"dissolve"
>
<transition
tag=
"luma"
id=
"dissolve"
type=
"short"
>
<name>
Dissolve
</name>
<description>
Fade out one video while fading in the other video.
</description>
<parameter
type=
"list"
name=
"resource"
default=
""
paramlist=
"%lumaPaths"
optional=
"1"
>
...
...
data/transitions/slide.xml
View file @
05ad207e
<!DOCTYPE kpartgui>
<transition
tag=
"composite"
id=
"slide"
>
<transition
tag=
"composite"
id=
"slide"
type=
"short"
>
<name>
Slide
</name>
<description>
Slide image from one side to another.
</description>
<author>
Dan Dennedy
</author>
...
...
data/transitions/wipe.xml
View file @
05ad207e
<!DOCTYPE kpartgui>
<transition
tag=
"composite"
id=
"wipe"
>
<transition
tag=
"composite"
id=
"wipe"
type=
"short"
>
<name>
Wipe
</name>
<description>
Applies a stationary transition between the current and next frames.
</description>
<author>
Dan Dennedy
</author>
...
...
src/timeline2/view/timelinecontroller.cpp
View file @
05ad207e
...
...
@@ -405,8 +405,10 @@ int TimelineController::insertNewComposition(int tid, int clipId, int offset, co
}
}
}
if
(
duration
<
0
)
{
duration
=
pCore
->
currentDoc
()
->
getFramePos
(
KdenliveSettings
::
transition_duration
());
int
defaultLength
=
pCore
->
currentDoc
()
->
getFramePos
(
KdenliveSettings
::
transition_duration
());
bool
isShortComposition
=
TransitionsRepository
::
get
()
->
getType
(
transitionId
)
==
TransitionType
::
VideoShortComposition
;
if
(
duration
<
0
||
(
isShortComposition
&&
duration
>
1.5
*
defaultLength
))
{
duration
=
defaultLength
;
}
else
if
(
duration
<=
1
)
{
// if suggested composition duration is lower than 4 frames, use default
duration
=
pCore
->
currentDoc
()
->
getFramePos
(
KdenliveSettings
::
transition_duration
());
...
...
src/transitions/transitionsrepository.cpp
View file @
05ad207e
...
...
@@ -97,6 +97,8 @@ void TransitionsRepository::parseCustomAssetFile(const QString &file_name, std::
QString
type
=
result
.
xml
.
attribute
(
QStringLiteral
(
"type"
),
QString
());
if
(
type
==
QLatin1String
(
"hidden"
))
{
result
.
type
=
TransitionType
::
Hidden
;
}
else
if
(
type
==
QLatin1String
(
"short"
))
{
result
.
type
=
TransitionType
::
VideoShortComposition
;
}
customAssets
[
result
.
id
]
=
result
;
}
...
...
@@ -164,7 +166,7 @@ std::unique_ptr<Mlt::Transition> TransitionsRepository::getTransition(const QStr
bool
TransitionsRepository
::
isComposition
(
const
QString
&
transitionId
)
const
{
auto
type
=
getType
(
transitionId
);
return
type
==
TransitionType
::
AudioComposition
||
type
==
TransitionType
::
VideoComposition
;
return
type
==
TransitionType
::
AudioComposition
||
type
==
TransitionType
::
VideoComposition
||
type
==
TransitionType
::
VideoShortComposition
;
}
const
QString
TransitionsRepository
::
getCompositingTransition
()
...
...
src/transitions/transitionsrepository.hpp
View file @
05ad207e
...
...
@@ -33,7 +33,7 @@
* Note that this class is a Singleton
*/
enum
class
TransitionType
{
AudioComposition
,
VideoComposition
,
AudioTransition
,
VideoTransition
,
Favorites
,
Hidden
=
-
1
};
enum
class
TransitionType
{
AudioComposition
,
VideoShortComposition
,
VideoComposition
,
AudioTransition
,
VideoTransition
,
Favorites
,
Hidden
=
-
1
};
Q_DECLARE_METATYPE
(
TransitionType
)
class
TransitionsRepository
:
public
AbstractAssetsRepository
<
TransitionType
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment