#include "ui_colorval_ui.h"
#include "ui_positionval_ui.h"
#include "ui_wipeval_ui.h"
+#include "ui_keyframeeditor_ui.h"
#include "complexparameter.h"
#include "geometryval.h"
+#include "keyframeedit.h"
+#include "effectslist.h"
#include "kdenlivesettings.h"
#include <KDebug>
QWidget *wid = new QWidget(parent);
area->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
area->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+ area->setFrameStyle(QFrame::NoFrame);
wid->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
area->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::MinimumExpanding));
void EffectStackEdit::setFrameSize(QPoint p)
{
m_frameSize = p;
+ 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();
+ QString paramName = i18n(na.toElement().text().toUtf8().data());
+
+ if (type == "geometry") {
+ Geometryval *geom = ((Geometryval*)m_valueItems[paramName+"geometry"]);
+ geom->setFrameSize(m_frameSize);
+ break;
+ }
+ }
+
}
void EffectStackEdit::updateProjectFormat(MltVideoProfile profile, Timecode t)
const int maxFrame = e.attribute("end").toInt();
- for (int i = 0;i < namenode.count() ;i++) {
+ for (int i = 0; i < namenode.count() ; i++) {
kDebug() << "in form";
QDomElement pa = namenode.item(i).toElement();
QDomNode na = pa.firstChildElement("name");
if (listitemsdisplay.count() != listitems.count()) listitemsdisplay = listitems;
//lsval->list->addItems(listitems);
lsval->list->setIconSize(QSize(30, 30));
- for (int i = 0;i < listitems.count();i++) {
+ for (int i = 0; i < listitems.count(); i++) {
lsval->list->addItem(listitemsdisplay.at(i), listitems.at(i));
QString entry = listitems.at(i);
if (!entry.isEmpty() && (entry.endsWith(".png") || entry.endsWith(".pgm"))) {
m_vbox->addWidget(geo);
m_valueItems[paramName+"geometry"] = geo;
m_items.append(geo);
+ } else if (type == "keyframe") {
+ // keyframe editor widget
+ kDebug() << "min: " << m_in << ", MAX: " << m_out;
+ KeyframeEdit *geo = new KeyframeEdit(pa, m_out - m_in, m_timecode);
+ connect(geo, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
+ //geo->setupParam(100, pa.attribute("min").toInt(), pa.attribute("max").toInt(), pa.attribute("keyframes"));
+ //connect(geo, SIGNAL(seekToPos(int)), this, SLOT(slotSeekToPos(int)));
+ //geo->setupParam(pa, minFrame, maxFrame);
+ m_vbox->addWidget(geo);
+ m_valueItems[paramName+"keyframe"] = geo;
+ m_items.append(geo);
} else if (type == "color") {
Colorval *cval = new Colorval;
cval->setupUi(toFillin);
QDomElement oldparam = m_params.cloneNode().toElement();
QDomNodeList namenode = m_params.elementsByTagName("parameter");
- for (int i = 0;i < namenode.count() ;i++) {
+ 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();
} else if (type == "position") {
KRestrictedLine *line = ((Positionval*)m_valueItems[paramName+"position"])->krestrictedline;
int pos = m_timecode.getFrameCount(line->text(), KdenliveSettings::project_fps());
+ setValue = QString::number(pos);
if (m_params.attribute("id") == "fadein" || m_params.attribute("id") == "fade_from_black") {
- pos += m_in;
+ // Make sure duration is not longer than clip
if (pos > m_out) {
pos = m_out;
line->setText(m_timecode.getTimecodeFromFrames(pos));
}
+ EffectsList::setParameter(m_params, "in", QString::number(m_in));
+ EffectsList::setParameter(m_params, "out", QString::number(m_in + pos));
+ setValue.clear();
} else if (m_params.attribute("id") == "fadeout" || m_params.attribute("id") == "fade_to_black") {
- pos = m_out - (pos - m_in);
- if (pos > m_out - m_in) {
- pos = m_out - m_in;
+ // Make sure duration is not longer than clip
+ if (pos > m_out) {
+ pos = m_out;
line->setText(m_timecode.getTimecodeFromFrames(pos));
}
+ EffectsList::setParameter(m_params, "in", QString::number(m_out + m_in - pos));
+ EffectsList::setParameter(m_params, "out", QString::number(m_out + m_in));
+ setValue.clear();
}
- setValue = QString::number(pos);
} else if (type == "wipe") {
Wipeval *wp = (Wipeval*)m_valueItems[paramName];
wipeInfo info;