comparison plugin/FeatureExtractionPluginFactory.cpp @ 47:bac8b14ab355

* Add menu for re-adding existing layers * Fix layer tree window so that it at least approximates correct * Add bundled operations in command history, for use with things like multiple consecutive changes to a parameter value * Disambiguate plugins that happen to have identical descriptions * Add spectral centroid plugin (could use some parameters!) * Some other fixes
author Chris Cannam
date Fri, 17 Mar 2006 17:38:28 +0000
parents 838652cc31e6
children 39ae3dee27b9
comparison
equal deleted inserted replaced
46:5364a9d338a2 47:bac8b14ab355
11 #include "PluginIdentifier.h" 11 #include "PluginIdentifier.h"
12 12
13 #include "plugins/BeatDetect.h" //!!! 13 #include "plugins/BeatDetect.h" //!!!
14 #include "plugins/ChromagramPlugin.h" //!!! 14 #include "plugins/ChromagramPlugin.h" //!!!
15 #include "plugins/ZeroCrossing.h" //!!! 15 #include "plugins/ZeroCrossing.h" //!!!
16 // NOTE: added by Martin Gasser 16 #include "plugins/SpectralCentroid.h" //!!!
17 #include "plugins/TonalChangeDetect.h" //!!! 17 #include "plugins/TonalChangeDetect.h" //!!!
18 18
19 #include <iostream> 19 #include <iostream>
20 20
21 static FeatureExtractionPluginFactory *_nativeInstance = 0; 21 static FeatureExtractionPluginFactory *_nativeInstance = 0;
67 { 67 {
68 std::vector<QString> rv; 68 std::vector<QString> rv;
69 rv.push_back("sv:_builtin:beats"); //!!! 69 rv.push_back("sv:_builtin:beats"); //!!!
70 rv.push_back("sv:_builtin:chromagram"); //!!! 70 rv.push_back("sv:_builtin:chromagram"); //!!!
71 rv.push_back("sv:_builtin:zerocrossing"); //!!! 71 rv.push_back("sv:_builtin:zerocrossing"); //!!!
72 // NOTE: added by Martin Gasser 72 rv.push_back("sv:_builtin:spectralcentroid"); //!!!
73 rv.push_back("sv:_builtin:tonalchange"); //!!! 73 rv.push_back("sv:_builtin:tonalchange"); //!!!
74 return rv; 74 return rv;
75 } 75 }
76 76
77 FeatureExtractionPlugin * 77 FeatureExtractionPlugin *
78 FeatureExtractionPluginFactory::instantiatePlugin(QString identifier, 78 FeatureExtractionPluginFactory::instantiatePlugin(QString identifier,
101 101
102 if (label == "zerocrossing") { 102 if (label == "zerocrossing") {
103 return new ZeroCrossing(inputSampleRate); //!!! 103 return new ZeroCrossing(inputSampleRate); //!!!
104 } 104 }
105 105
106 // NOTE: added by Martin Gasser 106 if (label == "spectralcentroid") {
107 return new SpectralCentroid(inputSampleRate); //!!!
108 }
109
107 if (label == "tonalchange") { 110 if (label == "tonalchange") {
108 return new TonalChangeDetect(inputSampleRate); //!!! 111 return new TonalChangeDetect(inputSampleRate); //!!!
109 } 112 }
110 113
111 std::cerr << "FeatureExtractionPluginFactory::instantiatePlugin: Unknown plugin \"" << identifier.toStdString() << "\"" << std::endl; 114 std::cerr << "FeatureExtractionPluginFactory::instantiatePlugin: Unknown plugin \"" << identifier.toStdString() << "\"" << std::endl;