content.setAttribute("font-color", colorToString(c));
// todo: These fields are missing from the newly generated xmldata:
// transform, startviewport, endviewport, background
-
+
QDomText conttxt = tdoc.createTextNode(ob.attribute("text"));
content.appendChild(conttxt);
item.appendChild(position);
item.appendChild(content);
- title.appendChild(item);
+ title.appendChild(item);
} else if (ob.attribute("type") == "5") {
// rectangle object
QDomElement item = tdoc.createElement("item");
if (wproducer.isNull()) {
kWarning() << "Found producer in westley0, that was not a QDomElement";
} else {
- // We have to do slightly different things, depending on the type
- kDebug() << "Converting producer element with type " << wproducer.attribute("type");
- if ( wproducer.attribute("type").toInt() == TEXT ) {
- kDebug() << "Found TEXT element in producer" << endl;
- QDomElement kproducer = wproducer.cloneNode(true).toElement();
- kproducer.setTagName("kdenlive_producer");
- kdenlivedoc_new.appendChild(kproducer);
- // todo: Perhaps needs some more changes here to "frequency", aspect ratio as a float, frame_size, channels, and later, ressource and title name
- } else {
- QDomElement kproducer = m_document.createElement("kdenlive_producer");
- kproducer.setAttribute("id", wproducer.attribute("id"));
- kproducer.setAttribute("description", wproducer.attribute("description"));
- kproducer.setAttribute("resource", wproducer.attribute("resource"));
- kproducer.setAttribute("type", wproducer.attribute("type"));
- kdenlivedoc_new.appendChild(kproducer);
- }
- if (wproducer.attribute("id").toInt() > max_kproducer_id) {
- max_kproducer_id = wproducer.attribute("id").toInt();
- }
+ // We have to do slightly different things, depending on the type
+ kDebug() << "Converting producer element with type " << wproducer.attribute("type");
+ if (wproducer.attribute("type").toInt() == TEXT) {
+ kDebug() << "Found TEXT element in producer" << endl;
+ QDomElement kproducer = wproducer.cloneNode(true).toElement();
+ kproducer.setTagName("kdenlive_producer");
+ kdenlivedoc_new.appendChild(kproducer);
+ // todo: Perhaps needs some more changes here to "frequency", aspect ratio as a float, frame_size, channels, and later, ressource and title name
+ } else {
+ QDomElement kproducer = m_document.createElement("kdenlive_producer");
+ kproducer.setAttribute("id", wproducer.attribute("id"));
+ kproducer.setAttribute("description", wproducer.attribute("description"));
+ kproducer.setAttribute("resource", wproducer.attribute("resource"));
+ kproducer.setAttribute("type", wproducer.attribute("type"));
+ kdenlivedoc_new.appendChild(kproducer);
+ }
+ if (wproducer.attribute("id").toInt() > max_kproducer_id) {
+ max_kproducer_id = wproducer.attribute("id").toInt();
+ }
}
}
}
return m_projectFolder;
}
-QString KdenliveDoc::getDocumentStandard() {
- //WARNING: this way to tell the video standard is a bit hackish...
- if (m_profile.description.contains("pal", Qt::CaseInsensitive) || m_profile.description.contains("25", Qt::CaseInsensitive) || m_profile.description.contains("50", Qt::CaseInsensitive)) return "PAL";
- return "NTSC";
-}
-
QString KdenliveDoc::profilePath() const {
return m_profile.path;
}
QString profilePath() const;
MltVideoProfile mltProfile() const;
QString description() const;
- /** Returns the document format: PAL or NTSC */
- QString getDocumentStandard();
void setUrl(KUrl url);
QDomElement documentInfoXml();
void setProfilePath(QString path);
KdenliveSettings::setProject_fps(m_activeDocument->fps());
setCaption(m_activeDocument->description(), m_activeDocument->isModified());
m_monitorManager->resetProfiles(m_activeDocument->timecode());
- if (m_renderWidget) m_renderWidget->setDocumentStandard(m_activeDocument->getDocumentStandard());
+ if (m_renderWidget) m_renderWidget->setProfile(m_activeDocument->mltProfile());
m_timelineArea->setTabText(m_timelineArea->currentIndex(), m_activeDocument->description());
// We need to desactivate & reactivate monitors to get a refresh
m_renderWidget = new RenderWidget(this);
connect(m_renderWidget, SIGNAL(doRender(const QString&, const QString&, const QStringList &, const QStringList &, bool, bool, double, double)), this, SLOT(slotDoRender(const QString&, const QString&, const QStringList &, const QStringList &, bool, bool, double, double)));
if (m_activeDocument) {
- m_renderWidget->setDocumentStandard(m_activeDocument->getDocumentStandard());
+ m_renderWidget->setProfile(m_activeDocument->mltProfile());
m_renderWidget->setGuides(m_activeDocument->guidesXml(), m_activeDocument->projectDuration());
}
}
trackView->projectView()->setContextMenu(m_timelineContextMenu, m_timelineContextClipMenu, m_timelineContextTransitionMenu);
m_activeTimeline = trackView;
- if (m_renderWidget) m_renderWidget->setDocumentStandard(doc->getDocumentStandard());
+ if (m_renderWidget) m_renderWidget->setProfile(doc->mltProfile());
doc->setRenderer(m_projectMonitor->render);
m_commandStack->setActiveStack(doc->commandStack());
KdenliveSettings::setProject_display_ratio(doc->dar());
startPos = m_view.guide_start->itemData(m_view.guide_start->currentIndex()).toDouble();
endPos = m_view.guide_end->itemData(m_view.guide_end->currentIndex()).toDouble();
}
- emit doRender(m_view.out_file->url().path(), item->data(RenderRole).toString(), overlayargs, m_view.advanced_params->toPlainText().split(' '), m_view.render_zone->isChecked(), m_view.play_after->isChecked(), startPos, endPos);
+ QString renderArgs = m_view.advanced_params->toPlainText();
+ renderArgs.replace("%width", QString::number(m_profile.width));
+ renderArgs.replace("%height", QString::number(m_profile.height));
+ renderArgs.replace("%dar", QString::number((double) m_profile.display_aspect_num / m_profile.display_aspect_den));
+ emit doRender(m_view.out_file->url().path(), item->data(RenderRole).toString(), overlayargs, renderArgs.split(' '), m_view.render_zone->isChecked(), m_view.play_after->isChecked(), startPos, endPos);
}
-void RenderWidget::setDocumentStandard(QString std) {
- if (std == "PAL") m_view.format_selection->setCurrentIndex(0);
+void RenderWidget::setProfile(MltVideoProfile profile) {
+ m_profile = profile;
+ //WARNING: this way to tell the video standard is a bit hackish...
+ if (m_profile.description.contains("pal", Qt::CaseInsensitive) || m_profile.description.contains("25", Qt::CaseInsensitive) || m_profile.description.contains("50", Qt::CaseInsensitive)) m_view.format_selection->setCurrentIndex(0);
else m_view.format_selection->setCurrentIndex(1);
-
refreshView();
}
#include <QDialog>
#include <QPushButton>
+#include "definitions.h"
#include "ui_renderwidget_ui.h"
class RenderWidget : public QDialog {
public:
RenderWidget(QWidget * parent = 0);
- void setDocumentStandard(QString std);
void setGuides(QDomElement guidesxml, double duration);
void focusFirstVisibleItem();
+ void setProfile(MltVideoProfile profile);
private slots:
void slotUpdateButtons();
private:
Ui::RenderWidget_UI m_view;
+ MltVideoProfile m_profile;
void parseProfiles(QString group = QString(), QString profile = QString());
void parseFile(QString exportFile, bool editable);