comparison plugin/FeatureExtractionPluginFactory.cpp @ 1229:e699bdeef63c piper

Add files that I forgot to track on Friday (sigh)
author Chris Cannam
date Tue, 25 Oct 2016 10:53:12 +0100
parents
children 9ae2ce9190e6
comparison
equal deleted inserted replaced
1227:5d886b7b4029 1229:e699bdeef63c
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 Sonic Visualiser
5 An audio file viewer and annotation editor.
6 Centre for Digital Music, Queen Mary, University of London.
7 This file copyright 2006-2016 Chris Cannam and QMUL.
8
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information.
14 */
15
16 #include "PiperVampPluginFactory.h"
17 #include "NativeVampPluginFactory.h"
18
19 #include <QMutex>
20 #include <QMutexLocker>
21
22 #include "base/Preferences.h"
23
24 FeatureExtractionPluginFactory *
25 FeatureExtractionPluginFactory::instance()
26 {
27 static QMutex mutex;
28 static FeatureExtractionPluginFactory *instance = 0;
29
30 QMutexLocker locker(&mutex);
31
32 if (!instance) {
33
34 if (Preferences::getInstance()->getRunPluginsInProcess()) {
35 cerr << "creating native instance" << endl;
36 instance = new NativeVampPluginFactory();
37 } else {
38 cerr << "creating piper instance" << endl;
39 instance = new PiperVampPluginFactory();
40 }
41 }
42
43 return instance;
44 }