From 54271b47a8c38afa53ce3baf048f238d36b8bc3a Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Thu, 19 Apr 2012 11:11:26 +0200 Subject: [PATCH] Optimize monitor scene & fix issues with new effect stack --- src/cornerswidget.cpp | 17 ----------- src/cornerswidget.h | 9 ------ src/effectstack/collapsibleeffect.cpp | 4 +-- src/effectstack/collapsibleeffect.h | 2 +- src/effectstack/effectstackview2.cpp | 37 ++++++++++++++++++----- src/effectstack/effectstackview2.h | 2 +- src/effectstack/parametercontainer.cpp | 7 ----- src/geometrywidget.cpp | 36 ---------------------- src/geometrywidget.h | 7 ----- src/kdenlivesettings.kcfg | 5 ++++ src/monitor.cpp | 41 +++++++++++++++++++------- src/monitoreditwidget.cpp | 2 ++ src/renderer.cpp | 10 +++++++ src/renderer.h | 2 ++ src/rotoscoping/rotowidget.cpp | 18 ----------- src/rotoscoping/rotowidget.h | 6 ---- 16 files changed, 82 insertions(+), 123 deletions(-) diff --git a/src/cornerswidget.cpp b/src/cornerswidget.cpp index 6454a7c0..f985cf4b 100644 --- a/src/cornerswidget.cpp +++ b/src/cornerswidget.cpp @@ -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 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) { diff --git a/src/cornerswidget.h b/src/cornerswidget.h index 9b8351ad..d5d5fe86 100644 --- a/src/cornerswidget.h +++ b/src/cornerswidget.h @@ -60,9 +60,6 @@ private: QList 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 diff --git a/src/effectstack/collapsibleeffect.cpp b/src/effectstack/collapsibleeffect.cpp index a28baa7d..d5e42f81 100644 --- a/src/effectstack/collapsibleeffect.cpp +++ b/src/effectstack/collapsibleeffect.cpp @@ -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))); diff --git a/src/effectstack/collapsibleeffect.h b/src/effectstack/collapsibleeffect.h index d94fa3a1..138e8c33 100644 --- a/src/effectstack/collapsibleeffect.h +++ b/src/effectstack/collapsibleeffect.h @@ -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); diff --git a/src/effectstack/effectstackview2.cpp b/src/effectstack/effectstackview2.cpp index 014ad293..0df60fbe 100644 --- a/src/effectstack/effectstackview2.cpp +++ b/src/effectstack/effectstackview2.cpp @@ -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 ,bool)), this , SLOT(slotMoveEffectUp(QList ,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 () << index, disable); else diff --git a/src/effectstack/effectstackview2.h b/src/effectstack/effectstackview2.h index 266ea540..1db98824 100644 --- a/src/effectstack/effectstackview2.h +++ b/src/effectstack/effectstackview2.h @@ -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); diff --git a/src/effectstack/parametercontainer.cpp b/src/effectstack/parametercontainer.cpp index 40d617f1..0fd2da73 100644 --- a/src/effectstack/parametercontainer.cpp +++ b/src/effectstack/parametercontainer.cpp @@ -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(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 diff --git a/src/geometrywidget.cpp b/src/geometrywidget.cpp index f526a79f..b75909a3 100644 --- a/src/geometrywidget.cpp +++ b/src/geometrywidget.cpp @@ -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; diff --git a/src/geometrywidget.h b/src/geometrywidget.h index d22171bf..582d4495 100644 --- a/src/geometrywidget.h +++ b/src/geometrywidget.h @@ -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); }; diff --git a/src/kdenlivesettings.kcfg b/src/kdenlivesettings.kcfg index c3ceaf16..92c47373 100644 --- a/src/kdenlivesettings.kcfg +++ b/src/kdenlivesettings.kcfg @@ -636,6 +636,11 @@ true + + + + true + diff --git a/src/monitor.cpp b/src/monitor.cpp index 34f23de8..18555e1b 100644 --- a/src/monitor.cpp +++ b/src/monitor.cpp @@ -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(); } } diff --git a/src/monitoreditwidget.cpp b/src/monitoreditwidget.cpp index 8e5bd1d7..05cef954 100644 --- a/src/monitoreditwidget.cpp +++ b/src/monitoreditwidget.cpp @@ -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; diff --git a/src/renderer.cpp b/src/renderer.cpp index 9f8dc198..2591146c 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp @@ -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) { diff --git a/src/renderer.h b/src/renderer.h index 87edd192..45b889d9 100644 --- a/src/renderer.h +++ b/src/renderer.h @@ -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: diff --git a/src/rotoscoping/rotowidget.cpp b/src/rotoscoping/rotowidget.cpp index 5210b7ea..6af6a67b 100644 --- a/src/rotoscoping/rotowidget.cpp +++ b/src/rotoscoping/rotowidget.cpp @@ -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 (), 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) diff --git a/src/rotoscoping/rotowidget.h b/src/rotoscoping/rotowidget.h index 235bf62b..91d53d2f 100644 --- a/src/rotoscoping/rotowidget.h +++ b/src/rotoscoping/rotowidget.h @@ -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); -- 2.39.2