]> git.sesse.net Git - kdenlive/commitdiff
cleanup and now every change of transitions tag updates the monitor
authorMarco Gittler <marco@gitma.de>
Mon, 24 Mar 2008 10:46:46 +0000 (10:46 +0000)
committerMarco Gittler <marco@gitma.de>
Mon, 24 Mar 2008 10:46:46 +0000 (10:46 +0000)
svn path=/branches/KDE4/; revision=2111

src/customtrackview.cpp
src/initeffects.cpp
src/renderer.cpp
src/renderer.h
src/transitionsettings.cpp

index ac3513c5181346afe7a02a710e36a18055adcdcf..be7920659d71ae1b3694d38d9156746bfb8a2b0f 100644 (file)
@@ -165,16 +165,16 @@ void CustomTrackView::mouseMoveEvent(QMouseEvent * event) {
                 m_dragItem->moveTo((int)(snappedPos / m_scale), m_scale, offset, moveTrack);
             } else if (m_operationMode == RESIZESTART) {
                 double snappedPos = getSnapPointForPos(mapToScene(event->pos()).x());
-                m_dragItem->resizeStart(snappedPos / m_scale, m_scale);
+                m_dragItem->resizeStart((int)(snappedPos / m_scale), m_scale);
             } else if (m_operationMode == RESIZEEND) {
                 double snappedPos = getSnapPointForPos(mapToScene(event->pos()).x());
-                m_dragItem->resizeEnd(snappedPos / m_scale, m_scale);
+                m_dragItem->resizeEnd((int)(snappedPos / m_scale), m_scale);
             } else if (m_operationMode == FADEIN) {
-                int pos = mapToScene(event->pos()).x() / m_scale;
-                m_dragItem->setFadeIn(pos - m_dragItem->startPos().frames(m_document->fps()), m_scale);
+                int pos = (int)(mapToScene(event->pos()).x() / m_scale);
+                m_dragItem->setFadeIn((int)(pos - m_dragItem->startPos().frames(m_document->fps())), m_scale);
             } else if (m_operationMode == FADEOUT) {
-                int pos = mapToScene(event->pos()).x() / m_scale;
-                m_dragItem->setFadeOut(m_dragItem->endPos().frames(m_document->fps()) - pos, m_scale);
+                int pos = (int)(mapToScene(event->pos()).x() / m_scale);
+                m_dragItem->setFadeOut((int)(m_dragItem->endPos().frames(m_document->fps()) - pos), m_scale);
             }
 
             if (m_animation) delete m_animation;
