mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-08-10 11:36:08 +08:00
committed by
Klaus Basan
parent
3fe5ece460
commit
c04e408844
@@ -4,24 +4,36 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "blackcore/voice_vatlib.h"
|
||||
#include "blackmisc/blackmiscfreefunctions.h"
|
||||
|
||||
#include "client.h"
|
||||
#include "reader.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDebug>
|
||||
#include <QThread>
|
||||
|
||||
using namespace BlackMisc::Audio;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication app (argc, argv);
|
||||
|
||||
Client client(&app);
|
||||
BlackMisc::registerMetadata();
|
||||
BlackCore::IVoice *m_voice = new BlackCore::CVoiceVatlib();
|
||||
QThread m_voiceThread;
|
||||
m_voice->moveToThread(&m_voiceThread);
|
||||
m_voiceThread.start();
|
||||
LineReader reader;
|
||||
QObject::connect(&reader, SIGNAL(command(const QString &)), &client, SLOT(command(const QString &)));
|
||||
QObject::connect(&client, SIGNAL(quit()), &reader, SLOT(terminate()));
|
||||
QObject::connect(&client, SIGNAL(quit()), &app, SLOT(quit()));
|
||||
QObject::connect(&client, &Client::quit, [&] ()
|
||||
{
|
||||
qDebug() << "Shutting down...";
|
||||
reader.terminate();
|
||||
m_voiceThread.quit();
|
||||
m_voiceThread.wait(5000);
|
||||
qApp->quit();
|
||||
});
|
||||
|
||||
reader.start();
|
||||
app.exec();
|
||||
|
||||
Reference in New Issue
Block a user