]> git.sesse.net Git - kdenlive/blob - src/clipitem.cpp
Fix timeline handling of objects (move them instead of changing their bounding rect
[kdenlive] / src / clipitem.cpp
1 /***************************************************************************
2  *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
3  *                                                                         *
4  *   This program is free software; you can redistribute it and/or modify  *
5  *   it under the terms of the GNU General Public License as published by  *
6  *   the Free Software Foundation; either version 2 of the License, or     *
7  *   (at your option) any later version.                                   *
8  *                                                                         *
9  *   This program is distributed in the hope that it will be useful,       *
10  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12  *   GNU General Public License for more details.                          *
13  *                                                                         *
14  *   You should have received a copy of the GNU General Public License     *
15  *   along with this program; if not, write to the                         *
16  *   Free Software Foundation, Inc.,                                       *
17  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
18  ***************************************************************************/
19
20
21
22 #include <QPainter>
23 #include <QTimer>
24 #include <QStyleOptionGraphicsItem>
25 #include <QGraphicsScene>
26 #include <QGraphicsView>
27 #include <QScrollBar>
28 #include <QMimeData>
29 #include <QApplication>
30
31 #include <KDebug>
32
33 #include "clipitem.h"
34 #include "customtrackview.h"
35 #include "renderer.h"
36 #include "docclipbase.h"
37 #include "transition.h"
38 #include "events.h"
39 #include "kdenlivesettings.h"
40 #include "kthumb.h"
41
42 ClipItem::ClipItem(DocClipBase *clip, ItemInfo info, double scale, double fps)
43         : AbstractClipItem(info, QRectF(), fps), m_clip(clip), m_resizeMode(NONE), m_grabPoint(0), m_maxTrack(0), m_hasThumbs(false), startThumbTimer(NULL), endThumbTimer(NULL), m_effectsCounter(1), audioThumbWasDrawn(false), m_opacity(1.0), m_timeLine(0), m_thumbsRequested(2), m_startFade(0), m_endFade(0), m_hover(false), m_selectedEffect(-1), m_speed(1.0), framePixelWidth(0) {
44     setRect(0, 0, (qreal)(info.endPos - info.startPos).frames(fps) * scale - .5, (qreal)(KdenliveSettings::trackheight() - 1));
45     setPos((qreal) info.startPos.frames(fps) * scale, (qreal)(info.track * KdenliveSettings::trackheight()) + 1);
46     kDebug() << "// ADDing CLIP TRK HGTH: " << KdenliveSettings::trackheight();
47
48     m_clipName = clip->name();
49     m_producer = clip->getId();
50     m_clipType = clip->clipType();
51     m_cropStart = info.cropStart;
52     m_maxDuration = clip->maxDuration();
53     setAcceptDrops(true);
54     audioThumbReady = clip->audioThumbCreated();
55
56     /*
57       m_cropStart = xml.attribute("in", 0).toInt();
58       m_maxDuration = xml.attribute("duration", 0).toInt();
59       if (m_maxDuration == 0) m_maxDuration = xml.attribute("out", 0).toInt() - m_cropStart;
60
61       if (duration != -1) m_cropDuration = duration;
62       else m_cropDuration = m_maxDuration;*/
63
64
65     setFlags(QGraphicsItem::ItemClipsToShape | QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
66     setAcceptsHoverEvents(true);
67     connect(this , SIGNAL(prepareAudioThumb(double, QPainterPath, int, int, int)) , this, SLOT(slotPrepareAudioThumb(double, QPainterPath, int, int, int)));
68
69     setBrush(QColor(141, 166, 215));
70     if (m_clipType == VIDEO || m_clipType == AV || m_clipType == SLIDESHOW) {
71         m_hasThumbs = true;
72         connect(this, SIGNAL(getThumb(int, int)), clip->thumbProducer(), SLOT(extractImage(int, int)));
73         connect(clip->thumbProducer(), SIGNAL(thumbReady(int, QPixmap)), this, SLOT(slotThumbReady(int, QPixmap)));
74         connect(clip, SIGNAL(gotAudioData()), this, SLOT(slotGotAudioData()));
75         QTimer::singleShot(200, this, SLOT(slotFetchThumbs()));
76
77         startThumbTimer = new QTimer(this);
78         startThumbTimer->setSingleShot(true);
79         connect(startThumbTimer, SIGNAL(timeout()), this, SLOT(slotGetStartThumb()));
80         endThumbTimer = new QTimer(this);
81         endThumbTimer->setSingleShot(true);
82         connect(endThumbTimer, SIGNAL(timeout()), this, SLOT(slotGetEndThumb()));
83     } else if (m_clipType == COLOR) {
84         QString colour = clip->getProperty("colour");
85         colour = colour.replace(0, 2, "#");
86         setBrush(QColor(colour.left(7)));
87     } else if (m_clipType == IMAGE || m_clipType == TEXT) {
88         m_startPix = KThumb::getImage(KUrl(clip->getProperty("resource")), (int)(50 * KdenliveSettings::project_display_ratio()), 50);
89         m_endPix = m_startPix;
90     } else if (m_clipType == AUDIO) {
91         connect(clip, SIGNAL(gotAudioData()), this, SLOT(slotGotAudioData()));
92     }
93 }
94
95
96 ClipItem::~ClipItem() {
97     if (startThumbTimer) delete startThumbTimer;
98     if (endThumbTimer) delete endThumbTimer;
99     if (m_timeLine) m_timeLine;
100 }
101
102 ClipItem *ClipItem::clone(double scale, ItemInfo info) const {
103     ClipItem *duplicate = new ClipItem(m_clip, info, scale, m_fps);
104     if (info.cropStart == cropStart()) duplicate->slotThumbReady(info.cropStart.frames(m_fps), m_startPix);
105     if (info.cropStart + (info.endPos - info.startPos) == m_cropStart + m_cropDuration) duplicate->slotThumbReady((m_cropStart + m_cropDuration).frames(m_fps) - 1, m_endPix);
106     kDebug() << "// CLoning clip: " << (info.cropStart + (info.endPos - info.startPos)).frames(m_fps) << ", CURRENT end: " << (cropStart() + duration()).frames(m_fps);
107     duplicate->setEffectList(m_effectList);
108     duplicate->setSpeed(m_speed);
109     return duplicate;
110 }
111
112 void ClipItem::setEffectList(const EffectsList effectList) {
113     m_effectList = effectList;
114     m_effectNames = m_effectList.effectNames().join(" / ");
115 }
116
117 const EffectsList ClipItem::effectList() {
118     return m_effectList;
119 }
120
121 int ClipItem::selectedEffectIndex() const {
122     return m_selectedEffect;
123 }
124
125 void ClipItem::initEffect(QDomElement effect) {
126     // the kdenlive_ix int is used to identify an effect in mlt's playlist, should
127     // not be changed
128     if (effect.attribute("kdenlive_ix").toInt() == 0)
129         effect.setAttribute("kdenlive_ix", QString::number(effectsCounter()));
130     // init keyframes if required
131     QDomNodeList params = effect.elementsByTagName("parameter");
132     for (int i = 0; i < params.count(); i++) {
133         QDomElement e = params.item(i).toElement();
134         if (!e.isNull() && e.attribute("type") == "keyframe") {
135             QString def = e.attribute("default");
136             // Effect has a keyframe type parameter, we need to set the values
137             if (e.attribute("keyframes").isEmpty()) {
138                 e.setAttribute("keyframes", QString::number(m_cropStart.frames(m_fps)) + ":" + def + ";" + QString::number((m_cropStart + m_cropDuration).frames(m_fps)) + ":" + def);
139                 //kDebug() << "///// EFFECT KEYFRAMES INITED: " << e.attribute("keyframes");
140                 break;
141             }
142         }
143     }
144 }
145
146 void ClipItem::setKeyframes(const int ix, const QString keyframes) {
147     QDomElement effect = effectAt(ix);
148     if (effect.attribute("disabled") == "1") return;
149     QDomNodeList params = effect.elementsByTagName("parameter");
150     for (int i = 0; i < params.count(); i++) {
151         QDomElement e = params.item(i).toElement();
152         if (!e.isNull() && e.attribute("type") == "keyframe") {
153             e.setAttribute("keyframes", keyframes);
154             if (ix == m_selectedEffect) {
155                 m_keyframes.clear();
156                 double max = e.attribute("max").toDouble();
157                 double min = e.attribute("min").toDouble();
158                 m_keyframeFactor = 100.0 / (max - min);
159                 m_keyframeDefault = e.attribute("default").toDouble();
160                 // parse keyframes
161                 const QStringList keyframes = e.attribute("keyframes").split(";", QString::SkipEmptyParts);
162                 foreach(const QString str, keyframes) {
163                     int pos = str.section(":", 0, 0).toInt();
164                     double val = str.section(":", 1, 1).toDouble();
165                     m_keyframes[pos] = val;
166                 }
167                 update();
168                 return;
169             }
170             break;
171         }
172     }
173 }
174
175
176 void ClipItem::setSelectedEffect(const int ix) {
177     m_selectedEffect = ix;
178     QDomElement effect = effectAt(m_selectedEffect);
179     QDomNodeList params = effect.elementsByTagName("parameter");
180     if (effect.attribute("disabled") != "1")
181         for (int i = 0; i < params.count(); i++) {
182             QDomElement e = params.item(i).toElement();
183             if (!e.isNull() && e.attribute("type") == "keyframe") {
184                 m_keyframes.clear();
185                 double max = e.attribute("max").toDouble();
186                 double min = e.attribute("min").toDouble();
187                 m_keyframeFactor = 100.0 / (max - min);
188                 m_keyframeDefault = e.attribute("default").toDouble();
189                 // parse keyframes
190                 const QStringList keyframes = e.attribute("keyframes").split(";", QString::SkipEmptyParts);
191                 foreach(const QString str, keyframes) {
192                     int pos = str.section(":", 0, 0).toInt();
193                     double val = str.section(":", 1, 1).toDouble();
194                     m_keyframes[pos] = val;
195                 }
196                 update();
197                 return;
198             }
199         }
200     if (!m_keyframes.isEmpty()) {
201         m_keyframes.clear();
202         update();
203     }
204 }
205
206 QString ClipItem::keyframes(const int index) {
207     QString result;
208     QDomElement effect = effectAt(index);
209     QDomNodeList params = effect.elementsByTagName("parameter");
210
211     for (int i = 0; i < params.count(); i++) {
212         QDomElement e = params.item(i).toElement();
213         if (!e.isNull() && e.attribute("type") == "keyframe") {
214             result = e.attribute("keyframes");
215             break;
216         }
217     }
218     return result;
219 }
220
221 void ClipItem::updateKeyframeEffect() {
222     // regenerate xml parameter from the clip keyframes
223     QDomElement effect = effectAt(m_selectedEffect);
224     if (effect.attribute("disabled") == "1") return;
225     QDomNodeList params = effect.elementsByTagName("parameter");
226
227     for (int i = 0; i < params.count(); i++) {
228         QDomElement e = params.item(i).toElement();
229         if (!e.isNull() && e.attribute("type") == "keyframe") {
230             QString keyframes;
231             if (m_keyframes.count() > 1) {
232                 QMap<int, double>::const_iterator i = m_keyframes.constBegin();
233                 double x1;
234                 double y1;
235                 while (i != m_keyframes.constEnd()) {
236                     keyframes.append(QString::number(i.key()) + ":" + QString::number(i.value()) + ";");
237                     ++i;
238                 }
239             }
240             // Effect has a keyframe type parameter, we need to set the values
241             //kDebug() << ":::::::::::::::   SETTING EFFECT KEYFRAMES: " << keyframes;
242             e.setAttribute("keyframes", keyframes);
243             break;
244         }
245     }
246 }
247
248 QDomElement ClipItem::selectedEffect() {
249     if (m_selectedEffect == -1 || m_effectList.isEmpty()) return QDomElement();
250     return effectAt(m_selectedEffect);
251 }
252
253 void ClipItem::resetThumbs() {
254     m_startPix = QPixmap();
255     m_endPix = QPixmap();
256     m_thumbsRequested = 2;
257     slotFetchThumbs();
258     audioThumbCachePic.clear();
259 }
260
261
262 void ClipItem::refreshClip() {
263     m_maxDuration = m_clip->maxDuration();
264     if (m_clipType == VIDEO || m_clipType == AV || m_clipType == SLIDESHOW) slotFetchThumbs();
265     else if (m_clipType == COLOR) {
266         QString colour = m_clip->getProperty("colour");
267         colour = colour.replace(0, 2, "#");
268         setBrush(QColor(colour.left(7)));
269     } else if (m_clipType == IMAGE || m_clipType == TEXT) {
270         m_startPix = KThumb::getImage(KUrl(m_clip->getProperty("resource")), (int)(50 * KdenliveSettings::project_display_ratio()), 50);
271         m_endPix = m_startPix;
272     }
273 }
274
275 void ClipItem::slotFetchThumbs() {
276     if (m_endPix.isNull() && m_startPix.isNull()) {
277         emit getThumb((int)m_cropStart.frames(m_fps), (int)(m_cropStart + m_cropDuration).frames(m_fps) - 1);
278     } else {
279         if (m_endPix.isNull()) slotGetEndThumb();
280         if (m_startPix.isNull()) slotGetStartThumb();
281     }
282 }
283
284 void ClipItem::slotGetStartThumb() {
285     emit getThumb((int)m_cropStart.frames(m_fps), -1);
286 }
287
288 void ClipItem::slotGetEndThumb() {
289     emit getThumb(-1, (int)(m_cropStart + m_cropDuration).frames(m_fps) - 1);
290 }
291
292 void ClipItem::slotThumbReady(int frame, QPixmap pix) {
293     if (frame == m_cropStart.frames(m_fps)) {
294         m_startPix = pix;
295         QRectF r = sceneBoundingRect();
296         r.setRight(pix.width() + 2);
297         update(r);
298         m_thumbsRequested--;
299     } else if (frame == (m_cropStart + m_cropDuration).frames(m_fps) - 1) {
300         m_endPix = pix;
301         QRectF r = sceneBoundingRect();
302         r.setLeft(r.right() - pix.width() - 2);
303         update(r);
304         m_thumbsRequested--;
305     }
306     if (m_thumbsRequested == 0) {
307         // Ok, we have out start and end thumbnails...
308         disconnect(m_clip->thumbProducer(), SIGNAL(thumbReady(int, QPixmap)), this, SLOT(slotThumbReady(int, QPixmap)));
309     }
310 }
311
312 void ClipItem::slotGotAudioData() {
313     audioThumbReady = true;
314     if (m_clipType == AV) {
315         QRectF r = boundingRect();
316         r.setTop(r.top() + r.height() / 2 - 1);
317         update(r);
318     } else update();
319 }
320
321 int ClipItem::type() const {
322     return AVWIDGET;
323 }
324
325 DocClipBase *ClipItem::baseClip() const {
326     return m_clip;
327 }
328
329 QDomElement ClipItem::xml() const {
330     return m_clip->toXML();
331 }
332
333 int ClipItem::clipType() const {
334     return m_clipType;
335 }
336
337 QString ClipItem::clipName() const {
338     return m_clipName;
339 }
340
341 int ClipItem::clipProducer() const {
342     return m_producer;
343 }
344
345 void ClipItem::flashClip() {
346     if (m_timeLine == 0) {
347         m_timeLine = new QTimeLine(750, this);
348         m_timeLine->setCurveShape(QTimeLine::EaseInOutCurve);
349         connect(m_timeLine, SIGNAL(valueChanged(qreal)), this, SLOT(animate(qreal)));
350     }
351     m_timeLine->start();
352 }
353
354 void ClipItem::animate(qreal value) {
355     QRectF r = boundingRect();
356     r.setHeight(20);
357     update(r);
358 }
359
360 // virtual
361 void ClipItem::paint(QPainter *painter,
362                      const QStyleOptionGraphicsItem *option,
363                      QWidget *) {
364     painter->setOpacity(m_opacity);
365     QBrush paintColor = brush();
366     if (isSelected()) paintColor = QBrush(QColor(79, 93, 121));
367     QRectF br = rect();
368     const double itemWidth = br.width();
369     const double itemHeight = br.height();
370     kDebug() << "/// ITEM RECT: " << br << ", EPXOSED: " << option->exposedRect;
371     double scale = itemWidth / (double) m_cropDuration.frames(m_fps);
372
373     // kDebug()<<"///   EXPOSED RECT: "<<option->exposedRect.x()<<" X "<<option->exposedRect.right();
374
375     double startpixel = option->exposedRect.x(); // - pos().x();
376
377     if (startpixel < 0)
378         startpixel = 0;
379     double endpixel = option->exposedRect.right();
380     if (endpixel < 0)
381         endpixel = 0;
382
383     //painter->setRenderHints(QPainter::Antialiasing);
384
385     QPainterPath roundRectPathUpper = upperRectPart(br), roundRectPathLower = lowerRectPart(br);
386     painter->setClipRect(option->exposedRect);
387
388     // build path around clip
389     QPainterPath resultClipPath = roundRectPathUpper.united(roundRectPathLower);
390     painter->fillPath(resultClipPath, paintColor);
391
392     painter->setClipPath(resultClipPath, Qt::IntersectClip);
393     // draw thumbnails
394     if (!m_startPix.isNull() && KdenliveSettings::videothumbnails()) {
395         if (m_clipType == IMAGE) {
396             painter->drawPixmap(QPointF(itemWidth - m_startPix.width(), 0), m_startPix);
397             QLine l(itemWidth - m_startPix.width(), 0, itemWidth - m_startPix.width(), itemHeight);
398             painter->drawLine(l);
399         } else {
400             painter->drawPixmap(QPointF(itemWidth - m_endPix.width(), 0), m_endPix);
401             QLine l(itemWidth - m_endPix.width(), 0, itemWidth - m_endPix.width(), itemHeight);
402             painter->drawLine(l);
403         }
404
405         painter->drawPixmap(QPointF(0, 0), m_startPix);
406         QLine l2(m_startPix.width(), 0, 0 + m_startPix.width(), itemHeight);
407         painter->drawLine(l2);
408     }
409
410     // draw audio thumbnails
411     if (KdenliveSettings::audiothumbnails() && ((m_clipType == AV && option->exposedRect.bottom() > (itemHeight / 2)) || m_clipType == AUDIO) && audioThumbReady) {
412
413         QPainterPath path = m_clipType == AV ? roundRectPathLower : resultClipPath;
414         if (m_clipType == AV) painter->fillPath(path, QBrush(QColor(200, 200, 200, 140)));
415
416         int channels = baseClip()->getProperty("channels").toInt();
417         if (scale != framePixelWidth)
418             audioThumbCachePic.clear();
419         double cropLeft = m_cropStart.frames(m_fps) * scale;
420         emit prepareAudioThumb(scale, path, startpixel + cropLeft, endpixel + cropLeft, channels);//200 more for less missing parts before repaint after scrolling
421         int newstart = startpixel + cropLeft;
422         for (int startCache = newstart - (newstart) % 100; startCache < endpixel + cropLeft; startCache += 100) {
423             if (audioThumbCachePic.contains(startCache) && !audioThumbCachePic[startCache].isNull())
424                 painter->drawPixmap((int)(startCache - cropLeft), (int)(path.boundingRect().y()), audioThumbCachePic[startCache]);
425         }
426     }
427
428     // draw markers
429     QList < CommentedTime > markers = baseClip()->commentedSnapMarkers();
430     QList < CommentedTime >::Iterator it = markers.begin();
431     GenTime pos;
432     double framepos;
433     const int markerwidth = 4;
434     QBrush markerBrush;
435     markerBrush = QBrush(QColor(120, 120, 0, 100));
436     QPen pen = painter->pen();
437     pen.setColor(QColor(255, 255, 255, 200));
438     pen.setStyle(Qt::DotLine);
439     painter->setPen(pen);
440     for (; it != markers.end(); ++it) {
441         pos = (*it).time() - cropStart();
442         if (pos > GenTime()) {
443             if (pos > duration()) break;
444             framepos = scale * pos.frames(m_fps);
445             QLineF l(framepos, 5, framepos, itemHeight - 5);
446             painter->drawLine(l);
447             if (KdenliveSettings::showmarkers()) {
448                 const QRectF txtBounding = painter->boundingRect(framepos + 1, 10, itemWidth - framepos - 2, itemHeight - 10, Qt::AlignLeft | Qt::AlignTop, " " + (*it).comment() + " ");
449                 QPainterPath path;
450                 path.addRoundedRect(txtBounding, 3, 3);
451                 painter->fillPath(path, markerBrush);
452                 painter->drawText(txtBounding, Qt::AlignCenter, (*it).comment());
453             }
454             //painter->fillRect(QRect(br.x() + framepos, br.y(), 10, br.height()), QBrush(QColor(0, 0, 0, 150)));
455         }
456     }
457     pen.setColor(Qt::black);
458     pen.setStyle(Qt::SolidLine);
459     painter->setPen(pen);
460
461     // draw start / end fades
462     QBrush fades;
463     if (isSelected()) {
464         fades = QBrush(QColor(200, 50, 50, 150));
465     } else fades = QBrush(QColor(200, 200, 200, 200));
466
467     if (m_startFade != 0) {
468         QPainterPath fadeInPath;
469         fadeInPath.moveTo(0, 0);
470         fadeInPath.lineTo(0, itemHeight);
471         fadeInPath.lineTo(m_startFade * scale, itemHeight);
472         fadeInPath.closeSubpath();
473         painter->fillPath(fadeInPath/*.intersected(resultClipPath)*/, fades);
474         if (isSelected()) {
475             QLineF l(m_startFade * scale, 0, 0, itemHeight);
476             painter->drawLine(l);
477         }
478     }
479     if (m_endFade != 0) {
480         QPainterPath fadeOutPath;
481         fadeOutPath.moveTo(itemWidth, 0);
482         fadeOutPath.lineTo(itemWidth, itemHeight);
483         fadeOutPath.lineTo(itemWidth - m_endFade * scale, 0);
484         fadeOutPath.closeSubpath();
485         painter->fillPath(fadeOutPath/*.intersected(resultClipPath)*/, fades);
486         if (isSelected()) {
487             QLineF l(itemWidth - m_endFade * scale, 0, itemWidth, itemHeight);
488             painter->drawLine(l);
489         }
490     }
491
492     // Draw effects names
493     if (!m_effectNames.isEmpty() && itemWidth > 30) {
494         QRectF txtBounding = painter->boundingRect(br, Qt::AlignLeft | Qt::AlignTop, m_effectNames);
495         txtBounding.setRight(txtBounding.right() + 15);
496         painter->setPen(Qt::white);
497         QBrush markerBrush(Qt::SolidPattern);
498         if (m_timeLine && m_timeLine->state() == QTimeLine::Running) {
499             qreal value = m_timeLine->currentValue();
500             txtBounding.setWidth(txtBounding.width() * value);
501             markerBrush.setColor(QColor(50 + 200 * (1.0 - value), 50, 50, 100 + 50 * value));
502         } else markerBrush.setColor(QColor(50, 50, 50, 150));
503         QPainterPath path;
504         path.addRoundedRect(txtBounding, 4, 4);
505         painter->fillPath(path/*.intersected(resultClipPath)*/, markerBrush);
506         painter->drawText(txtBounding, Qt::AlignCenter, m_effectNames);
507         painter->setPen(Qt::black);
508     }
509
510     // Draw clip name
511     QRectF txtBounding = painter->boundingRect(br, Qt::AlignHCenter | Qt::AlignTop, " " + m_clipName + " ");
512     //painter->fillRect(txtBounding, QBrush(QColor(255, 255, 255, 150)));
513     painter->setPen(QColor(0, 0, 0, 180));
514     painter->drawText(txtBounding, Qt::AlignCenter, m_clipName);
515     txtBounding.translate(QPointF(1, 1));
516     painter->setPen(QColor(255, 255, 255, 255));
517     painter->drawText(txtBounding, Qt::AlignCenter, m_clipName);
518     // draw frame around clip
519     if (isSelected()) {
520         pen.setColor(Qt::red);
521         //pen.setWidth(2);
522     } else {
523         pen.setColor(Qt::black);
524         //pen.setWidth(1);
525     }
526
527
528     // draw effect or transition keyframes
529     if (itemWidth > 20) drawKeyFrames(painter, option->exposedRect);
530
531     // draw clip border
532     painter->setClipRect(option->exposedRect);
533     painter->setPen(pen);
534     //painter->setClipRect(option->exposedRect);
535     painter->drawPath(resultClipPath);
536
537     if (m_hover && itemWidth > 30) {
538         painter->setBrush(QColor(180, 180, 50, 180)); //gradient);
539
540         // draw transitions handles
541         QPainterPath transitionHandle;
542         const int handle_size = 4;
543         transitionHandle.moveTo(0, 0);
544         transitionHandle.lineTo(handle_size, handle_size);
545         transitionHandle.lineTo(handle_size * 2, 0);
546         transitionHandle.lineTo(handle_size * 3, handle_size);
547         transitionHandle.lineTo(handle_size * 2, handle_size * 2);
548         transitionHandle.lineTo(handle_size * 3, handle_size * 3);
549         transitionHandle.lineTo(0, handle_size * 3);
550         transitionHandle.closeSubpath();
551         int pointy = (int)(itemHeight / 2);
552         int pointx1 = 10;
553         int pointx2 = (int)(itemWidth - (10 + handle_size * 3));
554 #if 0
555         painter->setPen(QPen(Qt::black));
556         painter->setBrush(QBrush(QColor(50, 50, 0)));
557 #else
558         /*QRadialGradient gradient(pointx1 + 5, pointy + 5 , 5, 2, 2);
559         gradient.setColorAt(0.2, Qt::white);
560         gradient.setColorAt(0.8, Qt::yellow);
561         gradient.setColorAt(1, Qt::black);*/
562
563 #endif
564         painter->translate(pointx1, pointy);
565         painter->drawPath(transitionHandle); //Ellipse(0, 0 , 10, 10);
566         painter->translate(-pointx1, -pointy);
567
568         /*        QRadialGradient gradient1(pointx2 + 5, pointy + 5 , 5, 2, 2);
569                 gradient1.setColorAt(0.2, Qt::white);
570                 gradient1.setColorAt(0.8, Qt::yellow);
571                 gradient1.setColorAt(1, Qt::black);
572                 painter->setBrush(gradient1);*/
573         painter->translate(pointx2, pointy);
574         QMatrix m;
575         m.scale(-1.0, 1.0);
576         //painter->setMatrix(m);
577         painter->drawPath(transitionHandle); // Ellipse(0, 0, 10, 10);
578         //painter->setMatrix(m);
579         painter->translate(- pointx2, -pointy);
580     }
581 }
582
583
584 OPERATIONTYPE ClipItem::operationMode(QPointF pos, double scale) {
585     if (isSelected()) {
586         m_editedKeyframe = mouseOverKeyFrames(pos);
587         if (m_editedKeyframe != -1) return KEYFRAME;
588     }
589     QRectF rect = sceneBoundingRect();
590     if (qAbs((int)(pos.x() - (rect.x() + scale * m_startFade))) < 6 && qAbs((int)(pos.y() - rect.y())) < 6) {
591         if (m_startFade == 0) setToolTip(i18n("Add audio fade"));
592         else setToolTip(i18n("Audio fade duration: %1s", GenTime(m_startFade, m_fps).seconds()));
593         return FADEIN;
594     } else if (qAbs((int)(pos.x() - rect.x())) < 6) {
595         setToolTip(i18n("Crop from start: %1s", cropStart().seconds()));
596         return RESIZESTART;
597     } else if (qAbs((int)(pos.x() - (rect.x() + rect.width() - scale * m_endFade))) < 6 && qAbs((int)(pos.y() - rect.y())) < 6) {
598         if (m_endFade == 0) setToolTip(i18n("Add audio fade"));
599         else setToolTip(i18n("Audio fade duration: %1s", GenTime(m_endFade, m_fps).seconds()));
600         return FADEOUT;
601     } else if (qAbs((int)(pos.x() - (rect.x() + rect.width()))) < 6) {
602         setToolTip(i18n("Clip duration: %1s", duration().seconds()));
603         return RESIZEEND;
604     } else if (qAbs((int)(pos.x() - (rect.x() + 16))) < 10 && qAbs((int)(pos.y() - (rect.y() + rect.height() / 2 + 5))) < 8) {
605         setToolTip(i18n("Add transition"));
606         return TRANSITIONSTART;
607     } else if (qAbs((int)(pos.x() - (rect.x() + rect.width() - 21))) < 10 && qAbs((int)(pos.y() - (rect.y() + rect.height() / 2 + 5))) < 8) {
608         setToolTip(i18n("Add transition"));
609         return TRANSITIONEND;
610     }
611     setToolTip(QString());
612     return MOVE;
613 }
614
615 QList <GenTime> ClipItem::snapMarkers() const {
616     QList < GenTime > snaps;
617     QList < GenTime > markers = baseClip()->snapMarkers();
618     GenTime pos;
619     double framepos;
620
621     for (int i = 0; i < markers.size(); i++) {
622         pos = markers.at(i) - cropStart();
623         if (pos > GenTime()) {
624             if (pos > duration()) break;
625             else snaps.append(pos + startPos());
626         }
627     }
628     return snaps;
629 }
630
631 QList <CommentedTime> ClipItem::commentedSnapMarkers() const {
632     QList < CommentedTime > snaps;
633     QList < CommentedTime > markers = baseClip()->commentedSnapMarkers();
634     GenTime pos;
635     double framepos;
636
637     for (int i = 0; i < markers.size(); i++) {
638         pos = markers.at(i).time() - cropStart();
639         if (pos > GenTime()) {
640             if (pos > duration()) break;
641             else snaps.append(CommentedTime(pos + startPos(), markers.at(i).comment()));
642         }
643     }
644     return snaps;
645 }
646
647 void ClipItem::slotPrepareAudioThumb(double pixelForOneFrame, QPainterPath path, int startpixel, int endpixel, int channels) {
648
649     QRectF re = path.boundingRect();
650     kDebug() << "// PREP AUDIO THMB FRMO : " << startpixel << ", to: " << endpixel;
651     //if ( (!audioThumbWasDrawn || framePixelWidth!=pixelForOneFrame ) && !baseClip()->audioFrameChache.isEmpty()){
652
653     for (int startCache = startpixel - startpixel % 100;startCache + 100 < endpixel + 100;startCache += 100) {
654         //kDebug() << "creating " << startCache;
655         //if (framePixelWidth!=pixelForOneFrame  ||
656         if (framePixelWidth == pixelForOneFrame && audioThumbCachePic.contains(startCache))
657             continue;
658         if (audioThumbCachePic[startCache].isNull() || framePixelWidth != pixelForOneFrame) {
659             audioThumbCachePic[startCache] = QPixmap(100, (int)(re.height()));
660             audioThumbCachePic[startCache].fill(QColor(200, 200, 200, 0));
661         }
662         bool fullAreaDraw = pixelForOneFrame < 10;
663         QMap<int, QPainterPath > positiveChannelPaths;
664         QMap<int, QPainterPath > negativeChannelPaths;
665         QPainter pixpainter(&audioThumbCachePic[startCache]);
666         QPen audiopen;
667         audiopen.setWidth(0);
668         pixpainter.setPen(audiopen);
669         //pixpainter.setRenderHint(QPainter::Antialiasing,true);
670         //pixpainter.drawLine(0,0,100,re.height());
671         int channelHeight = audioThumbCachePic[startCache].height() / channels;
672
673         for (int i = 0;i < channels;i++) {
674
675             positiveChannelPaths[i].moveTo(0, channelHeight*i + channelHeight / 2);
676             negativeChannelPaths[i].moveTo(0, channelHeight*i + channelHeight / 2);
677         }
678
679         for (int samples = 0;samples <= 100;samples++) {
680             double frame = (double)(samples + startCache - 0) / pixelForOneFrame;
681             int sample = (int)((frame - (int)(frame)) * 20);   // AUDIO_FRAME_SIZE
682             if (frame < 0 || sample < 0 || sample > 19)
683                 continue;
684             QMap<int, QByteArray> frame_channel_data = baseClip()->audioFrameChache[(int)frame];
685
686             for (int channel = 0;channel < channels && frame_channel_data[channel].size() > 0;channel++) {
687
688                 int y = channelHeight * channel + channelHeight / 2;
689                 int delta = (int)(frame_channel_data[channel][sample] - 127 / 2)  * channelHeight / 64;
690                 if (fullAreaDraw) {
691                     positiveChannelPaths[channel].lineTo(samples, 0.1 + y + qAbs(delta));
692                     negativeChannelPaths[channel].lineTo(samples, 0.1 + y - qAbs(delta));
693                 } else {
694                     positiveChannelPaths[channel].lineTo(samples, 0.1 + y + delta);
695                     negativeChannelPaths[channel].lineTo(samples, 0.1 + y - delta);
696                 }
697             }
698             for (int channel = 0;channel < channels ;channel++)
699                 if (fullAreaDraw && samples == 100) {
700                     positiveChannelPaths[channel].lineTo(samples, channelHeight*channel + channelHeight / 2);
701                     negativeChannelPaths[channel].lineTo(samples, channelHeight*channel + channelHeight / 2);
702                     positiveChannelPaths[channel].lineTo(0, channelHeight*channel + channelHeight / 2);
703                     negativeChannelPaths[channel].lineTo(0, channelHeight*channel + channelHeight / 2);
704                 }
705
706         }
707         if (m_clipType != AV) pixpainter.setBrush(QBrush(QColor(200, 200, 100)));
708         else {
709             pixpainter.setPen(QPen(QColor(0, 0, 0)));
710             pixpainter.setBrush(QBrush(QColor(60, 60, 60)));
711         }
712         for (int i = 0;i < channels;i++) {
713             if (fullAreaDraw) {
714                 //pixpainter.fillPath(positiveChannelPaths[i].united(negativeChannelPaths[i]),QBrush(Qt::SolidPattern));//or singleif looks better
715                 pixpainter.drawPath(positiveChannelPaths[i].united(negativeChannelPaths[i]));//or singleif looks better
716             } else
717                 pixpainter.drawPath(positiveChannelPaths[i]);
718         }
719     }
720     //audioThumbWasDrawn=true;
721     framePixelWidth = pixelForOneFrame;
722
723     //}
724 }
725
726 uint ClipItem::fadeIn() const {
727     return m_startFade;
728 }
729
730 uint ClipItem::fadeOut() const {
731     return m_endFade;
732 }
733
734
735 void ClipItem::setFadeIn(int pos, double scale) {
736     int oldIn = m_startFade;
737     if (pos < 0) pos = 0;
738     if (pos > m_cropDuration.frames(m_fps)) pos = (int)(m_cropDuration.frames(m_fps) / 2);
739     m_startFade = pos;
740     QRectF rect = boundingRect();
741     update(rect.x(), rect.y(), qMax(oldIn, pos) * scale, rect.height());
742 }
743
744 void ClipItem::setFadeOut(int pos, double scale) {
745     int oldOut = m_endFade;
746     if (pos < 0) pos = 0;
747     if (pos > m_cropDuration.frames(m_fps)) pos = (int)(m_cropDuration.frames(m_fps) / 2);
748     m_endFade = pos;
749     QRectF rect = boundingRect();
750     update(rect.x() + rect.width() - qMax(oldOut, pos) * scale, rect.y(), pos * scale, rect.height());
751
752 }
753
754 // virtual
755 void ClipItem::mousePressEvent(QGraphicsSceneMouseEvent * event) {
756     /*m_resizeMode = operationMode(event->pos());
757     if (m_resizeMode == MOVE) {
758       m_maxTrack = scene()->sceneRect().height();
759       m_grabPoint = (int) (event->pos().x() - rect().x());
760     }*/
761     QGraphicsRectItem::mousePressEvent(event);
762 }
763
764 // virtual
765 void ClipItem::mouseReleaseEvent(QGraphicsSceneMouseEvent * event) {
766     m_resizeMode = NONE;
767     QGraphicsRectItem::mouseReleaseEvent(event);
768 }
769
770 //virtual
771 void ClipItem::hoverEnterEvent(QGraphicsSceneHoverEvent *) {
772     m_hover = true;
773     QRectF r = boundingRect();
774     qreal width = qMin(25.0, r.width());
775     update(r.x(), r.y(), width, r.height());
776     update(r.right() - width, r.y(), width, r.height());
777 }
778
779 //virtual
780 void ClipItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *) {
781     m_hover = false;
782     QRectF r = boundingRect();
783     qreal width = qMin(25.0, r.width());
784     update(r.x(), r.y(), width, r.height());
785     update(r.right() - width, r.y(), width, r.height());
786 }
787
788 void ClipItem::resizeStart(int posx, double scale) {
789     const int min = (startPos() - cropStart()).frames(m_fps);
790     if (posx < min) posx = min;
791     if (posx == startPos().frames(m_fps)) return;
792     const int previous = cropStart().frames(m_fps);
793     AbstractClipItem::resizeStart(posx, scale);
794     checkEffectsKeyframesPos(previous, cropStart().frames(m_fps), true);
795     if (m_hasThumbs && KdenliveSettings::videothumbnails()) {
796         m_thumbsRequested++;
797         connect(m_clip->thumbProducer(), SIGNAL(thumbReady(int, QPixmap)), this, SLOT(slotThumbReady(int, QPixmap)));
798         startThumbTimer->start(100);
799     }
800 }
801
802 void ClipItem::resizeEnd(int posx, double scale) {
803     const int max = (startPos() - cropStart() + maxDuration()).frames(m_fps) + 1;
804     if (posx > max) posx = max;
805     if (posx == endPos().frames(m_fps)) return;
806     const int previous = (cropStart() + duration()).frames(m_fps);
807     AbstractClipItem::resizeEnd(posx, scale);
808     checkEffectsKeyframesPos(previous, (cropStart() + duration()).frames(m_fps), false);
809     if (m_hasThumbs && KdenliveSettings::videothumbnails()) {
810         m_thumbsRequested++;
811         connect(m_clip->thumbProducer(), SIGNAL(thumbReady(int, QPixmap)), this, SLOT(slotThumbReady(int, QPixmap)));
812         endThumbTimer->start(100);
813     }
814 }
815
816
817 void ClipItem::checkEffectsKeyframesPos(const int previous, const int current, bool fromStart) {
818     for (int i = 0; i < m_effectList.size(); i++) {
819         QDomElement effect = m_effectList.at(i);
820         QDomNodeList params = effect.elementsByTagName("parameter");
821         for (int j = 0; j < params.count(); j++) {
822             QDomElement e = params.item(i).toElement();
823             if (e.attribute("type") == "keyframe") {
824                 // parse keyframes and adjust values
825                 const QStringList keyframes = e.attribute("keyframes").split(";", QString::SkipEmptyParts);
826                 QMap <int, double> kfr;
827                 foreach(const QString str, keyframes) {
828                     int pos = str.section(":", 0, 0).toInt();
829                     double val = str.section(":", 1, 1).toDouble();
830                     if (pos == previous) kfr[current] = val;
831                     else {
832                         if (fromStart && pos >= current) kfr[pos] = val;
833                         else if (!fromStart && pos <= current) kfr[pos] = val;
834                     }
835                 }
836                 QString newkfr;
837                 QMap<int, double>::const_iterator k = kfr.constBegin();
838                 while (k != kfr.constEnd()) {
839                     newkfr.append(QString::number(k.key()) + ":" + QString::number(k.value()) + ";");
840                     ++k;
841                 }
842                 e.setAttribute("keyframes", newkfr);
843                 break;
844             }
845         }
846     }
847     if (m_selectedEffect >= 0) setSelectedEffect(m_selectedEffect);
848 }
849
850
851 // virtual
852 /*void ClipItem::mouseMoveEvent(QGraphicsSceneMouseEvent * event) {
853 }*/
854
855 int ClipItem::effectsCounter() {
856     return m_effectsCounter++;
857 }
858
859 int ClipItem::effectsCount() {
860     return m_effectList.size();
861 }
862
863 QStringList ClipItem::effectNames() {
864     return m_effectList.effectNames();
865 }
866
867 QDomElement ClipItem::effectAt(int ix) {
868     if (ix > m_effectList.count() - 1 || ix < 0) return QDomElement();
869     return m_effectList.at(ix);
870 }
871
872 void ClipItem::setEffectAt(int ix, QDomElement effect) {
873     kDebug() << "CHange EFFECT AT: " << ix << ", CURR: " << m_effectList.at(ix).attribute("tag") << ", NEW: " << effect.attribute("tag");
874     m_effectList.insert(ix, effect);
875     m_effectList.removeAt(ix + 1);
876     m_effectNames = m_effectList.effectNames().join(" / ");
877     if (effect.attribute("id") == "fadein" || effect.attribute("id") == "fadeout") update(boundingRect());
878     else {
879         QRectF r = boundingRect();
880         r.setHeight(20);
881         update(r);
882     }
883 }
884
885 QMap <QString, QString> ClipItem::addEffect(QDomElement effect, bool animate) {
886     QMap <QString, QString> effectParams;
887     bool needRepaint = false;
888     /*QDomDocument doc;
889     doc.appendChild(doc.importNode(effect, true));
890     kDebug() << "///////  CLIP ADD EFFECT: "<< doc.toString();*/
891     m_effectList.append(effect);
892     effectParams["tag"] = effect.attribute("tag");
893     QString effectId = effect.attribute("id");
894     if (effectId.isEmpty()) effectId = effect.attribute("tag");
895     effectParams["id"] = effectId;
896     effectParams["kdenlive_ix"] = effect.attribute("kdenlive_ix");
897     QString state = effect.attribute("disabled");
898     if (!state.isEmpty()) effectParams["disabled"] = state;
899     QDomNodeList params = effect.elementsByTagName("parameter");
900     int fade = 0;
901     for (int i = 0; i < params.count(); i++) {
902         QDomElement e = params.item(i).toElement();
903         if (!e.isNull()) {
904             if (e.attribute("type") == "keyframe") {
905                 effectParams["keyframes"] = e.attribute("keyframes");
906                 effectParams["min"] = e.attribute("min");
907                 effectParams["max"] = e.attribute("max");
908                 effectParams["factor"] = e.attribute("factor", "1");
909                 effectParams["starttag"] = e.attribute("starttag", "start");
910                 effectParams["endtag"] = e.attribute("endtag", "end");
911             }
912
913             double f = e.attribute("factor", "1").toDouble();
914
915             if (f == 1) {
916                 effectParams[e.attribute("name")] = e.attribute("value");
917                 // check if it is a fade effect
918                 if (effectId == "fadein") {
919                     needRepaint = true;
920                     if (e.attribute("name") == "out") fade += e.attribute("value").toInt();
921                     else if (e.attribute("name") == "in") fade -= e.attribute("value").toInt();
922                 } else if (effectId == "fadeout") {
923                     needRepaint = true;
924                     if (e.attribute("name") == "out") fade -= e.attribute("value").toInt();
925                     else if (e.attribute("name") == "in") fade += e.attribute("value").toInt();
926                 }
927             } else {
928                 effectParams[e.attribute("name")] =  QString::number(effectParams[e.attribute("name")].toDouble() / f);
929             }
930         }
931     }
932     m_effectNames = m_effectList.effectNames().join(" / ");
933     if (fade > 0) m_startFade = fade;
934     else if (fade < 0) m_endFade = -fade;
935     if (needRepaint) update(boundingRect());
936     if (animate) {
937         flashClip();
938     } else if (!needRepaint) {
939         QRectF r = boundingRect();
940         r.setHeight(20);
941         update(r);
942     }
943     if (m_selectedEffect == -1) {
944         m_selectedEffect = 0;
945         setSelectedEffect(m_selectedEffect);
946     }
947     return effectParams;
948 }
949
950 QMap <QString, QString> ClipItem::getEffectArgs(QDomElement effect) {
951     QMap <QString, QString> effectParams;
952     effectParams["tag"] = effect.attribute("tag");
953     effectParams["kdenlive_ix"] = effect.attribute("kdenlive_ix");
954     effectParams["id"] = effect.attribute("id");
955     QString state = effect.attribute("disabled");
956     if (!state.isEmpty()) effectParams["disabled"] = state;
957     QDomNodeList params = effect.elementsByTagName("parameter");
958     for (int i = 0; i < params.count(); i++) {
959         QDomElement e = params.item(i).toElement();
960         kDebug() << "/ / / /SENDING EFFECT PARAM: " << e.attribute("type") << ", NAME_ " << e.attribute("tag");
961         if (e.attribute("type") == "keyframe") {
962             kDebug() << "/ / / /SENDING KEYFR EFFECT TYPE";
963             effectParams["keyframes"] = e.attribute("keyframes");
964             effectParams["max"] = e.attribute("max");
965             effectParams["min"] = e.attribute("min");
966             effectParams["factor"] = e.attribute("factor", "1");
967             effectParams["starttag"] = e.attribute("starttag", "start");
968             effectParams["endtag"] = e.attribute("endtag", "end");
969         } else if (e.attribute("namedesc").contains(";")) {
970             QString format = e.attribute("format");
971             QStringList separators = format.split("%d", QString::SkipEmptyParts);
972             QStringList values = e.attribute("value").split(QRegExp("[,:;x]"));
973             QString neu;
974             QTextStream txtNeu(&neu);
975             if (values.size() > 0)
976                 txtNeu << (int)values[0].toDouble();
977             for (int i = 0;i < separators.size() && i + 1 < values.size();i++) {
978                 txtNeu << separators[i];
979                 txtNeu << (int)(values[i+1].toDouble());
980             }
981             effectParams["start"] = neu;
982         } else {
983             if (e.attribute("factor", "1") != "1")
984                 effectParams[e.attribute("name")] =  QString::number(e.attribute("value").toDouble() / e.attribute("factor").toDouble());
985             else effectParams[e.attribute("name")] = e.attribute("value");
986         }
987     }
988     return effectParams;
989 }
990
991 void ClipItem::deleteEffect(QString index) {
992     bool needRepaint = false;
993     for (int i = 0; i < m_effectList.size(); ++i) {
994         if (m_effectList.at(i).attribute("kdenlive_ix") == index) {
995             if (m_effectList.at(i).attribute("id") == "fadein") {
996                 m_startFade = 0;
997                 needRepaint = true;
998             } else if (m_effectList.at(i).attribute("id") == "fadeout") {
999                 m_endFade = 0;
1000                 needRepaint = true;
1001             }
1002             m_effectList.removeAt(i);
1003             break;
1004         }
1005     }
1006     m_effectNames = m_effectList.effectNames().join(" / ");
1007     if (needRepaint) update(boundingRect());
1008     flashClip();
1009 }
1010
1011 double ClipItem::speed() const {
1012     return m_speed;
1013 }
1014
1015 void ClipItem::setSpeed(const double speed) {
1016     m_speed = speed;
1017     if (m_speed == 1.0) m_clipName = baseClip()->name();
1018     else m_clipName = baseClip()->name() + " - " + QString::number(speed * 100, 'f', 0) + "%";
1019     update();
1020 }
1021
1022 GenTime ClipItem::maxDuration() const {
1023     return m_maxDuration / m_speed;
1024 }
1025
1026 //virtual
1027 void ClipItem::dropEvent(QGraphicsSceneDragDropEvent * event) {
1028     QString effects = QString(event->mimeData()->data("kdenlive/effectslist"));
1029     QDomDocument doc;
1030     doc.setContent(effects, true);
1031     QDomElement e = doc.documentElement();
1032     CustomTrackView *view = (CustomTrackView *) scene()->views()[0];
1033     if (view) view->slotAddEffect(e, m_startPos, track());
1034 }
1035
1036 //virtual
1037 void ClipItem::dragEnterEvent(QGraphicsSceneDragDropEvent *event) {
1038     event->setAccepted(event->mimeData()->hasFormat("kdenlive/effectslist"));
1039 }
1040
1041 void ClipItem::dragLeaveEvent(QGraphicsSceneDragDropEvent *event) {
1042     Q_UNUSED(event);
1043 }
1044 void ClipItem::addTransition(Transition* t) {
1045     m_transitionsList.append(t);
1046     CustomTrackView *view = (CustomTrackView *) scene()->views()[0];
1047     QDomDocument doc;
1048     QDomElement e = doc.documentElement();
1049     //if (view) view->slotAddTransition(this, t->toXML() , t->startPos(), track());
1050 }
1051 // virtual
1052 /*
1053 void CustomTrackView::mousePressEvent ( QMouseEvent * event )
1054 {
1055   int pos = event->x();
1056   if (event->modifiers() == Qt::ControlModifier)
1057     setDragMode(QGraphicsView::ScrollHandDrag);
1058   else if (event->modifiers() == Qt::ShiftModifier)
1059     setDragMode(QGraphicsView::RubberBandDrag);
1060   else {
1061     QGraphicsItem * item = itemAt(event->pos());
1062     if (item) {
1063     }
1064     else emit cursorMoved((int) mapToScene(event->x(), 0).x());
1065   }
1066   kDebug()<<pos;
1067   QGraphicsView::mousePressEvent(event);
1068 }
1069
1070 void CustomTrackView::mouseReleaseEvent ( QMouseEvent * event )
1071 {
1072   QGraphicsView::mouseReleaseEvent(event);
1073   setDragMode(QGraphicsView::NoDrag);
1074 }
1075 */
1076
1077 #include "clipitem.moc"