PluginXml.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4  Sonic Visualiser
5  An audio file viewer and annotation editor.
6  Centre for Digital Music, Queen Mary, University of London.
7  This file copyright 2006 Chris Cannam.
8 
9  This program is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License as
11  published by the Free Software Foundation; either version 2 of the
12  License, or (at your option) any later version. See the file
13  COPYING included with this distribution for more information.
14 */
15 
16 #ifndef SV_PLUGIN_XML_H
17 #define SV_PLUGIN_XML_H
18 
19 #include "base/XmlExportable.h"
20 #include <vamp-hostsdk/PluginBase.h>
21 
22 #include <memory>
23 
24 class QXmlAttributes;
25 
26 class PluginXml : public XmlExportable
27 {
28 public:
29  PluginXml(std::shared_ptr<Vamp::PluginBase> plugin);
30  virtual ~PluginXml();
31 
35  void toXml(QTextStream &stream,
36  QString indent = "",
37  QString extraAttributes = "") const override;
38 
43  virtual void setParameters(const QXmlAttributes &);
44 
50  virtual void setParametersFromXml(QString xml);
51 
52  static QString encodeConfigurationChars(QString text);
53  static QString decodeConfigurationChars(QString text);
54 
55 protected:
56  QString stripInvalidParameterNameCharacters(QString) const;
57 
58  std::shared_ptr<Vamp::PluginBase> m_plugin;
59 };
60 
61 #endif
virtual void setParametersFromXml(QString xml)
Set the parameters and program of a plugin from an XML plugin element as returned by toXml...
Definition: PluginXml.cpp:195
void toXml(QTextStream &stream, QString indent="", QString extraAttributes="") const override
Export plugin settings to XML.
Definition: PluginXml.cpp:62
QString stripInvalidParameterNameCharacters(QString) const
Definition: PluginXml.cpp:229
virtual void setParameters(const QXmlAttributes &)
Set the parameters and program of a plugin from a set of XML attributes.
Definition: PluginXml.cpp:129
virtual ~PluginXml()
Definition: PluginXml.cpp:41
PluginXml(std::shared_ptr< Vamp::PluginBase > plugin)
Definition: PluginXml.cpp:36
std::shared_ptr< Vamp::PluginBase > m_plugin
Definition: PluginXml.h:58
static QString decodeConfigurationChars(QString text)
Definition: PluginXml.cpp:53
static QString encodeConfigurationChars(QString text)
Definition: PluginXml.cpp:44