Now that we can track jobs within Kdenlive, add new config option to...

Now that we can track jobs within Kdenlive, add new config option to enable/disable use of KDE job view tracker to monitor rendering jobs (disabled by default).

svn path=/branches/KDE4/; revision=2989
parent be49eff2
......@@ -38,6 +38,11 @@ int main(int argc, char **argv) {
erase = true;
args.takeFirst();
}
bool usekuiserver = false;
if (args.at(0) == "-kuiserver") {
usekuiserver = true;
args.takeFirst();
}
if (args.at(0).startsWith("in=")) {
in = args.at(0).section('=', -1).toInt();
args.takeFirst();
......@@ -63,14 +68,15 @@ int main(int argc, char **argv) {
args.takeFirst();
QString dest = args.at(0);
args.takeFirst();
qDebug() << "//STARTING RENDERING: " << erase << "," << render << "," << profile << "," << rendermodule << "," << player << "," << src << "," << dest << "," << preargs << "," << args << "," << in << "," << out;
RenderJob *job = new RenderJob(erase, render, profile, rendermodule, player, src, dest, preargs, args, in, out);
qDebug() << "//STARTING RENDERING: " << erase << "," << usekuiserver << "," << render << "," << profile << "," << rendermodule << "," << player << "," << src << "," << dest << "," << preargs << "," << args << "," << in << "," << out ;
RenderJob *job = new RenderJob(erase, usekuiserver, render, profile, rendermodule, player, src, dest, preargs, args, in, out);
job->start();
app.exec();
} else {
fprintf(stderr, "Kdenlive video renderer for MLT.\nUsage: "
"kdenlive_render [-erase] [in=pos] [out=pos] [render] [profile] [rendermodule] [player] [src] [dest] [[arg1] [arg2] ...]\n"
"kdenlive_render [-erase] [-kuiserver] [in=pos] [out=pos] [render] [profile] [rendermodule] [player] [src] [dest] [[arg1] [arg2] ...]\n"
" -erase: if that parameter is present, src file will be erased at the end\n"
" -kuiserver: if that parameter is present, use KDE job tracker\n"
" in=pos: start rendering at frame pos\n"
" out=pos: end rendering at frame pos\n"
" render: path to inigo render\n"
......
......@@ -33,7 +33,7 @@ public:
static QDBusConnection connection(QLatin1String(""));
RenderJob::RenderJob(bool erase, const QString &renderer, const QString &profile, const QString &rendermodule, const QString &player, const QString &scenelist, const QString &dest, const QStringList &preargs, const QStringList &args, int in, int out) : QObject(), m_jobUiserver(NULL), m_kdenliveinterface(NULL) {
RenderJob::RenderJob(bool erase, bool usekuiserver, const QString &renderer, const QString &profile, const QString &rendermodule, const QString &player, const QString &scenelist, const QString &dest, const QStringList &preargs, const QStringList &args, int in, int out) : QObject(), m_usekuiserver(usekuiserver), m_jobUiserver(NULL), m_kdenliveinterface(NULL) {
m_scenelist = scenelist;
m_dest = dest;
m_player = player;
......@@ -128,7 +128,7 @@ void RenderJob::receivedStderr() {
void RenderJob::start() {
QDBusConnectionInterface* interface = QDBusConnection::sessionBus().interface();
if (interface) {
if (interface && m_usekuiserver) {
if (!interface->isServiceRegistered("org.kde.JobViewServer")) {
qDebug() << "No org.kde.JobViewServer registered, trying to start kuiserver";
m_logstream << "No org.kde.JobViewServer registered, trying to start kuiserver";
......
......@@ -32,7 +32,7 @@
class RenderJob : public QObject {
Q_OBJECT
public:
RenderJob(bool erase, const QString &renderer, const QString &profile, const QString &rendermodule, const QString &player, const QString &scenelist, const QString &dest, const QStringList &preargs, const QStringList &args, int in = -1, int out = -1);
RenderJob(bool erase, bool usekuiserver, const QString &renderer, const QString &profile, const QString &rendermodule, const QString &player, const QString &scenelist, const QString &dest, const QStringList &preargs, const QStringList &args, int in = -1, int out = -1);
~RenderJob();
void start();
......@@ -56,6 +56,7 @@ private:
QDBusInterface *m_kdenliveinterface;
QList<QVariant> m_dbusargs;
QTime m_startTime;
bool m_usekuiserver;
/** \brief Used to create a temporary file for logging */
QTemporaryFile m_logfile;
/** \brief Used to write to the log file */
......
......@@ -19,6 +19,11 @@
<default>false</default>
</entry>
<entry name="usekuiserver" type="Bool">
<label>Use KDE central job management to track render jobs.</label>
<default>false</default>
</entry>
<entry name="color_duration" type="String">
<label>Default color clip duration.</label>
<default>00:00:05:00</default>
......
......@@ -1435,6 +1435,7 @@ void MainWindow::slotDoRender(const QString &dest, const QString &render, const
QStringList args;
args << "-erase";
if (KdenliveSettings::usekuiserver()) args << "-kuiserver";
if (zoneOnly) args << "in=" + QString::number(in) << "out=" + QString::number(out);
else if (guideStart != -1) {
args << "in=" + QString::number(GenTime(guideStart).frames(m_activeDocument->fps())) << "out=" + QString::number(GenTime(guideEnd).frames(m_activeDocument->fps()));
......
......@@ -5,8 +5,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>278</width>
<height>340</height>
<width>338</width>
<height>359</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_4" >
......@@ -31,7 +31,7 @@
</property>
</widget>
</item>
<item row="3" column="0" colspan="6" >
<item row="4" column="0" colspan="6" >
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<string>Default Durations</string>
......@@ -71,7 +71,7 @@
</layout>
</widget>
</item>
<item row="4" column="0" colspan="6" >
<item row="5" column="0" colspan="6" >
<widget class="QGroupBox" name="properties" >
<property name="title" >
<string>Default Profile</string>
......@@ -157,14 +157,14 @@
</layout>
</widget>
</item>
<item row="5" column="0" >
<item row="6" column="0" >
<widget class="QLabel" name="label_6" >
<property name="text" >
<string>Video tracks</string>
</property>
</widget>
</item>
<item row="5" column="2" >
<item row="6" column="2" >
<spacer name="horizontalSpacer" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
......@@ -177,14 +177,14 @@
</property>
</spacer>
</item>
<item row="5" column="3" >
<item row="6" column="3" >
<widget class="QLabel" name="label_7" >
<property name="text" >
<string>Audio tracks</string>
</property>
</widget>
</item>
<item row="6" column="0" colspan="6" >
<item row="7" column="0" colspan="6" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
......@@ -197,12 +197,19 @@
</property>
</spacer>
</item>
<item row="5" column="1" >
<item row="6" column="1" >
<widget class="KIntSpinBox" name="kcfg_videotracks" />
</item>
<item row="5" column="4" >
<item row="6" column="4" >
<widget class="KIntSpinBox" name="kcfg_audiotracks" />
</item>
<item row="3" column="0" colspan="5" >
<widget class="QCheckBox" name="kcfg_usekuiserver" >
<property name="text" >
<string>Use KDE job tracking for render jobs</string>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
......
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