int display_aspect_num;
int display_aspect_den;
int colorspace;
+ bool operator==(const MltVideoProfile& point) const
+ {
+ if (!description.isEmpty() && point.description == description) return true;
+ return point.frame_rate_num == frame_rate_num &&
+ point.frame_rate_den == frame_rate_den &&
+ point.width == width &&
+ point.height == height &&
+ point.progressive == progressive &&
+ point.sample_aspect_num == sample_aspect_num &&
+ point.sample_aspect_den == sample_aspect_den &&
+ point.display_aspect_den == display_aspect_den &&
+ point.colorspace == colorspace;
+ }
+ bool operator!=(const MltVideoProfile &other) const {
+ return !(*this == other);
+ }
};
{
if (!m_renderWidget) {
QString projectfolder = m_activeDocument ? m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash) : KdenliveSettings::defaultprojectfolder();
- m_renderWidget = new RenderWidget(projectfolder, m_projectList->useProxy(), this);
+ MltVideoProfile profile;
+ if (m_activeDocument) profile = m_activeDocument->mltProfile();
+ m_renderWidget = new RenderWidget(projectfolder, m_projectList->useProxy(), profile, this);
connect(m_renderWidget, SIGNAL(shutdown()), this, SLOT(slotShutdown()));
connect(m_renderWidget, SIGNAL(selectedRenderProfile(QMap <QString, QString>)), this, SLOT(slotSetDocumentRenderProfile(QMap <QString, QString>)));
connect(m_renderWidget, SIGNAL(prepareRenderingData(bool, bool, const QString&)), this, SLOT(slotPrepareRendering(bool, bool, const QString&)));
const int FINISHEDJOB = 2;
-RenderWidget::RenderWidget(const QString &projectfolder, bool enableProxy, QWidget * parent) :
+RenderWidget::RenderWidget(const QString &projectfolder, bool enableProxy, MltVideoProfile profile, QWidget * parent) :
QDialog(parent),
m_projectFolder(projectfolder),
+ m_profile(profile),
m_blockProcessing(false)
{
m_view.setupUi(this);
void RenderWidget::setProfile(MltVideoProfile profile)
{
- m_profile = profile;
m_view.scanning_list->setCurrentIndex(0);
m_view.rescale_width->setValue(KdenliveSettings::defaultrescalewidth());
if (!m_view.rescale_keep->isChecked()) {
m_view.rescale_height->setValue(KdenliveSettings::defaultrescaleheight());
m_view.rescale_height->blockSignals(false);
}
- refreshView();
+ if (m_profile != profile) {
+ m_profile = profile;
+ refreshView();
+ }
}
void RenderWidget::refreshCategory()
m_view.size_list->setVisible(m_view.size_list->count() > 1 || m_view.format_list->count() <= 1);
m_view.size_list->blockSignals(false);
m_view.format_list->blockSignals(false);
- if (m_view.size_list->count() > 0)
+ if (m_view.size_list->count() > 0) {
refreshParams();
- else
+ }
+ else {
+ // No matching profile
+ errorMessage(i18n("No matching profile"));
m_view.advanced_params->clear();
+ }
}
KUrl RenderWidget::filenameWithExtension(KUrl url, QString extension)
// Format not available (e.g. codec not installed); Disable start button
QListWidgetItem *item = m_view.size_list->currentItem();
if (!item || item->isHidden()) {
+ if (!item) errorMessage(i18n("No matching profile"));
m_view.advanced_params->clear();
m_view.buttonRender->setEnabled(false);
m_view.buttonGenerateScript->setEnabled(false);
Q_OBJECT
public:
- explicit RenderWidget(const QString &projectfolder, bool enableProxy, QWidget * parent = 0);
+ explicit RenderWidget(const QString &projectfolder, bool enableProxy, MltVideoProfile profile, QWidget * parent = 0);
virtual ~RenderWidget();
void setGuides(QDomElement guidesxml, double duration);
void focusFirstVisibleItem();