Mercurial > hg > svgui
comparison widgets/PluginParameterBox.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 | 19da7fa80c3c |
comparison
equal
deleted
inserted
replaced
1580:a2ff9c01889e | 1581:11660e0c896f |
---|---|
32 #include <iostream> | 32 #include <iostream> |
33 #include <string> | 33 #include <string> |
34 | 34 |
35 #include <cmath> | 35 #include <cmath> |
36 | 36 |
37 PluginParameterBox::PluginParameterBox(Vamp::PluginBase *plugin, QWidget *parent) : | 37 PluginParameterBox::PluginParameterBox(std::shared_ptr<Vamp::PluginBase> plugin, |
38 QWidget *parent) : | |
38 QFrame(parent), | 39 QFrame(parent), |
39 m_plugin(plugin), | 40 m_plugin(plugin), |
40 m_programCombo(nullptr) | 41 m_programCombo(nullptr) |
41 { | 42 { |
42 m_layout = new QGridLayout; | 43 m_layout = new QGridLayout; |
98 float max = params[i].maxValue; | 99 float max = params[i].maxValue; |
99 float deft = params[i].defaultValue; | 100 float deft = params[i].defaultValue; |
100 float value = m_plugin->getParameter(params[i].identifier); | 101 float value = m_plugin->getParameter(params[i].identifier); |
101 | 102 |
102 int hint = PortHint::NoHint; | 103 int hint = PortHint::NoHint; |
103 RealTimePluginInstance *rtpi = dynamic_cast<RealTimePluginInstance *> | 104 auto rtpi = std::dynamic_pointer_cast<RealTimePluginInstance> |
104 (m_plugin); | 105 (m_plugin); |
105 if (rtpi) { | 106 if (rtpi) { |
106 hint = rtpi->getParameterDisplayHint(i); | 107 hint = rtpi->getParameterDisplayHint(i); |
107 } | 108 } |
108 | 109 |