connect(m_view.format_list, SIGNAL(currentRowChanged(int)), this, SLOT(refreshView()));
connect(m_view.size_list, SIGNAL(currentRowChanged(int)), this, SLOT(refreshParams()));
+ connect(m_view.render_guide, SIGNAL(clicked(bool)), this, SLOT(slotUpdateGuideBox()));
+ connect(m_view.render_zone, SIGNAL(clicked(bool)), this, SLOT(slotUpdateGuideBox()));
+ connect(m_view.render_full, SIGNAL(clicked(bool)), this, SLOT(slotUpdateGuideBox()));
+
+ connect(m_view.guide_end, SIGNAL(activated(int)), this, SLOT(slotCheckStartGuidePosition()));
+ connect(m_view.guide_start, SIGNAL(activated(int)), this, SLOT(slotCheckEndGuidePosition()));
+
+
m_view.buttonStart->setEnabled(false);
+ m_view.guides_box->setVisible(false);
parseProfiles();
}
+void RenderWidget::slotUpdateGuideBox() {
+ m_view.guides_box->setVisible(m_view.render_guide->isChecked());
+}
+
+void RenderWidget::slotCheckStartGuidePosition() {
+ if (m_view.guide_start->currentIndex() > m_view.guide_end->currentIndex())
+ m_view.guide_start->setCurrentIndex(m_view.guide_end->currentIndex());
+}
+
+void RenderWidget::slotCheckEndGuidePosition() {
+ if (m_view.guide_end->currentIndex() < m_view.guide_start->currentIndex())
+ m_view.guide_end->setCurrentIndex(m_view.guide_start->currentIndex());
+}
+
+void RenderWidget::setGuides(QDomElement guidesxml, double duration) {
+ m_view.guide_start->clear();
+ m_view.guide_end->clear();
+ QDomNodeList nodes = guidesxml.elementsByTagName("guide");
+ if (nodes.count() > 0) {
+ m_view.guide_start->addItem(i18n("Render"), "0");
+ m_view.render_guide->setEnabled(true);
+ } else m_view.render_guide->setEnabled(false);
+ for (int i = 0; i < nodes.count(); i++) {
+ QDomElement e = nodes.item(i).toElement();
+ if (!e.isNull()) {
+ m_view.guide_start->addItem(e.attribute("comment"), e.attribute("time").toDouble());
+ m_view.guide_end->addItem(e.attribute("comment"), e.attribute("time").toDouble());
+ }
+ }
+ if (nodes.count() > 0)
+ m_view.guide_end->addItem(i18n("End"), QString::number(duration));
+}
+
void RenderWidget::slotUpdateButtons() {
if (m_view.out_file->url().isEmpty()) m_view.buttonStart->setEnabled(false);
else m_view.buttonStart->setEnabled(true);
ui.extension->setText(m_view.size_list->currentItem()->data(ExtensionRole).toString());
ui.profile_name->setFocus();
if (d->exec() == QDialog::Accepted) {
- QString exportFile = KStandardDirs::locateLocal("data", "kdenlive/export/customprofiles.xml");
+ QString exportFile = KStandardDirs::locateLocal("appdata", "export/customprofiles.xml");
QDomDocument doc;
QFile file(exportFile);
doc.setContent(&file, false);
ui.profile_name->setFocus();
if (d->exec() == QDialog::Accepted) {
- slotDeleteProfile();
- QString exportFile = KStandardDirs::locateLocal("data", "kdenlive/export/customprofiles.xml");
+ slotDeleteProfile();
+ QString exportFile = KStandardDirs::locateLocal("appdata", "export/customprofiles.xml");
QDomDocument doc;
QFile file(exportFile);
doc.setContent(&file, false);
QString currentGroup = m_view.format_list->currentItem()->text();
QString currentProfile = m_view.size_list->currentItem()->text();
- QString exportFile = KStandardDirs::locateLocal("data", "kdenlive/export/customprofiles.xml");
+ QString exportFile = KStandardDirs::locateLocal("appdata", "export/customprofiles.xml");
QDomDocument doc;
QFile file(exportFile);
doc.setContent(&file, false);
if (!item) return;
QFile f(m_view.out_file->url().path());
if (f.exists()) {
- if (KMessageBox::warningYesNo(this, i18n("File already exists. Doy you want to overwrite it ?")) != KMessageBox::Yes)
+ if (KMessageBox::warningYesNo(this, i18n("File already exists. Do you want to overwrite it ?")) != KMessageBox::Yes)
return;
}
- emit doRender(m_view.out_file->url().path(), item->data(RenderRole).toString(), m_view.advanced_params->text().split(' '), m_view.zone_only->isChecked(), m_view.play_after->isChecked());
+ QStringList overlayargs;
+ if (m_view.tc_overlay->isChecked()) {
+ QString filterFile = KStandardDirs::locate("appdata", "metadata.properties");
+ overlayargs << "meta.attr.timecode=1" << "meta.attr.timecode.markup=#timecode";
+ overlayargs << "-attach" << "data_feed:attr_check" << "-attach";
+ overlayargs << "data_show:" + filterFile << "_fezzik=1" << "dynamic=1";
+ }
+ double startPos = -1;
+ double endPos = -1;
+ if (m_view.render_guide->isChecked()) {
+ 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->text().split(' '), m_view.render_zone->isChecked(), m_view.play_after->isChecked(), startPos, endPos);
}
void RenderWidget::setDocumentStandard(QString std) {
}
if (item->data(EditableRole).toString().isEmpty()) {
- m_view.buttonDelete->setEnabled(false);
- m_view.buttonEdit->setEnabled(false);
- }
- else {
- m_view.buttonDelete->setEnabled(true);
- m_view.buttonEdit->setEnabled(true);
+ m_view.buttonDelete->setEnabled(false);
+ m_view.buttonEdit->setEnabled(false);
+ } else {
+ m_view.buttonDelete->setEnabled(true);
+ m_view.buttonEdit->setEnabled(true);
}
}
void RenderWidget::parseProfiles(QString group, QString profile) {
m_view.size_list->clear();
m_view.format_list->clear();
- QString exportFile = KStandardDirs::locate("data", "kdenlive/export/profiles.xml");
+ QString exportFile = KStandardDirs::locate("appdata", "export/profiles.xml");
parseFile(exportFile, false);
- exportFile = KStandardDirs::locateLocal("data", "kdenlive/export/customprofiles.xml");
- parseFile(exportFile, true);
+ exportFile = KStandardDirs::locateLocal("appdata", "export/customprofiles.xml");
+ if (QFile::exists(exportFile)) parseFile(exportFile, true);
refreshView();
QList<QListWidgetItem *> child;
child = m_view.format_list->findItems(group, Qt::MatchExactly);