RenderWidget::RenderWidget(const QString &projectfolder, bool enableProxy, QWidget * parent) :
QDialog(parent),
m_projectFolder(projectfolder),
- m_blockProcessing(false),
- m_isPal(true)
+ m_blockProcessing(false)
{
m_view.setupUi(this);
setWindowTitle(i18n("Rendering"));
// Add current size parameter
renderArgs.append(subsize);
}
- bool resizeProfile = (subsize != currentSize);
QStringList paramsList = renderArgs.split(" ", QString::SkipEmptyParts);
QScriptEngine sEngine;
for (int i = 0; i < paramsList.count(); ++i) {
QString paramName = paramsList.at(i).section('=', 0, 0);
QString paramValue = paramsList.at(i).section('=', 1, 1);
- // If the profiles do not match we need to use the consumer tag
- if (paramName == "mlt_profile=" && paramValue != m_profile.path) {
- resizeProfile = true;
- }
// evaluate expression
if (paramValue.startsWith('%')) {
paramValue = sEngine.evaluate(paramValue.remove(0, 1)).toString();
sEngine.globalObject().setProperty(paramName.toUtf8().constData(), paramValue);
}
- if (resizeProfile)
- render_process_args << "consumer:" + (scriptExport ? "$SOURCE" : playlistPath);
- else
- render_process_args << (scriptExport ? "$SOURCE" : playlistPath);
+ render_process_args << (scriptExport ? "$SOURCE" : playlistPath);
render_process_args << (scriptExport ? "$TARGET" : KUrl(dest).url());
render_process_args << paramsList;
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_isPal = true;
- else
- m_isPal = false;
m_view.scanning_list->setCurrentIndex(0);
m_view.rescale_width->setValue(KdenliveSettings::defaultrescalewidth());
if (!m_view.rescale_keep->isChecked()) {
if ((sizeItem->data(GroupRole).toString() == group || sizeItem->data(GroupRole).toString().isEmpty()) && sizeItem->data(MetaGroupRole).toString() == destination) {
std = sizeItem->data(StandardRole).toString();
if (!std.isEmpty()) {
- if (std.contains("PAL", Qt::CaseInsensitive) && m_isPal) dupItem = sizeItem->clone();
- else if (std.contains("NTSC", Qt::CaseInsensitive) && !m_isPal) dupItem = sizeItem->clone();
+ if ((std.contains("PAL", Qt::CaseInsensitive) && m_profile.frame_rate_num == 25 && m_profile.frame_rate_den == 1) ||
+ (std.contains("NTSC", Qt::CaseInsensitive) && m_profile.frame_rate_num == 30000 && m_profile.frame_rate_den == 1001))
+ dupItem = sizeItem->clone();
} else {
dupItem = sizeItem->clone();
}
focusFirstVisibleItem();
m_view.size_list->blockSignals(false);
m_view.format_list->blockSignals(false);
- refreshParams();
+ if (m_view.size_list->count() > 0)
+ refreshParams();
+ else
+ m_view.advanced_params->clear();
}
KUrl RenderWidget::filenameWithExtension(KUrl url, QString extension)
// setup comboBox with bitrates
m_view.comboBitrates->clear();
- if (item->data(BitratesRole).canConvert(QVariant::StringList) && item->data(BitratesRole).toStringList().count()) {
+ if (params.contains("bitrate")) {
m_view.comboBitrates->setEnabled(true);
- QStringList bitrates = item->data(BitratesRole).toStringList();
- foreach (QString bitrate, bitrates)
- m_view.comboBitrates->addItem(bitrate);
- if (item->data(DefaultBitrateRole).canConvert(QVariant::String))
- m_view.comboBitrates->setCurrentIndex(bitrates.indexOf(item->data(DefaultBitrateRole).toString()));
+ if ( item->data(BitratesRole).canConvert(QVariant::StringList) && item->data(BitratesRole).toStringList().count()) {
+ QStringList bitrates = item->data(BitratesRole).toStringList();
+ foreach (QString bitrate, bitrates)
+ m_view.comboBitrates->addItem(bitrate);
+ if (item->data(DefaultBitrateRole).canConvert(QVariant::String))
+ m_view.comboBitrates->setCurrentIndex(bitrates.indexOf(item->data(DefaultBitrateRole).toString()));
+ }
} else {
m_view.comboBitrates->setEnabled(false);
}