QMap<QString, QImage> EffectStackEdit::iconCache;
EffectStackEdit::EffectStackEdit(Monitor *monitor, QWidget *parent) :
- QScrollArea(parent),
- m_in(0),
- m_out(0),
- m_frameSize(QPoint()),
- m_keyframeEditor(NULL),
- m_monitor(monitor)
+ QScrollArea(parent),
+ m_in(0),
+ m_out(0),
+ m_frameSize(QPoint()),
+ m_keyframeEditor(NULL),
+ m_monitor(monitor)
{
m_baseWidget = new QWidget(this);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
void EffectStackEdit::updateParameter(const QString &name, const QString &value)
{
m_params.setAttribute(name, value);
+ if (name == "disable") {
+ // if effect is disabled, disable parameters widget
+ setEnabled(value.toInt() == 0);
+ if (KdenliveSettings::on_monitor_effects()) {
+ // effect disabled, hide monitor scene if any
+ QDomNodeList namenode = m_params.elementsByTagName("parameter");
+ for (int i = 0; i < namenode.count() ; i++) {
+ QDomNode pa = namenode.item(i);
+ QDomNode na = pa.firstChildElement("name");
+ QString type = pa.attributes().namedItem("type").nodeValue();
+ if (type == "geometry") {
+ QString paramName = i18n(na.toElement().text().toUtf8().data());
+ paramName.append("geometry");
+ GeometryWidget *geometry = ((GeometryWidget*)m_valueItems.value(paramName));
+ geometry->slotShowScene(value.toInt() == 0);
+ }
+ }
+ }
+ }
}
void EffectStackEdit::transferParamDesc(const QDomElement d, int pos, int in, int out, bool isEffect)
QDomElement e = m_params.toElement();
const int minFrame = e.attribute("start").toInt();
const int maxFrame = e.attribute("end").toInt();
+ bool disabled = d.attribute("disable") == "1";
for (int i = 0; i < namenode.count() ; i++) {
connect(pl, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
} else if (type == "geometry") {
if (KdenliveSettings::on_monitor_effects()) {
- GeometryWidget *geometry = new GeometryWidget(m_monitor, m_timecode, pos, isEffect, this);
+ GeometryWidget *geometry = new GeometryWidget(m_monitor, m_timecode, pos, isEffect, disabled, this);
// connect this before setupParam to make sure the monitor scene shows up at startup
connect(geometry, SIGNAL(checkMonitorPosition(int)), this, SIGNAL(checkMonitorPosition(int)));
connect(geometry, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
}
m_vbox->addStretch();
- if(m_keyframeEditor)
+ if (m_keyframeEditor)
m_keyframeEditor->checkVisibleParam();
}
-GeometryWidget::GeometryWidget(Monitor* monitor, Timecode timecode, int clipPos, bool isEffect, QWidget* parent):
- QWidget(parent),
- m_monitor(monitor),
- m_timePos(new TimecodeDisplay(timecode)),
- m_clipPos(clipPos),
- m_inPoint(0),
- m_outPoint(1),
- m_isEffect(isEffect),
- m_rect(NULL),
- m_geometry(NULL),
- m_showScene(true)
+GeometryWidget::GeometryWidget(Monitor* monitor, Timecode timecode, int clipPos, bool isEffect, bool disabled, QWidget* parent):
+ QWidget(parent),
+ m_monitor(monitor),
+ m_timePos(new TimecodeDisplay(timecode)),
+ m_clipPos(clipPos),
+ m_inPoint(0),
+ m_outPoint(1),
+ m_isEffect(isEffect),
+ m_rect(NULL),
+ m_geometry(NULL),
+ m_showScene(true)
{
m_ui.setupUi(this);
m_scene = monitor->getEffectScene();
settingsLayout->setContentsMargins(0, 0, 0, 0);
((QGridLayout *)m_ui.widgetConfigButton->layout())->addWidget(m_config->getShowHideButton(), 1, 1);
connect(m_config, SIGNAL(showScene(bool)), this, SLOT(slotShowScene(bool)));
-
+ slotShowScene(!disabled);
connect(m_scene, SIGNAL(actionFinished()), this, SLOT(slotUpdateGeometry()));
* @param clipPos Position of the clip in timeline
* @param isEffect true if used in an effect, false if used in a transition
* @param parent (optional) Parent widget */
- GeometryWidget(Monitor *monitor, Timecode timecode, int clipPos, bool isEffect, QWidget* parent = 0);
+ GeometryWidget(Monitor *monitor, Timecode timecode, int clipPos, bool isEffect, bool disabled, QWidget* parent = 0);
virtual ~GeometryWidget();
/** @brief Gets the geometry as a serialized string. */
QString getValue() const;
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;
/** @brief Enables/Disables syncing with the timeline according to @param sync. */
void slotSetSynchronize(bool sync);
- /** @brief Switches from normal monitor to monitor scene according to @param show. */
- void slotShowScene(bool show = true);
signals:
void parameterChanged();