widgets/wipeval_ui.ui
widgets/boolval_ui.ui
widgets/colorval_ui.ui
+ widgets/positionval_ui.ui
widgets/titlewidget_ui.ui
widgets/timelinebuttons_ui.ui
widgets/renderwidget_ui.ui
m_document->setModified(true);
}
-void CustomTrackView::updateEffect(int track, GenTime pos, QDomElement effect, int ix) {
+void CustomTrackView::updateEffect(int track, GenTime pos, QDomElement effect, int ix, bool triggeredByUser) {
ClipItem *clip = getClipItemAt((int)pos.frames(m_document->fps()) + 1, m_scene->m_tracksList.count() - track);
if (clip) {
QHash <QString, QString> effectParams = clip->getEffectArgs(effect);
} else emit displayMessage(i18n("Problem deleting effect"), ErrorMessage);
} else if (!m_document->renderer()->mltEditEffect(m_scene->m_tracksList.count() - clip->track(), clip->startPos(), effectParams))
emit displayMessage(i18n("Problem editing effect"), ErrorMessage);
+
+ clip->setEffectAt(ix, effect);
if (ix == clip->selectedEffectIndex()) {
clip->setSelectedEffect(ix);
+ if (!triggeredByUser) emit clipItemSelected(clip, ix);
}
if (effect.attribute("tag") == "volume") {
// A fade effect was modified, update the clip
} else {
end += start;
QDomElement effect = oldeffect.cloneNode().toElement();
- EffectsList::setParameter(effect, "in", QString::number(start));
- EffectsList::setParameter(effect, "out", QString::number(end));
- slotUpdateClipEffect(item, oldeffect, effect, ix);
+ EffectsList::setParameter(oldeffect, "in", QString::number(start));
+ EffectsList::setParameter(oldeffect, "out", QString::number(end));
+ slotUpdateClipEffect(item, effect, oldeffect, ix);
+ emit clipItemSelected(item, ix);
}
} else if (item->fadeIn() != 0) {
QDomElement effect = MainWindow::audioEffects.getEffectByTag("volume", "fadein").cloneNode().toElement();
} else {
start = end - start;
QDomElement effect = oldeffect.cloneNode().toElement();
- EffectsList::setParameter(effect, "in", QString::number(start));
- EffectsList::setParameter(effect, "out", QString::number(end));
- slotUpdateClipEffect(item, oldeffect, effect, ix);
+ EffectsList::setParameter(oldeffect, "in", QString::number(start));
+ EffectsList::setParameter(oldeffect, "out", QString::number(end));
+ slotUpdateClipEffect(item, effect, oldeffect, ix);
+ emit clipItemSelected(item, ix);
}
} else if (item->fadeOut() != 0) {
QDomElement effect = MainWindow::audioEffects.getEffectByTag("volume", "fadeout").cloneNode().toElement();
void slotAddEffect(QDomElement effect, GenTime pos, int track);
void addEffect(int track, GenTime pos, QDomElement effect);
void deleteEffect(int track, GenTime pos, QDomElement effect);
- void updateEffect(int track, GenTime pos, QDomElement effect, int ix);
+ void updateEffect(int track, GenTime pos, QDomElement effect, int ix, bool triggeredByUser = true);
void moveEffect(int track, GenTime pos, int oldPos, int newPos);
void addTransition(ItemInfo transitionInfo, int endTrack, QDomElement params);
void deleteTransition(ItemInfo transitionInfo, int endTrack, QDomElement params);
// virtual
void EditEffectCommand::undo() {
kDebug() << "---- undoing action";
- m_view->updateEffect(m_track, m_pos, m_oldeffect, m_stackPos);
+ m_view->updateEffect(m_track, m_pos, m_oldeffect, m_stackPos, false);
}
// virtual
void EditEffectCommand::redo() {
kDebug() << "---- redoing action";
- m_view->updateEffect(m_track, m_pos, m_effect, m_stackPos);
+ m_view->updateEffect(m_track, m_pos, m_effect, m_stackPos, m_doIt);
+ m_doIt = false;
}
EffectsList::~EffectsList() {
}
-QMap <QString, QString> EffectsList::effect(const QString & name) {
- QMap <QString, QString> filter;
- QString effectName;
- QDomElement effect;
- for (int i = 0; i < this->size(); ++i) {
- effect = this->at(i);
- QDomNode namenode = effect.elementsByTagName("name").item(0);
- if (!namenode.isNull()) {
- effectName = i18n(namenode.toElement().text().toUtf8().data());
- if (name == effectName) break;
- }
- }
- filter.insert("mlt_service", effect.attribute("tag"));
- filter.insert("name", name);
- return filter;
-}
-
-
QDomElement EffectsList::getEffectByName(const QString & name) const {
QString effectName;
for (int i = 0; i < this->size(); ++i) {
QStringList effectNames();
QString getInfo(const QString & tag, const QString & id) const;
QString getInfoFromIndex(const int ix) const;
- QMap <QString, QString> effect(const QString & name);
EffectsList clone() const;
static bool hasKeyFrames(QDomElement effect);
static void setParameter(QDomElement effect, const QString &name, const QString &value);
#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) {
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) {
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);
+ pval->krestrictedline->setText(m_timecode.getTimecodeFromFrames(value.toInt()));
+ 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 = color->color().name();
- setValue.replace('#', "0x");
+ 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;
+ setValue = QString::number(m_timecode.getFrameCount(line->text(), KdenliveSettings::project_fps()));
+ kDebug() << "// NEW POSITION: " << setValue << "(" << line->text() << " PARAM: " << paramName + "position";
} else if (type == "wipe") {
Ui::Wipeval_UI *wp = (Ui::Wipeval_UI*)valueItems[paramName];
wipeInfo info;
#include <QMap>
#include "definitions.h"
+#include "timecode.h"
enum WIPE_DIRECTON { UP = 0, DOWN = 1, LEFT = 2, RIGHT = 3, CENTER = 4 };
public:
EffectStackEdit(QWidget *parent);
~EffectStackEdit();
- void updateProjectFormat(MltVideoProfile profile);
+ void updateProjectFormat(MltVideoProfile profile, Timecode t);
static QMap<QString, QImage> iconCache;
private:
wipeInfo getWipeInfo(QString value);
QString getWipeString(wipeInfo info);
MltVideoProfile m_profile;
+ Timecode m_timecode;
int m_in;
int m_out;
ui.buttonNew->setMenu(menu);
}
-void EffectStackView::updateProjectFormat(MltVideoProfile profile) {
- effectedit->updateProjectFormat(profile);
+void EffectStackView::updateProjectFormat(MltVideoProfile profile, Timecode t) {
+ effectedit->updateProjectFormat(profile, t);
}
void EffectStackView::slotSaveEffect() {
void raiseWindow(QWidget*);
void clear();
void setMenu(QMenu *menu);
- void updateProjectFormat(MltVideoProfile profile);
+ void updateProjectFormat(MltVideoProfile profile, Timecode t);
private:
Ui::EffectStack_UI ui;
KdenliveSettings::setProject_fps(doc->fps());
m_monitorManager->resetProfiles(doc->timecode());
m_projectList->setDocument(doc);
- transitionConfig->updateProjectFormat(doc->mltProfile());
- effectStack->updateProjectFormat(doc->mltProfile());
+ transitionConfig->updateProjectFormat(doc->mltProfile(), doc->timecode());
+ effectStack->updateProjectFormat(doc->mltProfile(), doc->timecode());
connect(m_projectList, SIGNAL(clipSelected(DocClipBase *)), m_clipMonitor, SLOT(slotSetXml(DocClipBase *)));
connect(m_projectList, SIGNAL(projectModified()), doc, SLOT(setModified()));
connect(trackView, SIGNAL(cursorMoved()), m_projectMonitor, SLOT(activateMonitor()));
ui.splitter->setStretchFactor(1, 10);
}
-void TransitionSettings::updateProjectFormat(MltVideoProfile profile) {
- effectEdit->updateProjectFormat(profile);
+void TransitionSettings::updateProjectFormat(MltVideoProfile profile, Timecode t) {
+ effectEdit->updateProjectFormat(profile, t);
}
#include "ui_transitionsettings_ui.h"
#include "definitions.h"
+class Timecode;
class Transition;
class EffectsList;
class EffectStackEdit;
public:
TransitionSettings(QWidget* parent = 0);
void raiseWindow(QWidget*);
- void updateProjectFormat(MltVideoProfile profile);
+ void updateProjectFormat(MltVideoProfile profile, Timecode t);
private:
Ui::TransitionSettings_UI ui;
--- /dev/null
+<ui version="4.0" >
+ <class>Positionval_UI</class>
+ <widget class="QWidget" name="Positionval_UI" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>135</width>
+ <height>28</height>
+ </rect>
+ </property>
+ <layout class="QGridLayout" name="gridLayout" >
+ <property name="verticalSpacing" >
+ <number>0</number>
+ </property>
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <item row="0" column="0" >
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>Position</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="KRestrictedLine" name="krestrictedline" >
+ <property name="inputMask" >
+ <string>99:99:99:99; </string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ <zorder>checkBox</zorder>
+ <zorder>label</zorder>
+ <zorder>krestrictedline</zorder>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>KRestrictedLine</class>
+ <extends>KLineEdit</extends>
+ <header>krestrictedline.h</header>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>