return QString(start + ";-1=" + end);
}
+void ParameterContainer::updateParameter(const QString &key, const QString &value)
+{
+ m_effect.setAttribute(key, value);
+}
+
void ParameterContainer::slotStartFilterJobAction()
{
QDomNodeList namenode = m_effect.elementsByTagName("parameter");
~ParameterContainer();
void updateTimecodeFormat();
void updateProjectFormat(MltVideoProfile profile, Timecode t);
+ void updateParameter(const QString &key, const QString &value);
private slots:
void slotCollectAllParameters();
m_effectMetaInfo.trackMode = false;
m_effectMetaInfo.monitor = monitor;
m_effects = QList <CollapsibleEffect*>();
+ setAcceptDrops(true);
m_ui.setupUi(this);
setFont(KGlobalSettings::smallestReadableFont());
}
}
+void EffectStackView2::dragEnterEvent(QDragEnterEvent *event)
+{
+ if (event->mimeData()->hasFormat("kdenlive/effectslist")) {
+ event->acceptProposedAction();
+ }
+}
+
+void EffectStackView2::dropEvent(QDropEvent *event)
+{
+ const QString effects = QString::fromUtf8(event->mimeData()->data("kdenlive/effectslist"));
+ //event->acceptProposedAction();
+ QDomDocument doc;
+ doc.setContent(effects, true);
+ QDomElement e = doc.documentElement();
+ int ix = e.attribute("kdenlive_ix").toInt();
+ if (e.tagName() == "effectgroup") {
+ // We are dropping a group, all effects in group should be moved
+ QDomNodeList effects = e.elementsByTagName("effect");
+ if (effects.count() == 0) {
+ event->ignore();
+ return;
+ }
+ EffectInfo info;
+ info.fromString(effects.at(0).toElement().attribute("kdenlive_info"));
+ if (info.groupIndex < 0) {
+ // Adding a new group effect to the stack
+ event->setDropAction(Qt::CopyAction);
+ event->accept();
+ slotAddEffect(e);
+ return;
+ }
+ for (int i = 0; i < effects.count(); i++) {
+ //TODO: not working because wee need to move all effects in one go
+ slotMoveEffect(effects.at(i).toElement().attribute("kdenlive_ix").toInt(), m_currentEffectList.count() + 1 + i, info.groupIndex, info.groupName);
+ }
+ }
+ else if (ix == 0) {
+ // effect dropped from effects list, add it
+ e.setAttribute("kdenlive_ix", m_currentEffectList.count() + 1);
+ event->setDropAction(Qt::CopyAction);
+ event->accept();
+ slotAddEffect(e);
+ return;
+ }
+ else {
+ // User is moving an effect
+ slotMoveEffect(ix, m_currentEffectList.count() + 1, -1);
+ }
+ event->setDropAction(Qt::MoveAction);
+ event->accept();
+}
+
#include "effectstackview2.moc"
virtual void mouseMoveEvent(QMouseEvent * event);
virtual void mouseReleaseEvent(QMouseEvent * event);
virtual void resizeEvent ( QResizeEvent * event );
+ virtual void dragEnterEvent(QDragEnterEvent *event);
+ virtual void dropEvent(QDropEvent *event);
private:
Ui::EffectStack2_UI m_ui;
void EffectStackEdit::updateParameter(const QString &name, const QString &value)
{
- m_params.setAttribute(name, value);
+ m_paramWidget->updateParameter(name, value);
if (name == "disable") {
// if effect is disabled, disable parameters widget
emit syncEffectsPos(pos);
}
-void EffectStackEdit::slotStartFilterJobAction()
-{
- QDomNodeList namenode = m_params.elementsByTagName("parameter");
- for (int i = 0; i < namenode.count() ; i++) {
- QDomElement pa = namenode.item(i).toElement();
- QString type = pa.attribute("type");
- if (type == "filterjob") {
- emit startFilterJob(pa.attribute("filtertag"), pa.attribute("filterparams"), pa.attribute("finalfilter"), pa.attribute("consumer"), pa.attribute("consumerparams"), pa.attribute("wantedproperties"));
- kDebug()<<" - - -PROPS:\n"<<pa.attribute("filtertag")<<"-"<< pa.attribute("filterparams")<<"-"<< pa.attribute("consumer")<<"-"<< pa.attribute("consumerparams")<<"-"<< pa.attribute("wantedproperties");
- break;
- }
- }
-}
QVBoxLayout *m_vbox;
QList<QWidget*> m_uiItems;
- QDomElement m_params;
QMap<QString, QWidget*> m_valueItems;
int m_in;
int m_out;
/** @brief Pass position changes of the timeline cursor to the effects to keep their local timelines in sync. */
void slotSyncEffectsPos(int pos);
-
-private slots:
- void slotStartFilterJobAction();
signals:
void parameterChanged(const QDomElement, const QDomElement, int);