Changeset View
Changeset View
Standalone View
Standalone View
src/timeline2/model/clipmodel.cpp
Context not available. | |||||
181 | }; | 181 | }; | ||
---|---|---|---|---|---|
182 | if (operation()) { | 182 | if (operation()) { | ||
183 | // we send a list of roles to be updated | 183 | // we send a list of roles to be updated | ||
184 | QVector<int> roles{TimelineModel::DurationRole}; | | |||
185 | if (right) { | | |||
186 | roles.push_back(TimelineModel::StartRole); | | |||
187 | roles.push_back(TimelineModel::InPointRole); | | |||
188 | } else { | | |||
189 | roles.push_back(TimelineModel::OutPointRole); | | |||
190 | } | | |||
191 | list.emplace_back(std::make_shared<ChangeUpdate>(getId(), m_parent, roles)); | | |||
192 | // Now, we are in the state in which the timeline should be when we try to revert current action. So we can build the reverse action from here | 184 | // Now, we are in the state in which the timeline should be when we try to revert current action. So we can build the reverse action from here | ||
185 | if (m_currentTrackId != -1) { | ||||
186 | QVector<int> roles{TimelineModel::DurationRole}; | ||||
187 | if (!right) { | ||||
188 | roles.push_back(TimelineModel::StartRole); | ||||
189 | roles.push_back(TimelineModel::InPointRole); | ||||
190 | } else { | ||||
191 | roles.push_back(TimelineModel::OutPointRole); | ||||
192 | } | ||||
193 | list.emplace_back(std::make_shared<ChangeUpdate>(getId(), m_parent, roles)); | ||||
194 | if (auto ptr = m_parent.lock()) { | ||||
195 | track_reverse = ptr->getTrackById(m_currentTrackId)->requestClipResize_lambda(m_id, old_in, old_out, right); | ||||
196 | } | ||||
197 | } | ||||
193 | Fun reverse = [this, old_in, old_out, track_reverse]() { | 198 | Fun reverse = [this, old_in, old_out, track_reverse]() { | ||
194 | if (track_reverse()) { | 199 | if (track_reverse()) { | ||
195 | m_producer->set_in_and_out(old_in, old_out); | 200 | m_producer->set_in_and_out(old_in, old_out); | ||
Context not available. |