]> git.sesse.net Git - kdenlive/blobdiff - src/customtrackview.cpp
* Small updates to composite transition
[kdenlive] / src / customtrackview.cpp
index 26d6eb58f2a16ec9760f818f3653543944cfb00e..d61a4a04836554c6f49ae7f94ea96f1da9eee75b 100644 (file)
@@ -619,7 +619,7 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event) {
             } else {
                 // Select all items on all tracks after click position
                 selection = items(event->pos().x(), 1, sceneRect().width() - event->pos().x(), sceneRect().height());
-               kDebug() << "SELELCTING ELEMENTS WITHIN =" << event->pos().x() << "/" <<  1 << ", " << sceneRect().width() - event->pos().x() << "/" << sceneRect().height();
+                kDebug() << "SELELCTING ELEMENTS WITHIN =" << event->pos().x() << "/" <<  1 << ", " << sceneRect().width() - event->pos().x() << "/" << sceneRect().height();
             }
             m_selectionGroup = new AbstractGroupItem(m_document->fps());
             scene()->addItem(m_selectionGroup);
@@ -629,35 +629,36 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event) {
                     m_selectionGroup->addToGroup(selection.at(i));
                     selection.at(i)->setFlags(QGraphicsItem::ItemIsSelectable);
                 }
-           }
-//         kDebug() << "SPACER TOOL: SELECTION GROUP POSITION " << m_selectionGroup->pos().x() << "/" << m_selectionGroup->pos().y();
+            }
+//      kDebug() << "SPACER TOOL: SELECTION GROUP POSITION " << m_selectionGroup->pos().x() << "/" << m_selectionGroup->pos().y();
 //             kDebug() << "SPACER TOOL: SELECTION GROUP RECT IS " << m_selectionGroup->boundingRect().top() << "/" << m_selectionGroup->boundingRect().left() << "; " << m_selectionGroup->boundingRect().bottom() << "/" << m_selectionGroup->boundingRect().right();
