Mercurial > hg > svgui
changeset 1592:1da52d5e6700
Merge from branch audio-source-refactor. Mostly handling changes to plugin ownership
author | Chris Cannam |
---|---|
date | Fri, 03 Apr 2020 12:12:47 +0100 |
parents | 26e80a450e74 (current diff) 11660e0c896f (diff) |
children | 32171776fcc9 5aef3f53a425 |
files | |
diffstat | 5 files changed, 19 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/widgets/PluginParameterBox.cpp Fri Apr 03 11:35:40 2020 +0100 +++ b/widgets/PluginParameterBox.cpp Fri Apr 03 12:12:47 2020 +0100 @@ -34,7 +34,8 @@ #include <cmath> -PluginParameterBox::PluginParameterBox(Vamp::PluginBase *plugin, QWidget *parent) : +PluginParameterBox::PluginParameterBox(std::shared_ptr<Vamp::PluginBase> plugin, + QWidget *parent) : QFrame(parent), m_plugin(plugin), m_programCombo(nullptr) @@ -100,7 +101,7 @@ float value = m_plugin->getParameter(params[i].identifier); int hint = PortHint::NoHint; - RealTimePluginInstance *rtpi = dynamic_cast<RealTimePluginInstance *> + auto rtpi = std::dynamic_pointer_cast<RealTimePluginInstance> (m_plugin); if (rtpi) { hint = rtpi->getParameterDisplayHint(i);
--- a/widgets/PluginParameterBox.h Fri Apr 03 11:35:40 2020 +0100 +++ b/widgets/PluginParameterBox.h Fri Apr 03 12:12:47 2020 +0100 @@ -32,10 +32,11 @@ Q_OBJECT public: - PluginParameterBox(Vamp::PluginBase *, QWidget *parent = 0); + PluginParameterBox(std::shared_ptr<Vamp::PluginBase>, + QWidget *parent = 0); ~PluginParameterBox(); - Vamp::PluginBase *getPlugin() { return m_plugin; } + std::shared_ptr<Vamp::PluginBase> getPlugin() { return m_plugin; } signals: void pluginConfigurationChanged(QString); @@ -51,7 +52,7 @@ void updateProgramCombo(); QGridLayout *m_layout; - Vamp::PluginBase *m_plugin; + std::shared_ptr<Vamp::PluginBase> m_plugin; struct ParamRec { AudioDial *dial;
--- a/widgets/PluginParameterDialog.cpp Fri Apr 03 11:35:40 2020 +0100 +++ b/widgets/PluginParameterDialog.cpp Fri Apr 03 12:12:47 2020 +0100 @@ -43,7 +43,7 @@ #include "base/Debug.h" -PluginParameterDialog::PluginParameterDialog(Vamp::PluginBase *plugin, +PluginParameterDialog::PluginParameterDialog(std::shared_ptr<Vamp::PluginBase> plugin, QWidget *parent) : QDialog(parent), m_plugin(plugin), @@ -368,9 +368,7 @@ if (showWindowSize) { - Vamp::Plugin *fePlugin = dynamic_cast<Vamp::Plugin *>(m_plugin); - if (!fePlugin) fePlugin = dynamic_cast<Vamp::PluginHostAdapter *>(m_plugin); - if (!fePlugin) fePlugin = dynamic_cast<Vamp::HostExt::PluginWrapper *>(m_plugin); + auto fePlugin = std::dynamic_pointer_cast<Vamp::Plugin>(m_plugin); int size = 1024; int increment = 1024; if (fePlugin) {
--- a/widgets/PluginParameterDialog.h Fri Apr 03 11:35:40 2020 +0100 +++ b/widgets/PluginParameterDialog.h Fri Apr 03 12:12:47 2020 +0100 @@ -43,7 +43,8 @@ Q_OBJECT public: - PluginParameterDialog(Vamp::PluginBase *, QWidget *parent = 0); + PluginParameterDialog(std::shared_ptr<Vamp::PluginBase> plugin, + QWidget *parent = 0); ~PluginParameterDialog(); void setChannelArrangement(int sourceChannels, @@ -61,7 +62,7 @@ QString defaultName); void setShowSelectionOnlyOption(bool show); - Vamp::PluginBase *getPlugin() { return m_plugin; } + std::shared_ptr<Vamp::PluginBase> getPlugin() { return m_plugin; } int getChannel() const { return m_channel; } @@ -93,7 +94,7 @@ void dialogAccepted(); protected: - Vamp::PluginBase *m_plugin; + std::shared_ptr<Vamp::PluginBase> m_plugin; int m_channel; int m_stepSize;
--- a/widgets/PluginReviewDialog.cpp Fri Apr 03 11:35:40 2020 +0100 +++ b/widgets/PluginReviewDialog.cpp Fri Apr 03 12:12:47 2020 +0100 @@ -90,13 +90,13 @@ for (QString id: dssiIds) { auto descriptor = dssiFactory->getPluginDescriptor(id); - if (!descriptor) continue; + if (descriptor.name == "") continue; m_table->setItem(row, typeCol, new QTableWidgetItem (tr("DSSI"))); m_table->setItem(row, idCol, new QTableWidgetItem - (QString::fromStdString(descriptor->label))); + (QString::fromStdString(descriptor.label))); m_table->setItem(row, nameCol, new QTableWidgetItem - (QString::fromStdString(descriptor->name))); + (QString::fromStdString(descriptor.name))); QString path = dssiFactory->getPluginLibraryPath(id); m_table->setItem(row, libCol, new QTableWidgetItem (QFileInfo(path).fileName())); @@ -107,13 +107,13 @@ for (QString id: ladspaIds) { auto descriptor = ladspaFactory->getPluginDescriptor(id); - if (!descriptor) continue; + if (descriptor.name == "") continue; m_table->setItem(row, typeCol, new QTableWidgetItem (tr("LADSPA"))); m_table->setItem(row, idCol, new QTableWidgetItem - (QString::fromStdString(descriptor->label))); + (QString::fromStdString(descriptor.label))); m_table->setItem(row, nameCol, new QTableWidgetItem - (QString::fromStdString(descriptor->name))); + (QString::fromStdString(descriptor.name))); QString path = ladspaFactory->getPluginLibraryPath(id); m_table->setItem(row, libCol, new QTableWidgetItem (QFileInfo(path).fileName()));