From: Till Theato Date: Thu, 19 May 2011 20:20:56 +0000 (+0000) Subject: render dialog: select and edit bitrates using a combo box (WIP). X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=96b6bac33fc676599014cf64747318a2833dd499;p=kdenlive render dialog: select and edit bitrates using a combo box (WIP). svn path=/trunk/kdenlive/; revision=5601 --- diff --git a/export/profiles.xml b/export/profiles.xml index 9e347c48..7a129d66 100644 --- a/export/profiles.xml +++ b/export/profiles.xml @@ -50,111 +50,42 @@ - - - - - - - - - - - - - + - - - - - - - - - - - - - + - - - - - - - - - - - + - - - - - - - - - - - - - + - - - - - - - - - - - + - - - - - - - - - - - + - - - - - - - - - - - + @@ -175,12 +106,10 @@ Media players - - - - - - + + diff --git a/src/renderwidget.cpp b/src/renderwidget.cpp index ec84a1de..e5e2f561 100644 --- a/src/renderwidget.cpp +++ b/src/renderwidget.cpp @@ -54,6 +54,8 @@ const int EditableRole = GroupRole + 5; const int MetaGroupRole = GroupRole + 6; const int ExtraRole = GroupRole + 7; const int TwoPassRole = GroupRole + 8; +const int BitratesRole = GroupRole + 9; +const int DefaultBitrateRole = GroupRole + 10; // Running job status const int WAITINGJOB = 0; @@ -776,6 +778,10 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut, const if (m_view.checkTwoPass->isEnabled() && m_view.checkTwoPass->isChecked()) renderArgs.append(" pass=2"); + // bitrate + if (m_view.comboBitrates->isEnabled()) + renderArgs.replace("%bitrate", m_view.comboBitrates->currentText()); + // Check if the rendering profile is different from project profile, // in which case we need to use the producer_comsumer from MLT QString std = renderArgs; @@ -1212,6 +1218,19 @@ void RenderWidget::refreshParams() m_view.buttonEdit->setEnabled(true); } + // setup comboBox with bitrates + if (item->data(BitratesRole).canConvert(QVariant::StringList)) { + m_view.comboBitrates->setEnabled(true); + m_view.comboBitrates->clear(); + 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); + } + m_view.buttonRender->setEnabled(m_view.size_list->currentItem()->toolTip().isEmpty()); m_view.buttonGenerateScript->setEnabled(m_view.size_list->currentItem()->toolTip().isEmpty()); } @@ -1416,6 +1435,7 @@ void RenderWidget::parseFile(QString exportFile, bool editable) QString params; QString standard; QString twoPass; + QString bitrates, defaultBitrate; KIcon icon; while (!groups.item(i).isNull()) { @@ -1464,6 +1484,8 @@ void RenderWidget::parseFile(QString exportFile, bool editable) profileElement = n.toElement(); profileName = profileElement.attribute("name"); standard = profileElement.attribute("standard"); + bitrates = profileElement.attribute("bitrates"); + defaultBitrate = profileElement.attribute("defaultbitrate"); params = profileElement.attribute("args"); if (replaceVorbisCodec && params.contains("acodec=vorbis")) { @@ -1484,6 +1506,8 @@ void RenderWidget::parseFile(QString exportFile, bool editable) item->setData(RenderRole, renderer); item->setData(StandardRole, standard); item->setData(ParamsRole, params); + item->setData(BitratesRole, bitrates.split(',')); + item->setData(DefaultBitrateRole, defaultBitrate); if (profileElement.hasAttribute("url")) item->setData(ExtraRole, profileElement.attribute("url")); if (editable) item->setData(EditableRole, exportFile); m_renderItems.append(item); diff --git a/src/widgets/renderwidget_ui.ui b/src/widgets/renderwidget_ui.ui index 39f766ec..5f21dbd4 100644 --- a/src/widgets/renderwidget_ui.ui +++ b/src/widgets/renderwidget_ui.ui @@ -6,8 +6,8 @@ 0 0 - 391 - 652 + 461 + 686 @@ -159,14 +159,14 @@ - + Scanning - + @@ -185,7 +185,7 @@ - + Export audio @@ -483,7 +483,7 @@ - + @@ -497,7 +497,24 @@ - + + + + true + + + true + + + + + + + Bitrate + + + + 2 pass