comparison plugin/FeatureExtractionPluginFactory.cpp @ 1249:d45a16c232bd piper

Align Sonic Annotator with the new Piper-ified subrepos (bearing in mind we want neither Piper nor the plugin load checker in Sonic Annotator itself)
author Chris Cannam
date Fri, 04 Nov 2016 14:16:01 +0000
parents 9ae2ce9190e6
children a99641535e02
comparison
equal deleted inserted replaced
1248:58dd6a6fe414 1249:d45a16c232bd
18 18
19 #include <QMutex> 19 #include <QMutex>
20 #include <QMutexLocker> 20 #include <QMutexLocker>
21 21
22 #include "base/Preferences.h" 22 #include "base/Preferences.h"
23 #include "base/Debug.h"
23 24
24 FeatureExtractionPluginFactory * 25 FeatureExtractionPluginFactory *
25 FeatureExtractionPluginFactory::instance() 26 FeatureExtractionPluginFactory::instance()
26 { 27 {
27 static QMutex mutex; 28 static QMutex mutex;
29 30
30 QMutexLocker locker(&mutex); 31 QMutexLocker locker(&mutex);
31 32
32 if (!instance) { 33 if (!instance) {
33 34
35 #ifdef HAVE_PIPER
34 if (Preferences::getInstance()->getRunPluginsInProcess()) { 36 if (Preferences::getInstance()->getRunPluginsInProcess()) {
35 cerr << "creating native instance" << endl; 37 SVDEBUG << "FeatureExtractionPluginFactory: creating native instance"
38 << endl;
36 instance = new NativeVampPluginFactory(); 39 instance = new NativeVampPluginFactory();
37 } else { 40 } else {
38 cerr << "creating piper instance" << endl; 41 SVDEBUG << "FeatureExtractionPluginFactory: creating Piper instance"
42 << endl;
39 instance = new PiperVampPluginFactory(); 43 instance = new PiperVampPluginFactory();
40 } 44 }
45 #else
46 SVDEBUG << "FeatureExtractionPluginFactory: no Piper support enabled,"
47 << " creating native instance" << endl;
48 instance = new NativeVampPluginFactory();
49 #endif
41 } 50 }
42 51
43 return instance; 52 return instance;
44 } 53 }