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
......@@ -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;
};
}
......
......@@ -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) {
......
......@@ -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
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment