#include "ui_listval_ui.h"
#include "ui_boolval_ui.h"
#include "ui_colorval_ui.h"
+#include "ui_positionval_ui.h"
#include "ui_wipeval_ui.h"
#include "complexparameter.h"
#include "effectstackedit.h"
#include "geometryval.h"
+#include "kdenlivesettings.h"
+
QMap<QString, QImage> EffectStackEdit::iconCache;
EffectStackEdit::EffectStackEdit(QWidget *parent): QWidget(parent), m_in(0), m_out(0) {
setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
- setBackgroundRole(QPalette::Dark);
QVBoxLayout *vbox1 = new QVBoxLayout(parent);
vbox1->setContentsMargins(0, 0, 0, 0);
vbox1->setSpacing(0);
iconCache.clear();
}
-void EffectStackEdit::updateProjectFormat(MltVideoProfile profile) {
+void EffectStackEdit::updateProjectFormat(MltVideoProfile profile, Timecode t) {
m_profile = profile;
+ m_timecode = t;
}
void EffectStackEdit::transferParamDesc(const QDomElement& d, int in, int out) {
QDomDocument doc;
doc.appendChild(doc.importNode(params, true));
- kDebug() << "IMPORTED TRANS: " << doc.toString();
+ //kDebug() << "IMPORTED TRANS: " << doc.toString();
QDomNodeList namenode = params.elementsByTagName("parameter");
QDomElement e = params.toElement();
const int minFrame = e.attribute("start").toInt();
cval->label->setText(paramName);
valueItems[paramName] = cval;
uiItems.append(cval);
+ } else if (type == "position") {
+ Ui::Positionval_UI *pval = new Ui::Positionval_UI;
+ pval->setupUi(toFillin);
+ int pos = value.toInt();
+ if (d.attribute("id") == "fadein") {
+ pos = pos - m_in;
+ } else if (d.attribute("id") == "fadeout") {
+ // fadeout position starts from clip end
+ pos = m_out - (pos - m_in);
+ }
+ pval->krestrictedline->setText(m_timecode.getTimecodeFromFrames(pos));
+ connect(pval->krestrictedline, SIGNAL(editingFinished()), this, SLOT(collectAllParameters()));
+ pval->label->setText(paramName);
+ valueItems[paramName + "position"] = pval;
+ uiItems.append(pval);
} else if (type == "wipe") {
Ui::Wipeval_UI *wpval = new Ui::Wipeval_UI;
wpval->setupUi(toFillin);
setValue = box->checkState() == Qt::Checked ? "1" : "0" ;
} else if (type == "color") {
KColorButton *color = ((Ui::Colorval_UI*)valueItems[paramName])->kcolorbutton;
- setValue.sprintf("0x%08x", color->color().rgba());
+ setValue = color->color().name();
+ setValue.replace('#', "0x");
} else if (type == "complex") {
ComplexParameter *complex = ((ComplexParameter*)valueItems[paramName+"complex"]);
namenode.item(i) = complex->getParamDesc();
} else if (type == "geometry") {
Geometryval *geom = ((Geometryval*)valueItems[paramName+"geometry"]);
namenode.item(i) = geom->getParamDesc();
+ } else if (type == "position") {
+ KRestrictedLine *line = ((Ui::Positionval_UI*)valueItems[paramName+"position"])->krestrictedline;
+ int pos = m_timecode.getFrameCount(line->text(), KdenliveSettings::project_fps());
+ if (params.attribute("id") == "fadein") {
+ pos += m_in;
+ if (pos > m_out) {
+ pos = m_out;
+ line->setText(m_timecode.getTimecodeFromFrames(pos));
+ }
+ } else if (params.attribute("id") == "fadeout") {
+ pos = m_out - (pos - m_in);
+ if (pos > m_out - m_in) {
+ pos = m_out - m_in;
+ line->setText(m_timecode.getTimecodeFromFrames(pos));
+ }
+ }
+ setValue = QString::number(pos);
} else if (type == "wipe") {
Ui::Wipeval_UI *wp = (Ui::Wipeval_UI*)valueItems[paramName];
wipeInfo info;