m_pos(0)
{
MonitorEditWidget *edit = monitor->getEffectEdit();
- edit->showVisibilityButton(true);
m_scene = edit->getScene();
m_scene->cleanup();
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()));
delete m_item;
if (m_monitor) {
MonitorEditWidget *edit = m_monitor->getEffectEdit();
- edit->showVisibilityButton(false);
edit->removeCustomControls();
}
}
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)
{
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();
/** @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
//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()));
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()
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)));
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);
}
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;
}
void EffectStackView2::setupListView()
{
blockSignals(true);
+ bool previousMonitorScene = m_monitorSceneWanted;
m_monitorSceneWanted = false;
m_draggedEffect = NULL;
m_draggedGroup = NULL;
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!!!!!!!!!";
}
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 );
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;
}
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()));
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)));
}
-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
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);
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);
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)
// 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 {
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
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();
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()));
}
Mlt::Geometry *g = m_extraGeometries.takeFirst();
delete g;
}
- if (m_monitor) {
- m_monitor->getEffectEdit()->showVisibilityButton(false);
- }
}
void GeometryWidget::slotShowPreviousKeyFrame(bool show)
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)
}
-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()
{
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;
/** @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. */
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);
};
<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>
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();
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();
}
}
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"));
MonitorEditWidget::~MonitorEditWidget()
{
+ KdenliveSettings::setShowOnMonitorScene(m_visibilityAction->isChecked());
delete m_view;
delete m_scene;
delete m_visibilityAction;
}
}
+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) {
/** @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:
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)));
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);
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)
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);
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);