-           QPointF top = m_selectionGroup->boundingRect().topLeft();
-           kDebug() << "SPACER TOOL: SELECTION RECT TOP LEFT IS " << m_selectionGroup->pos().x() << "/"<<m_selectionGroup->pos().y();// << " TO " << top.x() << "/" << top.y();
-           // Something goes wrong there
-           kDebug() << "SPACER TOOL: WILL SET TO " << top.x() << "/" << top.y();
-           m_selectionGroup->setPos(top);
-           kDebug() << "SPACER TOOL: POS SET; POSITION IS NOW " << m_selectionGroup->pos().x() << "/" << m_selectionGroup->pos().y();
-           if (m_selectionGroup->pos().x() == 0 && m_selectionGroup->pos().y() == 0) {
-              /*
-              This is _really_ strange. Sometimes the position cannot be set and remains (0|0). In this case, translating would cause
-              all videos to be moved around, a very nasty effect as even the track will be changed. 
-              It is somehow scale dependant (only when zoomed in far enough), at least in my project. ---Simon 
-              BUG ID: 0000604, http://www.kdenlive.org/mantis/view.php?id=604
-              */
-              kDebug() << "////////// SPACER TOOL: NOT TRANSLATING BY " << -top.x() << "/" << 1-top.y() << " BECAUSE CHANGING POSITION FAILED!";
-              //m_selectionGroup->translate(-top.x(), -top.y() + 1);
-              kDebug() << "SPACER TOOL: NOT TRANSLATED; POSITION IS STILL " << m_selectionGroup->pos().x() << "/" << m_selectionGroup->pos().y();
-           } else {
-              kDebug() << "SPACER TOOL: TRANSLATING BY " << -top.x() << "/" << 1-top.y();
-              m_selectionGroup->translate(-top.x(), -top.y() + 1);
-              kDebug() << "SPACER TOOL: TRANSLATED; POSITION IS NOW " << m_selectionGroup->pos().x() << "/" << m_selectionGroup->pos().y();
-           }
-           // End Wrong
+            QPointF top = m_selectionGroup->boundingRect().topLeft();
+            kDebug() << "SPACER TOOL: SELECTION RECT TOP LEFT IS " << m_selectionGroup->pos().x() << "/" << m_selectionGroup->pos().y();// << " TO " << top.x() << "/" << top.y();
+
+            // Something goes wrong there
+            kDebug() << "SPACER TOOL: WILL SET TO " << top.x() << "/" << top.y();
+            m_selectionGroup->setPos(top);
+            kDebug() << "SPACER TOOL: POS SET; POSITION IS NOW " << m_selectionGroup->pos().x() << "/" << m_selectionGroup->pos().y();
+            if (m_selectionGroup->pos().x() == 0 && m_selectionGroup->pos().y() == 0) {
+                /*
+                This is _really_ strange. Sometimes the position cannot be set and remains (0|0). In this case, translating would cause
+                all videos to be moved around, a very nasty effect as even the track will be changed.
+                It is somehow scale dependant (only when zoomed in far enough), at least in my project. ---Simon
+                BUG ID: 0000604, http://www.kdenlive.org/mantis/view.php?id=604
+                */
+                kDebug() << "////////// SPACER TOOL: NOT TRANSLATING BY " << -top.x() << "/" << 1 - top.y() << " BECAUSE CHANGING POSITION FAILED!";
+                //m_selectionGroup->translate(-top.x(), -top.y() + 1);
+                kDebug() << "SPACER TOOL: NOT TRANSLATED; POSITION IS STILL " << m_selectionGroup->pos().x() << "/" << m_selectionGroup->pos().y();
+            } else {
+                kDebug() << "SPACER TOOL: TRANSLATING BY " << -top.x() << "/" << 1 - top.y();
+                m_selectionGroup->translate(-top.x(), -top.y() + 1);
+                kDebug() << "SPACER TOOL: TRANSLATED; POSITION IS NOW " << m_selectionGroup->pos().x() << "/" << m_selectionGroup->pos().y();
+            }
+            // End Wrong
             kDebug() << "SPACER TOOL: SELECTION GROUP POSITION IS NOW " << m_selectionGroup->pos().x() << "/" << -m_selectionGroup->pos().y();
             m_operationMode = SPACER;
         } else setCursorPos((int)(mapToScene(event->x(), 0).x()));
-       kDebug() << "END mousePress EVENT ";
+        kDebug() << "END mousePress EVENT ";
         return;
     }
 
@@ -1351,7 +1352,7 @@ void CustomTrackView::dropEvent(QDropEvent * event) {
             if (item->baseClip()->isTransparent()) {
                 // add transparency transition
                 int endTrack = getPreviousVideoTrack(info.track);
-                Transition *tr = new Transition(info, endTrack, m_document->fps(), MainWindow::transitions.getEffectByTag("composite", "alphatransparency"), true);
+                Transition *tr = new Transition(info, endTrack, m_document->fps(), MainWindow::transitions.getEffectByTag("composite", "composite"), true);
                 if (m_document->renderer()->mltAddTransition(tr->transitionTag(), endTrack, m_document->tracksCount() - info.track, info.startPos, info.endPos, tr->toXML())) {
                     scene()->addItem(tr);
                 } else {
@@ -2253,7 +2254,7 @@ void CustomTrackView::addClip(QDomElement xml, const QString &clipId, ItemInfo i
     if (item->baseClip()->isTransparent()) {
         // add transparency transition
         int endTrack = getPreviousVideoTrack(info.track);
-        Transition *tr = new Transition(info, endTrack, m_document->fps(), MainWindow::transitions.getEffectByTag("composite", "alphatransparency"), true);
+        Transition *tr = new Transition(info, endTrack, m_document->fps(), MainWindow::transitions.getEffectByTag("composite", "composite"), true);
         if (m_document->renderer()->mltAddTransition(tr->transitionTag(), endTrack, m_document->tracksCount() - info.track, info.startPos, info.endPos, tr->toXML())) scene()->addItem(tr);
         else {
             emit displayMessage(i18n("Cannot add transition"), ErrorMessage);