# HG changeset patch # User Chris Cannam # Date 1145893940 0 # Node ID 9e027aa5b5c38ca441a3b3bb8d438ae0d346a08d # Parent c983dda79f726998801e497e8ee470d9fbc0755a * Avoid instantiating a plugin twice when configuring it (the min/max channel count call was instantiating the plugin again) * Add static library credits to the About box for static builds diff -r c983dda79f72 -r 9e027aa5b5c3 plugin/FeatureExtractionPluginFactory.cpp --- a/plugin/FeatureExtractionPluginFactory.cpp Thu Apr 13 18:29:10 2006 +0000 +++ b/plugin/FeatureExtractionPluginFactory.cpp Mon Apr 24 15:52:20 2006 +0000 @@ -263,6 +263,8 @@ rv = new Vamp::PluginHostAdapter(descriptor, inputSampleRate); + std::cerr << "FeatureExtractionPluginFactory::instantiatePlugin: Constructed Vamp plugin, rv is " << rv << std::endl; + //!!! need to dlclose() when plugins from a given library are unloaded done: diff -r c983dda79f72 -r 9e027aa5b5c3 transform/TransformFactory.cpp --- a/transform/TransformFactory.cpp Thu Apr 13 18:29:10 2006 +0000 +++ b/transform/TransformFactory.cpp Mon Apr 24 15:52:20 2006 +0000 @@ -334,6 +334,20 @@ } bool +TransformFactory::getChannelRange(TransformName name, Vamp::PluginBase *plugin, + int &minChannels, int &maxChannels) +{ + Vamp::Plugin *vp = 0; + if ((vp = dynamic_cast(plugin))) { + minChannels = vp->getMinChannelCount(); + maxChannels = vp->getMaxChannelCount(); + return true; + } else { + return getTransformChannelRange(name, minChannels, maxChannels); + } +} + +bool TransformFactory::getConfigurationForTransform(TransformName name, Model *inputModel, int &channel, @@ -372,7 +386,7 @@ } int minChannels = 1, maxChannels = sourceChannels; - getTransformChannelRange(name, minChannels, maxChannels); + getChannelRange(name, plugin, minChannels, maxChannels); int targetChannels = sourceChannels; if (sourceChannels < minChannels) targetChannels = minChannels; diff -r c983dda79f72 -r 9e027aa5b5c3 transform/TransformFactory.h --- a/transform/TransformFactory.h Thu Apr 13 18:29:10 2006 +0000 +++ b/transform/TransformFactory.h Mon Apr 24 15:52:20 2006 +0000 @@ -20,6 +20,8 @@ #include +namespace Vamp { class PluginBase; } + class TransformFactory : public QObject { Q_OBJECT @@ -143,6 +145,9 @@ void populateFeatureExtractionPlugins(TransformDescriptionMap &); void populateRealTimePlugins(TransformDescriptionMap &); + bool getChannelRange(TransformName name, + Vamp::PluginBase *plugin, int &min, int &max); + static TransformFactory *m_instance; };