true, KdenliveSettings::onmonitoreffects_cornersshowlines());
connect(edit, SIGNAL(showEdit(bool)), this, SLOT(slotShowScene(bool)));
- connect(m_monitor, SIGNAL(renderPosition(int)), this, SLOT(slotCheckMonitorPosition(int)));
connect(m_item, SIGNAL(changed()), this, SLOT(slotUpdateProperties()));
connect(m_scene, SIGNAL(addKeyframe()), this, SLOT(slotInsertKeyframe()));
MonitorEditWidget *edit = m_monitor->getEffectEdit();
edit->showVisibilityButton(false);
edit->removeCustomControls();
- m_monitor->slotShowEffectScene(false);
}
}
virtual void addParameter(QDomElement e, int activeKeyframe = -1);
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);
/** @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);
buttonDown->setVisible(ix < max - 1);
}
-bool CollapsibleEffect::needsMonitorEffectScene()
+bool CollapsibleEffect::needsMonitorEffectScene() const
{
return m_paramWidget->needsMonitorEffectScene();
}
/** @brief Show / hide up / down buttons. */
void adjustButtons(int ix, int max);
/** @brief Returns true of this effect requires an on monitor adjustable effect scene. */
- bool needsMonitorEffectScene();
+ bool needsMonitorEffectScene() const;
public slots:
void slotSyncEffectsPos(int pos);
void EffectStackView2::slotRenderPos(int pos)
{
if (m_effects.isEmpty()) return;
+ slotCheckMonitorPosition(pos);
if (!m_effectMetaInfo.trackMode && m_clipref) pos = pos - m_clipref->startPos().frames(KdenliveSettings::project_fps());
for (int i = 0; i< m_effects.count(); i++)
QVBoxLayout *vbox1 = new QVBoxLayout(view);
vbox1->setContentsMargins(0, 0, 0, 0);
vbox1->setSpacing(0);
-
- if (m_currentEffectList.isEmpty()) m_ui.labelComment->setHidden(true);
for (int i = 0; i < m_currentEffectList.count(); i++) {
QDomElement d = m_currentEffectList.at(i).cloneNode().toElement();
connectEffect(currentEffect);
}
- // Adjust group effects (up / down buttons)
- QList<CollapsibleGroup *> allGroups = m_ui.container->widget()->findChildren<CollapsibleGroup *>();
- for (int i = 0; i < allGroups.count(); i++) {
- allGroups.at(i)->adjustEffects();
+ if (m_currentEffectList.isEmpty()) {
+ m_ui.labelComment->setHidden(true);
+ }
+ else {
+ // Adjust group effects (up / down buttons)
+ QList<CollapsibleGroup *> allGroups = m_ui.container->widget()->findChildren<CollapsibleGroup *>();
+ for (int i = 0; i < allGroups.count(); i++) {
+ allGroups.at(i)->adjustEffects();
+ }
+ connect(m_effectMetaInfo.monitor, SIGNAL(renderPosition(int)), this, SLOT(slotRenderPos(int)));
}
vbox1->addStretch(10);
slotUpdateCheckAllButton();
- connect(m_effectMetaInfo.monitor, SIGNAL(renderPosition(int)), this, SLOT(slotRenderPos(int)));
// 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(changeEffectPosition(QList <int>,bool)), this , SLOT(slotMoveEffectUp(QList <int>,bool)));
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(checkMonitorPosition(int)), this, SLOT(slotCheckMonitorPosition(int)));
connect(currentEffect, SIGNAL(seekTimeline(int)), this , SLOT(slotSeekTimeline(int)));
connect(currentEffect, SIGNAL(createGroup(int)), this , SLOT(slotCreateGroup(int)));
connect(currentEffect, SIGNAL(moveEffect(QList<int>,int,int,QString)), this , SLOT(slotMoveEffect(QList<int>,int,int,QString)));
void EffectStackView2::slotCheckMonitorPosition(int renderPos)
{
- if (m_effectMetaInfo.trackMode || (m_clipref && renderPos >= m_clipref->startPos().frames(KdenliveSettings::project_fps()) && renderPos <= m_clipref->endPos().frames(KdenliveSettings::project_fps()))) {
- if (!m_effectMetaInfo.monitor->effectSceneDisplayed())
- //if (!m_effectMetaInfo.monitor->getEffectEdit()->getScene()->views().at(0)->isVisible())
- m_effectMetaInfo.monitor->slotShowEffectScene(true);
- } else {
- m_effectMetaInfo.monitor->slotShowEffectScene(false);
+ CollapsibleEffect *current = currentEffect();
+ if (current && current->needsMonitorEffectScene()) {
+ if (m_effectMetaInfo.trackMode || (m_clipref && renderPos >= m_clipref->startPos().frames(KdenliveSettings::project_fps()) && renderPos <= m_clipref->endPos().frames(KdenliveSettings::project_fps()))) {
+ if (!m_effectMetaInfo.monitor->effectSceneDisplayed()) {
+ m_effectMetaInfo.monitor->slotShowEffectScene(true);
+ }
+ } else {
+ m_effectMetaInfo.monitor->slotShowEffectScene(false);
+ }
+ }
+ else {
+ m_effectMetaInfo.monitor->slotShowEffectScene(false);
}
}
m_clipref->setSelectedEffect(ix);
for (int i = 0; i < m_effects.count(); i++) {
if (m_effects.at(i)->effectIndex() == ix) {
+ if (m_effects.at(i)->isActive()) return;
m_effects.at(i)->setActive(true);
- m_effectMetaInfo.monitor->slotShowEffectScene(m_effects.at(i)->needsMonitorEffectScene());
+ slotCheckMonitorPosition(m_effectMetaInfo.monitor->render->seekFramePosition());
m_ui.labelComment->setText(i18n(m_effects.at(i)->effect().firstChildElement("description").firstChildElement("full").text().toUtf8().data()));
m_ui.labelComment->setHidden(!m_ui.buttonShowComments->isChecked() || m_ui.labelComment->text().isEmpty());
}
}
}
+CollapsibleEffect *EffectStackView2::currentEffect() const
+{
+ for (int i = 0; i < m_effects.count(); i++) {
+ if (m_effects.at(i)->isActive()) return m_effects.at(i);
+ }
+ return NULL;
+}
+
void EffectStackView2::slotDeleteGroup(QDomDocument doc)
{
QDomNodeList effects = doc.elementsByTagName("effect");
void connectEffect(CollapsibleEffect *currentEffect);
/** @brief Connect a group to its signals. */
void connectGroup(CollapsibleGroup *group);
+ /** @brief Returns the currentl active effect. */
+ CollapsibleEffect *currentEffect() const;
public slots:
/** @brief Sets the clip whose effect list should be managed.
m_keyframeEditor(NULL),
m_geometryWidget(NULL),
m_metaInfo(metaInfo),
- m_effect(effect)
+ m_effect(effect),
+ m_needsMonitorEffectScene(false)
{
m_in = info.cropStart.frames(KdenliveSettings::project_fps());
m_out = (info.cropStart + info.cropDuration).frames(KdenliveSettings::project_fps()) - 1;
connect(pl, SIGNAL(parameterChanged()), this, SLOT(slotCollectAllParameters()));
} else if (type == "geometry") {
if (KdenliveSettings::on_monitor_effects()) {
+ 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);
- m_geometryWidget->slotShowScene(!disable);
// 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 (pa.attribute("widget") == "corners") {
// 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);
- corners->slotShowScene(!disable);
+ 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)));
meetDependency(paramName, type, EffectsList::parameter(e, depends));
#ifdef USE_QJSON
} else if (type == "roto-spline") {
+ m_needsMonitorEffectScene = true;
RotoWidget *roto = new RotoWidget(value, m_metaInfo->monitor, info, m_metaInfo->timecode, parent);
- roto->slotShowScene(!disable);
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)));
}
}
-bool ParameterContainer::needsMonitorEffectScene()
+bool ParameterContainer::needsMonitorEffectScene() const
{
- return true;
+ return m_needsMonitorEffectScene;
}
void updateProjectFormat(MltVideoProfile profile, Timecode t);
void updateParameter(const QString &key, const QString &value);
/** @brief Returns true of this effect requires an on monitor adjustable effect scene. */
- bool needsMonitorEffectScene();
+ bool needsMonitorEffectScene() const;
private slots:
void slotCollectAllParameters();
EffectMetaInfo *m_metaInfo;
QDomElement m_effect;
QVBoxLayout *m_vbox;
+ bool m_needsMonitorEffectScene;
signals:
void parameterChanged(const QDomElement, const QDomElement, int);
#include "effectstackedit.h"
#include "effectstack/effectstackview2.h"
#include "effectslist.h"
+#include "monitor.h"
#include "kdenlivesettings.h"
#include <KDebug>
EffectStackEdit::EffectStackEdit(Monitor *monitor, QWidget *parent) :
QScrollArea(parent),
- m_in(0),
- m_out(0),
m_paramWidget(NULL)
{
m_baseWidget = new QWidget(this);
connect (m_paramWidget, SIGNAL(checkMonitorPosition(int)), this, SIGNAL(checkMonitorPosition(int)));
connect (m_paramWidget, SIGNAL(seekTimeline(int)), this, SIGNAL(seekTimeline(int)));
-
Q_FOREACH( QSpinBox * sp, m_baseWidget->findChildren<QSpinBox*>() ) {
sp->installEventFilter( this );
sp->setFocusPolicy( Qt::StrongFocus );
cb->installEventFilter( this );
cb->setFocusPolicy( Qt::StrongFocus );
}
-
- return;
}
void EffectStackEdit::slotSyncEffectsPos(int pos)
emit syncEffectsPos(pos);
}
+bool EffectStackEdit::needsMonitorEffectScene() const
+{
+ if (!m_paramWidget) return false;
+ return m_paramWidget->needsMonitorEffectScene();
+}
Monitor *monitor();
/** @brief Install event filter so that scrolling with mouse wheel does not change parameter value. */
virtual bool eventFilter( QObject * o, QEvent * e );
+ /** @brief Returns true if this transition requires an on monitor scene. */
+ bool needsMonitorEffectScene() const;
private:
- int m_in;
- int m_out;
Monitor *m_monitor;
EffectMetaInfo m_metaInfo;
QWidget *m_baseWidget;
connect(edit, SIGNAL(showEdit(bool)), this, SLOT(slotShowScene(bool)));
connect(m_scene, SIGNAL(addKeyframe()), this, SLOT(slotAddKeyframe()));
- connect(m_monitor, SIGNAL(renderPosition(int)), this, SLOT(slotCheckMonitorPosition(int)));
connect(this, SIGNAL(parameterChanged()), this, SLOT(slotUpdateProperties()));
}
}
if (m_monitor) {
m_monitor->getEffectEdit()->showVisibilityButton(false);
- m_monitor->slotShowEffectScene(false);
}
}
void setupParam(const QDomElement elem, int minframe, int maxframe);
/** @brief Updates position of the local timeline to @param relTimelinePos. */
void slotSyncPosition(int relTimelinePos);
- /** @brief Switches from normal monitor to monitor scene according to @param show. */
- void slotShowScene(bool show = true);
private:
Ui::GeometryWidget_UI m_ui;
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 Monitor::slotShowEffectScene(bool show)
{
if (m_id == Kdenlive::projectMonitor) {
+ kDebug()<<"// SHOWING SCENE: "<<show<<", IS DISPLAYD: "<<m_effectWidget->isVisible();
+ if (m_effectWidget->isVisible() == show) return;
if (videoSurface) {
videoSurface->setVisible(!show);
} else {
connect(m_item, SIGNAL(changed(bool)), this, SLOT(slotUpdateData(bool)));
connect(edit, SIGNAL(showEdit(bool)), this, SLOT(slotShowScene(bool)));
- connect(m_monitor, SIGNAL(renderPosition(int)), this, SLOT(slotCheckMonitorPosition(int)));
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)));
connect(transitionList, SIGNAL(activated(int)), this, SLOT(slotTransitionChanged()));
connect(transitionTrack, SIGNAL(activated(int)), this, SLOT(slotTransitionTrackChanged()));
connect(m_effectEdit, SIGNAL(parameterChanged(const QDomElement, const QDomElement, int)), this , SLOT(slotUpdateEffectParams(const QDomElement, const QDomElement)));
- connect(m_effectEdit, SIGNAL(checkMonitorPosition(int)), this, SLOT(slotCheckMonitorPosition(int)));
- connect(monitor, SIGNAL(renderPosition(int)), this, SLOT(slotRenderPos(int)));
}
void TransitionSettings::updateProjectFormat(MltVideoProfile profile, Timecode t, const QList <TrackInfo> info)
if (m_usedTransition->hasGeometry())
m_effectEdit->transferParamDesc(m_usedTransition->toXML(), m_usedTransition->info(), false);
}
+ slotCheckMonitorPosition(m_effectEdit->monitor()->render->seekFramePosition());
}
void TransitionSettings::slotTransitionTrackChanged()
setEnabled(t != NULL);
m_effectEdit->setFrameSize(p);
m_autoTrackTransition = nextTrack;
+ disconnect(m_effectEdit->monitor(), SIGNAL(renderPosition(int)), this, SLOT(slotRenderPos(int)));
if (t == m_usedTransition) {
if (t == NULL) return;
if (update) {
slotTransitionChanged(false, false);
transitionList->blockSignals(false);
}
+ if (m_effectEdit->needsMonitorEffectScene()) {
+ connect(m_effectEdit->monitor(), SIGNAL(renderPosition(int)), this, SLOT(slotRenderPos(int)));
+ }
} else {
// null transition selected
m_usedTransition = NULL;
ItemInfo info;
m_effectEdit->transferParamDesc(QDomElement(), info, false);
}
-
}
void TransitionSettings::slotUpdateEffectParams(const QDomElement oldparam, const QDomElement param)
void TransitionSettings::slotRenderPos(int pos)
{
- if (m_usedTransition)
+ if (m_usedTransition) {
m_effectEdit->slotSyncEffectsPos(pos - m_usedTransition->startPos().frames(KdenliveSettings::project_fps()));
+ if (isEnabled()) slotCheckMonitorPosition(pos);
+ }
}
void TransitionSettings::slotSeekTimeline(int pos)
void TransitionSettings::slotCheckMonitorPosition(int renderPos)
{
- if (renderPos >= m_usedTransition->startPos().frames(KdenliveSettings::project_fps()) && renderPos <= m_usedTransition->endPos().frames(KdenliveSettings::project_fps())) {
- if (!m_effectEdit->monitor()->effectSceneDisplayed())
- //m_effectEdit->monitor()->getEffectEdit()->getScene()->views().at(0)->isVisible())
- m_effectEdit->monitor()->slotShowEffectScene(true);
- } else {
- m_effectEdit->monitor()->slotShowEffectScene(false);
+ if (!isEnabled()) return;
+ if (m_effectEdit->needsMonitorEffectScene()) {
+ if (renderPos >= m_usedTransition->startPos().frames(KdenliveSettings::project_fps()) && renderPos <= m_usedTransition->endPos().frames(KdenliveSettings::project_fps())) {
+ if (!m_effectEdit->monitor()->effectSceneDisplayed()) {
+ m_effectEdit->monitor()->slotShowEffectScene(true);
+ }
+ } else {
+ m_effectEdit->monitor()->slotShowEffectScene(false);
+ }
+ }
+ else {
+ m_effectEdit->monitor()->slotShowEffectScene(false);
}
}