ExcitThread* eThread = new ExcitThread(this, eInfo, this);
eThread
->start
(QThread::LowestPriority);
ExcitThread* eThread = new ExcitThread(this, eInfo, this);
eThread->start(QThread::LowestPriority);
To copy to clipboard, switch view to plain text mode
ExcitThread
::ExcitThread(QObject* parent,
const ExcitInfo
& anInfo,
QWidget* aFeedback
) : QThread(parent
) { this->info = anInfo;
this->feedback = aFeedback;
connect(this, SIGNAL(showStatus(const QString&)), this->feedback, SLOT(showStatus(const QString&)));
connect(this, SIGNAL(showStatus(const QString&, int)), this->feedback, SLOT(showStatus(const QString&, int)));
connect(this, SIGNAL(showCritical(const QString&)), this->feedback, SLOT(showCritical(const QString&)));
}
void ExcitThread::run() {
emit showStatus("Generating excitation...");
try {
Excitation::generate( this->info.workDir.toStdString(),
this->info.duration,
this->info.sampleRate,
this->info.bitDepth,
this->info.minFreq,
this->info.maxFreq
);
} catch(QLE e) {
emit showCritical(e.msg.c_str());
emit showStatus("Excitation generating failed!", 2000);
return;
}
emit showStatus("Excitation and inverse filter are generated!", 2000);
}
ExcitThread::ExcitThread(QObject* parent, const ExcitInfo& anInfo, QWidget* aFeedback) : QThread(parent) {
this->info = anInfo;
this->feedback = aFeedback;
connect(this, SIGNAL(showStatus(const QString&)), this->feedback, SLOT(showStatus(const QString&)));
connect(this, SIGNAL(showStatus(const QString&, int)), this->feedback, SLOT(showStatus(const QString&, int)));
connect(this, SIGNAL(showCritical(const QString&)), this->feedback, SLOT(showCritical(const QString&)));
}
void ExcitThread::run() {
emit showStatus("Generating excitation...");
try {
Excitation::generate( this->info.workDir.toStdString(),
this->info.duration,
this->info.sampleRate,
this->info.bitDepth,
this->info.minFreq,
this->info.maxFreq
);
} catch(QLE e) {
emit showCritical(e.msg.c_str());
emit showStatus("Excitation generating failed!", 2000);
return;
}
emit showStatus("Excitation and inverse filter are generated!", 2000);
}
To copy to clipboard, switch view to plain text mode
Bookmarks