]> git.sesse.net Git - kdenlive/commitdiff
On-Monitor effects:
authorTill Theato <root@ttill.de>
Thu, 5 Aug 2010 20:11:17 +0000 (20:11 +0000)
committerTill Theato <root@ttill.de>
Thu, 5 Aug 2010 20:11:17 +0000 (20:11 +0000)
- Fix crash when clicking in clip monitor
- Use background color also used for SDL playback

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

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

index fee08f3ae8de7050fe92343459193e0d950a510d..db965cb30e210f9d759c4fb75559506aa89b2845 100644 (file)
 #include "renderer.h"
 #include "monitorscene.h"
 
+#include <QGraphicsView>
 #include <QGraphicsRectItem>
 
 GeometryWidget::GeometryWidget(Monitor* monitor, int clipPos, QWidget* parent ):
         QWidget(parent),
         m_monitor(monitor),
-        m_rect(NULL),
-        m_geometry(NULL),
         m_clipPos(clipPos),
         m_inPoint(0),
-        m_outPoint(1)
+        m_outPoint(1),
+        m_rect(NULL),
+        m_geometry(NULL)
 {
     m_ui.setupUi(this);
     m_scene = monitor->getEffectScene();
@@ -94,9 +95,10 @@ void GeometryWidget::setupParam(const QDomElement elem, int minframe, int maxfra
 
 void GeometryWidget::slotCheckPosition(int renderPos)
 {
-    if (renderPos >= m_clipPos && renderPos <= m_clipPos + m_outPoint - m_inPoint)
-        m_monitor->slotEffectScene(true);
-    else
+    if (renderPos >= m_clipPos && renderPos <= m_clipPos + m_outPoint - m_inPoint) {
+        if (!m_scene->views().at(0)->isVisible())
+            m_monitor->slotEffectScene(true);
+    } else
         m_monitor->slotEffectScene(false);
 }
 
index f53278ad474cca24d5d75efe41331bcf030d5668..192c73a021383062ab73453c6f7f7c36adb95875 100644 (file)
@@ -44,10 +44,10 @@ public slots:
 
 private:
     Ui::GeometryWidget_UI m_ui;
+    Monitor *m_monitor;
     int m_clipPos;
     int m_inPoint;
     int m_outPoint;
-    Monitor *m_monitor;
     MonitorScene *m_scene;
     QGraphicsRectItem *m_rect;
     Mlt::Geometry *m_geometry;
index 3b62bc68e75cb8d957877b4fcf83b5e56507ad42..29e4772b65ab4dd83bfba3906e82c88d49d942c1 100644 (file)
@@ -42,7 +42,6 @@
 #include <QIntValidator>
 #include <QVBoxLayout>
 #include <QGraphicsView>
-#include <QGraphicsPixmapItem>
 
 
 Monitor::Monitor(QString name, MonitorManager *manager, QString profile, QWidget *parent) :
@@ -382,7 +381,7 @@ void Monitor::slotSetZoneEnd()
 void Monitor::mousePressEvent(QMouseEvent * event)
 {
     if (event->button() != Qt::RightButton) {
-        if (m_ui.video_frame->underMouse() && !m_effectView->isVisible()) {
+        if (m_ui.video_frame->underMouse()) {
             m_dragStarted = true;
             m_DragStartPosition = event->pos();
         }
@@ -393,7 +392,7 @@ void Monitor::mousePressEvent(QMouseEvent * event)
 void Monitor::mouseReleaseEvent(QMouseEvent * event)
 {
     if (m_dragStarted) {
-        if (m_ui.video_frame->underMouse() && !m_effectView->isVisible()) {
+        if (m_ui.video_frame->underMouse()) {
             if (isActive()) slotPlay();
             else activateMonitor();
         } else QWidget::mouseReleaseEvent(event);
index e52e7e9cb6a2711dac2bacb528b328e3a004f609..d0a512027d53fd208b9918341f4d64ef4db1dd22 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "monitorscene.h"
 #include "renderer.h"
+#include "kdenlivesettings.h"
 
 #include <QGraphicsView>
 #include <QGraphicsPixmapItem>
@@ -33,7 +34,7 @@ MonitorScene::MonitorScene(Render *renderer, QObject* parent) :
 
 void MonitorScene::setUp()
 {
-    setBackgroundBrush(QBrush(QColor(0, 0, 255)));
+    setBackgroundBrush(QBrush(QColor(KdenliveSettings::window_background().name())));
 
     QPen framepen(Qt::DotLine);
     framepen.setColor(Qt::red);
@@ -57,8 +58,6 @@ void MonitorScene::setUp()
     connect(m_renderer, SIGNAL(rendererPosition(int)), this, SLOT(slotUpdateBackground()));
     connect(m_renderer, SIGNAL(frameUpdated(int)), this, SLOT(slotUpdateBackground()));
     slotUpdateBackground();
-    views().at(0)->fitInView(m_frameBorder, Qt::KeepAspectRatio);
-    views().at(0)->centerOn(m_frameBorder);
 }
 
 void MonitorScene::slotUpdateBackground()