]> git.sesse.net Git - kdenlive/blobdiff - src/effectstack/effectstackview2.cpp
Cleanup
[kdenlive] / src / effectstack / effectstackview2.cpp
index 69c28d758bbdc7d01eae7b3f82dfa1c1ea434048..5b7610d4e40ec0eb65b83996fa3b05de37ec6dec 100644 (file)
@@ -93,14 +93,24 @@ void EffectStackView2::slotRenderPos(int pos)
         m_effects.at(i)->slotSyncEffectsPos(pos);
 }
 
+void EffectStackView2::slotClipItemUpdate()
+{
+    int inPoint = m_clipref->cropStart().frames(KdenliveSettings::project_fps());
+    int outPoint = m_clipref->cropDuration().frames(KdenliveSettings::project_fps()) + inPoint;
+    for (int i = 0; i < m_effects.count(); i++) {
+        m_effects.at(i)->setRange(inPoint, outPoint);
+    }
+}
+
 void EffectStackView2::slotClipItemSelected(ClipItem* c)
 {
     if (c && !c->isEnabled()) return;
     if (c && c == m_clipref) {
-
     } else {
+       if (m_clipref) disconnect(m_clipref, SIGNAL(updateRange()), this, SLOT(slotClipItemUpdate()));
         m_clipref = c;
         if (c) {
+           connect(m_clipref, SIGNAL(updateRange()), this, SLOT(slotClipItemUpdate()));
             QString cname = m_clipref->clipName();
             if (cname.length() > 30) {
                 m_ui.checkAll->setToolTip(i18n("Effects for %1", cname));
@@ -942,6 +952,16 @@ void EffectStackView2::dropEvent(QDropEvent *event)
     processDroppedEffect(doc.documentElement(), event);
 }
 
+void EffectStackView2::setKeyframes(const QString data, int maximum)
+{
+    for (int i = 0; i < m_effects.count(); i++) {
+        if (m_effects.at(i)->isActive()) {
+           m_effects.at(i)->setKeyframes(data, maximum);
+            break;
+        }
+    }
+}
+
 //static
 const QString EffectStackView2::getStyleSheet()
 {