- end.append(':' + QString::number(info.endTransparency));
- return QString(start + ";-1=" + end);
-}
-
-void EffectStackEdit::collectAllParameters()
-{
- if (m_valueItems.isEmpty()) return;
- QDomElement oldparam = m_params.cloneNode().toElement();
- 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 == "complex") paramName.append("complex");
- else if (type == "position") paramName.append("position");
- else if (type == "geometry") paramName.append("geometry");
- else if (type == "keyframe") paramName.append("keyframe");
- if (!m_valueItems.contains(paramName)) {
- kDebug() << "// Param: " << paramName << " NOT FOUND";
- continue;
- }
-
- QString setValue;
- if (type == "double" || type == "constant") {
- QSlider* slider = ((Constval*)m_valueItems.value(paramName))->horizontalSlider;
- setValue = QString::number(slider->value());
- } else if (type == "list") {
- KComboBox *box = ((Listval*)m_valueItems.value(paramName))->list;
- setValue = box->itemData(box->currentIndex()).toString();
- } else if (type == "bool") {
- QCheckBox *box = ((Boolval*)m_valueItems.value(paramName))->checkBox;
- setValue = box->checkState() == Qt::Checked ? "1" : "0" ;
- } else if (type == "color") {
- KColorButton *color = ((Colorval*)m_valueItems.value(paramName))->kcolorbutton;
- setValue = color->color().name();
- } else if (type == "complex") {
- ComplexParameter *complex = ((ComplexParameter*)m_valueItems.value(paramName));
- namenode.item(i) = complex->getParamDesc();
- } else if (type == "geometry") {
- 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());
- 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) {
- 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") {
- // 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();
- }
- } else if (type == "wipe") {
- Wipeval *wp = (Wipeval*)m_valueItems.value(paramName);
- wipeInfo info;
- if (wp->start_left->isChecked()) info.start = LEFT;
- else if (wp->start_right->isChecked()) info.start = RIGHT;
- else if (wp->start_up->isChecked()) info.start = UP;
- else if (wp->start_down->isChecked()) info.start = DOWN;
- else if (wp->start_center->isChecked()) info.start = CENTER;
- else info.start = LEFT;
- info.startTransparency = wp->start_transp->value();
- if (wp->end_left->isChecked()) info.end = LEFT;
- else if (wp->end_right->isChecked()) info.end = RIGHT;
- else if (wp->end_up->isChecked()) info.end = UP;
- else if (wp->end_down->isChecked()) info.end = DOWN;
- else if (wp->end_center->isChecked()) info.end = CENTER;
- else info.end = RIGHT;
- info.endTransparency = wp->end_transp->value();
- setValue = getWipeString(info);
- }
-
- if (!setValue.isNull()) {
- pa.attributes().namedItem("value").setNodeValue(setValue);
- }