documentvalidator.cpp
cliptranscode.cpp
keyframeedit.cpp
+ positionedit.cpp
)
add_definitions( ${KDE4_DEFINITIONS} )
#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 "ui_keyframeeditor_ui.h"
#include "complexparameter.h"
#include "geometryval.h"
#include "keyframeedit.h"
+#include "positionedit.h"
#include "effectslist.h"
#include "kdenlivesettings.h"
#include "profilesdialog.h"
{
};
-class Positionval: public EffectStackEdit::UiItem, public Ui::Positionval_UI
-{
-};
-
class Wipeval: public EffectStackEdit::UiItem, public Ui::Wipeval_UI
{
};
connect(cval->kcolorbutton, SIGNAL(clicked()) , this, SLOT(collectAllParameters()));
m_uiItems.append(cval);
} else if (type == "position") {
- Positionval *pval = new Positionval;
- pval->setupUi(toFillin);
int pos = value.toInt();
if (d.attribute("id") == "fadein" || d.attribute("id") == "fade_from_black") {
pos = pos - m_in;
// fadeout position starts from clip end
pos = m_out - (pos - m_in);
}
- pval->krestrictedline->setText(m_timecode.getTimecodeFromFrames(pos));
- pval->label->setText(paramName);
- m_valueItems[paramName + "position"] = pval;
- connect(pval->krestrictedline, SIGNAL(editingFinished()), this, SLOT(collectAllParameters()));
- m_uiItems.append(pval);
+ PositionEdit *posedit = new PositionEdit(paramName, pos, 1, m_out, m_timecode);
+ m_vbox->addWidget(posedit);
+ m_valueItems[paramName+"position"] = posedit;
+ connect(posedit, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
+ m_items.append(posedit);
} else if (type == "wipe") {
Wipeval *wpval = new Wipeval;
wpval->setupUi(toFillin);
Geometryval *geom = ((Geometryval*)m_valueItems.value(paramName));
namenode.item(i) = geom->getParamDesc();
} else if (type == "position") {
- KRestrictedLine *line = ((Positionval*)m_valueItems.value(paramName))->krestrictedline;
- int pos = m_timecode.getFrameCount(line->text(), KdenliveSettings::project_fps());
+ PositionEdit *pedit = ((PositionEdit*)m_valueItems.value(paramName));
+ int pos = pedit->getPosition();
setValue = QString::number(pos);
if (m_params.attribute("id") == "fadein" || m_params.attribute("id") == "fade_from_black") {
// Make sure duration is not longer than clip
- if (pos > m_out) {
+ /*if (pos > m_out) {
pos = m_out;
- line->setText(m_timecode.getTimecodeFromFrames(pos));
- }
+ pedit->setPosition(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") {
// Make sure duration is not longer than clip
- if (pos > m_out) {
+ /*if (pos > m_out) {
pos = m_out;
- line->setText(m_timecode.getTimecodeFromFrames(pos));
- }
+ pedit->setPosition(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();
--- /dev/null
+/***************************************************************************
+ geomeytrval.cpp - description
+ -------------------
+ begin : 03 Aug 2008
+ copyright : (C) 2008 by Marco Gittler
+ email : g.marco@freenet.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "positionedit.h"
+#include "kdenlivesettings.h"
+
+#include <KDebug>
+
+PositionEdit::PositionEdit(const QString name, int pos, int min, int max, const Timecode tc, QWidget* parent) :
+ QWidget(parent),
+ m_tc(tc)
+{
+ m_ui.setupUi(this);
+ m_ui.label->setText(name);
+ m_ui.horizontalSlider->setRange(min, max);
+ connect(m_ui.horizontalSlider, SIGNAL(valueChanged(int)), this, SLOT(slotUpdateTimecode()));
+ connect(m_ui.krestrictedline, SIGNAL(editingFinished()), this, SLOT(slotUpdatePosition()));
+ m_ui.horizontalSlider->setValue(pos);
+ m_ui.krestrictedline->setText(m_tc.getTimecodeFromFrames(pos));
+}
+
+int PositionEdit::getPosition() const
+{
+ return m_ui.horizontalSlider->value();
+}
+
+void PositionEdit::setPosition(int pos)
+{
+ m_ui.horizontalSlider->setValue(pos);
+ m_ui.krestrictedline->setText(m_tc.getTimecodeFromFrames(pos));
+}
+
+void PositionEdit::slotUpdateTimecode()
+{
+ m_ui.krestrictedline->setText(m_tc.getTimecodeFromFrames(m_ui.horizontalSlider->value()));
+ emit parameterChanged();
+}
+
+void PositionEdit::slotUpdatePosition()
+{
+ m_ui.horizontalSlider->blockSignals(true);
+ int pos = m_tc.getFrameCount(m_ui.krestrictedline->text(), KdenliveSettings::project_fps());
+ m_ui.horizontalSlider->setValue(pos);
+ if (pos != m_ui.horizontalSlider->value()) {
+ // Value out of range
+ m_ui.krestrictedline->setText(m_tc.getTimecodeFromFrames(m_ui.horizontalSlider->value()));
+ }
+ m_ui.horizontalSlider->blockSignals(false);
+ emit parameterChanged();
+}
+
--- /dev/null
+/***************************************************************************
+ geomeytrval.h - description
+ -------------------
+ begin : 03 Aug 2008
+ copyright : (C) 2008 by Marco Gittler
+ email : g.marco@freenet.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef POSITONEDIT_H
+#define POSITONEDIT_H
+
+
+#include <QWidget>
+
+#include "ui_positionval_ui.h"
+#include "timecode.h"
+
+
+class PositionEdit : public QWidget
+{
+ Q_OBJECT
+public:
+ explicit PositionEdit(const QString name, int pos, int min, int max, const Timecode tc, QWidget* parent = 0);
+ int getPosition() const;
+ void setPosition(int pos);
+
+private:
+ Ui::Positionval_UI m_ui;
+ Timecode m_tc;
+
+private slots:
+ void slotUpdateTimecode();
+ void slotUpdatePosition();
+
+signals:
+ void parameterChanged();
+};
+
+#endif
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>Positionval_UI</class>
- <widget class="QWidget" name="Positionval_UI" >
- <property name="geometry" >
+ <widget class="QWidget" name="Positionval_UI">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
- <width>135</width>
- <height>28</height>
+ <width>167</width>
+ <height>54</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" >
+ <layout class="QGridLayout" name="gridLayout">
+ <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" >
+ <item row="1" column="0">
+ <widget class="KRestrictedLine" name="krestrictedline">
+ <property name="inputMask">
<string>99:99:99:99; </string>
</property>
</widget>
</item>
+ <item row="1" column="1">
+ <widget class="QSlider" name="horizontalSlider">
+ <property name="pageStep">
+ <number>1</number>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
</layout>
- <zorder>checkBox</zorder>
- <zorder>label</zorder>
- <zorder>krestrictedline</zorder>
</widget>
<customwidgets>
+ <customwidget>
+ <class>KLineEdit</class>
+ <extends>QLineEdit</extends>
+ <header>klineedit.h</header>
+ </customwidget>
<customwidget>
<class>KRestrictedLine</class>
<extends>KLineEdit</extends>