mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 21:15:07 +02:00
Handle DDE stopping unexpectedly
This commit is contained in:
parent
3b6a35c38f
commit
b7f7cebb80
2 changed files with 14 additions and 1 deletions
|
@ -20,6 +20,7 @@
|
||||||
#include "DdeFaceTracker.h"
|
#include "DdeFaceTracker.h"
|
||||||
#include "FaceshiftConstants.h"
|
#include "FaceshiftConstants.h"
|
||||||
#include "InterfaceLogging.h"
|
#include "InterfaceLogging.h"
|
||||||
|
#include "Menu.h"
|
||||||
|
|
||||||
|
|
||||||
static const QHostAddress DDE_SERVER_ADDR("127.0.0.1");
|
static const QHostAddress DDE_SERVER_ADDR("127.0.0.1");
|
||||||
|
@ -178,6 +179,7 @@ void DdeFaceTracker::setEnabled(bool enabled) {
|
||||||
if (enabled && !_ddeProcess) {
|
if (enabled && !_ddeProcess) {
|
||||||
qDebug() << "[Info] DDE Face Tracker Starting";
|
qDebug() << "[Info] DDE Face Tracker Starting";
|
||||||
_ddeProcess = new QProcess(qApp);
|
_ddeProcess = new QProcess(qApp);
|
||||||
|
connect(_ddeProcess, SIGNAL(finished(int, QProcess::ExitStatus)), SLOT(processFinished(int, QProcess::ExitStatus)));
|
||||||
_ddeProcess->start(QCoreApplication::applicationDirPath() + DDE_PROGRAM_PATH, DDE_ARGUMENTS);
|
_ddeProcess->start(QCoreApplication::applicationDirPath() + DDE_PROGRAM_PATH, DDE_ARGUMENTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,6 +197,16 @@ void DdeFaceTracker::setEnabled(bool enabled) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DdeFaceTracker::processFinished(int exitCode, QProcess::ExitStatus exitStatus) {
|
||||||
|
if (_ddeProcess) {
|
||||||
|
// DDE crashed or was manually terminated
|
||||||
|
qDebug() << "[Info] DDE Face Tracker Stopped Unexpectedly";
|
||||||
|
_udpSocket.close();
|
||||||
|
_ddeProcess = NULL;
|
||||||
|
Menu::getInstance()->setIsOptionChecked(MenuOption::NoFaceTracking, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void DdeFaceTracker::resetTracking() {
|
void DdeFaceTracker::resetTracking() {
|
||||||
qDebug() << "[Info] Reset DDE Tracking";
|
qDebug() << "[Info] Reset DDE Tracking";
|
||||||
const char* DDE_RESET_COMMAND = "reset";
|
const char* DDE_RESET_COMMAND = "reset";
|
||||||
|
|
|
@ -53,7 +53,8 @@ public slots:
|
||||||
void resetTracking();
|
void resetTracking();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void processFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
||||||
|
|
||||||
//sockets
|
//sockets
|
||||||
void socketErrorOccurred(QAbstractSocket::SocketError socketError);
|
void socketErrorOccurred(QAbstractSocket::SocketError socketError);
|
||||||
void readPendingDatagrams();
|
void readPendingDatagrams();
|
||||||
|
|
Loading…
Reference in a new issue