mirror of
https://invent.kde.org/multimedia/kdenlive
synced 2025-12-06 00:09:59 +01:00
Don't change timeline cursor pos when moving a group at end of track
This commit is contained in:
@@ -5155,7 +5155,7 @@ void CustomTrackView::moveGroup(QList<ItemInfo> startClip, QList<ItemInfo> start
|
||||
if (alreadyMoved)
|
||||
clip->setEnabled(false);
|
||||
}
|
||||
m_timeline->track(startClip.at(i).track)->del(startClip.at(i).startPos.seconds());
|
||||
m_timeline->track(startClip.at(i).track)->del(startClip.at(i).startPos.seconds(), false);
|
||||
} else qDebug() << "//MISSING CLIP AT: " << startClip.at(i).startPos.frames(25)<<" / track: "<<startClip.at(i).track<<" / OFFSET: "<<trackOffset;
|
||||
}
|
||||
for (int i = 0; i < startTransition.count(); ++i) {
|
||||
@@ -5265,6 +5265,7 @@ void CustomTrackView::moveGroup(QList<ItemInfo> startClip, QList<ItemInfo> start
|
||||
rebuildGroup(groupList.at(i));
|
||||
}
|
||||
groupSelectedItems(children, false);
|
||||
m_timeline->checkDuration();
|
||||
//clearSelection();
|
||||
KdenliveSettings::setSnaptopoints(snap);
|
||||
//TODO: calculate affected ranges and invalidate previews
|
||||
|
||||
@@ -33,7 +33,7 @@ MoveManager::MoveManager(TransitionHandler *handler, CustomTrackView *view, DocU
|
||||
{
|
||||
}
|
||||
|
||||
bool MoveManager::mousePress(ItemInfo info, Qt::KeyboardModifiers modifiers, QList<QGraphicsItem *>)
|
||||
bool MoveManager::mousePress(ItemInfo info, Qt::KeyboardModifiers , QList<QGraphicsItem *>)
|
||||
{
|
||||
m_view->setCursor(Qt::ClosedHandCursor);
|
||||
m_dragItemInfo = info;
|
||||
|
||||
@@ -345,30 +345,8 @@ int Timeline::getTracks() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
void Timeline::checkDuration(int duration) {
|
||||
Q_UNUSED(duration)
|
||||
void Timeline::checkDuration() {
|
||||
m_doc->renderer()->mltCheckLength(m_tractor);
|
||||
return;
|
||||
/*FIXME
|
||||
for (int i = 1; i < m_tractor->count(); ++i) {
|
||||
QScopedPointer<Mlt::Producer> tk(m_tractor->track(i));
|
||||
int len = tk->get_playtime() - 1;
|
||||
if (len > duration) duration = len;
|
||||
}
|
||||
QScopedPointer<Mlt::Producer> tk1(m_tractor->track(0));
|
||||
Mlt::Service s(tk1->get_service());
|
||||
Mlt::Playlist blackTrack(s);
|
||||
if (blackTrack.get_playtime() - 1 != duration) {
|
||||
QScopedPointer<Mlt::Producer> blackClip(blackTrack.get_clip(0));
|
||||
if (blackClip->parent().get_length() <= duration) {
|
||||
blackClip->parent().set("length", duration + 1);
|
||||
blackClip->parent().set("out", duration);
|
||||
blackClip->set("length", duration + 1);
|
||||
}
|
||||
blackTrack.resize_clip(0, 0, duration);
|
||||
}
|
||||
//TODO: rewind consumer if beyond duration / emit durationChanged
|
||||
*/
|
||||
}
|
||||
|
||||
void Timeline::getTransitions() {
|
||||
|
||||
@@ -186,7 +186,7 @@ public slots:
|
||||
void slotSetZone(const QPoint &p, bool updateDocumentProperties = true);
|
||||
/** @brief Save a snapshot image of current timeline view */
|
||||
void slotSaveTimelinePreview(const QString &path);
|
||||
void checkDuration(int duration);
|
||||
void checkDuration();
|
||||
void slotShowTrackEffects(int);
|
||||
void updateProfile(bool fpsChanged);
|
||||
/** @brief Enable/disable multitrack view (split monitor in 4) */
|
||||
|
||||
@@ -150,7 +150,7 @@ bool Track::isLastClip(qreal t)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Track::del(qreal t)
|
||||
bool Track::del(qreal t, bool checkDuration)
|
||||
{
|
||||
m_playlist.lock();
|
||||
bool durationChanged = false;
|
||||
@@ -170,7 +170,7 @@ bool Track::del(qreal t)
|
||||
}
|
||||
m_playlist.consolidate_blanks();
|
||||
m_playlist.unlock();
|
||||
if (durationChanged) {
|
||||
if (durationChanged && checkDuration) {
|
||||
emit newTrackDuration(m_playlist.get_playtime());
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
/** @brief delete a clip
|
||||
* @param time where clip is present (in seconds);
|
||||
* @return true if success */
|
||||
bool del(qreal t);
|
||||
bool del(qreal t, bool checkDuration = true);
|
||||
/** delete a region
|
||||
* @param t is the start,
|
||||
* @param dt is the duration (in seconds)
|
||||
|
||||
Reference in New Issue
Block a user