Hide export profiles that resize video ( size is different than project...

Hide export profiles that resize video ( size is different than project profile). They can be re-enabled by clicking on the "experimental render formats" checkbox.
In response of following issue:
http://www.kdenlive.org/mantis/view.php?id=323

svn path=/branches/KDE4/; revision=2677
parent 8fab555a
......@@ -344,5 +344,9 @@
<default>false</default>
</entry>
<entry name="experimentalrender" type="Bool">
<label>Show buggy rendering formats.</label>
<default>false</default>
</entry>
</group>
</kcfg>
\ No newline at end of file
......@@ -236,7 +236,7 @@ void Monitor::mouseReleaseEvent(QMouseEvent * event) {
// virtual
void Monitor::mouseMoveEvent(QMouseEvent *event) {
kDebug() << "// DRAG STARTED, MOUSE MOVED: ";
// kDebug() << "// DRAG STARTED, MOUSE MOVED: ";
if (!m_dragStarted || m_currentClip == NULL) return;
if ((event->pos() - m_DragStartPosition).manhattanLength()
......
......@@ -55,6 +55,8 @@ RenderWidget::RenderWidget(QWidget * parent): QDialog(parent) {
m_view.buttonInfo->setDown(true);
} else m_view.advanced_params->hide();
m_view.experimentalrender->setChecked(KdenliveSettings::experimentalrender());
connect(m_view.buttonInfo, SIGNAL(clicked()), this, SLOT(showInfoPanel()));
connect(m_view.buttonSave, SIGNAL(clicked()), this, SLOT(slotSaveProfile()));
......@@ -73,6 +75,7 @@ RenderWidget::RenderWidget(QWidget * parent): QDialog(parent) {
connect(m_view.guide_start, SIGNAL(activated(int)), this, SLOT(slotCheckEndGuidePosition()));
connect(m_view.format_selection, SIGNAL(activated(int)), this, SLOT(refreshView()));
connect(m_view.experimentalrender, SIGNAL(stateChanged(int)), this, SLOT(slotUpdateExperimentalRendering()));
m_view.buttonStart->setEnabled(false);
m_view.guides_box->setVisible(false);
......@@ -83,6 +86,12 @@ RenderWidget::RenderWidget(QWidget * parent): QDialog(parent) {
focusFirstVisibleItem();
}
void RenderWidget::slotUpdateExperimentalRendering() {
KdenliveSettings::setExperimentalrender(m_view.experimentalrender->isChecked());
refreshView();
}
void RenderWidget::showInfoPanel() {
if (m_view.advanced_params->isVisible()) {
m_view.advanced_params->setVisible(false);
......@@ -328,8 +337,29 @@ void RenderWidget::slotDeleteProfile() {
focusFirstVisibleItem();
}
void RenderWidget::updateButtons() {
if (!m_view.size_list->currentItem() || m_view.size_list->currentItem()->isHidden()) {
m_view.buttonSave->setEnabled(false);
m_view.buttonDelete->setEnabled(false);
m_view.buttonEdit->setEnabled(false);
} else {
m_view.buttonSave->setEnabled(true);
if (m_view.size_list->currentItem()->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);
}
}
}
void RenderWidget::focusFirstVisibleItem() {
if (m_view.size_list->currentItem() && !m_view.size_list->currentItem()->isHidden()) return;
if (m_view.size_list->currentItem() && !m_view.size_list->currentItem()->isHidden()) {
updateButtons();
return;
}
for (uint ix = 0; ix < m_view.size_list->count(); ix++) {
QListWidgetItem *item = m_view.size_list->item(ix);
if (item && !item->isHidden()) {
......@@ -338,6 +368,7 @@ void RenderWidget::focusFirstVisibleItem() {
}
}
if (!m_view.size_list->currentItem()) m_view.size_list->setCurrentRow(0);
updateButtons();
}
void RenderWidget::slotExport() {
......@@ -380,6 +411,7 @@ void RenderWidget::setProfile(MltVideoProfile profile) {
}
void RenderWidget::refreshView() {
m_view.size_list->blockSignals(true);
QListWidgetItem *item = m_view.format_list->currentItem();
if (!item) {
m_view.format_list->setCurrentRow(0);
......@@ -392,8 +424,8 @@ void RenderWidget::refreshView() {
bool firstSelected = false;
for (int i = 0; i < m_view.size_list->count(); i++) {
sizeItem = m_view.size_list->item(i);
std = sizeItem->data(StandardRole).toString();
if (sizeItem->data(GroupRole) == group) {
std = sizeItem->data(StandardRole).toString();
if (!std.isEmpty()) {
if (std.contains("PAL", Qt::CaseInsensitive)) sizeItem->setHidden(m_view.format_selection->currentIndex() != 0);
else if (std.contains("NTSC", Qt::CaseInsensitive)) sizeItem->setHidden(m_view.format_selection->currentIndex() != 1);
......@@ -402,15 +434,32 @@ void RenderWidget::refreshView() {
if (!firstSelected) m_view.size_list->setCurrentItem(sizeItem);
firstSelected = true;
}
if (!KdenliveSettings::experimentalrender() && !sizeItem->isHidden()) {
// hide experimental codecs (which do resize the video)
std = sizeItem->data(ParamsRole).toString();
if (std.contains(" s=")) {
QString subsize = std.section(" s=", 1, 1);
subsize = subsize.section(' ', 0, 0).toLower();
if (subsize != "%widthx%height") {
const QString currentSize = QString::number(m_profile.width) + 'x' + QString::number(m_profile.height);
if (subsize != currentSize) sizeItem->setHidden(true);
}
}
}
} else sizeItem->setHidden(true);
}
focusFirstVisibleItem();
m_view.size_list->blockSignals(false);
refreshParams();
}
void RenderWidget::refreshParams() {
QListWidgetItem *item = m_view.size_list->currentItem();
if (!item) return;
if (!item || item->isHidden()) {
m_view.advanced_params->clear();
m_view.buttonStart->setEnabled(false);
return;
}
QString params = item->data(ParamsRole).toString();
QString extension = item->data(ExtensionRole).toString();
m_view.advanced_params->setPlainText(params);
......@@ -433,6 +482,7 @@ void RenderWidget::refreshParams() {
m_view.buttonDelete->setEnabled(true);
m_view.buttonEdit->setEnabled(true);
}
m_view.buttonStart->setEnabled(true);
}
void RenderWidget::parseProfiles(QString group, QString profile) {
......
......@@ -48,13 +48,14 @@ private slots:
void slotCheckStartGuidePosition();
void slotCheckEndGuidePosition();
void showInfoPanel();
void slotUpdateExperimentalRendering();
private:
Ui::RenderWidget_UI m_view;
MltVideoProfile m_profile;
void parseProfiles(QString group = QString(), QString profile = QString());
void parseFile(QString exportFile, bool editable);
void updateButtons();
signals:
void doRender(const QString&, const QString&, const QStringList &, const QStringList &, bool, bool, double, double);
};
......
......@@ -5,17 +5,14 @@
<rect>
<x>0</x>
<y>0</y>
<width>362</width>
<height>457</height>
<width>374</width>
<height>379</height>
</rect>
</property>
<property name="windowTitle" >
<string>Rendering</string>
</property>
<layout class="QGridLayout" name="gridLayout_3" >
<item row="0" column="1" colspan="2" >
<widget class="KUrlRequester" name="out_file" />
</item>
<item row="0" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
......@@ -23,126 +20,138 @@
</property>
</widget>
</item>
<item row="0" column="1" colspan="2" >
<widget class="KUrlRequester" name="out_file" />
</item>
<item row="1" column="0" colspan="3" >
<widget class="KTabWidget" name="ktabwidget" >
<property name="currentIndex" >
<number>0</number>
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<string/>
</property>
<widget class="QWidget" name="tab_2" >
<attribute name="title" >
<string>Templates</string>
</attribute>
<layout class="QGridLayout" name="gridLayout" >
<item row="0" column="0" >
<widget class="QLabel" name="label_3" >
<property name="text" >
<string>Format</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<spacer name="horizontalSpacer_2" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>165</width>
<height>24</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2" >
<widget class="KComboBox" name="format_selection" >
<item>
<property name="text" >
<string>PAL</string>
</property>
</item>
<item>
<property name="text" >
<string>NTSC</string>
</property>
</item>
</widget>
</item>
<item row="0" column="3" >
<widget class="QToolButton" name="buttonEdit" >
<property name="text" >
<string>E</string>
</property>
</widget>
</item>
<item row="0" column="4" >
<widget class="QToolButton" name="buttonInfo" >
<property name="text" >
<string>I</string>
</property>
</widget>
</item>
<item row="0" column="5" >
<widget class="QToolButton" name="buttonSave" >
<layout class="QGridLayout" name="gridLayout" >
<item row="0" column="0" >
<widget class="QLabel" name="label_3" >
<property name="text" >
<string>Format</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<spacer name="horizontalSpacer_2" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>165</width>
<height>24</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2" colspan="2" >
<widget class="KComboBox" name="format_selection" >
<item>
<property name="text" >
<string>S</string>
<string>PAL</string>
</property>
</widget>
</item>
<item row="0" column="6" >
<widget class="QToolButton" name="buttonDelete" >
</item>
<item>
<property name="text" >
<string>D</string>
<string>NTSC</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="7" >
<widget class="QSplitter" name="splitter_3" >
</item>
</widget>
</item>
<item row="0" column="4" >
<widget class="QToolButton" name="buttonEdit" >
<property name="text" >
<string>E</string>
</property>
</widget>
</item>
<item row="0" column="5" >
<widget class="QToolButton" name="buttonInfo" >
<property name="text" >
<string>I</string>
</property>
</widget>
</item>
<item row="0" column="6" >
<widget class="QToolButton" name="buttonSave" >
<property name="text" >
<string>S</string>
</property>
</widget>
</item>
<item row="0" column="7" >
<widget class="QToolButton" name="buttonDelete" >
<property name="text" >
<string>D</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="8" >
<widget class="QSplitter" name="splitter_3" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<widget class="QSplitter" name="splitter" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
<enum>Qt::Horizontal</enum>
</property>
<widget class="QSplitter" name="splitter" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
<widget class="KListWidget" name="format_list" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<widget class="KListWidget" name="format_list" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
<widget class="KListWidget" name="size_list" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</widget>
<widget class="KTextEdit" name="advanced_params" >
<property name="readOnly" >
<bool>true</bool>
</property>
<property name="acceptRichText" >
<bool>false</bool>
<widget class="KListWidget" name="size_list" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</widget>
</item>
<item row="2" column="0" colspan="7" >
<widget class="QCheckBox" name="force_progressive" >
<property name="text" >
<string>Progressive</string>
</property>
<property name="tristate" >
<widget class="KTextEdit" name="advanced_params" >
<property name="readOnly" >
<bool>true</bool>
</property>
<property name="acceptRichText" >
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item row="2" column="0" colspan="3" >
<widget class="QCheckBox" name="experimentalrender" >
<property name="toolTip" >
<string>Changing the size of video when rendering
is not fully supported, you may have problems
with some effects or title clips, so the export
profiles that resize your video are marked as
experimental</string>
</property>
<property name="text" >
<string>Show experimental formats</string>
</property>
</widget>
</item>
<item row="2" column="3" colspan="5" >
<widget class="QCheckBox" name="force_progressive" >
<property name="text" >
<string>Progressive</string>
</property>
<property name="tristate" >
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="0" colspan="2" >
......@@ -295,12 +304,6 @@
<extends>QPushButton</extends>
<header>kpushbutton.h</header>
</customwidget>
<customwidget>
<class>KTabWidget</class>
<extends>QTabWidget</extends>
<header>ktabwidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>KTextEdit</class>
<extends>QTextEdit</extends>
......
Markdown is supported
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