<name>Power (Gamma) Alpha</name>
</parameter>
- <parameter type="simplekeyframe" name="saturation" default="100" min="0" max="500" factor="100">
+ <parameter type="simplekeyframe" name="saturation" default="100" min="0" max="500" factor="100" intimeline="1">
<name>Overall Saturation</name>
</parameter>
int keyframeParams = 0;
for (int i = 0; i < params.count(); i++) {
QDomElement e = params.item(i).toElement();
- if (!e.isNull() && (e.attribute("type") == "keyframe" || e.attribute("type") == "simplekeyframe")) {
+ if (!e.isNull() && (e.attribute("type") == "keyframe" || e.attribute("type") == "simplekeyframe") && e.attribute("intimeline") == "1") {
e.setAttribute("keyframes", keyframes.at(keyframeParams));
if (ix == m_selectedEffect && keyframeParams == 0) {
m_keyframes.clear();
if (effect.attribute("disable") != "1")
for (int i = 0; i < params.count(); i++) {
QDomElement e = params.item(i).toElement();
- if (!e.isNull() && (e.attribute("type") == "keyframe" || e.attribute("type") == "simplekeyframe")) {
+ if (!e.isNull() && (e.attribute("type") == "keyframe" || e.attribute("type") == "simplekeyframe") && e.attribute("intimeline") == "1") {
m_keyframes.clear();
m_visibleParam = i;
double max = e.attribute("max").toDouble();
// parse keyframes
QDomNodeList params = effect.elementsByTagName("parameter");
QDomElement e = params.item(m_visibleParam).toElement();
+ if (e.attribute("intimeline") != "1") {
+ setSelectedEffect(m_selectedEffect);
+ return;
+ }
const QStringList keyframes = e.attribute("keyframes").split(';', QString::SkipEmptyParts);
foreach(const QString &str, keyframes) {
int pos = str.section(':', 0, 0).toInt();
setValue = getWipeString(info);
} else if ((type == "simplekeyframe" || type == "keyframe") && m_keyframeEditor) {
+ QDomElement elem = pa.toElement();
QString realName = i18n(na.toElement().text().toUtf8().data());
QString val = m_keyframeEditor->getValue(realName);
- //kDebug() << "SET VALUE: " << val;
- namenode.item(i).toElement().setAttribute("keyframes", val);
+ elem.setAttribute("keyframes", val);
+
+ if (m_keyframeEditor->isVisibleParam(realName))
+ elem.setAttribute("intimeline", "1");
+ else if (elem.hasAttribute("intimeline"))
+ elem.removeAttribute("intimeline");
} else if (type == "url") {
KUrlRequester *req = ((Urlval*)m_valueItems.value(paramName))->urlwidget;
setValue = req->url().path();
#include <KGlobalSettings>
#include <QHeaderView>
+#include <QButtonGroup>
+#include <QRadioButton>
KeyframeEdit::KeyframeEdit(QDomElement e, int minFrame, int maxFrame, Timecode tc, int activeKeyframe, QWidget* parent) :
QWidget(parent),
connect(keyframe_list, SIGNAL(itemSelectionChanged()), this, SLOT(slotAdjustKeyframeInfo()));
connect(keyframe_list, SIGNAL(cellChanged(int, int)), this, SLOT(slotGenerateParams(int, int)));
+ m_showButtons = new QButtonGroup(this);
m_slidersLayout = new QGridLayout(param_sliders);
keyframe_list->setSelectionBehavior(QAbstractItemView::SelectRows);
keyframe_list->setSelectionMode(QAbstractItemView::SingleSelection);
connect(buttonKeyframes, SIGNAL(clicked()), this, SLOT(slotKeyframeMode()));
connect(buttonResetKeyframe, SIGNAL(clicked()), this, SLOT(slotResetKeyframe()));
connect(keyframe_pos, SIGNAL(valueChanged(int)), this, SLOT(slotAdjustKeyframePos(int)));
+ connect(m_showButtons, SIGNAL(buttonClicked(int)), this, SLOT(slotUpdateVisibleParameter(int)));
//connect(keyframe_list, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, SLOT(slotSaveCurrentParam(QTreeWidgetItem *, int)));
connect(doubleparam, SIGNAL(valueChanged(int)), this, SLOT(slotAdjustKeyframeValue(int)));
m_slidersLayout->addWidget(doubleparam, columnId, 0);
+ QRadioButton *radio = new QRadioButton(this);
+ m_showButtons->addButton(radio, columnId);
+ if (e.attribute("intimeline") == "1")
+ radio->setChecked(true);
+ m_slidersLayout->addWidget(radio, columnId, 1);
+
QStringList frames = e.attribute("keyframes").split(";", QString::SkipEmptyParts);
for (int i = 0; i < frames.count(); i++) {
int frame = frames.at(i).section(':', 0, 0).toInt();
}
}
+void KeyframeEdit::slotUpdateVisibleParameter(int id)
+{
+ for (int i = 0; i < m_params.count(); ++i)
+ m_params[i].setAttribute("intimeline", (i == id ? "1" : "0"));
+ emit parameterChanged();
+}
+
+bool KeyframeEdit::isVisibleParam(const QString& name)
+{
+ for (int col = 0; col < keyframe_list->columnCount(); ++col) {
+ QDomNode na = m_params.at(col).firstChildElement("name");
+ QString paramName = i18n(na.toElement().text().toUtf8().data());
+ if (paramName == name)
+ return m_params.at(col).attribute("intimeline") == "1";
+ }
+ return false;
+}
+
#include "keyframeedit.moc"
#include <QAbstractItemView>
#include <QSpinBox>
+class QButtonGroup;
#include "ui_keyframeeditor_ui.h"
#include "definitions.h"
/** @brief Updates the timecode display according to settings (frame number or hh:mm:ss:ff) */
void updateTimecodeFormat();
+ /** @brief Returns true if the parameter @param name should be shown on the clip in timeline. */
+ bool isVisibleParam(const QString &name);
+
private:
QList <QDomElement> m_params;
int m_min;
int m_max;
Timecode m_timecode;
QGridLayout *m_slidersLayout;
+ QButtonGroup *m_showButtons;
void generateAllParams();
/** @brief Gets the position of a keyframe from the table.
/** @brief Resets all parameters of the selected keyframe to their default values. */
void slotResetKeyframe();
+ /** @brief Makes the parameter at column @param id the visible (in timeline) one. */
+ void slotUpdateVisibleParameter(int id);
+
signals:
void parameterChanged();
void seekToPos(int);