Chris@1229: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@1229: Chris@1229: /* Chris@1229: Sonic Visualiser Chris@1229: An audio file viewer and annotation editor. Chris@1229: Centre for Digital Music, Queen Mary, University of London. Chris@1229: This file copyright 2006-2016 Chris Cannam and QMUL. Chris@1229: Chris@1229: This program is free software; you can redistribute it and/or Chris@1229: modify it under the terms of the GNU General Public License as Chris@1229: published by the Free Software Foundation; either version 2 of the Chris@1229: License, or (at your option) any later version. See the file Chris@1229: COPYING included with this distribution for more information. Chris@1229: */ Chris@1229: Chris@1229: #include "PiperVampPluginFactory.h" Chris@1229: #include "NativeVampPluginFactory.h" Chris@1229: Chris@1229: #include Chris@1229: #include Chris@1229: Chris@1229: #include "base/Preferences.h" Chris@1249: #include "base/Debug.h" Chris@1229: Chris@1229: FeatureExtractionPluginFactory * Chris@1229: FeatureExtractionPluginFactory::instance() Chris@1229: { Chris@1229: static QMutex mutex; Chris@1229: static FeatureExtractionPluginFactory *instance = 0; Chris@1229: Chris@1229: QMutexLocker locker(&mutex); Chris@1229: Chris@1229: if (!instance) { Chris@1229: Chris@1249: #ifdef HAVE_PIPER Chris@1229: if (Preferences::getInstance()->getRunPluginsInProcess()) { Chris@1249: SVDEBUG << "FeatureExtractionPluginFactory: creating native instance" Chris@1249: << endl; Chris@1229: instance = new NativeVampPluginFactory(); Chris@1229: } else { Chris@1249: SVDEBUG << "FeatureExtractionPluginFactory: creating Piper instance" Chris@1249: << endl; Chris@1229: instance = new PiperVampPluginFactory(); Chris@1229: } Chris@1249: #else Chris@1249: SVDEBUG << "FeatureExtractionPluginFactory: no Piper support enabled," Chris@1249: << " creating native instance" << endl; Chris@1249: instance = new NativeVampPluginFactory(); Chris@1249: #endif Chris@1229: } Chris@1229: Chris@1229: return instance; Chris@1229: }