various: added hooks so that various lengthy functions could be cancelled from another thread
This commit is contained in:
@@ -18,6 +18,7 @@ set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
common/bezier.h
|
||||
common/bezier.cpp
|
||||
common/cancelableobject.h
|
||||
common/channellayout.h
|
||||
common/clamp.h
|
||||
common/constructors.h
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#ifndef CANCELABLEOBJECT_H
|
||||
#define CANCELABLEOBJECT_H
|
||||
|
||||
#include <QAtomicInt>
|
||||
|
||||
class CancelableObject {
|
||||
public:
|
||||
CancelableObject() :
|
||||
cancelled_(false)
|
||||
{
|
||||
}
|
||||
|
||||
void Cancel() {
|
||||
cancelled_ = true;
|
||||
}
|
||||
|
||||
const QAtomicInt& IsCancelled() const {
|
||||
return cancelled_;
|
||||
}
|
||||
|
||||
private:
|
||||
QAtomicInt cancelled_;
|
||||
|
||||
};
|
||||
|
||||
#endif // CANCELABLEOBJECT_H
|
||||
Reference in New Issue
Block a user