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
7244aeb1
Commit
7244aeb1
authored
Dec 09, 2021
by
Jean-Baptiste Mardelle
Browse files
Include clip markers and effect params in test hash function for better regression tracking
parent
741b84ba
Pipeline
#107243
passed with stage
in 6 minutes and 5 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/model/clipmodel.cpp
View file @
7244aeb1
...
...
@@ -86,7 +86,7 @@ int ClipModel::construct(const std::shared_ptr<TimelineModel> &parent, const QSt
return
id
;
}
void
ClipModel
::
allSnaps
(
std
::
vector
<
int
>
&
snaps
,
int
offset
)
void
ClipModel
::
allSnaps
(
std
::
vector
<
int
>
&
snaps
,
int
offset
)
const
{
m_clipMarkerModel
->
allSnaps
(
snaps
,
offset
);
}
...
...
@@ -1464,3 +1464,27 @@ FileStatus::ClipStatus ClipModel::clipStatus() const
std
::
shared_ptr
<
ProjectClip
>
binClip
=
pCore
->
projectItemModel
()
->
getClipByBinID
(
m_binClipId
);
return
binClip
->
clipStatus
();
}
QString
ClipModel
::
clipHash
()
const
{
QDomDocument
document
;
QDomElement
container
=
document
.
createElement
(
QStringLiteral
(
"clip"
));
container
.
setAttribute
(
QStringLiteral
(
"service"
),
m_producer
->
parent
().
get
(
"mlt_service"
));
container
.
setAttribute
(
QStringLiteral
(
"in"
),
getIn
());
container
.
setAttribute
(
QStringLiteral
(
"out"
),
getOut
());
container
.
setAttribute
(
QStringLiteral
(
"position"
),
getPosition
());
container
.
setAttribute
(
QStringLiteral
(
"state"
),
m_currentState
);
container
.
setAttribute
(
QStringLiteral
(
"playlist"
),
m_subPlaylistIndex
);
container
.
setAttribute
(
QStringLiteral
(
"speed"
),
QString
::
number
(
m_speed
,
'f'
));
container
.
setAttribute
(
QStringLiteral
(
"audioStream"
),
getIntProperty
(
QStringLiteral
(
"audio_index"
)));
std
::
vector
<
int
>
snaps
;
allSnaps
(
snaps
);
QString
snapData
;
for
(
auto
&
s
:
snaps
)
{
snapData
.
append
(
QString
::
number
(
s
));
}
container
.
setAttribute
(
QStringLiteral
(
"markers"
),
snapData
);
document
.
appendChild
(
container
);
container
.
appendChild
(
m_effectStack
->
toXml
(
document
));
return
document
.
toString
();
}
src/timeline2/model/clipmodel.hpp
View file @
7244aeb1
...
...
@@ -108,11 +108,13 @@ public:
QDomElement
toXml
(
QDomDocument
&
document
);
/** @brief Retrieve a list of all snaps for this clip */
void
allSnaps
(
std
::
vector
<
int
>
&
snaps
,
int
offset
=
0
);
void
allSnaps
(
std
::
vector
<
int
>
&
snaps
,
int
offset
=
0
)
const
;
protected:
/** @brief helper functions that creates the lambda */
Fun
setClipState_lambda
(
PlaylistState
::
ClipState
state
);
/** @brief Returns a clip hash, useful for regression testing */
QString
clipHash
()
const
;
public:
/** @brief returns the length of the item on the timeline
...
...
src/timeline2/model/clipsnapmodel.cpp
View file @
7244aeb1
...
...
@@ -87,7 +87,7 @@ void ClipSnapModel::removeAllSnaps()
}
}
void
ClipSnapModel
::
allSnaps
(
std
::
vector
<
int
>
&
snaps
,
int
offset
)
void
ClipSnapModel
::
allSnaps
(
std
::
vector
<
int
>
&
snaps
,
int
offset
)
const
{
snaps
.
push_back
(
m_position
-
offset
);
if
(
auto
ptr
=
m_registeredSnap
.
lock
())
{
...
...
src/timeline2/model/clipsnapmodel.hpp
View file @
7244aeb1
...
...
@@ -38,7 +38,7 @@ public:
void
updateSnapModelInOut
(
std
::
vector
<
int
>
borderSnaps
);
void
updateSnapMixPosition
(
int
mixPos
);
/** @brief Retrieve all snap points */
void
allSnaps
(
std
::
vector
<
int
>
&
snaps
,
int
offset
=
0
);
void
allSnaps
(
std
::
vector
<
int
>
&
snaps
,
int
offset
=
0
)
const
;
private:
...
...
src/timeline2/model/trackmodel.cpp
View file @
7244aeb1
...
...
@@ -2596,8 +2596,7 @@ QByteArray TrackModel::trackHash()
QByteArray
fileData
;
// Parse clips
for
(
auto
&
clip
:
m_allClips
)
{
QString
clipData
=
QString
(
"%1 %2 %3 %4"
).
arg
(
QString
::
number
(
clip
.
second
->
getPosition
()),
QString
::
number
(
clip
.
second
->
getPlaytime
()),
QString
::
number
(
clip
.
second
->
getSubPlaylistIndex
()),
clip
.
second
->
effectNames
());
fileData
.
append
(
clipData
.
toLatin1
());
fileData
.
append
(
clip
.
second
->
clipHash
().
toUtf8
());
}
// Parse mixes
for
(
auto
&
sameComposition
:
m_sameCompositions
)
{
...
...
Write
Preview
Markdown
is supported
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