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
double y2;
// draw line showing default value
double y2;
// draw line showing default value
+ bool active = isSelected() || (parentItem() && parentItem()->isSelected());
+ if (active) {
x1 = br.x();
x2 = br.right();
y1 = br.bottom() - m_keyframeDefault * maxh;
x1 = br.x();
x2 = br.right();
y1 = br.bottom() - m_keyframeDefault * maxh;
QLineF l(x1, y1, x2, y2);
l2 = painter->matrix().map(l);
painter->drawLine(l2);
QLineF l(x1, y1, x2, y2);
l2 = painter->matrix().map(l);
painter->drawLine(l2);
painter->fillRect(l2.x1() - 3, l2.y1() - 3, 6, 6, QBrush(color));
}
x1 = x2;
y1 = y2;
}
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)
}
int AbstractClipItem::mouseOverKeyFrames(QPointF pos)
{
if (isItemLocked()) return NONE;
{
if (isItemLocked()) return NONE;
+ if (isSelected() || (parentItem() && parentItem()->isSelected())) {
m_editedKeyframe = mouseOverKeyFrames(pos);
if (m_editedKeyframe != -1) return KEYFRAME;
}
m_editedKeyframe = mouseOverKeyFrames(pos);
if (m_editedKeyframe != -1) return KEYFRAME;
}
for (int i = 0; i < itemList.count(); i++) {
if (itemList.at(i)->type() == AVWIDGET) {
ClipItem *item = static_cast <ClipItem *>(itemList.at(i));
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;
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;
for (int i = 0; i < itemList.count(); i++) {
if (itemList.at(i)->type() == AVWIDGET) {
ClipItem *item = (ClipItem *)itemList.at(i);
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;
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;