Render dialog

svn path=/branches/KDE4/; revision=2032
parent 2d29ded2
......@@ -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 )
......
......@@ -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);
}
}
......
......@@ -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
/***************************************************************************
* 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 <QDir>
#include <KStandardDirs>
#include <KDebug>
#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"
/***************************************************************************
* 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 <QDialog>
#include <QPushButton>
#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
<ui version="4.0" >
<class>RenderWidget_UI</class>
<widget class="QDialog" name="RenderWidget_UI" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>374</width>
<height>243</height>
</rect>
</property>
<property name="windowTitle" >
<string>Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout_3" >
<item row="0" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
<string>Output file</string>
</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="QGroupBox" name="groupBox" >
<property name="title" >
<string>Video Profile</string>
</property>
<layout class="QGridLayout" name="gridLayout_2" >
<item row="0" column="0" >
<widget class="KComboBox" name="export_profile" />
</item>
<item rowspan="2" row="0" column="1" >
<layout class="QGridLayout" name="gridLayout" >
<item row="0" column="0" >
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>Image size:</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLabel" name="label_size" >
<property name="text" >
<string>720x576</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label_4" >
<property name="text" >
<string>Frame rate: </string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLabel" name="label_fps" >
<property name="text" >
<string>25</string>
</property>
</widget>
</item>
</layout>
</item>
<item rowspan="2" row="1" column="0" >
<spacer name="verticalSpacer" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1" >
<spacer name="verticalSpacer_2" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>6</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="2" column="0" colspan="2" >
<widget class="QCheckBox" name="zone_only" >
<property name="text" >
<string>Selected zone only</string>
</property>
</widget>
</item>
<item row="2" column="2" >
<widget class="QCheckBox" name="play_after" >
<property name="text" >
<string>Play after render</string>
</property>
</widget>
</item>
<item row="3" column="0" >
<widget class="QCheckBox" name="enable_params" >
<property name="text" >
<string>Parameters</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2" >
<widget class="KLineEdit" name="av_params" />
</item>
<item row="4" column="0" >
<widget class="KPushButton" name="buttonStart" >
<property name="text" >
<string>Start</string>
</property>
</widget>
</item>
<item row="4" column="1" colspan="2" >
<widget class="QDialogButtonBox" name="buttonBox" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons" >
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KComboBox</class>
<extends>QComboBox</extends>
<header>kcombobox.h</header>
</customwidget>
<customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
<header>klineedit.h</header>
</customwidget>
<customwidget>
<class>KPushButton</class>
<extends>QPushButton</extends>
<header>kpushbutton.h</header>
</customwidget>
<customwidget>
<class>KUrlRequester</class>
<extends>QFrame</extends>
<header>kurlrequester.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>RenderWidget_UI</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel" >
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>RenderWidget_UI</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel" >
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel" >
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
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