]> git.sesse.net Git - kdenlive/commitdiff
Optimize monitor scene & fix issues with new effect stack
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Thu, 19 Apr 2012 09:11:26 +0000 (11:11 +0200)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Thu, 19 Apr 2012 09:11:26 +0000 (11:11 +0200)
16 files changed:
src/cornerswidget.cpp
src/cornerswidget.h
src/effectstack/collapsibleeffect.cpp
src/effectstack/collapsibleeffect.h
src/effectstack/effectstackview2.cpp
src/effectstack/effectstackview2.h
src/effectstack/parametercontainer.cpp
src/geometrywidget.cpp
src/geometrywidget.h
src/kdenlivesettings.kcfg
src/monitor.cpp
src/monitoreditwidget.cpp
src/renderer.cpp
src/renderer.h
src/rotoscoping/rotowidget.cpp
src/rotoscoping/rotowidget.h

index 6454a7c0d80b18dfbcb708d81c53857f17a3fa4c..f985cf4bd228ab7084ce924a377f1d5a1be201a2 100644 (file)
@@ -43,7 +43,6 @@ CornersWidget::CornersWidget(Monitor *monitor, QDomElement e, int minFrame, int
         m_pos(0)
 {
     MonitorEditWidget *edit = monitor->getEffectEdit();
-    edit->showVisibilityButton(true);
     m_scene = edit->getScene();
     m_scene->cleanup();
 
@@ -57,7 +56,6 @@ CornersWidget::CornersWidget(Monitor *monitor, QDomElement e, int minFrame, int
     edit->addCustomButton(KIcon("insert-horizontal-rule"), i18n("Show/Hide the lines connecting the corners"), this, SLOT(slotShowLines(bool)),
                           true, KdenliveSettings::onmonitoreffects_cornersshowlines());
 
-    connect(edit, SIGNAL(showEdit(bool)), this, SLOT(slotShowScene(bool)));
     connect(m_item, SIGNAL(changed()), this, SLOT(slotUpdateProperties()));
     connect(m_scene, SIGNAL(addKeyframe()), this, SLOT(slotInsertKeyframe()));
 
@@ -71,7 +69,6 @@ CornersWidget::~CornersWidget()
     delete m_item;
     if (m_monitor) {
         MonitorEditWidget *edit = m_monitor->getEffectEdit();
-        edit->showVisibilityButton(false);
         edit->removeCustomControls();
     }
 }
@@ -166,20 +163,6 @@ QList<QPointF> CornersWidget::getPoints(QTableWidgetItem* keyframe)
     return points;
 }
 
-void CornersWidget::slotCheckMonitorPosition(int renderPos)
-{
-    if (m_showScene)
-        emit checkMonitorPosition(renderPos);
-}
-
-void CornersWidget::slotShowScene(bool show)
-{
-    m_showScene = show;
-    if (!m_showScene)
-        m_monitor->slotShowEffectScene(false);
-    else
-        slotCheckMonitorPosition(m_monitor->render->seekFramePosition());
-}
 
 void CornersWidget::slotShowLines(bool show)
 {
index 9b8351ad5e1bc97bb21026fea7bfae5b45a3d660..d5d5fe860c187ffed81b5fe9d15124e485796a6b 100644 (file)
@@ -60,9 +60,6 @@ private:
     QList <QPointF> getPoints(QTableWidgetItem *keyframe);
 
 private slots:
-    /** @brief Makes sure the monitor effect scene is only visible if the clip this geometry belongs to is visible.
-    * @param renderPos Postion of the Monitor / Timeline cursor */
-    void slotCheckMonitorPosition(int renderPos);
 
     /** @brief Updates the on-monitor item according to the current timeline position. */
     void slotUpdateItem();
@@ -77,12 +74,6 @@ private slots:
 
     /** @brief Shows/Hides additional controls on the monitor according to @param show. */
     void slotShowControls(bool show = true);
-    
-    /** @brief Switches from normal monitor to monitor scene according to @param show. */
-    void slotShowScene(bool show = true);
-
-signals:
-    void checkMonitorPosition(int);
 };
 
 #endif
index a28baa7de078de85f85e1e5f669750b89e73e971..d5e42f81b7245c84f234653b9b21baee77442509 100644 (file)
@@ -75,7 +75,6 @@ CollapsibleEffect::CollapsibleEffect(QDomElement effect, QDomElement original_ef
     //buttonShowComments->setIcon(KIcon("help-about"));
     //buttonShowComments->setToolTip(i18n("Show additional information for the parameters"));
     m_menu = new QMenu;
-    if (m_regionEffect) m_menu->addAction(KIcon("document-new"), i18n("Change Region"), this, SLOT(slotResetEffect()));
     m_menu->addAction(KIcon("view-refresh"), i18n("Reset Effect"), this, SLOT(slotResetEffect()));
     m_menu->addAction(KIcon("document-save"), i18n("Save Effect"), this, SLOT(slotSaveEffect()));
     
@@ -264,7 +263,7 @@ void CollapsibleEffect::slotEnable(bool disable, bool emitInfo)
     if (!disable || KdenliveSettings::disable_effect_parameters()) {
         widgetFrame->setEnabled(!disable);
     }
-    if (emitInfo) emit effectStateChanged(disable, effectIndex());
+    if (emitInfo) emit effectStateChanged(disable, effectIndex(), isActive() && needsMonitorEffectScene());
 }
 
 void CollapsibleEffect::slotDeleteEffect()
@@ -457,7 +456,6 @@ void CollapsibleEffect::setupWidget(ItemInfo info, EffectMetaInfo *metaInfo)
     connect(m_paramWidget, SIGNAL(startFilterJob(QString,QString,QString,QString,QString,QString)), this, SIGNAL(startFilterJob(QString,QString,QString,QString,QString,QString)));
     
     connect (this, SIGNAL(syncEffectsPos(int)), m_paramWidget, SIGNAL(syncEffectsPos(int)));
-    connect (this, SIGNAL(effectStateChanged(bool)), m_paramWidget, SIGNAL(effectStateChanged(bool)));
     connect (m_paramWidget, SIGNAL(checkMonitorPosition(int)), this, SIGNAL(checkMonitorPosition(int)));
     connect (m_paramWidget, SIGNAL(seekTimeline(int)), this, SIGNAL(seekTimeline(int)));
     
index d94fa3a1f7ce38cded4e930d0b293825abb9fa61..138e8c331f4c5c80bc2daf4997794d0368e12431 100644 (file)
@@ -121,7 +121,7 @@ protected:
 signals:
     void parameterChanged(const QDomElement, const QDomElement, int);
     void syncEffectsPos(int);
-    void effectStateChanged(bool, int ix = -1, bool updateMainStatus = true);
+    void effectStateChanged(bool, int ix, bool effectNeedsMonitorScene);
     void deleteEffect(const QDomElement);
     void activateEffect(int);
     void checkMonitorPosition(int);
index 014ad293c37ed14d82609409734317b303e89e4a..0df60fbed829b4e4bab673929c5fe4875cb434cc 100644 (file)
@@ -118,8 +118,11 @@ void EffectStackView2::slotClipItemSelected(ClipItem* c)
     }
     if (m_clipref == NULL) {
         //TODO: clear list, reset paramdesc and info
-        //ItemInfo info;
-        //m_effectedit->transferParamDesc(QDomElement(), info);
+        // If monitor scene is displayed, hide it
+        if (m_monitorSceneWanted) {
+           m_effectMetaInfo.monitor->slotShowEffectScene(false);
+       }
+        m_monitorSceneWanted = false;
        clear();
         return;
     }
