summaryrefslogtreecommitdiffstats
path: root/video.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'video.cpp')
-rw-r--r--video.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/video.cpp b/video.cpp
new file mode 100644
index 0000000..0daccf2
--- /dev/null
+++ b/video.cpp
@@ -0,0 +1,34 @@
+#include "video.h"
+#include "job.h"
+#include "dvdimagejob.h"
+
+Video::Video() : m_jobsCompleted(QBitArray(5))
+{
+ //Do something
+}
+void Video::completedJob(bool success)
+{
+ Job *job = qobject_cast<Job*>(sender());
+ qDebug() << "Job code" << job->jobType() << "completed" << success;
+ m_jobsCompleted.setBit(job->jobType(), success);
+ delete job;
+
+ if (success) {
+ //queue next job function
+ ;
+ } else {
+ //failure mechanism
+ ;
+ }
+}
+Job* Video::nextJob()
+{
+ Job *job;
+ if (!m_jobsCompleted.at(Video::DVDImage)) {
+ job = new DVDImageJob(this);
+ } else {
+ return job = 0; //Other jobs...
+ }
+ connect(job, SIGNAL(completed(bool)), this, SLOT(completedJob(bool)));
+ return job;
+}