Commit a51b140a authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Render preset edit: allow specifying a file extension (for example mkv for matroska format)

parent 364d2f2f
Pipeline #210474 passed with stage
in 8 minutes and 33 seconds
......@@ -199,6 +199,7 @@ RenderPresetDialog::RenderPresetDialog(QWidget *parent, RenderPresetModel *prese
}
preset_name->setFocus();
formatCombo->setCurrentText(preset->getParam(QStringLiteral("f")));
extension->setText(preset->extension());
QString width = preset->getParam(QStringLiteral("width"));
QString height = preset->getParam(QStringLiteral("height"));
QString size = preset->getParam(QStringLiteral("s"));
......@@ -418,7 +419,7 @@ RenderPresetDialog::RenderPresetDialog(QWidget *parent, RenderPresetModel *prese
QString speeds_list_str = speeds_list->toPlainText().replace('\n', ';').simplified();
std::unique_ptr<RenderPresetModel> newPreset(new RenderPresetModel(
newPresetName, newGroupName, parameters->toPlainText().simplified(), QString::number(default_vbitrate->value()),
newPresetName, newGroupName, parameters->toPlainText().simplified(), extension->text().simplified(), QString::number(default_vbitrate->value()),
QString::number(default_vquality->value()), QString::number(aBitrate->value()), QString::number(aQuality->value()), speeds_list_str));
m_saveName = RenderPresetRepository::get()->savePreset(newPreset.get(), mode == Mode::Edit);
......@@ -428,7 +429,14 @@ RenderPresetDialog::RenderPresetDialog(QWidget *parent, RenderPresetModel *prese
accept();
});
connect(formatCombo, &QComboBox::currentTextChanged, this, &RenderPresetDialog::slotUpdateParams);
connect(formatCombo, &QComboBox::currentTextChanged, [this](const QString &format) {
if (format == QLatin1String("matroska")) {
extension->setText(QStringLiteral("mkv"));
} else {
extension->setText(format);
}
slotUpdateParams();
});
connect(vCodecCombo, &QComboBox::currentTextChanged, this, &RenderPresetDialog::slotUpdateParams);
connect(fieldOrderCombo, &QComboBox::currentTextChanged, this, &RenderPresetDialog::slotUpdateParams);
......@@ -510,13 +518,13 @@ RenderPresetDialog::RenderPresetDialog(QWidget *parent, RenderPresetModel *prese
// TODO
if (false && m_monitor == nullptr) {
// QString profile = DvdWizardVob::getDvdProfile(format);
m_monitor = new Monitor(Kdenlive::RenderMonitor, pCore->monitorManager(), this);
/*m_monitor = new Monitor(Kdenlive::RenderMonitor, pCore->monitorManager(), this);
m_monitor->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
mainBox->addWidget(m_monitor);
pCore->monitorManager()->appendMonitor(m_monitor);
// m_monitor->setCustomProfile(profile, m_tc);
pCore->monitorManager()->activateMonitor(Kdenlive::RenderMonitor);
m_monitor->start();
m_monitor->start();*/
}
}
......
......@@ -1189,7 +1189,7 @@ void RenderWidget::slotChangeSelection(const QModelIndex &current, const QModelI
if (m_treeModel->parent(current) == QModelIndex()) {
// in that case, we have selected a category, which we don't want
QItemSelectionModel *selection = m_view.profileTree->selectionModel();
selection->select(previous, QItemSelectionModel::Select);
selection->select(previous, QItemSelectionModel::ClearAndSelect);
// expand corresponding category
auto parent = m_treeModel->parent(previous);
m_view.profileTree->expand(parent);
......
......@@ -98,16 +98,16 @@ RenderPresetModel::RenderPresetModel(const QString &groupName, const QString &pa
checkPreset();
}
RenderPresetModel::RenderPresetModel(const QString &name, const QString &groupName, const QString &params, const QString &defaultVBitrate,
const QString &defaultVQuality, const QString &defaultABitrate, const QString &defaultAQuality,
const QString &speedsString)
RenderPresetModel::RenderPresetModel(const QString &name, const QString &groupName, const QString &params, const QString &extension,
const QString &defaultVBitrate, const QString &defaultVQuality, const QString &defaultABitrate,
const QString &defaultAQuality, const QString &speedsString)
: m_presetFile()
, m_editable()
, m_name(name)
, m_note()
, m_standard()
, m_params(params)
, m_extension()
, m_extension(extension)
, m_groupName(groupName)
, m_renderer(QStringLiteral("avformat"))
, m_url()
......
......@@ -24,8 +24,8 @@ public:
RenderPresetModel(QDomElement preset, const QString &presetFile, bool editable, const QString &groupName = QString(),
const QString &renderer = QStringLiteral("avformat"));
RenderPresetModel(const QString &groupName, const QString &path, QString presetName, const QString &params, bool codecInName);
RenderPresetModel(const QString &name, const QString &groupName, const QString &params, const QString &defaultVBitrate, const QString &defaultVQuality,
const QString &defaultABitrate, const QString &defaultAQuality, const QString &speedsString);
RenderPresetModel(const QString &name, const QString &groupName, const QString &params, const QString &extension, const QString &defaultVBitrate,
const QString &defaultVQuality, const QString &defaultABitrate, const QString &defaultAQuality, const QString &speedsString);
enum InstallType { BuildIn, Custom, Download };
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment