Skip to content
GitLab
Menu
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
c5e507ea
Commit
c5e507ea
authored
Aug 28, 2019
by
Jean-Baptiste Mardelle
Browse files
Merge branch '1908'
parents
d40d5e07
4d0c9d43
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/assets/abstractassetsrepository.hpp
View file @
c5e507ea
...
...
@@ -83,7 +83,7 @@ protected:
bool
parseInfoFromMlt
(
const
QString
&
assetId
,
Info
&
res
);
/* @brief Returns the metadata associated with the given asset*/
virtual
Mlt
::
Properties
*
getMetadata
(
const
QString
&
assetId
)
=
0
;
virtual
Mlt
::
Properties
*
getMetadata
(
const
QString
&
assetId
)
const
=
0
;
/* @brief Parse one asset from its XML content
@param res data structure to fill
...
...
src/effects/effectlist/view/effectlistwidget.cpp
View file @
c5e507ea
...
...
@@ -72,7 +72,7 @@ void EffectListWidget::setFilterType(const QString &type)
static_cast
<
EffectFilter
*>
(
m_proxyModel
.
get
())
->
setFilterType
(
true
,
EffectType
::
Audio
);
}
else
if
(
type
==
"customAudio"
)
{
static_cast
<
EffectFilter
*>
(
m_proxyModel
.
get
())
->
setFilterType
(
true
,
EffectType
::
CustomAudio
);
}
else
if
(
type
==
"custom"
)
{
}
else
if
(
type
==
"custom
Video
"
)
{
static_cast
<
EffectFilter
*>
(
m_proxyModel
.
get
())
->
setFilterType
(
true
,
EffectType
::
Custom
);
}
else
if
(
type
==
"favorites"
)
{
static_cast
<
EffectFilter
*>
(
m_proxyModel
.
get
())
->
setFilterType
(
true
,
EffectType
::
Favorites
);
...
...
src/effects/effectsrepository.cpp
View file @
c5e507ea
...
...
@@ -61,7 +61,7 @@ Mlt::Properties *EffectsRepository::retrieveListFromMlt() const
return
pCore
->
getMltRepository
()
->
filters
();
}
Mlt
::
Properties
*
EffectsRepository
::
getMetadata
(
const
QString
&
effectId
)
Mlt
::
Properties
*
EffectsRepository
::
getMetadata
(
const
QString
&
effectId
)
const
{
return
pCore
->
getMltRepository
()
->
metadata
(
filter_type
,
effectId
.
toLatin1
().
data
());
}
...
...
@@ -121,12 +121,31 @@ void EffectsRepository::parseCustomAssetFile(const QString &file_name, std::unor
QString
type
=
currentEffect
.
attribute
(
QStringLiteral
(
"type"
),
QString
());
if
(
type
==
QLatin1String
(
"audio"
))
{
result
.
type
=
EffectType
::
Audio
;
}
else
if
(
type
==
QLatin1String
(
"custom"
))
{
}
else
if
(
type
==
QLatin1String
(
"custom
Video
"
))
{
result
.
type
=
EffectType
::
Custom
;
}
else
if
(
type
==
QLatin1String
(
"customAudio"
))
{
result
.
type
=
EffectType
::
CustomAudio
;
}
else
if
(
type
==
QLatin1String
(
"hidden"
))
{
result
.
type
=
EffectType
::
Hidden
;
}
else
if
(
type
==
QLatin1String
(
"custom"
))
{
// Old type effect, update to customVideo / customAudio
const
QString
effectTag
=
currentEffect
.
attribute
(
QStringLiteral
(
"tag"
));
QScopedPointer
<
Mlt
::
Properties
>
metadata
(
getMetadata
(
effectTag
));
if
(
metadata
&&
metadata
->
is_valid
())
{
Mlt
::
Properties
tags
((
mlt_properties
)
metadata
->
get_data
(
"tags"
));
if
(
QString
(
tags
.
get
(
0
))
==
QLatin1String
(
"Audio"
))
{
result
.
type
=
EffectType
::
CustomAudio
;
currentEffect
.
setAttribute
(
QStringLiteral
(
"type"
),
QStringLiteral
(
"customAudio"
));
}
else
{
result
.
type
=
EffectType
::
Custom
;
currentEffect
.
setAttribute
(
QStringLiteral
(
"type"
),
QStringLiteral
(
"customVideo"
));
}
QFile
effectFile
(
file_name
);
if
(
effectFile
.
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Text
))
{
effectFile
.
write
(
doc
.
toString
().
toUtf8
());
}
file
.
close
();
}
}
else
{
result
.
type
=
EffectType
::
Video
;
}
...
...
src/effects/effectsrepository.hpp
View file @
c5e507ea
...
...
@@ -79,7 +79,7 @@ protected:
void
parseType
(
QScopedPointer
<
Mlt
::
Properties
>
&
metadata
,
Info
&
res
)
override
;
/* @brief Returns the metadata associated with the given asset*/
Mlt
::
Properties
*
getMetadata
(
const
QString
&
assetId
)
override
;
Mlt
::
Properties
*
getMetadata
(
const
QString
&
assetId
)
const
override
;
QPair
<
QString
,
QString
>
fixCustomAssetFile
(
const
QString
&
path
);
...
...
src/effects/effectstack/view/collapsibleeffectview.cpp
View file @
c5e507ea
...
...
@@ -431,7 +431,7 @@ void CollapsibleEffectView::slotSaveEffect()
effect
.
removeAttribute
(
QStringLiteral
(
"kdenlive_ix"
));
effect
.
setAttribute
(
QStringLiteral
(
"id"
),
name
);
QString
masterType
=
effect
.
attribute
(
QLatin1String
(
"type"
));
effect
.
setAttribute
(
QStringLiteral
(
"type"
),
(
masterType
==
QLatin1String
(
"audio"
)
||
masterType
==
QLatin1String
(
"customAudio"
))
?
QStringLiteral
(
"customAudio"
)
:
QStringLiteral
(
"custom"
));
effect
.
setAttribute
(
QStringLiteral
(
"type"
),
(
masterType
==
QLatin1String
(
"audio"
)
||
masterType
==
QLatin1String
(
"customAudio"
))
?
QStringLiteral
(
"customAudio"
)
:
QStringLiteral
(
"custom
Video
"
));
/*
if (m_paramWidget) {
int in = m_paramWidget->range().x();
...
...
src/timeline2/model/timelinemodel.cpp
View file @
c5e507ea
...
...
@@ -769,7 +769,7 @@ int TimelineModel::suggestClipMove(int clipId, int trackId, int position, int cu
}
}
int
blank_length
=
getTrackById
(
trackId
)
->
getBlankSizeNearClip
(
clipId
,
after
);
int
blank_length
=
getTrackById
_const
(
trackId
)
->
getBlankSizeNearClip
(
clipId
,
after
);
qDebug
()
<<
"Found blank"
<<
blank_length
;
if
(
blank_length
<
INT_MAX
)
{
if
(
after
)
{
...
...
@@ -785,6 +785,11 @@ int TimelineModel::suggestClipMove(int clipId, int trackId, int position, int cu
TRACE_RES
(
possible
?
position
:
currentPos
);
return
possible
?
position
:
currentPos
;
}
if
(
trackId
!=
sourceTrackId
)
{
// Try same track move
possible
=
requestClipMove
(
clipId
,
sourceTrackId
,
position
,
moveMirrorTracks
,
true
,
false
,
false
);
return
possible
?
position
:
currentPos
;
}
// find best pos for groups
int
groupId
=
m_groups
->
getRootId
(
clipId
);
std
::
unordered_set
<
int
>
all_items
=
m_groups
->
getLeaves
(
groupId
);
...
...
@@ -814,26 +819,34 @@ int TimelineModel::suggestClipMove(int clipId, int trackId, int position, int cu
trackPosition
.
insert
(
clipTrack
,
after
?
in
+
getItemPlaytime
(
current_clipId
)
-
1
:
in
);
}
}
// Now check space on each track
QMapIterator
<
int
,
int
>
i
(
trackPosition
);
int
blank_length
=
-
1
;
int
blank_length
=
0
;
while
(
i
.
hasNext
())
{
i
.
next
();
int
track_space
;
if
(
!
after
)
{
// Check space before the position
track_space
=
i
.
value
()
-
getTrackById
(
i
.
key
())
->
getBlankStart
(
i
.
value
()
-
1
);
if
(
blank_length
==
-
1
||
blank_length
>
track_space
)
{
track_space
=
i
.
value
()
-
getTrackById
_const
(
i
.
key
())
->
getBlankStart
(
i
.
value
()
-
1
);
if
(
blank_length
==
0
||
blank_length
>
track_space
)
{
blank_length
=
track_space
;
}
}
else
{
// Check space after the position
track_space
=
getTrackById
(
i
.
key
())
->
getBlankEnd
(
i
.
value
()
+
1
)
-
i
.
value
()
-
1
;
if
(
blank_length
==
-
1
||
blank_length
>
track_space
)
{
if
(
blank_length
==
0
||
blank_length
>
track_space
)
{
blank_length
=
track_space
;
}
}
}
if
(
snapDistance
>
0
)
{
if
(
blank_length
>
10
*
snapDistance
)
{
blank_length
=
0
;
}
}
else
if
(
blank_length
/
m_profile
->
fps
()
>
5
)
{
blank_length
=
0
;
}
if
(
blank_length
!=
0
)
{
int
updatedPos
=
currentPos
+
(
after
?
blank_length
:
-
blank_length
);
possible
=
requestClipMove
(
clipId
,
trackId
,
updatedPos
,
moveMirrorTracks
,
true
,
false
,
false
);
...
...
src/transitions/transitionsrepository.cpp
View file @
c5e507ea
...
...
@@ -58,7 +58,7 @@ Mlt::Properties *TransitionsRepository::retrieveListFromMlt() const
return
pCore
->
getMltRepository
()
->
transitions
();
}
Mlt
::
Properties
*
TransitionsRepository
::
getMetadata
(
const
QString
&
assetId
)
Mlt
::
Properties
*
TransitionsRepository
::
getMetadata
(
const
QString
&
assetId
)
const
{
return
pCore
->
getMltRepository
()
->
metadata
(
transition_type
,
assetId
.
toLatin1
().
data
());
}
...
...
src/transitions/transitionsrepository.hpp
View file @
c5e507ea
...
...
@@ -77,7 +77,7 @@ protected:
void
parseType
(
QScopedPointer
<
Mlt
::
Properties
>
&
metadata
,
Info
&
res
)
override
;
/* @brief Returns the metadata associated with the given asset*/
Mlt
::
Properties
*
getMetadata
(
const
QString
&
assetId
)
override
;
Mlt
::
Properties
*
getMetadata
(
const
QString
&
assetId
)
const
override
;
/* @brief Returns all transitions that can be represented as Single Track Transitions*/
static
QSet
<
QString
>
getSingleTrackTransitions
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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