comparison widgets/PluginParameterDialog.cpp @ 1581:11660e0c896f audio-source-refactor

Use shared_ptr for plugin instances throughout; also descriptors are copyable
author Chris Cannam
date Fri, 20 Mar 2020 16:31:23 +0000
parents c8a6fd3f9dff
children
comparison
equal deleted inserted replaced
1580:a2ff9c01889e 1581:11660e0c896f
41 #include <QDesktopServices> 41 #include <QDesktopServices>
42 #include <QUrl> 42 #include <QUrl>
43 43
44 #include "base/Debug.h" 44 #include "base/Debug.h"
45 45
46 PluginParameterDialog::PluginParameterDialog(Vamp::PluginBase *plugin, 46 PluginParameterDialog::PluginParameterDialog(std::shared_ptr<Vamp::PluginBase> plugin,
47 QWidget *parent) : 47 QWidget *parent) :
48 QDialog(parent), 48 QDialog(parent),
49 m_plugin(plugin), 49 m_plugin(plugin),
50 m_channel(-1), 50 m_channel(-1),
51 m_stepSize(0), 51 m_stepSize(0),
366 return; 366 return;
367 } 367 }
368 368
369 if (showWindowSize) { 369 if (showWindowSize) {
370 370
371 Vamp::Plugin *fePlugin = dynamic_cast<Vamp::Plugin *>(m_plugin); 371 auto fePlugin = std::dynamic_pointer_cast<Vamp::Plugin>(m_plugin);
372 if (!fePlugin) fePlugin = dynamic_cast<Vamp::PluginHostAdapter *>(m_plugin);
373 if (!fePlugin) fePlugin = dynamic_cast<Vamp::HostExt::PluginWrapper *>(m_plugin);
374 int size = 1024; 372 int size = 1024;
375 int increment = 1024; 373 int increment = 1024;
376 if (fePlugin) { 374 if (fePlugin) {
377 size = int(fePlugin->getPreferredBlockSize()); 375 size = int(fePlugin->getPreferredBlockSize());
378 cerr << "Feature extraction plugin \"" << fePlugin->getName() << "\" reports preferred block size as " << size << endl; 376 cerr << "Feature extraction plugin \"" << fePlugin->getName() << "\" reports preferred block size as " << size << endl;