annotate plugin/PluginXml.h @ 1196:c7b9c902642f spectrogram-minor-refactor

Fix threshold in spectrogram -- it wasn't working in the last release. There is a new protocol for this. Formerly the threshold parameter had a range from -50dB to 0 with the default at -50, and -50 treated internally as "no threshold". However, there was a hardcoded, hidden internal threshold for spectrogram colour mapping at -80dB with anything below this being rounded to zero. Now the threshold parameter has range -81 to -1 with the default at -80, -81 is treated internally as "no threshold", and there is no hidden internal threshold. So the default behaviour is the same as before, an effective -80dB threshold, but it is now possible to change this in both directions. Sessions reloaded from prior versions may look slightly different because, if the session says there should be no threshold, there will now actually be no threshold instead of having the hidden internal one. Still need to do something in the UI to make it apparent that the -81dB setting removes the threshold entirely. This is at least no worse than the previous, also obscured, magic -50dB setting.
author Chris Cannam
date Mon, 01 Aug 2016 16:21:01 +0100
parents 4c000e196bf1
children c01cbe41aeb5
rev   line source
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@66 16 #ifndef _PLUGIN_XML_H_
Chris@66 17 #define _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@66 22 class QXmlAttributes;
Chris@66 23
Chris@66 24 class PluginXml : public XmlExportable
Chris@66 25 {
Chris@66 26 public:
Chris@66 27 PluginXml(Vamp::PluginBase *plugin);
Chris@66 28 virtual ~PluginXml();
Chris@66 29
Chris@66 30 /**
Chris@66 31 * Export plugin settings to XML.
Chris@66 32 */
Chris@314 33 virtual void toXml(QTextStream &stream,
Chris@314 34 QString indent = "",
Chris@314 35 QString extraAttributes = "") const;
Chris@66 36
Chris@66 37 /**
Chris@66 38 * Set the parameters and program of a plugin from a set of XML
Chris@314 39 * attributes. This is a partial inverse of toXml.
Chris@66 40 */
Chris@66 41 virtual void setParameters(const QXmlAttributes &);
Chris@66 42
Chris@66 43 /**
Chris@66 44 * Set the parameters and program of a plugin from an XML plugin
Chris@314 45 * element as returned by toXml. This is a partial inverse of
Chris@314 46 * toXml.
Chris@66 47 */
Chris@66 48 virtual void setParametersFromXml(QString xml);
Chris@66 49
Chris@81 50 static QString encodeConfigurationChars(QString text);
Chris@81 51 static QString decodeConfigurationChars(QString text);
Chris@81 52
Chris@66 53 protected:
Chris@66 54 QString stripInvalidParameterNameCharacters(QString) const;
Chris@66 55
Chris@66 56 Vamp::PluginBase *m_plugin;
Chris@66 57 };
Chris@66 58
Chris@66 59 #endif