@@ -218,10 +218,10 @@ void CustomTrackView::mouseMoveEvent(QMouseEvent * event) {
                 kDebug() << "********  RESIZE CLIP START; WIDTH: " << size;
                 if (m_visualTip == NULL) {
                     QPolygon polygon;
-                    polygon << QPoint(clip->rect().x(), clip->rect().y() + clip->rect().height() / 2 - size * 2);
-                    polygon << QPoint(clip->rect().x() + size * 2, clip->rect().y() + clip->rect().height() / 2);
-                    polygon << QPoint(clip->rect().x(), clip->rect().y() + clip->rect().height() / 2 + size * 2);
-                    polygon << QPoint(clip->rect().x(), clip->rect().y() + clip->rect().height() / 2 - size * 2);
+                    polygon << QPoint((int)clip->rect().x(), (int)(clip->rect().y() + clip->rect().height() / 2 - size * 2));
+                    polygon << QPoint((int)(clip->rect().x() + size * 2), (int)(clip->rect().y() + clip->rect().height() / 2));
+                    polygon << QPoint((int)clip->rect().x(), (int)(clip->rect().y() + clip->rect().height() / 2 + size * 2));
+                    polygon << QPoint((int)clip->rect().x(), (int)(clip->rect().y() + clip->rect().height() / 2 - size * 2));
 
                     m_visualTip = new QGraphicsPolygonItem(polygon);
                     ((QGraphicsPolygonItem*) m_visualTip)->setBrush(m_tipColor);
@@ -244,10 +244,10 @@ void CustomTrackView::mouseMoveEvent(QMouseEvent * event) {
                 setCursor(KCursor("right_side", Qt::SizeHorCursor));
                 if (m_visualTip == NULL) {
                     QPolygon polygon;
-                    polygon << QPoint(clip->rect().x() + clip->rect().width(), clip->rect().y() + clip->rect().height() / 2 - size * 2);
-                    polygon << QPoint(clip->rect().x() + clip->rect().width() - size * 2, clip->rect().y() + clip->rect().height() / 2);
-                    polygon << QPoint(clip->rect().x() + clip->rect().width(), clip->rect().y() + clip->rect().height() / 2 + size * 2);
-                    polygon << QPoint(clip->rect().x() + clip->rect().width(), clip->rect().y() + clip->rect().height() / 2 - size * 2);
+                    polygon << QPoint((int)(clip->rect().x() + clip->rect().width()), (int)(clip->rect().y() + clip->rect().height() / 2 - size * 2));
+                    polygon << QPoint((int)(clip->rect().x() + clip->rect().width() - size * 2), (int)(clip->rect().y() + clip->rect().height() / 2));
+                    polygon << QPoint((int)(clip->rect().x() + clip->rect().width()), (int)(clip->rect().y() + clip->rect().height() / 2 + size * 2));
+                    polygon << QPoint((int)(clip->rect().x() + clip->rect().width()), (int)(clip->rect().y() + clip->rect().height() / 2 - size * 2));
 
                     m_visualTip = new QGraphicsPolygonItem(polygon);
                     ((QGraphicsPolygonItem*) m_visualTip)->setBrush(m_tipColor);
@@ -347,7 +347,7 @@ void CustomTrackView::mouseMoveEvent(QMouseEvent * event) {
         } else {
             m_moveOpMode = NONE;
             if (event->buttons() != Qt::NoButton && event->modifiers() == Qt::NoModifier) {
-                setCursorPos((int) mapToScene(event->pos().x(), 0).x() / m_scale);
+                setCursorPos((int)(mapToScene(event->pos().x(), 0).x() / m_scale));
             }
             if (m_visualTip) {
                 if (m_animation) delete m_animation;
@@ -395,7 +395,7 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event) {
                 } else if (item->type() == TRANSITIONWIDGET) {
                     transitionItem = m_dragItem;
                 }
-                m_clickPoint = QPoint(mapToScene(event->pos()).x() - m_dragItem->startPos().frames(m_document->fps()) * m_scale, event->pos().y() - m_dragItem->rect().top());
+                m_clickPoint = QPoint((int)(mapToScene(event->pos()).x() - m_dragItem->startPos().frames(m_document->fps()) * m_scale), (int)(event->pos().y() - m_dragItem->rect().top()));
                 m_operationMode = m_dragItem->operationMode(item->mapFromScene(mapToScene(event->pos())), m_scale);
                 if (m_operationMode == MOVE) setCursor(Qt::ClosedHandCursor);
                 if (m_operationMode == MOVE || m_operationMode == RESIZESTART)
@@ -404,8 +404,8 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event) {
                     m_startPos = QPointF(m_dragItem->endPos().frames(m_document->fps()), m_dragItem->track());
                 else if (m_operationMode == TRANSITIONSTART) {
                     Transition *tr = new Transition(
-                        QRect(m_dragItem->startPos().frames(m_document->fps()) *m_scale , m_dragItem->rect().y() + m_dragItem->rect().height() / 2,
-                              GenTime(2.5).frames(m_document->fps()) *m_scale ,  m_dragItem->rect().height()
+                        QRect((int)(m_dragItem->startPos().frames(m_document->fps()) *m_scale) , (int)(m_dragItem->rect().y() + m_dragItem->rect().height() / 2),
+                              (int)(GenTime(2.5).frames(m_document->fps()) *m_scale) , (int)(m_dragItem->rect().height())
                              ),
                         (ClipItem*)m_dragItem, "luma" , m_dragItem->startPos(), m_dragItem->startPos() + GenTime(2.5), m_document->fps());
                     tr->setTrack(m_dragItem->track());
@@ -430,7 +430,7 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event) {
             //emit clipItemSelected(NULL);
             if (event->button() == Qt::RightButton) {
                 displayContextMenu(event->globalPos());
-            } else setCursorPos((int) mapToScene(event->x(), 0).x() / m_scale);
+            } else setCursorPos((int)(mapToScene(event->x(), 0).x() / m_scale));
         } else if (event->button() == Qt::RightButton) {
             m_operationMode = NONE;
             displayContextMenu(event->globalPos(), (ClipItem *) m_dragItem);
@@ -474,7 +474,7 @@ void CustomTrackView::slotRefreshEffects(ClipItem *clip) {
 }
 
 void CustomTrackView::addEffect(int track, GenTime pos, QDomElement effect) {
-    ClipItem *clip = getClipItemAt(pos.frames(m_document->fps()) + 1, m_tracksList.count() - track);
+    ClipItem *clip = getClipItemAt((int)pos.frames(m_document->fps()) + 1, m_tracksList.count() - track);
     if (clip) {
         QMap <QString, QString> effectParams = clip->addEffect(effect);
         m_document->renderer()->mltAddEffect(track, pos, effectParams);
@@ -485,7 +485,7 @@ void CustomTrackView::addEffect(int track, GenTime pos, QDomElement effect) {
 void CustomTrackView::deleteEffect(int track, GenTime pos, QDomElement effect) {
     QString index = effect.attribute("kdenlive_ix");
     m_document->renderer()->mltRemoveEffect(track, pos, index);
-    ClipItem *clip = getClipItemAt(pos.frames(m_document->fps()) + 1, m_tracksList.count() - track);
+    ClipItem *clip = getClipItemAt((int)pos.frames(m_document->fps()) + 1, m_tracksList.count() - track);
     if (clip) {
         clip->deleteEffect(index);
         emit clipItemSelected(clip);
@@ -497,7 +497,7 @@ void CustomTrackView::slotAddEffect(QDomElement effect, GenTime pos, int track)
     if (track == -1)
         itemList = items();
     else {
-        ClipItem *clip = getClipItemAt(pos.frames(m_document->fps()) + 1, track);
+        ClipItem *clip = getClipItemAt((int)pos.frames(m_document->fps()) + 1, track);
         if (clip) itemList.append(clip);
         else kDebug() << "------   wrning, clip eff not found";
     }
@@ -523,7 +523,7 @@ void CustomTrackView::slotDeleteEffect(ClipItem *clip, QDomElement effect) {
 }
 
 void CustomTrackView::updateEffect(int track, GenTime pos, QDomElement effect) {
-    ClipItem *clip = getClipItemAt(pos.frames(m_document->fps()) + 1, m_tracksList.count() - track);
+    ClipItem *clip = getClipItemAt((int)pos.frames(m_document->fps()) + 1, m_tracksList.count() - track);
     if (clip) {
         QMap <QString, QString> effectParams = clip->getEffectArgs(effect);
         if (effectParams["disabled"] == "1") {
@@ -617,6 +617,7 @@ void CustomTrackView::updateTransition(int track, GenTime pos, QDomElement oldTr
             GenTime(transition.attribute("start").toInt(), m_document->renderer()->fps()),
             GenTime(transition.attribute("end").toInt(), m_document->renderer()->fps()),
             map);
+    repaint();
     m_document->setModified(true);
 }
 
@@ -635,7 +636,7 @@ void CustomTrackView::dragMoveEvent(QDragMoveEvent * event) {
     //kDebug()<<"+++++++++++++   DRAG MOVE, : "<<mapToScene(event->pos()).x()<<", SCAL: "<<m_scale;
     if (m_dropItem) {
         int track = (int)(event->pos().y() / m_tracksHeight);  //) * (m_scale * 50) + m_scale;
-        m_dropItem->moveTo(mapToScene(event->pos()).x() / m_scale, m_scale, (double)(track - m_dropItem->track()) * m_tracksHeight, track);
+        m_dropItem->moveTo((int)(mapToScene(event->pos()).x() / m_scale), m_scale, (double)(track - m_dropItem->track()) * m_tracksHeight, track);
         event->setDropAction(Qt::MoveAction);
         if (event->mimeData()->hasFormat("kdenlive/producerslist")) {
             event->acceptProposedAction();
@@ -732,7 +733,7 @@ void CustomTrackView::deleteClip(int clipId) {
 }
 
 void CustomTrackView::setCursorPos(int pos, bool seek) {
-    emit cursorMoved(m_cursorPos * m_scale, pos * m_scale);
+    emit cursorMoved((int)(m_cursorPos * m_scale), (int)(pos * m_scale));
     m_cursorPos = pos;
     m_cursorLine->setPos(pos * m_scale, 0);
     if (seek) m_document->renderer()->seek(GenTime(pos, m_document->fps()));
@@ -744,7 +745,7 @@ void CustomTrackView::updateCursorPos() {
 }
 
 int CustomTrackView::cursorPos() {
-    return m_cursorPos * m_scale;
+    return (int)(m_cursorPos * m_scale);
 }
 
 void CustomTrackView::checkScrolling() {
@@ -752,7 +753,7 @@ void CustomTrackView::checkScrolling() {
     int delta = rectInView.width() / 3;
     int max = rectInView.right() + horizontalScrollBar()->value() - delta;
     //kDebug() << "CURSOR POS: "<<m_cursorPos<< "Scale: "<<m_scale;
-    if (m_cursorPos * m_scale >= max) horizontalScrollBar()->setValue(horizontalScrollBar()->value() + 1 + m_scale);
+    if (m_cursorPos * m_scale >= max) horizontalScrollBar()->setValue((int)(horizontalScrollBar()->value() + 1 + m_scale));
 }
 
 void CustomTrackView::mouseReleaseEvent(QMouseEvent * event) {
@@ -764,12 +765,12 @@ void CustomTrackView::mouseReleaseEvent(QMouseEvent * event) {
         // move clip
         MoveClipCommand *command = new MoveClipCommand(this, m_startPos, QPointF(m_dragItem->startPos().frames(m_document->fps()), m_dragItem->track()), false);
         m_commandStack->push(command);
-        if (m_dragItem->type() == AVWIDGET) m_document->renderer()->mltMoveClip(m_tracksList.count() - m_startPos.y(), m_tracksList.count() - m_dragItem->track(), m_startPos.x(), m_dragItem->startPos().frames(m_document->fps()));
+        if (m_dragItem->type() == AVWIDGET) m_document->renderer()->mltMoveClip((int)(m_tracksList.count() - m_startPos.y()), (int)(m_tracksList.count() - m_dragItem->track()), (int) m_startPos.x(), (int)(m_dragItem->startPos().frames(m_document->fps())));
     } else if (m_operationMode == RESIZESTART) {
         // resize start
         ResizeClipCommand *command = new ResizeClipCommand(this, m_startPos, QPointF(m_dragItem->startPos().frames(m_document->fps()), m_dragItem->track()), true, false);
 
-        if (m_dragItem->type() == AVWIDGET) m_document->renderer()->mltResizeClipStart(m_tracksList.count() - m_dragItem->track(), m_dragItem->endPos(), m_dragItem->startPos(), GenTime(m_startPos.x(), m_document->fps()), m_dragItem->cropStart(), m_dragItem->cropStart() + m_dragItem->endPos() - m_dragItem->startPos());
+        if (m_dragItem->type() == AVWIDGET) m_document->renderer()->mltResizeClipStart(m_tracksList.count() - m_dragItem->track(), m_dragItem->endPos(), m_dragItem->startPos(), GenTime((int)m_startPos.x(), m_document->fps()), m_dragItem->cropStart(), m_dragItem->cropStart() + m_dragItem->endPos() - m_dragItem->startPos());
         m_commandStack->push(command);
         m_document->renderer()->doRefresh();
     } else if (m_operationMode == RESIZEEND) {
@@ -810,7 +811,7 @@ void CustomTrackView::deleteSelectedClips() {
 }
 
 void CustomTrackView::addClip(QDomElement xml, int clipId, int track, GenTime startpos, const QRectF &rect, GenTime duration) {
-    QRect r(startpos.frames(m_document->fps()) * m_scale, m_tracksHeight * track, duration.frames(m_document->fps()) * m_scale, m_tracksHeight - 1);
+    QRect r((int)(startpos.frames(m_document->fps()) * m_scale), m_tracksHeight * track, (int)(duration.frames(m_document->fps()) * m_scale), m_tracksHeight - 1);
     DocClipBase *baseclip = m_document->clipManager()->getClipById(clipId);
     ClipItem *item = new ClipItem(baseclip, track, startpos, r, duration, m_document->fps());
     scene()->addItem(item);
@@ -829,39 +830,39 @@ ClipItem *CustomTrackView::getClipItemAt(GenTime pos, int track) {
 }
 
 void CustomTrackView::moveClip(const QPointF &startPos, const QPointF &endPos) {
-    ClipItem *item = getClipItemAt(startPos.x() + 1, startPos.y());
+    ClipItem *item = getClipItemAt((int)startPos.x() + 1, (int)startPos.y());
     if (!item) {
         kDebug() << "----------------  ERROR, CANNOT find clip to move at: " << startPos.x() * m_scale * FRAME_SIZE + 1 << ", " << startPos.y() * m_tracksHeight + m_tracksHeight / 2;
         return;
     }
     kDebug() << "----------------  Move CLIP FROM: " << startPos.x() << ", END:" << endPos.x();
-    item->moveTo(endPos.x(), m_scale, (endPos.y() - startPos.y()) * m_tracksHeight, endPos.y());
-    m_document->renderer()->mltMoveClip(m_tracksList.count() - startPos.y(), m_tracksList.count() - endPos.y(), startPos.x(), endPos.x());
+    item->moveTo((int)endPos.x(), m_scale, (endPos.y() - startPos.y()) * m_tracksHeight, (int)endPos.y());
+    m_document->renderer()->mltMoveClip((int)(m_tracksList.count() - startPos.y()), (int)(m_tracksList.count() - endPos.y()), (int) startPos.x(), (int)endPos.x());
 }
 
 void CustomTrackView::resizeClip(const QPointF &startPos, const QPointF &endPos, bool resizeClipStart) {
     int offset;
     if (resizeClipStart) offset = 1;
     else offset = -1;
-    ClipItem *item = getClipItemAt(startPos.x() + offset, startPos.y());
+    ClipItem *item = getClipItemAt((int)(startPos.x() + offset), (int) startPos.y());
     if (!item) {
         kDebug() << "----------------  ERROR, CANNOT find clip to resize at: " << startPos;
         return;
     }
     qreal diff = endPos.x() - startPos.x();
     if (resizeClipStart) {
-        m_document->renderer()->mltResizeClipStart(m_tracksList.count() - item->track(), item->endPos(), GenTime(endPos.x(), m_document->fps()), item->startPos(), item->cropStart() + GenTime(diff, m_document->fps()), item->cropStart() + GenTime(diff, m_document->fps()) + item->endPos() - GenTime(endPos.x(), m_document->fps()));
-        item->resizeStart(endPos.x(), m_scale);
+        m_document->renderer()->mltResizeClipStart(m_tracksList.count() - item->track(), item->endPos(), GenTime((int)endPos.x(), m_document->fps()), item->startPos(), item->cropStart() + GenTime((int)diff, m_document->fps()), item->cropStart() + GenTime((int)diff, m_document->fps()) + item->endPos() - GenTime((int)endPos.x(), m_document->fps()));
+        item->resizeStart((int)endPos.x(), m_scale);
     } else {
-        m_document->renderer()->mltResizeClipEnd(m_tracksList.count() - item->track(), item->startPos(), item->cropStart(), item->cropStart() + GenTime(endPos.x(), m_document->fps()) - item->startPos());
-        item->resizeEnd(endPos.x(), m_scale);
+        m_document->renderer()->mltResizeClipEnd(m_tracksList.count() - item->track(), item->startPos(), item->cropStart(), item->cropStart() + GenTime((int)endPos.x(), m_document->fps()) - item->startPos());
+        item->resizeEnd((int)endPos.x(), m_scale);
     }
     m_document->renderer()->doRefresh();
 }
 
 double CustomTrackView::getSnapPointForPos(double pos) {
     for (int i = 0; i < m_snapPoints.size(); ++i) {
-        if (abs(pos - m_snapPoints.at(i).frames(m_document->fps()) * m_scale) < 10) {
+        if (abs((int)(pos - m_snapPoints.at(i).frames(m_document->fps()) * m_scale)) < 10) {
             //kDebug()<<" FOUND SNAP POINT AT: "<<m_snapPoints.at(i)<<", current pos: "<<pos / m_scale;
             return m_snapPoints.at(i).frames(m_document->fps()) * m_scale + 0.5;
         }
index efd3266d058e05f6fb8dc154986d3cc8993a7ca3..d56cc5f553c91433f3085eb08551ce31813c68c7 100644 (file)
@@ -456,21 +456,21 @@ void initEffects::fillTransitionsList(Mlt::Repository * repository, EffectsList*
                 tname.appendChild(ret.createTextNode("Mix"));
             } else if (name == "affine") {
                 tname.appendChild(ret.createTextNode("Affine"));
-                paramList.append(quickParameterFill(ret, "Rotate Y", "rotate_y", "double", "1", "0", "360"));
-                paramList.append(quickParameterFill(ret, "Rotate X", "rotate_x", "double", "1", "0", "360"));
-                paramList.append(quickParameterFill(ret, "Rotate Z", "rotate_z", "double", "1", "0", "360"));
-                paramList.append(quickParameterFill(ret, "Fix Rotate Y", "fix_rotate_y", "double", "1", "0", "360"));
-                paramList.append(quickParameterFill(ret, "Fix Rotate X", "fix_rotate_x", "double", "1", "0", "360"));
-                paramList.append(quickParameterFill(ret, "Fix Rotate Z", "fix_rotate_z", "double", "1", "0", "360"));
-                paramList.append(quickParameterFill(ret, "Shear Y", "shear_y", "double", "1", "0", "360"));
-                paramList.append(quickParameterFill(ret, "Shear X", "shear_x", "double", "1", "0", "360"));
-                paramList.append(quickParameterFill(ret, "Shear Z", "shear_z", "double", "1", "0", "360"));
-                paramList.append(quickParameterFill(ret, "Fix Shear Y", "fix_shear_y", "double", "1", "0", "360"));
-                paramList.append(quickParameterFill(ret, "Fix Shear X", "fix_shear_x", "double", "1", "0", "360"));
-                paramList.append(quickParameterFill(ret, "Fix Shear Z", "fix_shear_z", "double", "1", "0", "360"));
-                paramList.append(quickParameterFill(ret, "Mirror", "mirror_off", "bool", "1", "0", "1"));
-                paramList.append(quickParameterFill(ret, "Repeat", "repeat_off", "bool", "1", "0", "1"));
-                paramList.append(quickParameterFill(ret, "Geometry", "geometry", "geometry", "0,0:100%x100%", "0,0:100%x100%0", "0,0:100%x100%1"));
+                paramList.append(quickParameterFill(ret, "Rotate Y", "rotate_y", "double", "0", "0", "360"));
+                paramList.append(quickParameterFill(ret, "Rotate X", "rotate_x", "double", "0", "0", "360"));
+                paramList.append(quickParameterFill(ret, "Rotate Z", "rotate_z", "double", "0", "0", "360"));
+                paramList.append(quickParameterFill(ret, "Fix Rotate Y", "fix_rotate_y", "double", "0", "0", "360"));
+                paramList.append(quickParameterFill(ret, "Fix Rotate X", "fix_rotate_x", "double", "0", "0", "360"));
+                paramList.append(quickParameterFill(ret, "Fix Rotate Z", "fix_rotate_z", "double", "0", "0", "360"));
+                paramList.append(quickParameterFill(ret, "Shear Y", "shear_y", "double", "0", "0", "360"));
+                paramList.append(quickParameterFill(ret, "Shear X", "shear_x", "double", "0", "0", "360"));
+                paramList.append(quickParameterFill(ret, "Shear Z", "shear_z", "double", "0", "0", "360"));
+                paramList.append(quickParameterFill(ret, "Fix Shear Y", "fix_shear_y", "double", "0", "0", "360"));
+                paramList.append(quickParameterFill(ret, "Fix Shear X", "fix_shear_x", "double", "0", "0", "360"));
+                paramList.append(quickParameterFill(ret, "Fix Shear Z", "fix_shear_z", "double", "0", "0", "360"));
+                paramList.append(quickParameterFill(ret, "Mirror", "mirror_off", "bool", "0", "0", "1"));
+                paramList.append(quickParameterFill(ret, "Repeat", "repeat_off", "bool", "0", "0", "1"));
+                paramList.append(quickParameterFill(ret, "Geometry", "geometry", "geometry", "0%,0%:100%x100%", "0,0:100%x100%0", "0,0:100%x100%1"));
             } else if (name == "region") {
                 tname.appendChild(ret.createTextNode("Region"));
             }
index de81a7a8e395fbac9585525271e23639fee2aaaf..ba3932aa287dcfdd6cfd552c40068dc9ec4cf24e 100644 (file)
@@ -1390,7 +1390,7 @@ void Render::mltMoveTransition(QString type, int startTrack, int trackOffset, Ge
 void Render::mltUpdateTransition(QString oldTag, QString tag, int a_track, int b_track, GenTime in, GenTime out, QMap <QString, QString> args) {
     kDebug() << "update transition"  << tag;
 
-    mltDeleteTransition(oldTag, a_track, b_track, in, out, args);
+    mltDeleteTransition(oldTag, a_track, b_track, in, out, args, false);
     mltAddTransition(tag, a_track, b_track, in, out, args);
     mltSavePlaylist();
 }
@@ -1404,7 +1404,7 @@ void Render::replaceTimelineTractor(Mlt::Tractor t) {
     kDebug() << "newTractor inserted";
 }
 
-void Render::mltDeleteTransition(QString tag, int a_track, int b_track, GenTime in, GenTime out, QMap <QString, QString> args) {
+void Render::mltDeleteTransition(QString tag, int a_track, int b_track, GenTime in, GenTime out, QMap <QString, QString> args, bool do_refresh) {
 
     Mlt::Tractor *tractor = getTractor();
     if (tractor) {
@@ -1437,9 +1437,9 @@ void Render::mltDeleteTransition(QString tag, int a_track, int b_track, GenTime
                 int currentIn = (int) mlt_transition_get_in(tr);
                 int currentOut = (int) mlt_transition_get_out(tr);
                 int old_pos = (int)((in.frames(m_fps) + out.frames(m_fps)) / 2);
-                //kDebug() << current_a_track << current_b_track << a_track << b_track << currentIn << currentOut << old_pos << mlt_properties_get(prop,"mlt_service");
+                kDebug() << current_a_track << current_b_track << a_track << b_track << currentIn << currentOut << old_pos << mlt_properties_get(prop, "mlt_service");
                 if (current_a_track == a_track &&  b_track == current_b_track && currentIn <= old_pos && currentOut >= old_pos) {
-                    //kDebug() << "removing " << mlt_properties_get(prop,"mlt_service");
+                    kDebug() << "removing " << mlt_properties_get(prop, "mlt_service");
                 } else
                     newTractor.plant_transition(transition, current_a_track, current_b_track);
             }
@@ -1449,14 +1449,13 @@ void Render::mltDeleteTransition(QString tag, int a_track, int b_track, GenTime
         replaceTimelineTractor(newTractor);
         m_mltProducer->seek(old_position);
         delete tractor;
-        refresh();
+        if (do_refresh) refresh();
     }
 
 }
 
-void Render::mltAddTransition(QString tag, int a_track, int b_track, GenTime in, GenTime out, QMap <QString, QString> args) {
+void Render::mltAddTransition(QString tag, int a_track, int b_track, GenTime in, GenTime out, QMap <QString, QString> args, bool do_refresh) {
 
-    m_isBlocked = true;
     Mlt::Tractor *tractor = getTractor();
     if (tractor) {
         Mlt::Field *field = tractor->field();
@@ -1485,9 +1484,8 @@ void Render::mltAddTransition(QString tag, int a_track, int b_track, GenTime in,
         // attach filter to the clip
         field->plant_transition(transition, a_track, b_track);
         delete[] transId;
-        m_isBlocked = false;
         mltSavePlaylist();
-        refresh();
+        if (do_refresh) refresh();
         delete tractor;
     }
 }
index 482b67353f0132109baf6e449df3e4b2fe5f560c..8092e1f0ff6f2ac46d0648d312d6f1370a45f13a 100644 (file)
@@ -156,8 +156,8 @@ Q_OBJECT public:
     void mltEditEffect(int track, GenTime position, QMap <QString, QString> args);
     void mltChangeTrackState(int track, bool mute, bool blind);
     void mltMoveTransition(QString type, int startTrack, int trackOffset, GenTime oldIn, GenTime oldOut, GenTime newIn, GenTime newOut);
-    void mltAddTransition(QString tag, int a_track, int b_track, GenTime in, GenTime out, QMap <QString, QString> args);
-    void mltDeleteTransition(QString tag, int a_track, int b_track, GenTime in, GenTime out, QMap <QString, QString> args);
+    void mltAddTransition(QString tag, int a_track, int b_track, GenTime in, GenTime out, QMap <QString, QString> args, bool refresh = true);
+    void mltDeleteTransition(QString tag, int a_track, int b_track, GenTime in, GenTime out, QMap <QString, QString> args, bool refresh = true);
     void mltUpdateTransition(QString oldTag, QString tag, int a_track, int b_track, GenTime in, GenTime out, QMap <QString, QString> args);
 
 
index dc0748336f596f4840c54df39c87f9a81bd453f1..8ee01b889389b023e0beee3030317742bdcd5a1d 100644 (file)
@@ -41,7 +41,7 @@ void TransitionSettings::slotTransitionChanged() {
     QDomElement desc = m_transitions->getEffectByName(ui.listWidget->currentItem()->text());
     if (m_usedTransition)
         m_usedTransition->setTransitionParameters(desc);
-    emit transitionUpdated(e, desc);
+    emit transitionUpdated(e, m_usedTransition->toXML());
     emit transferParamDesc(desc, 0, 0);
 }