From: Jean-Baptiste M. <jb...@kd...> - 2011-12-23 13:28:41
|
Git commit f66ba6de519084c8ca598ea16c6e98b5619bae38 by Jean-Baptiste Mardelle. Committed on 23/12/2011 at 14:28. Pushed by mardelle into branch 'master'. Audio transcoding actions are now in "Extract audio" menu M +3 -1 src/cliptranscode.cpp M +3 -1 src/kdenliveui.rc M +14 -4 src/mainwindow.cpp M +23 -10 src/projectlist.cpp M +1 -0 src/projectlist.h http://commits.kde.org/kdenlive/f66ba6de519084c8ca598ea16c6e98b5619bae38 diff --git a/src/cliptranscode.cpp b/src/cliptranscode.cpp index 863db13..fac4a04 100644 --- a/src/cliptranscode.cpp +++ b/src/cliptranscode.cpp @@ -79,7 +79,7 @@ ClipTranscode::ClipTranscode(KUrl::List urls, const QString ¶ms, const QStri QMapIterator<QString, QString> i(profiles); while (i.hasNext()) { i.next(); - QStringList data = i.value().split(";", QString::SkipEmptyParts); + QStringList data = i.value().split(";"); profile_list->addItem(i.key(), data.at(0)); if (data.count() > 1) profile_list->setItemData(profile_list->count() - 1, data.at(1), Qt::UserRole + 1); } @@ -92,6 +92,8 @@ ClipTranscode::ClipTranscode(KUrl::List urls, const QString ¶ms, const QStri m_transcodeProcess.setProcessChannelMode(QProcess::MergedChannels); connect(&m_transcodeProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(slotShowTranscodeInfo())); connect(&m_transcodeProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(slotTranscodeFinished(int, QProcess::ExitStatus))); + + ffmpeg_params->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 5); adjustSize(); } diff --git a/src/kdenliveui.rc b/src/kdenliveui.rc index 0a350be..b48fb4e 100644 --- a/src/kdenliveui.rc +++ b/src/kdenliveui.rc @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE kpartgui SYSTEM "kpartgui.dtd"> -<gui name="kdenlive" version="65"> +<gui name="kdenlive" version="66"> <ToolBar name="extraToolBar" > <text>Extra Toolbar</text> <Action name="project_render" /> @@ -25,6 +25,8 @@ <Action name="add_text_clip" /> <Action name="add_text_template_clip" /> <Action name="add_folder" /> + <Menu name="extract_audio" ><text>Extract Audio</text> + </Menu> <Menu name="stabilize" ><text>Stabilize</text> </Menu> <Menu name="transcoders" ><text>Transcode</text> diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 498f4a6..a88ac9e 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -497,6 +497,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString & clipInTimeline->setIcon(KIcon("go-jump")); QHash<QString,QMenu*> menus; menus.insert("addMenu",static_cast<QMenu*>(factory()->container("generators", this))); + menus.insert("extractAudioMenu",static_cast<QMenu*>(factory()->container("extract_audio", this))); menus.insert("transcodeMenu",static_cast<QMenu*>(factory()->container("transcoders", this))); menus.insert("stabilizeMenu",static_cast<QMenu*>(factory()->container("stabilize", this))); menus.insert("inTimelineMenu",clipInTimeline); @@ -3818,6 +3819,9 @@ void MainWindow::loadTranscoders() { QMenu *transMenu = static_cast<QMenu*>(factory()->container("transcoders", this)); transMenu->clear(); + + QMenu *extractAudioMenu = static_cast<QMenu*>(factory()->container("extract_audio", this)); + extractAudioMenu->clear(); KSharedConfigPtr config = KSharedConfig::openConfig("kdenlivetranscodingrc"); KConfigGroup transConfig(config, "Transcoding"); @@ -3826,11 +3830,17 @@ void MainWindow::loadTranscoders() QMapIterator<QString, QString> i(profiles); while (i.hasNext()) { i.next(); - QStringList data = i.value().split(";", QString::SkipEmptyParts); - QAction *a = transMenu->addAction(i.key()); + QStringList data = i.value().split(";"); + QAction *a; + // separate audio transcoding in a separate menu + if (data.count() > 2 && data.at(2) == "audio") { + a = extractAudioMenu->addAction(i.key()); + } + else { + a = transMenu->addAction(i.key()); + } a->setData(data); - if (data.count() > 1) - a->setToolTip(data.at(1)); + a->setToolTip(data.at(1)); connect(a, SIGNAL(triggered()), this, SLOT(slotTranscode())); } } diff --git a/src/projectlist.cpp b/src/projectlist.cpp index 516e60a..d3584e8 100644 --- a/src/projectlist.cpp +++ b/src/projectlist.cpp @@ -203,8 +203,9 @@ ProjectList::ProjectList(QWidget *parent) : m_commandStack(NULL), m_openAction(NULL), m_reloadAction(NULL), - m_stabilizeAction(NULL), + m_extractAudioAction(NULL), m_transcodeAction(NULL), + m_stabilizeAction(NULL), m_doc(NULL), m_refreshed(false), m_allClipsProcessed(false), @@ -377,18 +378,21 @@ void ProjectList::setupGeneratorMenu(const QHash<QString,QMenu*>& menus) QMenu* addMenu=menus.value("addMenu"); menu->addMenu(addMenu); m_addButton->setMenu(menu); - - m_menu->addMenu(addMenu); if (addMenu->isEmpty()) addMenu->setEnabled(false); } - if (menus.contains("transcodeMenu") && menus.value("transcodeMenu") ){ - QMenu* transcodeMenu=menus.value("transcodeMenu"); - m_menu->addMenu(transcodeMenu); - if (transcodeMenu->isEmpty()) - transcodeMenu->setEnabled(false); - m_transcodeAction = transcodeMenu; + if (menus.contains("extractAudioMenu") && menus.value("extractAudioMenu") ){ + QMenu* extractAudioMenu = menus.value("extractAudioMenu"); + m_menu->addMenu(extractAudioMenu); + m_extractAudioAction = extractAudioMenu; } + if (menus.contains("transcodeMenu") && menus.value("transcodeMenu") ){ + QMenu* transcodeMenu = menus.value("transcodeMenu"); + m_menu->addMenu(transcodeMenu); + if (transcodeMenu->isEmpty()) + transcodeMenu->setEnabled(false); + m_transcodeAction = transcodeMenu; + } if (menus.contains("stabilizeMenu") && menus.value("stabilizeMenu") ){ QMenu* stabilizeMenu=menus.value("stabilizeMenu"); m_menu->addMenu(stabilizeMenu); @@ -791,6 +795,7 @@ void ProjectList::slotClipSelected() m_deleteButton->defaultAction()->setEnabled(true); m_openAction->setEnabled(false); m_reloadAction->setEnabled(false); + m_extractAudioAction->setEnabled(false); m_transcodeAction->setEnabled(false); m_stabilizeAction->setEnabled(false); } else { @@ -801,6 +806,7 @@ void ProjectList::slotClipSelected() if (clip == NULL) kDebug() << "-----------ERROR"; SubProjectItem *sub = static_cast <SubProjectItem*>(item); emit clipSelected(clip->referencedClip(), sub->zone()); + m_extractAudioAction->setEnabled(false); m_transcodeAction->setEnabled(false); m_stabilizeAction->setEnabled(false); m_reloadAction->setEnabled(false); @@ -813,6 +819,7 @@ void ProjectList::slotClipSelected() m_editButton->defaultAction()->setEnabled(true); m_deleteButton->defaultAction()->setEnabled(true); m_reloadAction->setEnabled(true); + m_extractAudioAction->setEnabled(true); m_transcodeAction->setEnabled(true); m_stabilizeAction->setEnabled(true); if (clip && clip->clipType() == IMAGE && !KdenliveSettings::defaultimageapp().isEmpty()) { @@ -836,6 +843,7 @@ void ProjectList::slotClipSelected() m_deleteButton->defaultAction()->setEnabled(false); m_openAction->setEnabled(false); m_reloadAction->setEnabled(false); + m_extractAudioAction->setEnabled(true); m_transcodeAction->setEnabled(false); m_stabilizeAction->setEnabled(false); } @@ -869,9 +877,11 @@ void ProjectList::adjustTranscodeActions(ProjectItem *clip) const { if (clip == NULL || clip->type() != PROJECTCLIPTYPE || clip->clipType() == COLOR || clip->clipType() == TEXT || clip->clipType() == PLAYLIST || clip->clipType() == SLIDESHOW) { m_transcodeAction->setEnabled(false); + m_extractAudioAction->setEnabled(false); return; } m_transcodeAction->setEnabled(true); + m_extractAudioAction->setEnabled(true); QList<QAction *> transcodeActions = m_transcodeAction->actions(); QStringList data; QString condition; @@ -1016,12 +1026,14 @@ void ProjectList::slotContextMenu(const QPoint &pos, QTreeWidgetItem *item) m_editButton->defaultAction()->setEnabled(enable); m_deleteButton->defaultAction()->setEnabled(enable); m_reloadAction->setEnabled(enable); + m_extractAudioAction->setEnabled(enable); m_transcodeAction->setEnabled(enable); m_stabilizeAction->setEnabled(enable); if (enable) { ProjectItem *clip = NULL; if (m_listView->currentItem()->type() == PROJECTSUBCLIPTYPE) { clip = static_cast <ProjectItem*>(item->parent()); + m_extractAudioAction->setEnabled(false); m_transcodeAction->setEnabled(false); m_stabilizeAction->setEnabled(false); adjustProxyActions(clip); @@ -1034,6 +1046,7 @@ void ProjectList::slotContextMenu(const QPoint &pos, QTreeWidgetItem *item) // Display uses in timeline emit findInTimeline(clip->clipId()); } else { + m_extractAudioAction->setEnabled(false); m_transcodeAction->setEnabled(false); m_stabilizeAction->setEnabled(false); } @@ -2280,6 +2293,7 @@ void ProjectList::slotSelectClip(const QString &ix) m_editButton->defaultAction()->setEnabled(true); m_deleteButton->defaultAction()->setEnabled(true); m_reloadAction->setEnabled(true); + m_extractAudioAction->setEnabled(true); m_transcodeAction->setEnabled(true); m_stabilizeAction->setEnabled(true); if (clip->clipType() == IMAGE && !KdenliveSettings::defaultimageapp().isEmpty()) { @@ -3160,5 +3174,4 @@ void ProjectList::discardJobs(const QString &id, JOBTYPE type) { } } - #include "projectlist.moc" diff --git a/src/projectlist.h b/src/projectlist.h index 2858890..083efce 100644 --- a/src/projectlist.h +++ b/src/projectlist.h @@ -313,6 +313,7 @@ private: FolderProjectItem *getFolderItemById(const QString &id); QAction *m_openAction; QAction *m_reloadAction; + QMenu *m_extractAudioAction; QMenu *m_transcodeAction; QMenu *m_stabilizeAction; KdenliveDoc *m_doc; |