Changeset View
Changeset View
Standalone View
Standalone View
src/timeline2/model/timelinefunctions.cpp
Context not available. | |||||
420 | Fun local_undo = []() { return true; }; | 420 | Fun local_undo = []() { return true; }; | ||
---|---|---|---|---|---|
421 | Fun local_redo = []() { return true; }; | 421 | Fun local_redo = []() { return true; }; | ||
422 | bool result = timeline->m_allClips[clipId]->setClipState(status, local_undo, local_redo); | 422 | bool result = timeline->m_allClips[clipId]->setClipState(status, local_undo, local_redo); | ||
423 | Fun operation = [timeline, clipId]() { | | |||
424 | int trackId = timeline->getClipTrackId(clipId); | | |||
425 | // in order to make the producer change effective, we need to unplant / replant the clip in int track | | |||
426 | if (trackId != -1) { | | |||
427 | timeline->getTrackById(trackId)->replugClip(clipId); | | |||
428 | } | | |||
429 | return true; | | |||
430 | }; | | |||
431 | result = result && operation(); | | |||
432 | if (!result) { | | |||
433 | bool undone = local_undo(); | | |||
434 | Q_ASSERT(undone); | | |||
435 | return false; | | |||
436 | } | | |||
437 | auto reverse = operation; | | |||
438 | UPDATE_UNDO_REDO_NOLOCK(operation, reverse, local_undo, local_redo); | | |||
439 | UPDATE_UNDO_REDO_NOLOCK(local_redo, local_undo, undo, redo); | 423 | UPDATE_UNDO_REDO_NOLOCK(local_redo, local_undo, undo, redo); | ||
440 | return result; | 424 | return result; | ||
441 | } | 425 | } | ||
Context not available. |