@@ -146,6 +149,7 @@ void EffectStackView2::slotTrackItemSelected(int ix, const TrackInfo info)
 void EffectStackView2::setupListView()
 {
     blockSignals(true);
+    bool previousMonitorScene = m_monitorSceneWanted;
     m_monitorSceneWanted = false;
     m_draggedEffect = NULL;
     m_draggedGroup = NULL;
@@ -164,7 +168,14 @@ void EffectStackView2::setupListView()
     vbox1->setContentsMargins(0, 0, 0, 0);
     vbox1->setSpacing(0);
 
-    for (int i = 0; i < m_currentEffectList.count(); i++) {
+    int effectsCount = m_currentEffectList.count();
+    
+    // Make sure we always have one effect selected
+    int selectedEffect = m_clipref->selectedEffectIndex();
+    if (selectedEffect < 1 && effectsCount > 0) m_clipref->setSelectedEffect(1);
+    else if (selectedEffect > effectsCount) m_clipref->setSelectedEffect(effectsCount);
+    
+    for (int i = 0; i < effectsCount; i++) {
         QDomElement d = m_currentEffectList.at(i).cloneNode().toElement();
         if (d.isNull()) {
             kDebug() << " . . . . WARNING, NULL EFFECT IN STACK!!!!!!!!!";
@@ -185,7 +196,7 @@ void EffectStackView2::setupListView()
            }
            
            if (group == NULL) {
-               group = new CollapsibleGroup(effectInfo.groupIndex, i == 0, i == m_currentEffectList.count() - 1, effectInfo, m_ui.container->widget());
+               group = new CollapsibleGroup(effectInfo.groupIndex, i == 0, i == effectsCount - 1, effectInfo, m_ui.container->widget());
                connectGroup(group);
                vbox1->addWidget(group);
                group->installEventFilter( this );
@@ -210,7 +221,7 @@ void EffectStackView2::setupListView()
            info = m_clipref->info();
        }
 
-        CollapsibleEffect *currentEffect = new CollapsibleEffect(d, m_currentEffectList.at(i), info, &m_effectMetaInfo, i == m_currentEffectList.count() - 1, view);
+        CollapsibleEffect *currentEffect = new CollapsibleEffect(d, m_currentEffectList.at(i), info, &m_effectMetaInfo, i == effectsCount - 1, view);
        if (m_effectMetaInfo.trackMode) {
            isSelected = currentEffect->effectIndex() == 1;
        }
@@ -244,6 +255,10 @@ void EffectStackView2::setupListView()
     
     vbox1->addStretch(10);
     slotUpdateCheckAllButton();
+    if (previousMonitorScene && !m_monitorSceneWanted) {
+       // monitor scene was displayed, not wanted anymore
+       m_effectMetaInfo.monitor->slotShowEffectScene(false);
+    }
     
     // Wait a little bit for the new layout to be ready, then check if we have a scrollbar
     QTimer::singleShot(200, this, SLOT(slotCheckWheelEventFilter()));
@@ -259,7 +274,7 @@ void EffectStackView2::connectEffect(CollapsibleEffect *currentEffect)
     connect(currentEffect, SIGNAL(reloadEffects()), this , SIGNAL(reloadEffects()));
     connect(currentEffect, SIGNAL(resetEffect(int)), this , SLOT(slotResetEffect(int)));
     connect(currentEffect, SIGNAL(changeEffectPosition(QList <int>,bool)), this , SLOT(slotMoveEffectUp(QList <int>,bool)));
-    connect(currentEffect, SIGNAL(effectStateChanged(bool,int)), this, SLOT(slotUpdateEffectState(bool,int)));
+    connect(currentEffect, SIGNAL(effectStateChanged(bool,int,bool)), this, SLOT(slotUpdateEffectState(bool,int,bool)));
     connect(currentEffect, SIGNAL(activateEffect(int)), this, SLOT(slotSetCurrentEffect(int)));
     connect(currentEffect, SIGNAL(seekTimeline(int)), this , SLOT(slotSeekTimeline(int)));
     connect(currentEffect, SIGNAL(createGroup(int)), this , SLOT(slotCreateGroup(int)));
@@ -380,8 +395,16 @@ void EffectStackView2::startDrag()
 }
 
 
-void EffectStackView2::slotUpdateEffectState(bool disable, int index)
+void EffectStackView2::slotUpdateEffectState(bool disable, int index, bool needsMonitorEffectScene)
 {
+    if (m_monitorSceneWanted && disable) {
+       m_effectMetaInfo.monitor->slotShowEffectScene(false);
+       m_monitorSceneWanted = false;
+    }
+    else if (!disable && !m_monitorSceneWanted && needsMonitorEffectScene) {
+       m_effectMetaInfo.monitor->slotShowEffectScene(true);
+       m_monitorSceneWanted = true;
+    }
     if (m_effectMetaInfo.trackMode)
         emit changeEffectState(NULL, m_trackindex, QList <int>() << index, disable);
     else
index 266ea5403b17ec9f2946d5ce28c6ad91986f14fe..1db988249be19dc3b7a65de76bcafdd59064ebfe 100644 (file)
@@ -162,7 +162,7 @@ private slots:
     void slotRenderPos(int pos);
 
     /** @brief Called whenever an effect is enabled / disabled by user. */
-    void slotUpdateEffectState(bool disable, int index);
+    void slotUpdateEffectState(bool disable, int index, bool needsMonitorEffectScene);
 
     void slotSetCurrentEffect(int ix);
     
index 40d617f1535075099f23778dfb3bf5117ed70741..0fd2da73b03125dcf948d5f96cdb0e36050886e2 100644 (file)
@@ -218,8 +218,6 @@ ParameterContainer::ParameterContainer(QDomElement effect, ItemInfo info, Effect
                m_needsMonitorEffectScene = true;
                 m_geometryWidget = new GeometryWidget(m_metaInfo->monitor, m_metaInfo->timecode, 0, true, effect.hasAttribute("showrotation"), parent);
                 m_geometryWidget->setFrameSize(m_metaInfo->frameSize);
-                // connect this before setupParam to make sure the monitor scene shows up at startup
-                connect(m_geometryWidget, SIGNAL(checkMonitorPosition(int)), this, SIGNAL(checkMonitorPosition(int)));
                 connect(m_geometryWidget, SIGNAL(parameterChanged()), this, SLOT(slotCollectAllParameters()));
                 if (minFrame == maxFrame)
                     m_geometryWidget->setupParam(pa, m_in, m_out);
@@ -229,7 +227,6 @@ ParameterContainer::ParameterContainer(QDomElement effect, ItemInfo info, Effect
                 m_valueItems[paramName+"geometry"] = m_geometryWidget;
                 connect(m_geometryWidget, SIGNAL(seekToPos(int)), this, SIGNAL(seekTimeline(int)));
                 connect(this, SIGNAL(syncEffectsPos(int)), m_geometryWidget, SLOT(slotSyncPosition(int)));
-                connect(this, SIGNAL(effectStateChanged(bool)), m_geometryWidget, SLOT(slotShowScene(bool)));
             } else {
                 Geometryval *geo = new Geometryval(m_metaInfo->profile, m_metaInfo->timecode, m_metaInfo->frameSize, 0);
                 if (minFrame == maxFrame)
@@ -253,8 +250,6 @@ ParameterContainer::ParameterContainer(QDomElement effect, ItemInfo info, Effect
                     // we want a corners-keyframe-widget
                     CornersWidget *corners = new CornersWidget(m_metaInfo->monitor, pa, m_in, m_out, m_metaInfo->timecode, e.attribute("active_keyframe", "-1").toInt(), parent);
                    m_needsMonitorEffectScene = true;
-                    connect(corners, SIGNAL(checkMonitorPosition(int)), this, SIGNAL(checkMonitorPosition(int)));
-                    connect(this, SIGNAL(effectStateChanged(bool)), corners, SLOT(slotShowScene(bool)));
                     connect(this, SIGNAL(syncEffectsPos(int)), corners, SLOT(slotSyncPosition(int)));
                     geo = static_cast<KeyframeEdit *>(corners);
                 } else {
@@ -344,10 +339,8 @@ ParameterContainer::ParameterContainer(QDomElement effect, ItemInfo info, Effect
            m_needsMonitorEffectScene = true;
             RotoWidget *roto = new RotoWidget(value, m_metaInfo->monitor, info, m_metaInfo->timecode, parent);
             connect(roto, SIGNAL(valueChanged()), this, SLOT(slotCollectAllParameters()));
-            connect(roto, SIGNAL(checkMonitorPosition(int)), this, SIGNAL(checkMonitorPosition(int)));
             connect(roto, SIGNAL(seekToPos(int)), this, SIGNAL(seekTimeline(int)));
             connect(this, SIGNAL(syncEffectsPos(int)), roto, SLOT(slotSyncPosition(int)));
-            connect(this, SIGNAL(effectStateChanged(bool)), roto, SLOT(slotShowScene(bool)));
             m_vbox->addWidget(roto);
             m_valueItems[paramName] = roto;
 #endif
index f526a79fb35bfa14c82392d96edc8ba0825ac02a..b75909a3fc4d3fa34ac7d0639fc2c83708d20581 100644 (file)
@@ -56,7 +56,6 @@ GeometryWidget::GeometryWidget(Monitor* monitor, Timecode timecode, int clipPos,
     MonitorEditWidget *edit = monitor->getEffectEdit();
     edit->removeCustomControls();
     edit->addCustomButton(KIcon("transform-crop"), i18n("Show previous keyframe"), this, SLOT(slotShowPreviousKeyFrame(bool)), true, KdenliveSettings::onmonitoreffects_geometryshowprevious());
-    edit->showVisibilityButton(true);
     m_scene = edit->getScene();
 
 
@@ -226,8 +225,6 @@ GeometryWidget::GeometryWidget(Monitor* monitor, Timecode timecode, int clipPos,
         Setup of configuration controls
     */
 
-    connect(edit, SIGNAL(showEdit(bool)), this, SLOT(slotShowScene(bool)));
-
     connect(m_scene, SIGNAL(addKeyframe()),    this, SLOT(slotAddKeyframe()));
     connect(this, SIGNAL(parameterChanged()), this, SLOT(slotUpdateProperties()));
 }
@@ -252,9 +249,6 @@ GeometryWidget::~GeometryWidget()
         Mlt::Geometry *g = m_extraGeometries.takeFirst();
         delete g;
     }
-    if (m_monitor) {
-        m_monitor->getEffectEdit()->showVisibilityButton(false);
-    }
 }
 
 void GeometryWidget::slotShowPreviousKeyFrame(bool show)
@@ -327,7 +321,6 @@ void GeometryWidget::setupParam(const QDomElement elem, int minframe, int maxfra
     connect(m_rect, SIGNAL(changed()), this, SLOT(slotUpdateGeometry()));
     m_scene->centerView();
     slotPositionChanged(0, false);
-    slotCheckMonitorPosition(m_monitor->render->seekFramePosition());
 }
 
 void GeometryWidget::addParameter(const QDomElement elem)
@@ -525,26 +518,6 @@ void GeometryWidget::slotAddDeleteKeyframe()
 }
 
 
-void GeometryWidget::slotCheckMonitorPosition(int renderPos)
-{
-    if (m_showScene) {
-        /*
-            We do only get the position in timeline if this geometry belongs to a transition,
-            therefore we need two ways here.
-        */
-        if (m_isEffect) {
-            emit checkMonitorPosition(renderPos);
-        } else {
-            if (renderPos >= m_clipPos && renderPos <= m_clipPos + m_outPoint - m_inPoint) {
-                if (!m_scene->views().at(0)->isVisible())
-                    m_monitor->slotShowEffectScene(true);
-            } else {
-                m_monitor->slotShowEffectScene(false);
-            }
-        }
-    }
-}
-
 
 void GeometryWidget::slotUpdateGeometry()
 {
@@ -702,15 +675,6 @@ void GeometryWidget::slotSetSynchronize(bool sync)
         emit seekToPos(m_clipPos + m_timePos->getValue());
 }
 
-void GeometryWidget::slotShowScene(bool show)
-{
-    m_showScene = show;
-    if (!m_showScene)
-        m_monitor->slotShowEffectScene(false);
-    else
-        slotCheckMonitorPosition(m_monitor->render->seekFramePosition());
-}
-
 void GeometryWidget::setFrameSize(QPoint size)
 {
     m_frameSize = size;
index d22171bffc5070d4ad54c707bde927266c7afa02..582d44954dcd2e04acab3ca4d293e77cac5205f6 100644 (file)
@@ -126,10 +126,6 @@ private slots:
     /** @brief Adds or deletes a keyframe depending on whether there is already a keyframe at the current position. */
     void slotAddDeleteKeyframe();
 
-    /** @brief Makes sure the monitor effect scene is only visible if the clip this geometry belongs to is visible.
-    * @param renderPos Postion of the Monitor / Timeline cursor */
-    void slotCheckMonitorPosition(int renderPos);
-
     /** @brief Updates the Mlt::Geometry object. */
     void slotUpdateGeometry();
     /** @brief Updates the spinBoxes according to the rect. */
@@ -170,12 +166,9 @@ private slots:
     void slotFitToHeight();
     /** @brief Show / hide previous keyframe in monitor scene. */
     void slotShowPreviousKeyFrame(bool show);
-    /** @brief Switches from normal monitor to monitor scene according to @param show. */
-    void slotShowScene(bool show = true);
 
 signals:
     void parameterChanged();
-    void checkMonitorPosition(int);
     void seekToPos(int);
 };
 
index c3ceaf16e77dcafde56a2c38a7b66a3cd9e7602f..92c47373faa353da4d276bb41e1c576fdba5dc41 100644 (file)
       <label>Show overlay info on monitor (in / out points, markers,...).</label>
       <default>true</default>
     </entry>
+    
+    <entry name="showOnMonitorScene" type="Bool">
+      <label>Show on monitor adjustable effect parameter (geometry, ..).</label>
+      <default>true</default>
+    </entry>
 
     <entry name="autoaudiodrivername" type="String">
       <label>Audio driver selected automatically.</label>
index 34f23de87747b0ffba7e31b83cf7feabd4cc03dd..18555e1ba54df7d6fa15b22bb5690d3e31bccc85 100644 (file)
@@ -187,6 +187,7 @@ Monitor::Monitor(Kdenlive::MONITORID id, MonitorManager *manager, QString profil
 
     if (id == Kdenlive::projectMonitor) {
         m_effectWidget = new MonitorEditWidget(render, videoBox);
+       connect(m_effectWidget, SIGNAL(showEdit(bool)), this, SLOT(slotShowEffectScene(bool)));
         m_toolbar->addAction(m_effectWidget->getVisibilityAction());
         videoBox->layout()->addWidget(m_effectWidget);
         m_effectWidget->hide();
@@ -989,22 +990,40 @@ void Monitor::slotSetSelectedClip(Transition* item)
 void Monitor::slotShowEffectScene(bool show)
 {
     if (m_id == Kdenlive::projectMonitor) {
+       if (!m_effectWidget->getVisibilityAction()->isChecked()) show = false;
        if (m_effectWidget->isVisible() == show) return;
-        if (videoSurface) {
-            videoSurface->setVisible(!show);
-        } else {
+       setUpdatesEnabled(false);
+       if (show) {
+           if (videoSurface) {
+               videoSurface->setVisible(!show);
+               // Preview is handeled internally through the Render::showFrame method
+               render->disablePreview(show);
+           } else {
 #ifdef USE_OPENGL
-            m_glWidget->setVisible(!show);
+               m_glWidget->setVisible(!show);
 #endif
-        }
-        m_effectWidget->setVisible(show);
-        m_effectWidget->getVisibilityAction()->setChecked(show);
-        emit requestFrameForAnalysis(show);
-        if (show) {
+           }
+           m_effectWidget->setVisible(show);
             m_effectWidget->getScene()->slotZoomFit();
-        }
+           emit requestFrameForAnalysis(show);
+       }
+       else {      
+           m_effectWidget->setVisible(show);
+           emit requestFrameForAnalysis(show);
+           if (videoSurface) {
+               videoSurface->setVisible(!show);
+               // Preview is handeled internally through the Render::showFrame method
+               render->disablePreview(show);
+           } else {
+#ifdef USE_OPENGL
+               m_glWidget->setVisible(!show);
+#endif
+           }
+       }
+       m_effectWidget->showVisibilityButton(show);
+        setUpdatesEnabled(true);
         videoBox->setEnabled(show);
-        render->doRefresh();
+        //render->doRefresh();
     }
 }
 
index 8e5bd1d77024ae19e38ff4b615412d6dcff72b57..05cef9545907c5290d2874c5f56ac5df5d931769 100644 (file)
@@ -54,6 +54,7 @@ MonitorEditWidget::MonitorEditWidget(Render* renderer, QWidget* parent) :
 
     m_visibilityAction = new QAction(KIcon("video-display"), i18n("Show/Hide edit mode"), this);
     m_visibilityAction->setCheckable(true);
+    m_visibilityAction->setChecked(KdenliveSettings::showOnMonitorScene());
     m_visibilityAction->setVisible(false);
 
     m_ui.buttonDirectUpdate->setIcon(KIcon("transform-scale"));
@@ -77,6 +78,7 @@ MonitorEditWidget::MonitorEditWidget(Render* renderer, QWidget* parent) :
 
 MonitorEditWidget::~MonitorEditWidget()
 {
+    KdenliveSettings::setShowOnMonitorScene(m_visibilityAction->isChecked());
     delete m_view;
     delete m_scene;
     delete m_visibilityAction;
index 9f8dc19815eb3a5a9470530f397cfc4cb71b90b3..2591146c27d61e30135d3f74d9a46b0fcf65e4d7 100644 (file)
@@ -1691,6 +1691,16 @@ void Render::showFrame(Mlt::Frame& frame)
     }
 }
 
+void Render::disablePreview(bool disable)
+{
+    if (m_mltConsumer) {
+       m_mltConsumer->stop();
+       m_mltConsumer->set("preview_off", (int) disable);
+       m_mltConsumer->set("refresh", 0);
+       m_mltConsumer->start();
+    }
+}
+
 void Render::showAudio(Mlt::Frame& frame)
 {
     if (!frame.is_valid() || frame.get_int("test_audio") != 0) {
index 87edd1925613153663ba005f7a0eb4dc41ee7ec5..45b889d98ca69d778ec3cff340b3d0c70a14ead8 100644 (file)
@@ -318,6 +318,8 @@ Q_OBJECT public:
     /** @brief Fill a combobox with the found blackmagic devices */
     static bool getBlackMagicDeviceList(KComboBox *devicelist);
     static bool getBlackMagicOutputDeviceList(KComboBox *devicelist);
+    /** @brief Frame rendering is handeled by Kdenlive, don't show video through SDL display */
+    void disablePreview(bool disable);
 
 private:
 
index 5210b7ea2bdeafcf1cb435ff19d65c2c36bc9f30..6af6a67be366221b4d616c5d67ca50bdad4a7d91 100644 (file)
@@ -57,14 +57,12 @@ RotoWidget::RotoWidget(QString data, Monitor *monitor, ItemInfo info, Timecode t
     l->addWidget(m_keyframeWidget);
 
     MonitorEditWidget *edit = monitor->getEffectEdit();
-    edit->showVisibilityButton(true);
     m_scene = edit->getScene();
     m_scene->cleanup();
 
     m_item = new SplineItem(QList <BPoint>(), NULL, m_scene);
 
     connect(m_item, SIGNAL(changed(bool)), this, SLOT(slotUpdateData(bool)));
-    connect(edit, SIGNAL(showEdit(bool)), this, SLOT(slotShowScene(bool)));
     connect(m_keyframeWidget, SIGNAL(positionChanged(int)), this, SLOT(slotPositionChanged(int)));
     connect(m_keyframeWidget, SIGNAL(keyframeAdded(int)), this, SLOT(slotAddKeyframe(int)));
     connect(m_keyframeWidget, SIGNAL(keyframeRemoved(int)), this, SLOT(slotRemoveKeyframe(int)));
@@ -88,18 +86,11 @@ RotoWidget::~RotoWidget()
 
     if (m_monitor) {
         MonitorEditWidget *edit = m_monitor->getEffectEdit();
-        edit->showVisibilityButton(false);
         edit->removeCustomControls();
         m_monitor->slotShowEffectScene(false);
     }
 }
 
-void RotoWidget::slotCheckMonitorPosition(int renderPos)
-{
-    if (m_showScene)
-        emit checkMonitorPosition(renderPos);
-}
-
 void RotoWidget::slotSyncPosition(int relTimelinePos)
 {
     relTimelinePos = qBound(0, relTimelinePos, m_out);
@@ -107,15 +98,6 @@ void RotoWidget::slotSyncPosition(int relTimelinePos)
     slotPositionChanged(relTimelinePos, false);
 }
 
-void RotoWidget::slotShowScene(bool show)
-{
-    m_showScene = show;
-    if (!m_showScene)
-        m_monitor->slotShowEffectScene(false);
-    else
-        slotCheckMonitorPosition(m_monitor->render->seekFramePosition());
-}
-
 void RotoWidget::slotUpdateData(int pos, bool editing)
 {
     Q_UNUSED(editing)
index 235bf62b320c25970e681af20344a8389a339a10..91d53d2f4685b0646f8e657603e0a6965d5e6c46 100644 (file)
@@ -55,14 +55,11 @@ public:
     void updateTimecodeFormat();
 
 public slots:
-    /** @brief Switches from normal monitor to monitor scene according to @param show. */
-    void slotShowScene(bool show = true);
     /** @brief Updates the on-monitor item.  */
     void slotSyncPosition(int relTimelinePos);
 
 signals:
     void valueChanged();
-    void checkMonitorPosition(int);
     void seekToPos(int pos);
 
 
@@ -90,9 +87,6 @@ private:
     void keyframeTimelineFullUpdate();
 
 private slots:
-    /** @brief Makes sure the monitor effect scene is only visible if the clip this geometry belongs to is visible.
-    * @param renderPos Postion of the Monitor / Timeline cursor */
-    void slotCheckMonitorPosition(int renderPos);
 
     /** @brief Updates/Creates the spline at @param pos based on the on-monitor items. */
     void slotUpdateData(int pos = -1, bool editing = false);