svn path=/trunk/kdenlive/; revision=3259
#include <QImage>
#include <QApplication>
#include <QImage>
#include <QApplication>
-void MyThread::init(QObject *parent, KUrl url, QString target, double frame, double frameLength, int frequency, int channels, int arrayWidth)
+void MyThread::init(KUrl url, QString target, double frame, double frameLength, int frequency, int channels, int arrayWidth)
m_isWorking = false;
f.setFileName(target);
m_url = url;
m_isWorking = false;
f.setFileName(target);
m_url = url;
m_producer.attach(m_convert);
}
m_producer.attach(m_convert);
}
- //QApplication::postEvent(m_parent, new ProgressEvent(-1, (QEvent::Type)10005));
-
int last_val = 0;
int val = 0;
kDebug() << "for " << m_frame << " " << m_frameLength << " " << m_producer.is_valid();
int last_val = 0;
int val = 0;
kDebug() << "for " << m_frame << " " << m_frameLength << " " << m_producer.is_valid();
val = (int)((z - m_frame) / (m_frame + m_frameLength) * 100.0);
if (last_val != val && val > 1) {
emit audioThumbProgress(val);
val = (int)((z - m_frame) / (m_frame + m_frameLength) * 100.0);
if (last_val != val && val > 1) {
emit audioThumbProgress(val);
- //QApplication::postEvent(m_parent, new ProgressEvent(val, (QEvent::Type)10005));
-
last_val = val;
}
m_producer.seek(z);
last_val = val;
}
m_producer.seek(z);
if (mlt_frame)
delete mlt_frame;
}
if (mlt_frame)
delete mlt_frame;
}
f.close();
m_isWorking = false;
if (stop_me) {
f.remove();
f.close();
m_isWorking = false;
if (stop_me) {
f.remove();
- }
- emit audioThumbOver();
- //QApplication::postEvent(m_parent, new ProgressEvent(-1, (QEvent::Type)10005));
-
+ } else emit audioThumbOver();
}
KThumb::KThumb(ClipManager *clipManager, KUrl url, const QString &id, const QString &hash, QObject * parent, const char */*name*/) :
}
KThumb::KThumb(ClipManager *clipManager, KUrl url, const QString &id, const QString &hash, QObject * parent, const char */*name*/) :
KThumb::~KThumb()
{
if (audioThumbProducer.isRunning()) {
KThumb::~KThumb()
{
if (audioThumbProducer.isRunning()) {
audioThumbProducer.stop_me = true;
audioThumbProducer.stop_me = true;
- audioThumbProducer.wait(300);
+ audioThumbProducer.wait();
+ slotAudioThumbOver();
*/
void KThumb::stopAudioThumbs()
{
*/
void KThumb::stopAudioThumbs()
{
- if (audioThumbProducer.isRunning()) audioThumbProducer.stop_me = true;
+ if (audioThumbProducer.isRunning()) {
+ audioThumbProducer.stop_me = true;
+ slotAudioThumbOver();
+ }
}
void KThumb::removeAudioThumb()
}
void KThumb::removeAudioThumb()
slotAudioThumbOver();
} else {
if (audioThumbProducer.isRunning()) return;
slotAudioThumbOver();
} else {
if (audioThumbProducer.isRunning()) return;
- audioThumbProducer.init(this, m_url, m_thumbFile, frame, frameLength, m_frequency, m_channels, arrayWidth);
+ audioThumbProducer.init(m_url, m_thumbFile, frame, frameLength, m_frequency, m_channels, arrayWidth);
audioThumbProducer.start(QThread::LowestPriority);
audioThumbProducer.start(QThread::LowestPriority);
- kDebug() << "STARTING GENERATE THMB FOR: " << m_url << " ................................";
+ kDebug() << "STARTING GENERATE THMB FOR: " << m_url << " ................................";
Q_OBJECT
public:
virtual void run();
Q_OBJECT
public:
virtual void run();
- void init(QObject *parent, KUrl url, QString target, double frame, double frameLength, int frequency, int channels, int arrayWidth);
+ void init(KUrl url, QString target, double frame, double frameLength, int frequency, int channels, int arrayWidth);
bool isWorking();
bool stop_me;
bool isWorking();
bool stop_me;
int m_channels;
int m_arrayWidth;
bool m_isWorking;
int m_channels;
int m_arrayWidth;
bool m_isWorking;
signals:
void audioThumbProgress(const int);
signals:
void audioThumbProgress(const int);