]> git.sesse.net Git - kdenlive/commitdiff
Disable (until fixed) show frame on mouse move with razor tool. Fixes crash on clip...
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 9 Aug 2008 17:29:43 +0000 (17:29 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 9 Aug 2008 17:29:43 +0000 (17:29 +0000)
svn path=/branches/KDE4/; revision=2370

src/clipitem.cpp
src/customtrackview.cpp
src/kthumb.cpp
src/mainwindow.cpp

index 624ea4800ba35750265430c51d6876b921232237..073132d536e34691097372835bd1f37e218535c6 100644 (file)
@@ -390,21 +390,24 @@ void ClipItem::paint(QPainter *painter,
     painter->fillPath(resultClipPath, paintColor);
 
     painter->setClipPath(resultClipPath, Qt::IntersectClip);
+
     // draw thumbnails
-    if (!m_startPix.isNull() && KdenliveSettings::videothumbnails()) {
-        if (m_clipType == IMAGE) {
+    if (KdenliveSettings::videothumbnails()) {
+       if (m_clipType == IMAGE && !m_startPix.isNull()) {
             painter->drawPixmap(QPointF(itemWidth - m_startPix.width(), 0), m_startPix);
             QLine l(itemWidth - m_startPix.width(), 0, itemWidth - m_startPix.width(), itemHeight);
             painter->drawLine(l);
-        } else {
+       }
+       else if (!m_endPix.isNull()) {
             painter->drawPixmap(QPointF(itemWidth - m_endPix.width(), 0), m_endPix);
             QLine l(itemWidth - m_endPix.width(), 0, itemWidth - m_endPix.width(), itemHeight);
             painter->drawLine(l);
         }
-
-        painter->drawPixmap(QPointF(0, 0), m_startPix);
-        QLine l2(m_startPix.width(), 0, 0 + m_startPix.width(), itemHeight);
-        painter->drawLine(l2);
+       if (!m_startPix.isNull()) {
+           painter->drawPixmap(QPointF(0, 0), m_startPix);
+           QLine l2(m_startPix.width(), 0, 0 + m_startPix.width(), itemHeight);
+           painter->drawLine(l2);
+       }
     }
 
     // draw audio thumbnails
index f9d12fbf5e526267ba3f277056cd345d607065f9..25228bc7257164d3e62ebcfe4752929000f9ce41 100644 (file)
@@ -264,7 +264,8 @@ void CustomTrackView::mouseMoveEvent(QMouseEvent * event) {
         if (m_tool == RAZORTOOL) {
             // razor tool over a clip, display current frame in monitor
             if (!m_blockRefresh && item->type() == AVWIDGET) {
-                emit showClipFrame(((ClipItem *) item)->baseClip(), mapToScene(event->pos()).x() / m_scale - (clip->startPos() - clip->cropStart()).frames(m_document->fps()));
+               //TODO: solve crash when showing frame when moving razor over clip
+                //emit showClipFrame(((ClipItem *) item)->baseClip(), mapToScene(event->pos()).x() / m_scale - (clip->startPos() - clip->cropStart()).frames(m_document->fps()));
             }
             event->accept();
             return;
index ec3fea708c6922e6d26aaf40b181d7f3f27efc23..e83672bb0d7656763d4a9b66e46044dd2bbf71b3 100644 (file)
@@ -222,38 +222,39 @@ QPixmap KThumb::getImage(QDomElement xml, int frame, int width, int height) {
 
 //static
 QPixmap KThumb::getFrame(Mlt::Producer *producer, int framepos, int width, int height) {
-    kDebug() << "//REQUESTING FRAME: " << framepos;
-    if (producer == NULL) return QPixmap();
+    if (producer == NULL) {
+       QPixmap p(width, height);
+       p.fill(Qt::red);
+       return p;
+    }
+
     producer->seek(framepos);
     Mlt::Frame *frame = producer->get_frame();
     if (!frame) {
         kDebug() << "///// BROKEN FRAME";
-        return QPixmap();
+       QPixmap p(width, height);
+       p.fill(Qt::red);
+       return p;
     }
-    kDebug() << "///// FRAME exists";
     mlt_image_format format = mlt_image_yuv422;
     int frame_width = 0;
     int frame_height = 0;
     frame->set("normalised_height", height);
     frame->set("normalised_width", width);
     QPixmap pix(width, height);
-    kDebug() << "///// FRAME exists 2";
     uint8_t *data = frame->get_image(format, frame_width, frame_height, 0);
-    kDebug() << "///// FRAME exists 2a";
     uint8_t *new_image = (uint8_t *)mlt_pool_alloc(frame_width * (frame_height + 1) * 4);
-    kDebug() << "///// FRAME exists 2b";
     mlt_convert_yuv422_to_rgb24a((uint8_t *)data, new_image, frame_width * frame_height);
-    kDebug() << "///// FRAME exists 2c";
+
     QImage image((uchar *)new_image, frame_width, frame_height, QImage::Format_ARGB32);
-    kDebug() << "///// FRAME exists 3";
+
     if (!image.isNull()) {
         pix = pix.fromImage(image.rgbSwapped());
     } else
-        pix.fill(Qt::black);
+        pix.fill(Qt::red);
 
     mlt_pool_release(new_image);
     delete frame;
-    kDebug() << "//REQUESTING FRAME " << framepos << " OVER";
     return pix;
 }
 /*
index 65c78640562dbc3200e235732903926873fe6d1f..a3286563a2fa9020f47fd1d2fd2c0b3272813fa9 100644 (file)
@@ -191,7 +191,7 @@ MainWindow::MainWindow(QWidget *parent)
     tabifyDockWidget(projectListDock, effectStackDock);
     tabifyDockWidget(projectListDock, transitionConfigDock);
     //tabifyDockWidget(projectListDock, undoViewDock);
-    projectListDock->raise();
+
 
     tabifyDockWidget(clipMonitorDock, projectMonitorDock);
     tabifyDockWidget(clipMonitorDock, recMonitorDock);
@@ -281,6 +281,7 @@ MainWindow::MainWindow(QWidget *parent)
     } else newFile();
 
     activateShuttleDevice();
+    projectListDock->raise();
 }
 
 void MainWindow::queryQuit() {