]> git.sesse.net Git - kdenlive/blobdiff - src/mainwindow.cpp
Drag and drop from effects list
[kdenlive] / src / mainwindow.cpp
index 1455498e9728081856ed676c00b4d44476cccc24..be6ac10b1cd74c7ea2d0a70d1d910174a9374547 100644 (file)
@@ -178,7 +178,7 @@ bool MainWindow::queryClose()
   }
 }
 
-void MainWindow::slotAddEffect(QDomElement effect)
+void MainWindow::slotAddEffect(QDomElement effect, GenTime pos, int track)
 {
   if (!m_activeDocument) return;
   /*QMap <QString, QString> filter;
@@ -188,8 +188,12 @@ void MainWindow::slotAddEffect(QDomElement effect)
     filter = m_audioEffects.effect(effectName);
   else 
     filter = m_customEffects.effect(effectName);*/
+  if (effect.isNull()) {
+    kDebug()<<"--- ERROR, TRYING TO APPEND NULL EFFECT";
+    return;
+  }
   TrackView *currentTimeLine = (TrackView *) m_timelineArea->currentWidget();
-  currentTimeLine->projectView()->slotAddEffect(effect);
+  currentTimeLine->projectView()->slotAddEffect(effect, pos, track);
 }
 
 void MainWindow::slotRaiseMonitor(bool clipMonitor)
@@ -523,5 +527,10 @@ void MainWindow::customEvent ( QEvent * event ){
                        statusProgressBar->setVisible(false);
                }
        }
+       if (event->type()==10010){
+               EffectEvent* p=(EffectEvent*) event;
+               slotAddEffect(p->xml(), p->pos(), p->track());
+       }
+
 }
 #include "mainwindow.moc"