From 59373ab56bb7d2c669d816bb377aaf53faa2ea20 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Sun, 9 Mar 2008 22:09:00 +0000 Subject: [PATCH] Render dialog svn path=/branches/KDE4/; revision=2032 --- src/CMakeLists.txt | 2 + src/mainwindow.cpp | 25 +++-- src/mainwindow.h | 3 + src/renderwidget.cpp | 47 ++++++++ src/renderwidget.h | 48 ++++++++ src/widgets/renderwidget_ui.ui | 196 +++++++++++++++++++++++++++++++++ 6 files changed, 314 insertions(+), 7 deletions(-) create mode 100644 src/renderwidget.cpp create mode 100644 src/renderwidget.h create mode 100644 src/widgets/renderwidget_ui.ui diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8489d82d..d9f526bc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -37,6 +37,7 @@ kde4_add_ui_files(kdenlive_UI widgets/colorval_ui.ui widgets/titlewidget_ui.ui widgets/timelinebuttons_ui.ui + widgets/renderwidget_ui.ui ) set(kdenlive_SRCS @@ -83,6 +84,7 @@ set(kdenlive_SRCS titledocument.cpp transition.cpp renderjob.cpp + renderwidget.cpp ) kde4_add_kcfg_files(kdenlive_SRCS GENERATE_MOC kdenlivesettings.kcfgc ) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index e115bffe..8852041b 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -64,7 +64,7 @@ MainWindow::MainWindow(QWidget *parent) : KXmlGuiWindow(parent), - fileName(QString()), m_activeDocument(NULL), m_activeTimeline(NULL) { + fileName(QString()), m_activeDocument(NULL), m_activeTimeline(NULL), m_renderWidget(NULL) { parseProfiles(); m_commandStack = new QUndoGroup; @@ -473,12 +473,22 @@ void MainWindow::slotEditProjectSettings() { } void MainWindow::slotRenderProject() { - KUrl exportFile = KUrl(KFileDialog::getSaveFileName()); - if (exportFile.isEmpty()) return; + if (!m_renderWidget) { + m_renderWidget = new RenderWidget(this); + connect(m_renderWidget, SIGNAL(doRender(const QString&, const QStringList &, bool, bool)), this, SLOT(slotDoRender(const QString&, const QStringList &, bool, bool))); + } + /*TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget(); + if (currentTab) m_renderWidget->setTimeline(currentTab); + m_renderWidget->setDocument(m_activeDocument);*/ + m_renderWidget->show(); +} + +void MainWindow::slotDoRender(const QString &dest, const QStringList &args, bool zoneOnly, bool playAfter) { + if (dest.isEmpty()) return; int in; int out; TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget(); - if (currentTab) { + if (currentTab && zoneOnly) { in = currentTab->inPoint(); out = currentTab->outPoint(); } @@ -486,12 +496,13 @@ void MainWindow::slotRenderProject() { temp.setAutoRemove(false); temp.setSuffix(".westley"); if (temp.open()) { - kDebug() << "/////// STARTING EXPORT: " << temp.fileName() << ", TO: " << exportFile.path(); m_projectMonitor->saveSceneList(temp.fileName()); QStringList args; args << "-erase"; - args << "in=" + QString::number(in) << "out=" + QString::number(out); - args << "inigo" << "kmplayer" << temp.fileName() << exportFile.path(); + if (zoneOnly) args << "in=" + QString::number(in) << "out=" + QString::number(out); + QString videoPlayer = "-"; + if (playAfter) videoPlayer = "kmplayer"; + args << "inigo" << videoPlayer << temp.fileName() << dest; QProcess::startDetached("kdenlive_render", args); } } diff --git a/src/mainwindow.h b/src/mainwindow.h index 7170318a..a284aef0 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -44,6 +44,7 @@ #include "effectslistview.h" #include "effectstackview.h" #include "ui_timelinebuttons_ui.h" +#include "renderwidget.h" class MainWindow : public KXmlGuiWindow { Q_OBJECT @@ -98,6 +99,7 @@ private: EffectsList m_audioEffects; EffectsList m_customEffects; + RenderWidget *m_renderWidget; Ui::TimelineButtons_UI timeline_buttons_ui; KRecentFilesAction *m_fileOpenRecent; @@ -132,6 +134,7 @@ private slots: void slotSwitchVideoThumbs(); void slotSwitchAudioThumbs(); void slotRenderProject(); + void slotDoRender(const QString &dest, const QStringList &args, bool zoneOnly, bool playAfter); }; #endif diff --git a/src/renderwidget.cpp b/src/renderwidget.cpp new file mode 100644 index 00000000..278a93f7 --- /dev/null +++ b/src/renderwidget.cpp @@ -0,0 +1,47 @@ +/*************************************************************************** + * Copyright (C) 2008 by Jean-Baptiste Mardelle (jb@kdenlive.org) * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + +#include + +#include +#include + +#include "kdenlivesettings.h" +#include "renderwidget.h" + +RenderWidget::RenderWidget(QWidget * parent): QDialog(parent) { + m_view.setupUi(this); + connect(m_view.buttonStart, SIGNAL(clicked()), this, SLOT(slotExport())); + connect(m_view.out_file, SIGNAL(textChanged(const QString &)), this, SLOT(slotUpdateButtons())); + m_view.buttonStart->setEnabled(false); +} + +void RenderWidget::slotUpdateButtons() { + if (m_view.out_file->url().isEmpty()) m_view.buttonStart->setEnabled(false); + else m_view.buttonStart->setEnabled(true); +} + +void RenderWidget::slotExport() { + emit doRender(m_view.out_file->url().path(), QStringList(), m_view.zone_only->isChecked(), m_view.play_after->isChecked()); +} + + +#include "renderwidget.moc" + + diff --git a/src/renderwidget.h b/src/renderwidget.h new file mode 100644 index 00000000..55324e78 --- /dev/null +++ b/src/renderwidget.h @@ -0,0 +1,48 @@ +/*************************************************************************** + * Copyright (C) 2008 by Jean-Baptiste Mardelle (jb@kdenlive.org) * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + + +#ifndef RENDERWIDGET_H +#define RENDERWIDGET_H + +#include +#include + +#include "ui_renderwidget_ui.h" + +class RenderWidget : public QDialog { + Q_OBJECT + +public: + RenderWidget(QWidget * parent = 0); + +private slots: + void slotUpdateButtons(); + void slotExport(); + +private: + Ui::RenderWidget_UI m_view; + +signals: + void doRender(const QString&, const QStringList &, bool, bool); +}; + + +#endif + diff --git a/src/widgets/renderwidget_ui.ui b/src/widgets/renderwidget_ui.ui new file mode 100644 index 00000000..e8c076f2 --- /dev/null +++ b/src/widgets/renderwidget_ui.ui @@ -0,0 +1,196 @@ + + RenderWidget_UI + + + + 0 + 0 + 374 + 243 + + + + Dialog + + + + + + Output file + + + + + + + + + + Video Profile + + + + + + + + + + + Image size: + + + + + + + 720x576 + + + + + + + Frame rate: + + + + + + + 25 + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Vertical + + + + 20 + 6 + + + + + + + + + + + Selected zone only + + + + + + + Play after render + + + + + + + Parameters + + + + + + + + + + Start + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + + + + + KComboBox + QComboBox +
kcombobox.h
+
+ + KLineEdit + QLineEdit +
klineedit.h
+
+ + KPushButton + QPushButton +
kpushbutton.h
+
+ + KUrlRequester + QFrame +
kurlrequester.h
+
+
+ + + + buttonBox + accepted() + RenderWidget_UI + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + RenderWidget_UI + reject() + + + 316 + 260 + + + 286 + 274 + + + + +
-- 2.39.5