Merge pull request #2901 from polac/19671_proposal

Initialise lisencing manager after we have enabled Visage.
This commit is contained in:
Brad Hefta-Gaub 2014-05-22 14:28:20 -07:00
commit 5964cb9c96

View file

@ -41,14 +41,8 @@ Visage::Visage() :
_headOrigin(DEFAULT_HEAD_ORIGIN) {
#ifdef HAVE_VISAGE
#ifdef WIN32
QByteArray licensePath = Application::resourcesPath().toLatin1() + "visage";
#else
QByteArray licensePath = Application::resourcesPath().toLatin1() + "visage/license.vlc";
#endif
initializeLicenseManager(licensePath.data());
_tracker = new VisageTracker2(Application::resourcesPath().toLatin1() + "visage/tracker.cfg");
_data = new FaceData();
_tracker = NULL;
_data = NULL;
#endif
}
@ -179,6 +173,19 @@ void Visage::setEnabled(bool enabled) {
return;
}
if ((_enabled = enabled)) {
if(_tracker == NULL && _data == NULL){
#ifdef WIN32
QByteArray licensePath = Application::resourcesPath().toLatin1() + "visage";
#else
QByteArray licensePath = Application::resourcesPath().toLatin1() + "visage/license.vlc";
#endif
initializeLicenseManager(licensePath.data());
_tracker = new VisageTracker2(Application::resourcesPath().toLatin1() + "visage/tracker.cfg");
_data = new FaceData();
}
_tracker->trackFromCam();
} else {
_tracker->stop();