2013-11-24 16:10:48 +01:00
|
|
|
#pragma once
|
|
|
|
|
2013-11-26 21:38:24 +01:00
|
|
|
// Qt includes
|
|
|
|
#include <QThread>
|
2013-11-24 16:10:48 +01:00
|
|
|
|
2013-11-26 21:38:24 +01:00
|
|
|
// Python includes
|
|
|
|
#include <Python.h>
|
|
|
|
|
|
|
|
class Effect : public QThread
|
2013-11-24 16:10:48 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2013-11-26 21:38:24 +01:00
|
|
|
Effect(int priority, int timeout);
|
2013-11-24 16:10:48 +01:00
|
|
|
virtual ~Effect();
|
2013-11-26 21:38:24 +01:00
|
|
|
|
|
|
|
virtual void run();
|
|
|
|
|
|
|
|
int getPriority() const;
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void abort();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void effectFinished(Effect * effect);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void effectFinished();
|
|
|
|
|
|
|
|
private:
|
|
|
|
const int _priority;
|
|
|
|
|
|
|
|
const int _timeout;
|
|
|
|
|
|
|
|
PyThreadState * _interpreterThreadState;
|
|
|
|
|
|
|
|
bool _abortRequested;
|
2013-11-24 16:10:48 +01:00
|
|
|
};
|