Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

refresh monitor on clip resize and composition move

parent 604c4722
......@@ -469,6 +469,7 @@ bool TimelineModel::requestClipDeletion(int clipId, Fun &undo, Fun &redo)
undo();
return false;
}
bool TimelineModel::requestCompositionDeletion(int compositionId, Fun &undo, Fun &redo)
{
int trackId = getCompositionTrackId(compositionId);
......
......@@ -245,8 +245,8 @@ public: /* @brief Given an intended move, try to suggest a more valid one
action is undoable Returns true on success. If it fails, nothing is
modified. If the clip/composition is in a group, the call is deferred to
requestGroupDeletion @param clipId is the ID of the clip/composition
@param logUndo if set to false, no undo object is stored */ Q_INVOKABLE bool
requestItemDeletion(int clipId, bool logUndo = true);
@param logUndo if set to false, no undo object is stored */
Q_INVOKABLE bool requestItemDeletion(int clipId, bool logUndo = true);
/* Same function, but accumulates undo and redo, and doesn't check for group*/
bool requestClipDeletion(int clipId, Fun &undo, Fun &redo);
bool requestCompositionDeletion(int compositionId, Fun &undo, Fun &redo);
......
......@@ -287,13 +287,22 @@ Fun TrackModel::requestClipResize_lambda(int clipId, int in, int out, bool right
int target_clip = clip_loc.second;
Q_ASSERT(target_clip < m_playlists[target_track].count());
int size = out - in + 1;
int state = m_track.get_int("hide");
bool checkRefresh = false;
if ((state == 0 || state == 2) && m_track.get_int("kdenlive:audio_track") != 1) {
checkRefresh = true;
}
auto update_snaps = [old_in, old_out, this](int new_in, int new_out) {
auto update_snaps = [old_in, old_out, checkRefresh, this](int new_in, int new_out) {
if (auto ptr = m_parent.lock()) {
ptr->m_snaps->removePoint(old_in);
ptr->m_snaps->removePoint(old_out);
ptr->m_snaps->addPoint(new_in);
ptr->m_snaps->addPoint(new_out);
if (checkRefresh) {
ptr->checkRefresh(old_in, old_out);
ptr->checkRefresh(new_in, new_out);
}
} else {
qDebug() << "Error : clip resize failed because parent timeline is not available anymore";
Q_ASSERT(false);
......@@ -574,6 +583,8 @@ Fun TrackModel::requestCompositionResize_lambda(int compoId, int in, int out)
ptr->m_snaps->removePoint(old_out);
ptr->m_snaps->addPoint(new_in);
ptr->m_snaps->addPoint(new_out);
ptr->checkRefresh(old_in, old_out);
ptr->checkRefresh(new_in, new_out);
} else {
qDebug() << "Error : Composition resize failed because parent timeline is not available anymore";
Q_ASSERT(false);
......@@ -696,6 +707,7 @@ Fun TrackModel::requestCompositionInsertion_lambda(int compoId, int position, bo
}
ptr->m_snaps->addPoint(new_in);
ptr->m_snaps->addPoint(new_out);
ptr->checkRefresh(new_in, new_out);
m_compoPos[new_in] = composition->getId();
return true;
}
......
......@@ -130,7 +130,7 @@ Rectangle {
}
onExited:{
if (clipBeingDroppedId != -1) {
controller.requestCompositionDeletion(clipBeingDroppedId, false)
controller.requestItemDeletion(clipBeingDroppedId, false)
}
clipBeingDroppedId = -1
droppedPosition = -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