summaryrefslogtreecommitdiffstats
path: root/daemon/RipTask.h
blob: ab15ad71de88493cfc17bd90bbc6a9098d378c64 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef RIPTASK_H
#define RIPTASK_H

#include "Task.h"
#include <QReadWriteLock>
class QIODevice;

class RipTask : public Task
{
	Q_OBJECT
public:
	RipTask(QObject *parent = 0);
	~RipTask();
	bool saveImageToDevice(QIODevice &out);
	bool saveImageToPath(const QString &path);
	bool canRunTask(const Movie *movie) const;
	QString status() const;

public slots:
	void kill();

private:
	static int cmpvob(const void *p1, const void *p2);
	typedef struct vobfile {
		int32_t start, end;
	} vobfile;
	QReadWriteLock m_locker;
	bool m_terminate;
	QString m_status;

protected:
	bool executeTask(Movie *movie);
	void cleanUp(bool result);

signals:
	void extractProgress(int current, int total);
};

#endif // RIPTASK_H