]> git.sesse.net Git - kdenlive/commitdiff
On-monitor effects:
authorTill Theato <root@ttill.de>
Sun, 5 Sep 2010 12:55:53 +0000 (12:55 +0000)
committerTill Theato <root@ttill.de>
Sun, 5 Sep 2010 12:55:53 +0000 (12:55 +0000)
- Allow to add keyframe by double-click on monitor
- Lower background update period to 100ms

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

src/geometrywidget.cpp
src/monitorscene.cpp
src/monitorscene.h

index e32e2f339c5f2e97414e5111e7e75276c93b20d9..ed9dd5eb60a5b33922262008523fc6da2e4d1b81 100644 (file)
@@ -154,6 +154,7 @@ GeometryWidget::GeometryWidget(Monitor* monitor, Timecode timecode, int clipPos,
 
 
     connect(m_scene, SIGNAL(actionFinished()), this, SLOT(slotUpdateGeometry()));
+    connect(m_scene, SIGNAL(addKeyframe()),    this, SLOT(slotAddKeyframe()));
     connect(m_monitor, SIGNAL(renderPosition(int)), this, SLOT(slotCheckMonitorPosition(int)));
     connect(this, SIGNAL(parameterChanged()), this, SLOT(slotUpdateProperties()));
 }
index 857caab990d0a56ee7b64c9bfda77f659efc5ada..c7eb792046d9853451c06c904fff26a187211451 100644 (file)
@@ -89,7 +89,7 @@ void MonitorScene::setEnabled(bool enabled)
 void MonitorScene::slotUpdateBackground()
 {
     if (m_view && m_view->isVisible()) {
-        if (m_lastUpdate.elapsed() > 200) {
+        if (m_lastUpdate.elapsed() > 100) {
             m_background->setPixmap(QPixmap::fromImage(m_backgroundImage, Qt::ThresholdDither));
             m_lastUpdate.start();
         }
@@ -216,8 +216,11 @@ void MonitorScene::mousePressEvent(QGraphicsSceneMouseEvent *event)
 
 void MonitorScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
 {
-    if (!m_enabled)
+    if (!m_enabled) {
+        if (m_view)
+            m_view->setCursor(Qt::ArrowCursor);
         return;
+    }
 
     /*if (event->buttons() != Qt::NoButton && (event->screenPos() - m_screenClickPoint).manhattanLength() < QApplication::startDragDistance()) {
         event->accept();
@@ -354,14 +357,24 @@ void MonitorScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
 
 void MonitorScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
 {
+    Q_UNUSED(event);
+
     if (!m_enabled)
         return;
 
-    QGraphicsScene::mouseReleaseEvent(event);
     if (m_modified) {
         m_modified = false;
         emit actionFinished();
     }
 }
 
+void MonitorScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event)
+{
+    Q_UNUSED(event);
+
+    if (!m_enabled)
+        emit addKeyframe();
+}
+
+
 #include "monitorscene.moc"
index 6725a007d5142f7b741a0cade57fcf9ca112197c..3dccf2b498b774a826f12a27b1720bc37a486e1a 100644 (file)
@@ -41,6 +41,7 @@ protected:
     virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
     virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
     virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+    virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
 
 public slots:
     void slotUpdateBackground();
@@ -74,6 +75,7 @@ private:
 signals:
     void actionFinished();
     void zoomChanged(int);
+    void addKeyframe();
 };
 
 #endif