Mercurial > hg > svcore
comparison plugin/PluginXml.h @ 1830:5f8fbbde08ff audio-source-refactor
Use shared_ptr for plugin instances throughout
| author | Chris Cannam |
|---|---|
| date | Fri, 20 Mar 2020 16:30:33 +0000 |
| parents | ad5f892c0c4d |
| children |
comparison
equal
deleted
inserted
replaced
| 1829:51fd27fbce9a | 1830:5f8fbbde08ff |
|---|---|
| 17 #define SV_PLUGIN_XML_H | 17 #define SV_PLUGIN_XML_H |
| 18 | 18 |
| 19 #include "base/XmlExportable.h" | 19 #include "base/XmlExportable.h" |
| 20 #include <vamp-hostsdk/PluginBase.h> | 20 #include <vamp-hostsdk/PluginBase.h> |
| 21 | 21 |
| 22 #include <memory> | |
| 23 | |
| 22 class QXmlAttributes; | 24 class QXmlAttributes; |
| 23 | 25 |
| 24 class PluginXml : public XmlExportable | 26 class PluginXml : public XmlExportable |
| 25 { | 27 { |
| 26 public: | 28 public: |
| 27 PluginXml(Vamp::PluginBase *plugin); | 29 PluginXml(std::shared_ptr<Vamp::PluginBase> plugin); |
| 28 virtual ~PluginXml(); | 30 virtual ~PluginXml(); |
| 29 | 31 |
| 30 /** | 32 /** |
| 31 * Export plugin settings to XML. | 33 * Export plugin settings to XML. |
| 32 */ | 34 */ |
| 33 void toXml(QTextStream &stream, | 35 void toXml(QTextStream &stream, |
| 34 QString indent = "", | 36 QString indent = "", |
| 35 QString extraAttributes = "") const override; | 37 QString extraAttributes = "") const override; |
| 36 | 38 |
| 37 /** | 39 /** |
| 38 * Set the parameters and program of a plugin from a set of XML | 40 * Set the parameters and program of a plugin from a set of XML |
| 39 * attributes. This is a partial inverse of toXml. | 41 * attributes. This is a partial inverse of toXml. |
| 40 */ | 42 */ |
| 51 static QString decodeConfigurationChars(QString text); | 53 static QString decodeConfigurationChars(QString text); |
| 52 | 54 |
| 53 protected: | 55 protected: |
| 54 QString stripInvalidParameterNameCharacters(QString) const; | 56 QString stripInvalidParameterNameCharacters(QString) const; |
| 55 | 57 |
| 56 Vamp::PluginBase *m_plugin; | 58 std::shared_ptr<Vamp::PluginBase> m_plugin; |
| 57 }; | 59 }; |
| 58 | 60 |
| 59 #endif | 61 #endif |
