summaryrefslogtreecommitdiffstats
path: root/libk3b/projects/movixdvd
diff options
context:
space:
mode:
Diffstat (limited to 'libk3b/projects/movixdvd')
-rw-r--r--libk3b/projects/movixdvd/Makefile.am21
-rw-r--r--libk3b/projects/movixdvd/k3bmovixdvddoc.cpp36
-rw-r--r--libk3b/projects/movixdvd/k3bmovixdvddoc.h40
-rw-r--r--libk3b/projects/movixdvd/k3bmovixdvdjob.cpp131
-rw-r--r--libk3b/projects/movixdvd/k3bmovixdvdjob.h60
5 files changed, 288 insertions, 0 deletions
diff --git a/libk3b/projects/movixdvd/Makefile.am b/libk3b/projects/movixdvd/Makefile.am
new file mode 100644
index 0000000..7af7283
--- /dev/null
+++ b/libk3b/projects/movixdvd/Makefile.am
@@ -0,0 +1,21 @@
+# we need the ../datacd and ../movixcd for the uic generated header files
+AM_CPPFLAGS= -I$(srcdir)/../../core \
+ -I$(srcdir)/../../../libk3bdevice \
+ -I$(srcdir)/../../../src \
+ -I$(srcdir)/../../tools \
+ -I$(srcdir)/../datadvd \
+ -I$(srcdir)/../movixcd \
+ -I$(srcdir)/../datacd \
+ -I$(srcdir)/.. \
+ -I../datacd \
+ -I../movixcd \
+ $(all_includes)
+
+METASOURCES = AUTO
+
+noinst_LTLIBRARIES = libmovixdvd.la
+
+libmovixdvd_la_SOURCES = k3bmovixdvddoc.cpp k3bmovixdvdjob.cpp
+
+include_HEADERS = k3bmovixdvddoc.h \
+ k3bmovixdvdjob.h
diff --git a/libk3b/projects/movixdvd/k3bmovixdvddoc.cpp b/libk3b/projects/movixdvd/k3bmovixdvddoc.cpp
new file mode 100644
index 0000000..80b8ec2
--- /dev/null
+++ b/libk3b/projects/movixdvd/k3bmovixdvddoc.cpp
@@ -0,0 +1,36 @@
+/*
+ *
+ * $Id: k3bmovixdvddoc.cpp 619556 2007-01-03 17:38:12Z trueg $
+ * Copyright (C) 2003 Sebastian Trueg <trueg@k3b.org>
+ *
+ * This file is part of the K3b project.
+ * Copyright (C) 1998-2007 Sebastian Trueg <trueg@k3b.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.
+ * See the file "COPYING" for the exact licensing terms.
+ */
+
+#include "k3bmovixdvddoc.h"
+#include "k3bmovixdvdjob.h"
+
+#include <kconfig.h>
+
+
+K3bMovixDvdDoc::K3bMovixDvdDoc( QObject* parent )
+ : K3bMovixDoc( parent )
+{
+}
+
+K3bMovixDvdDoc::~K3bMovixDvdDoc()
+{
+}
+
+K3bBurnJob* K3bMovixDvdDoc::newBurnJob( K3bJobHandler* hdl, QObject* parent )
+{
+ return new K3bMovixDvdJob( this, hdl, parent );
+}
+
+#include "k3bmovixdvddoc.moc"
diff --git a/libk3b/projects/movixdvd/k3bmovixdvddoc.h b/libk3b/projects/movixdvd/k3bmovixdvddoc.h
new file mode 100644
index 0000000..85943f0
--- /dev/null
+++ b/libk3b/projects/movixdvd/k3bmovixdvddoc.h
@@ -0,0 +1,40 @@
+/*
+ *
+ * $Id: k3bmovixdvddoc.h 619556 2007-01-03 17:38:12Z trueg $
+ * Copyright (C) 2003 Sebastian Trueg <trueg@k3b.org>
+ *
+ * This file is part of the K3b project.
+ * Copyright (C) 1998-2007 Sebastian Trueg <trueg@k3b.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.
+ * See the file "COPYING" for the exact licensing terms.
+ */
+
+#ifndef _K3B_MOVIX_DVD_DOC_H_
+#define _K3B_MOVIX_DVD_DOC_H_
+
+#include <k3bmovixdoc.h>
+#include "k3b_export.h"
+class KConfig;
+
+
+class LIBK3B_EXPORT K3bMovixDvdDoc : public K3bMovixDoc
+{
+ Q_OBJECT
+
+ public:
+ K3bMovixDvdDoc( QObject* parent = 0 );
+ ~K3bMovixDvdDoc();
+
+ int type() const { return MOVIX_DVD; }
+
+ K3bBurnJob* newBurnJob( K3bJobHandler* hdl, QObject* parent );
+
+ protected:
+ QString typeString() const { return "movixdvd"; }
+};
+
+#endif
diff --git a/libk3b/projects/movixdvd/k3bmovixdvdjob.cpp b/libk3b/projects/movixdvd/k3bmovixdvdjob.cpp
new file mode 100644
index 0000000..b556997
--- /dev/null
+++ b/libk3b/projects/movixdvd/k3bmovixdvdjob.cpp
@@ -0,0 +1,131 @@
+/*
+ *
+ * $Id: k3bmovixdvdjob.cpp 619556 2007-01-03 17:38:12Z trueg $
+ * Copyright (C) 2003 Sebastian Trueg <trueg@k3b.org>
+ *
+ * This file is part of the K3b project.
+ * Copyright (C) 1998-2007 Sebastian Trueg <trueg@k3b.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.
+ * See the file "COPYING" for the exact licensing terms.
+ */
+
+
+#include "k3bmovixdvdjob.h"
+#include "k3bmovixdvddoc.h"
+#include "k3bmovixfileitem.h"
+#include "k3bmovixdocpreparer.h"
+
+#include <k3bcore.h>
+#include <k3bdvdjob.h>
+#include <k3bdevice.h>
+
+#include <klocale.h>
+#include <kdebug.h>
+
+
+K3bMovixDvdJob::K3bMovixDvdJob( K3bMovixDvdDoc* doc, K3bJobHandler* jh, QObject* parent )
+ : K3bBurnJob( jh, parent ),
+ m_doc(doc)
+{
+ m_dvdJob = new K3bDvdJob( doc, this, this );
+ m_movixDocPreparer = new K3bMovixDocPreparer( doc, this, this );
+
+ // pipe signals
+ connect( m_dvdJob, SIGNAL(percent(int)), this, SIGNAL(percent(int)) );
+ connect( m_dvdJob, SIGNAL(subPercent(int)), this, SIGNAL(subPercent(int)) );
+ connect( m_dvdJob, SIGNAL(processedSubSize(int, int)), this, SIGNAL(processedSubSize(int, int)) );
+ connect( m_dvdJob, SIGNAL(processedSize(int, int)), this, SIGNAL(processedSize(int, int)) );
+ connect( m_dvdJob, SIGNAL(bufferStatus(int)), this, SIGNAL(bufferStatus(int)) );
+ connect( m_dvdJob, SIGNAL(writeSpeed(int, int)), this, SIGNAL(writeSpeed(int, int)) );
+ connect( m_dvdJob, SIGNAL(newTask(const QString&)), this, SIGNAL(newTask(const QString&)) );
+ connect( m_dvdJob, SIGNAL(newSubTask(const QString&)), this, SIGNAL(newSubTask(const QString&)) );
+ connect( m_dvdJob, SIGNAL(debuggingOutput(const QString&, const QString&)),
+ this, SIGNAL(debuggingOutput(const QString&, const QString&)) );
+ connect( m_dvdJob, SIGNAL(infoMessage(const QString&, int)),
+ this, SIGNAL(infoMessage(const QString&, int)) );
+ connect( m_dvdJob, SIGNAL(burning(bool)), this, SIGNAL(burning(bool)) );
+
+ // we need to clean up here
+ connect( m_dvdJob, SIGNAL(finished(bool)), this, SLOT(slotDvdJobFinished(bool)) );
+
+ connect( m_movixDocPreparer, SIGNAL(infoMessage(const QString&, int)),
+ this, SIGNAL(infoMessage(const QString&, int)) );
+}
+
+
+K3bMovixDvdJob::~K3bMovixDvdJob()
+{
+}
+
+
+K3bDevice::Device* K3bMovixDvdJob::writer() const
+{
+ return m_dvdJob->writer();
+}
+
+
+K3bDoc* K3bMovixDvdJob::doc() const
+{
+ return m_doc;
+}
+
+
+void K3bMovixDvdJob::start()
+{
+ jobStarted();
+
+ m_canceled = false;
+ m_dvdJob->setWritingApp( writingApp() );
+
+ if( m_movixDocPreparer->createMovixStructures() ) {
+ m_dvdJob->start();
+ }
+ else {
+ m_movixDocPreparer->removeMovixStructures();
+ jobFinished(false);
+ }
+}
+
+
+void K3bMovixDvdJob::cancel()
+{
+ m_canceled = true;
+ m_dvdJob->cancel();
+}
+
+
+void K3bMovixDvdJob::slotDvdJobFinished( bool success )
+{
+ m_movixDocPreparer->removeMovixStructures();
+
+ if( m_canceled || m_dvdJob->hasBeenCanceled() )
+ emit canceled();
+
+ jobFinished( success );
+}
+
+
+QString K3bMovixDvdJob::jobDescription() const
+{
+ if( m_doc->isoOptions().volumeID().isEmpty() )
+ return i18n("Writing eMovix DVD");
+ else
+ return i18n("Writing eMovix DVD (%1)").arg(m_doc->isoOptions().volumeID());
+}
+
+
+QString K3bMovixDvdJob::jobDetails() const
+{
+ return ( i18n("1 file (%1) and about 8 MB eMovix data",
+ "%n files (%1) and about 8 MB eMovix data",
+ m_doc->movixFileItems().count()).arg(KIO::convertSize(m_doc->size()))
+ + ( m_doc->copies() > 1
+ ? i18n(" - %n copy", " - %n copies", m_doc->copies())
+ : QString::null ) );
+}
+
+#include "k3bmovixdvdjob.moc"
diff --git a/libk3b/projects/movixdvd/k3bmovixdvdjob.h b/libk3b/projects/movixdvd/k3bmovixdvdjob.h
new file mode 100644
index 0000000..2b9ce10
--- /dev/null
+++ b/libk3b/projects/movixdvd/k3bmovixdvdjob.h
@@ -0,0 +1,60 @@
+/*
+ *
+ * $Id: k3bmovixdvdjob.h 619556 2007-01-03 17:38:12Z trueg $
+ * Copyright (C) 2003 Sebastian Trueg <trueg@k3b.org>
+ *
+ * This file is part of the K3b project.
+ * Copyright (C) 1998-2007 Sebastian Trueg <trueg@k3b.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.
+ * See the file "COPYING" for the exact licensing terms.
+ */
+
+
+#ifndef _K3B_MOVIX_DVD_JOB_H_
+#define _K3B_MOVIX_DVD_JOB_H_
+
+#include <k3bjob.h>
+
+class K3bMovixDvdDoc;
+class K3bDevice::Device;
+class K3bDvdJob;
+class KTempFile;
+class K3bMovixInstallation;
+class K3bMovixDocPreparer;
+class K3bDirItem;
+class K3bFileItem;
+
+class K3bMovixDvdJob : public K3bBurnJob
+{
+ Q_OBJECT
+
+ public:
+ K3bMovixDvdJob( K3bMovixDvdDoc* doc, K3bJobHandler*, QObject* parent = 0 );
+ ~K3bMovixDvdJob();
+
+ K3bDoc* doc() const;
+ K3bDevice::Device* writer() const;
+
+ QString jobDescription() const;
+ QString jobDetails() const;
+
+ public slots:
+ void start();
+ void cancel();
+
+ private slots:
+ void slotDvdJobFinished( bool );
+
+ private:
+ K3bMovixDvdDoc* m_doc;
+ K3bDvdJob* m_dvdJob;
+ K3bMovixDocPreparer* m_movixDocPreparer;
+
+ bool m_canceled;
+};
+
+#endif