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