aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <[email protected]>2016-06-19 21:43:37 +0200
committerJean-Baptiste Mardelle <[email protected]>2016-06-19 21:43:37 +0200
commit06f4c5a1fc70a7d11f33e42a0e11af0324ad17e8 (patch)
tree1565fcefeafc709491832d2371f3f61da9864f82
parent6ed852a4a5c9fadd828f9e3353ae3dd8e38a12a9 (diff)
Don't change timeline cursor pos when moving a group at end of track
-rw-r--r--src/timeline/customtrackview.cpp3
-rw-r--r--src/timeline/managers/movemanager.cpp2
-rw-r--r--src/timeline/timeline.cpp24
-rw-r--r--src/timeline/timeline.h2
-rw-r--r--src/timeline/track.cpp4
-rw-r--r--src/timeline/track.h2
6 files changed, 8 insertions, 29 deletions
diff --git a/src/timeline/customtrackview.cpp b/src/timeline/customtrackview.cpp
index 7445e42..f55bb87 100644
--- a/src/timeline/customtrackview.cpp
+++ b/src/timeline/customtrackview.cpp
@@ -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
diff --git a/src/timeline/managers/movemanager.cpp b/src/timeline/managers/movemanager.cpp
index 3b56db7..377310d 100644
--- a/src/timeline/managers/movemanager.cpp
+++ b/src/timeline/managers/movemanager.cpp
@@ -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;
diff --git a/src/timeline/timeline.cpp b/src/timeline/timeline.cpp
index 32304c6..84a7c4a 100644
--- a/src/timeline/timeline.cpp
+++ b/src/timeline/timeline.cpp
@@ -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() {
diff --git a/src/timeline/timeline.h b/src/timeline/timeline.h
index 85e12bc..c4c713a 100644
--- a/src/timeline/timeline.h
+++ b/src/timeline/timeline.h
@@ -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) */
diff --git a/src/timeline/track.cpp b/src/timeline/track.cpp
index bf0f5fe..3aeabb3 100644
--- a/src/timeline/track.cpp
+++ b/src/timeline/track.cpp
@@ -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;
diff --git a/src/timeline/track.h b/src/timeline/track.h
index 263d98c..b4e9b9c 100644
--- a/src/timeline/track.h
+++ b/src/timeline/track.h
@@ -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)