]> git.sesse.net Git - kdenlive/blobdiff - src/abstractmonitor.cpp
Moves VideoSurface into widgets folder.
[kdenlive] / src / abstractmonitor.cpp
index fa6f43c935e96852f7a65412a2061df3e89c48a1..dc9ccd646c9288e682965c9503d06871c63916cc 100644 (file)
@@ -29,7 +29,7 @@
 #include <QVBoxLayout>
 
 
-AbstractMonitor::AbstractMonitor(Kdenlive::MONITORID id, MonitorManager *manager, QWidget *parent): 
+AbstractMonitor::AbstractMonitor(Kdenlive::MonitorId id, MonitorManager *manager, QWidget *parent): 
     QWidget(parent),
     videoSurface(NULL),
     m_id(id),
@@ -41,8 +41,7 @@ AbstractMonitor::AbstractMonitor(Kdenlive::MONITORID id, MonitorManager *manager
 
 AbstractMonitor::~AbstractMonitor()
 {
-    if (videoSurface)
-       delete videoSurface;
+    delete videoSurface;
 }
 
 void AbstractMonitor::createVideoSurface()
@@ -59,9 +58,9 @@ bool AbstractMonitor::isActive() const
     return m_monitorManager->isActive(m_id);
 }
 
-bool AbstractMonitor::slotActivateMonitor()
+bool AbstractMonitor::slotActivateMonitor(bool forceRefresh)
 {
-    return m_monitorManager->activateMonitor(m_id);
+    return m_monitorManager->activateMonitor(m_id, forceRefresh);
 }
 
 VideoContainer::VideoContainer(AbstractMonitor* monitor, QWidget *parent) :
@@ -161,22 +160,4 @@ void VideoContainer::switchFullScreen()
     }
 }
 
-VideoSurface::VideoSurface(QWidget* parent) :
-    QWidget(parent)
-{
-    // MonitorRefresh is used as container for the SDL display (it's window id is passed to SDL)
-    setAttribute(Qt::WA_PaintOnScreen);
-    setAttribute(Qt::WA_OpaquePaintEvent);
-    setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
-    setAttribute(Qt::WA_NoSystemBackground);
-    setUpdatesEnabled(false);
-}
-
-void VideoSurface::paintEvent(QPaintEvent *event)
-{
-    Q_UNUSED(event);
-    //WARNING: This might trigger unnecessary refreshes from MLT's producer, but without this,
-    // as soon as monitor is covered by a popup menu or another window, image is corrupted.
-    emit refreshMonitor();
-}
-
+#include "abstractmonitor.moc"