Commit c2749e94 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle

Merge branch 'Applications/15.12' of git.kde.org:kdenlive into 15.12

parents 333c3514 4d4e7fd9
......@@ -2602,7 +2602,6 @@ ClipItem *CustomTrackView::cutClip(const ItemInfo &info, const GenTime &cutTime,
return dup;
} else {
// uncut clip
ClipItem *item = getClipItemAtStart(info.startPos, info.track);
ClipItem *dup = getClipItemAtStart(cutTime, info.track);
......@@ -2610,6 +2609,7 @@ ClipItem *CustomTrackView::cutClip(const ItemInfo &info, const GenTime &cutTime,
emit displayMessage(i18n("Cannot find clip to uncut"), ErrorMessage);
return NULL;
}
if (!m_timeline->track(info.track)->del(cutTime.seconds())) {
emit displayMessage(i18n("Error removing clip at %1 on track %2", m_document->timecode().getTimecodeFromFrames(cutTime.frames(m_document->fps())), m_timeline->getTrackInfo(info.track).trackName), ErrorMessage);
return NULL;
......@@ -2631,7 +2631,7 @@ ClipItem *CustomTrackView::cutClip(const ItemInfo &info, const GenTime &cutTime,
dup = NULL;
ItemInfo clipinfo = item->info();
bool success = m_timeline->track(clipinfo.track)->resize(clipinfo.startPos.seconds(), (info.endPos - info.startPos).seconds(), true);
bool success = m_timeline->track(clipinfo.track)->resize(clipinfo.startPos.seconds(), (info.endPos - cutTime).seconds(), true);
if (success) {
item->resizeEnd((int) info.endPos.frames(m_document->fps()));
item->setEffectList(oldStack);
......@@ -3292,6 +3292,9 @@ void CustomTrackView::removeTrack(int ix)
}
}
}
//Manually remove all transitions issued from track ix, otherwise MLT will relocate it to another track
m_timeline->transitionHandler->deleteTrackTransitions(ix);
// Delete track in MLT playlist
tractor->remove_track(ix);
......
......@@ -283,7 +283,7 @@ int Timeline::getTracks() {
getEffects(playlist, NULL, i);
slotUpdateTrackEffectState(i);
}
connect(tk, &Track::newTrackDuration, this, &Timeline::checkDuration);
connect(tk, &Track::newTrackDuration, this, &Timeline::checkDuration, Qt::DirectConnection);
connect(tk, SIGNAL(storeSlowMotion(QString,Mlt::Producer *)), m_doc->renderer(), SLOT(storeSlowmotionProducer(QString,Mlt::Producer *)));
}
}
......
......@@ -191,6 +191,7 @@ bool Track::resize(qreal t, qreal dt, bool end)
QScopedPointer<Mlt::Producer> clip(m_playlist.get_clip(index));
if (clip == NULL || clip->is_blank()) {
qWarning("Can't resize clip at %f", t);
m_playlist.unlock();
return false;
}
......@@ -241,6 +242,7 @@ bool Track::resize(qreal t, qreal dt, bool end)
}
}
}
m_playlist.consolidate_blanks();
m_playlist.unlock();
return true;
......
......@@ -285,6 +285,23 @@ void TransitionHandler::deleteTransition(QString tag, int /*a_track*/, int b_tra
//if (m_isBlocked == 0) m_mltConsumer->set("refresh", 1);
}
void TransitionHandler::deleteTrackTransitions(int ix)
{
QScopedPointer<Mlt::Field> field(m_tractor->field());
mlt_service nextservice = mlt_service_get_producer(field->get_service());
mlt_service_type type = mlt_service_identify( nextservice );
while (type == transition_type) {
Mlt::Transition transition((mlt_transition) nextservice);
nextservice = mlt_service_producer(nextservice);
int currentTrack = transition.get_b_track();
if (ix == currentTrack) {
field->disconnect_service(transition);
}
if (nextservice == NULL) break;
type = mlt_service_identify(nextservice );
}
}
bool TransitionHandler::moveTransition(QString type, int startTrack, int newTrack, int newTransitionTrack, GenTime oldIn, GenTime oldOut, GenTime newIn, GenTime newOut)
{
int new_in = (int)newIn.frames(m_fps);
......
......@@ -44,6 +44,7 @@ public:
void updateTransition(QString oldTag, QString tag, int a_track, int b_track, GenTime in, GenTime out, QDomElement xml, bool force = false);
void updateTransitionParams(QString type, int a_track, int b_track, GenTime in, GenTime out, QDomElement xml);
void deleteTransition(QString tag, int a_track, int b_track, GenTime in, GenTime out, QDomElement xml, bool refresh = true);
void deleteTrackTransitions(int ix);
bool moveTransition(QString type, int startTrack, int newTrack, int newTransitionTrack, GenTime oldIn, GenTime oldOut, GenTime newIn, GenTime newOut);
QList <TransitionInfo> mltInsertTrack(int ix, const QString &name, bool videoTrack);
void duplicateTransitionOnPlaylist(int in, int out, QString tag, QDomElement xml, int a_track, int b_track, Mlt::Field *field);
......
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