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
6fd83d69
Commit
6fd83d69
authored
Feb 14, 2020
by
Jean-Baptiste Mardelle
Browse files
Speed change triggers a new clip insert so no need to create a binding, also fix tests
parent
50e2356f
Pipeline
#15024
passed with stage
in 17 minutes and 25 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/model/clipmodel.cpp
View file @
6fd83d69
...
...
@@ -518,12 +518,6 @@ Fun ClipModel::useTimewarpProducer_lambda(double speed, bool pitchCompensate)
qDebug
()
<<
"timeWarp producer"
<<
speed
;
refreshProducerFromBin
(
m_currentTrackId
,
m_currentState
,
speed
);
m_producer
->
parent
().
set
(
"warp_pitch"
,
pitchCompensate
?
1
:
0
);
if
(
m_currentTrackId
>
-
1
)
{
if
(
auto
ptr
=
m_parent
.
lock
())
{
QModelIndex
ix
=
ptr
->
makeClipIndexFromID
(
m_id
);
ptr
->
notifyChange
(
ix
,
ix
,
TimelineModel
::
SpeedRole
);
}
}
return
true
;
};
}
...
...
src/timeline2/model/timelinemodel.cpp
View file @
6fd83d69
...
...
@@ -3395,7 +3395,6 @@ bool TimelineModel::requestClipTimeWarp(int clipId, double speed, bool pitchComp
success
=
success
&&
getTrackById
(
trackId
)
->
requestClipDeletion
(
clipId
,
true
,
true
,
local_undo
,
local_redo
,
false
,
false
);
}
if
(
success
)
{
qDebug
()
<<
"Warp pass 3"
;
success
=
m_allClips
[
clipId
]
->
useTimewarpProducer
(
speed
,
pitchCompensate
,
changeDuration
,
local_undo
,
local_redo
);
}
if
(
trackId
!=
-
1
)
{
...
...
src/timeline2/view/qml/Track.qml
View file @
6fd83d69
...
...
@@ -193,12 +193,6 @@ Item{
value
:
model
.
resource
when
:
loader
.
status
==
Loader
.
Ready
&&
isClip
(
model
.
clipType
)
}
Binding
{
target
:
loader
.
item
property
:
"
speed
"
value
:
model
.
speed
when
:
loader
.
status
==
Loader
.
Ready
&&
isClip
(
model
.
clipType
)
}
Binding
{
target
:
loader
.
item
property
:
"
maxDuration
"
...
...
@@ -239,7 +233,8 @@ Item{
item
.
canBeVideo
=
model
.
canBeVideo
item
.
itemType
=
model
.
clipType
item
.
audioChannels
=
model
.
audioChannels
//item.binId= model.binId
// Speed change triggers a new clip insert so no binding necessary
item
.
speed
=
model
.
speed
}
else
if
(
model
.
clipType
==
ProducerType
.
Composition
)
{
console
.
log
(
'
loaded composition:
'
,
model
.
start
,
'
, ID:
'
,
model
.
item
,
'
, index:
'
,
trackRoot
.
DelegateModel
.
itemsIndex
)
//item.aTrack = model.a_track
...
...
tests/timewarptest.cpp
View file @
6fd83d69
...
...
@@ -61,7 +61,6 @@ TEST_CASE("Test of timewarping", "[Timewarp]")
REQUIRE
(
timeline
->
requestClipTimeWarp
(
cid3
,
0.1
,
false
,
true
,
undo
,
redo
));
CHECK_UPDATE
(
TimelineModel
::
SpeedRole
);
REQUIRE
(
timeline
->
getClipSpeed
(
cid3
)
==
0.1
);
INFO
(
timeline
->
m_allClips
[
cid3
]
->
getIn
());
INFO
(
timeline
->
m_allClips
[
cid3
]
->
getOut
());
...
...
@@ -69,13 +68,11 @@ TEST_CASE("Test of timewarping", "[Timewarp]")
undo
();
CHECK_UPDATE
(
TimelineModel
::
SpeedRole
);
REQUIRE
(
timeline
->
getClipSpeed
(
cid3
)
==
1.
);
REQUIRE
(
timeline
->
getClipPlaytime
(
cid3
)
==
originalDuration
);
redo
();
CHECK_UPDATE
(
TimelineModel
::
SpeedRole
);
REQUIRE
(
timeline
->
getClipSpeed
(
cid3
)
==
0.1
);
REQUIRE
(
timeline
->
getClipPlaytime
(
cid3
)
==
originalDuration
/
0.1
);
...
...
@@ -83,17 +80,14 @@ TEST_CASE("Test of timewarping", "[Timewarp]")
std
::
function
<
bool
(
void
)
>
redo2
=
[]()
{
return
true
;
};
REQUIRE
(
timeline
->
requestClipTimeWarp
(
cid3
,
1.2
,
false
,
true
,
undo2
,
redo2
));
CHECK_UPDATE
(
TimelineModel
::
SpeedRole
);
REQUIRE
(
timeline
->
getClipSpeed
(
cid3
)
==
1.2
);
REQUIRE
(
timeline
->
getClipPlaytime
(
cid3
)
==
int
(
originalDuration
/
1.2
));
undo2
();
CHECK_UPDATE
(
TimelineModel
::
SpeedRole
);
REQUIRE
(
timeline
->
getClipSpeed
(
cid3
)
==
0.1
);
REQUIRE
(
timeline
->
getClipPlaytime
(
cid3
)
==
originalDuration
/
0.1
);
undo
();
CHECK_UPDATE
(
TimelineModel
::
SpeedRole
);
REQUIRE
(
timeline
->
getClipSpeed
(
cid3
)
==
1.
);
REQUIRE
(
timeline
->
getClipPlaytime
(
cid3
)
==
originalDuration
);
...
...
@@ -104,7 +98,6 @@ TEST_CASE("Test of timewarping", "[Timewarp]")
// This is the limit, should work
REQUIRE
(
timeline
->
requestClipTimeWarp
(
cid3
,
double
(
curLength
),
false
,
true
,
undo2
,
redo2
));
CHECK_UPDATE
(
TimelineModel
::
SpeedRole
);
REQUIRE
(
timeline
->
getClipSpeed
(
cid3
)
==
double
(
curLength
));
REQUIRE
(
timeline
->
getClipPlaytime
(
cid3
)
==
1
);
...
...
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