annotate plugin/LADSPAPluginFactory.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 98664afd518b
children 48e9f538e6e9
rev   line source
Chris@49 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@0 2
Chris@0 3 /*
Chris@52 4 Sonic Visualiser
Chris@52 5 An audio file viewer and annotation editor.
Chris@52 6 Centre for Digital Music, Queen Mary, University of London.
Chris@0 7
Chris@52 8 This program is free software; you can redistribute it and/or
Chris@52 9 modify it under the terms of the GNU General Public License as
Chris@52 10 published by the Free Software Foundation; either version 2 of the
Chris@52 11 License, or (at your option) any later version. See the file
Chris@52 12 COPYING included with this distribution for more information.
Chris@0 13 */
Chris@0 14
Chris@0 15 /*
Chris@0 16 This is a modified version of a source file from the
Chris@0 17 Rosegarden MIDI and audio sequencer and notation editor.
Chris@17 18 This file copyright 2000-2006 Chris Cannam and Richard Bown.
Chris@0 19 */
Chris@0 20
Chris@0 21 #ifndef _LADSPA_PLUGIN_FACTORY_H_
Chris@0 22 #define _LADSPA_PLUGIN_FACTORY_H_
Chris@0 23
Chris@0 24 #include "RealTimePluginFactory.h"
Chris@0 25 #include "api/ladspa.h"
Chris@0 26
Chris@1179 27 #include "PluginScan.h"
Chris@1179 28
Chris@0 29 #include <vector>
Chris@0 30 #include <map>
Chris@0 31 #include <set>
Chris@0 32 #include <QString>
Chris@0 33
Chris@0 34 class LADSPAPluginInstance;
Chris@0 35
Chris@0 36 class LADSPAPluginFactory : public RealTimePluginFactory
Chris@0 37 {
Chris@0 38 public:
Chris@0 39 virtual ~LADSPAPluginFactory();
Chris@0 40
Chris@0 41 virtual void discoverPlugins();
Chris@0 42
Chris@0 43 virtual const std::vector<QString> &getPluginIdentifiers() const;
Chris@0 44
Chris@0 45 virtual void enumeratePlugins(std::vector<QString> &list);
Chris@0 46
Chris@60 47 virtual const RealTimePluginDescriptor *getPluginDescriptor(QString identifier) const;
Chris@60 48
Chris@0 49 virtual RealTimePluginInstance *instantiatePlugin(QString identifier,
Chris@0 50 int clientId,
Chris@0 51 int position,
Chris@1040 52 sv_samplerate_t sampleRate,
Chris@1040 53 int blockSize,
Chris@1040 54 int channels);
Chris@0 55
Chris@165 56 virtual QString getPluginCategory(QString identifier);
Chris@165 57
Chris@0 58 float getPortMinimum(const LADSPA_Descriptor *, int port);
Chris@0 59 float getPortMaximum(const LADSPA_Descriptor *, int port);
Chris@0 60 float getPortDefault(const LADSPA_Descriptor *, int port);
Chris@57 61 float getPortQuantization(const LADSPA_Descriptor *, int port);
Chris@0 62 int getPortDisplayHint(const LADSPA_Descriptor *, int port);
Chris@0 63
Chris@0 64 protected:
Chris@0 65 LADSPAPluginFactory();
Chris@0 66 friend class RealTimePluginFactory;
Chris@0 67
Chris@1180 68 virtual PluginScan::PluginType getPluginType() const {
Chris@1180 69 return PluginScan::LADSPAPlugin;
Chris@1179 70 }
Chris@1179 71
Chris@0 72 virtual std::vector<QString> getPluginPath();
Chris@0 73
Chris@0 74 virtual std::vector<QString> getLRDFPath(QString &baseUri);
Chris@0 75
Chris@929 76 virtual void discoverPluginsFrom(QString soName);
Chris@0 77 virtual void generateTaxonomy(QString uri, QString base);
Chris@0 78 virtual void generateFallbackCategories();
Chris@0 79
Chris@0 80 virtual void releasePlugin(RealTimePluginInstance *, QString);
Chris@0 81
Chris@0 82 virtual const LADSPA_Descriptor *getLADSPADescriptor(QString identifier);
Chris@0 83
Chris@0 84 void loadLibrary(QString soName);
Chris@0 85 void unloadLibrary(QString soName);
Chris@0 86 void unloadUnusedLibraries();
Chris@0 87
Chris@0 88 std::vector<QString> m_identifiers;
Chris@60 89 std::map<QString, RealTimePluginDescriptor *> m_rtDescriptors;
Chris@0 90
Chris@165 91 std::map<QString, QString> m_taxonomy;
Chris@165 92 std::map<unsigned long, QString> m_lrdfTaxonomy;
Chris@0 93 std::map<unsigned long, std::map<int, float> > m_portDefaults;
Chris@0 94
Chris@0 95 std::set<RealTimePluginInstance *> m_instances;
Chris@0 96
Chris@0 97 typedef std::map<QString, void *> LibraryHandleMap;
Chris@0 98 LibraryHandleMap m_libraryHandles;
Chris@0 99 };
Chris@0 100
Chris@0 101 #endif
Chris@0 102