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
81ee8a0e
Commit
81ee8a0e
authored
Aug 09, 2022
by
Jean-Baptiste Mardelle
Browse files
Fix tests
parent
3b2bd76b
Pipeline
#215265
passed with stage
in 7 minutes and 26 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/model/timelinemodel.cpp
View file @
81ee8a0e
...
...
@@ -3249,25 +3249,28 @@ int TimelineModel::requestItemResize(int itemId, int size, bool right, bool logU
}
else
{
return
-
1
;
}
}
else
{
// Mix was resized, update cut position
int
currentMixDuration
=
m_allClips
[
mixData
.
first
.
secondClipId
]
->
getMixDuration
();
int
currentMixCut
=
m_allClips
[
mixData
.
first
.
secondClipId
]
->
getMixCutPosition
();
adjust_mix
=
[
this
,
tid
,
currentMixCut
,
itemId
]()
{
MixInfo
firstMixData
=
getTrackById_const
(
tid
)
->
getMixInfo
(
itemId
).
first
;
if
(
firstMixData
.
firstClipId
>
-
1
&&
firstMixData
.
secondClipId
>
-
1
)
{
getTrackById_const
(
tid
)
->
setMixDuration
(
firstMixData
.
secondClipId
,
firstMixData
.
firstClipInOut
.
second
-
firstMixData
.
secondClipInOut
.
first
,
currentMixCut
);
QModelIndex
ix
=
makeClipIndexFromID
(
firstMixData
.
secondClipId
);
emit
dataChanged
(
ix
,
ix
,
{
TimelineModel
::
MixRole
,
TimelineModel
::
MixCutRole
});
}
return
true
;
};
Fun
adjust_mix_undo
=
[
this
,
tid
,
mixData
,
currentMixCut
,
currentMixDuration
]()
{
getTrackById_const
(
tid
)
->
setMixDuration
(
mixData
.
first
.
secondClipId
,
currentMixDuration
,
currentMixCut
);
QModelIndex
ix
=
makeClipIndexFromID
(
mixData
.
first
.
secondClipId
);
emit
dataChanged
(
ix
,
ix
,
{
TimelineModel
::
MixRole
,
TimelineModel
::
MixCutRole
});
return
true
;
};
PUSH_LAMBDA
(
adjust_mix_undo
,
undo
);
}
// Mix was resized, update cut position
int
currentMixDuration
=
m_allClips
[
mixData
.
first
.
secondClipId
]
->
getMixDuration
();
int
currentMixCut
=
m_allClips
[
mixData
.
first
.
secondClipId
]
->
getMixCutPosition
();
adjust_mix
=
[
this
,
tid
,
mixData
,
currentMixCut
,
itemId
]()
{
MixInfo
firstMixData
=
getTrackById_const
(
tid
)
->
getMixInfo
(
itemId
).
first
;
getTrackById_const
(
tid
)
->
setMixDuration
(
firstMixData
.
secondClipId
,
firstMixData
.
firstClipInOut
.
second
-
firstMixData
.
secondClipInOut
.
first
,
currentMixCut
);
QModelIndex
ix
=
makeClipIndexFromID
(
firstMixData
.
secondClipId
);
emit
dataChanged
(
ix
,
ix
,
{
TimelineModel
::
MixRole
,
TimelineModel
::
MixCutRole
});
return
true
;
};
Fun
adjust_mix_undo
=
[
this
,
tid
,
mixData
,
currentMixCut
,
currentMixDuration
]()
{
getTrackById_const
(
tid
)
->
setMixDuration
(
mixData
.
first
.
secondClipId
,
currentMixDuration
,
currentMixCut
);
QModelIndex
ix
=
makeClipIndexFromID
(
mixData
.
first
.
secondClipId
);
emit
dataChanged
(
ix
,
ix
,
{
TimelineModel
::
MixRole
,
TimelineModel
::
MixCutRole
});
return
true
;
};
PUSH_LAMBDA
(
adjust_mix_undo
,
undo
);
}
if
(
getTrackById_const
(
tid
)
->
hasEndMix
(
itemId
))
{
// Resize mix if necessary
...
...
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