]> git.sesse.net Git - kdenlive/commitdiff
* Allow editing keyframable effects in groups:
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 12 Jun 2009 23:22:14 +0000 (23:22 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 12 Jun 2009 23:22:14 +0000 (23:22 +0000)
http://kdenlive.org/mantis/view.php?id=814
* Don't add audio effects on video only clips nor video effects on sound clips

svn path=/trunk/kdenlive/; revision=3526

src/abstractclipitem.cpp
src/clipitem.cpp
src/customtrackview.cpp

index 4521e9d74ed9437995294648467520dd37923c61..e58178ea70f203fc4096646654dbdbfc75855a58 100644 (file)
@@ -255,7 +255,8 @@ void AbstractClipItem::drawKeyFrames(QPainter *painter, QRectF /*exposedRect*/)
     double y2;
 
     // draw line showing default value
-    if (isSelected()) {
+    bool active = isSelected() || (parentItem() && parentItem()->isSelected());
+    if (active) {
         x1 = br.x();
         x2 = br.right();
         y1 = br.bottom() - m_keyframeDefault * maxh;
@@ -285,13 +286,13 @@ void AbstractClipItem::drawKeyFrames(QPainter *painter, QRectF /*exposedRect*/)
         QLineF l(x1, y1, x2, y2);
         l2 = painter->matrix().map(l);
         painter->drawLine(l2);
-        if (isSelected()) {
+        if (active) {
             painter->fillRect(l2.x1() - 3, l2.y1() - 3, 6, 6, QBrush(color));
         }
         x1 = x2;
         y1 = y2;
     }
-    if (isSelected()) painter->fillRect(l2.x2() - 3, l2.y2() - 3, 6, 6, QBrush(color));
+    if (active) painter->fillRect(l2.x2() - 3, l2.y2() - 3, 6, 6, QBrush(color));
 }
 
 int AbstractClipItem::mouseOverKeyFrames(QPointF pos)
index ab680d99dd30f79376a28e32c58f159e485ac259..1159d3432298cfdb2909ec03be08a96030693adc 100644 (file)
@@ -851,7 +851,7 @@ OPERATIONTYPE ClipItem::operationMode(QPointF pos)
 {
     if (isItemLocked()) return NONE;
 
-    if (isSelected()) {
+    if (isSelected() || (parentItem() && parentItem()->isSelected())) {
         m_editedKeyframe = mouseOverKeyFrames(pos);
         if (m_editedKeyframe != -1) return KEYFRAME;
     }
index f73e49c3e581ff8cdc352347d6dffdf832f0fb31..180b000bff4790486cec50ced8c83a47e259d7dd 100644 (file)
@@ -1262,6 +1262,14 @@ void CustomTrackView::slotAddGroupEffect(QDomElement effect, AbstractGroupItem *
     for (int i = 0; i < itemList.count(); i++) {
         if (itemList.at(i)->type() == AVWIDGET) {
             ClipItem *item = static_cast <ClipItem *>(itemList.at(i));
+            if (effect.attribute("type") == "audio") {
+                // Don't add audio effects on video clips
+                if (item->isVideoOnly() || (item->clipType() != AUDIO && item->clipType() != AV && item->clipType() != PLAYLIST)) continue;
+            } else if (effect.hasAttribute("type") == false) {
+                // Don't add video effect on audio clips
+                if (item->isAudioOnly() || item->clipType() == AUDIO) continue;
+            }
+
             if (item->hasEffect(effect.attribute("tag"), effect.attribute("id")) != -1 && effect.attribute("unique", "0") != "0") {
                 emit displayMessage(i18n("Effect already present in clip"), ErrorMessage);
                 continue;
@@ -1305,6 +1313,13 @@ void CustomTrackView::slotAddEffect(QDomElement effect, GenTime pos, int track)
     for (int i = 0; i < itemList.count(); i++) {
         if (itemList.at(i)->type() == AVWIDGET) {
             ClipItem *item = (ClipItem *)itemList.at(i);
+            if (effect.attribute("type") == "audio") {
+                // Don't add audio effects on video clips
+                if (item->isVideoOnly() || (item->clipType() != AUDIO && item->clipType() != AV && item->clipType() != PLAYLIST)) continue;
+            } else if (effect.hasAttribute("type") == false) {
+                // Don't add video effect on audio clips
+                if (item->isAudioOnly() || item->clipType() == AUDIO) continue;
+            }
             if (item->hasEffect(effect.attribute("tag"), effect.attribute("id")) != -1 && effect.attribute("unique", "0") != "0") {
                 emit displayMessage(i18n("Effect already present in clip"), ErrorMessage);
                 continue;