annotate plugin/LADSPAPluginFactory.h @ 0:da6937383da8

initial import
author Chris Cannam
date Tue, 10 Jan 2006 16:33:16 +0000
parents
children d86891498eef
rev   line source
Chris@0 1 /* -*- c-basic-offset: 4 -*- vi:set ts=8 sts=4 sw=4: */
Chris@0 2
Chris@0 3 /*
Chris@0 4 A waveform viewer and audio annotation editor.
Chris@0 5 Chris Cannam, Queen Mary University of London, 2005
Chris@0 6
Chris@0 7 This is experimental software. Not for distribution.
Chris@0 8 */
Chris@0 9
Chris@0 10 /*
Chris@0 11 This is a modified version of a source file from the
Chris@0 12 Rosegarden MIDI and audio sequencer and notation editor.
Chris@0 13 This file copyright 2000-2005 Chris Cannam and Richard Bown.
Chris@0 14 */
Chris@0 15
Chris@0 16 #ifndef _LADSPA_PLUGIN_FACTORY_H_
Chris@0 17 #define _LADSPA_PLUGIN_FACTORY_H_
Chris@0 18
Chris@0 19 #include "RealTimePluginFactory.h"
Chris@0 20 #include "api/ladspa.h"
Chris@0 21
Chris@0 22 #include <vector>
Chris@0 23 #include <map>
Chris@0 24 #include <set>
Chris@0 25 #include <QString>
Chris@0 26
Chris@0 27 class LADSPAPluginInstance;
Chris@0 28
Chris@0 29 class LADSPAPluginFactory : public RealTimePluginFactory
Chris@0 30 {
Chris@0 31 public:
Chris@0 32 virtual ~LADSPAPluginFactory();
Chris@0 33
Chris@0 34 virtual void discoverPlugins();
Chris@0 35
Chris@0 36 virtual const std::vector<QString> &getPluginIdentifiers() const;
Chris@0 37
Chris@0 38 virtual void enumeratePlugins(std::vector<QString> &list);
Chris@0 39
Chris@0 40 virtual RealTimePluginInstance *instantiatePlugin(QString identifier,
Chris@0 41 int clientId,
Chris@0 42 int position,
Chris@0 43 unsigned int sampleRate,
Chris@0 44 unsigned int blockSize,
Chris@0 45 unsigned int channels);
Chris@0 46
Chris@0 47 float getPortMinimum(const LADSPA_Descriptor *, int port);
Chris@0 48 float getPortMaximum(const LADSPA_Descriptor *, int port);
Chris@0 49 float getPortDefault(const LADSPA_Descriptor *, int port);
Chris@0 50 int getPortDisplayHint(const LADSPA_Descriptor *, int port);
Chris@0 51
Chris@0 52 protected:
Chris@0 53 LADSPAPluginFactory();
Chris@0 54 friend class RealTimePluginFactory;
Chris@0 55
Chris@0 56 virtual std::vector<QString> getPluginPath();
Chris@0 57
Chris@0 58 #ifdef HAVE_LIBLRDF
Chris@0 59 virtual std::vector<QString> getLRDFPath(QString &baseUri);
Chris@0 60 #endif
Chris@0 61
Chris@0 62 virtual void discoverPlugins(QString soName);
Chris@0 63 virtual void generateTaxonomy(QString uri, QString base);
Chris@0 64 virtual void generateFallbackCategories();
Chris@0 65
Chris@0 66 virtual void releasePlugin(RealTimePluginInstance *, QString);
Chris@0 67
Chris@0 68 virtual const LADSPA_Descriptor *getLADSPADescriptor(QString identifier);
Chris@0 69
Chris@0 70 void loadLibrary(QString soName);
Chris@0 71 void unloadLibrary(QString soName);
Chris@0 72 void unloadUnusedLibraries();
Chris@0 73
Chris@0 74 std::vector<QString> m_identifiers;
Chris@0 75
Chris@0 76 std::map<unsigned long, QString> m_taxonomy;
Chris@0 77 std::map<QString, QString> m_fallbackCategories;
Chris@0 78 std::map<unsigned long, std::map<int, float> > m_portDefaults;
Chris@0 79
Chris@0 80 std::set<RealTimePluginInstance *> m_instances;
Chris@0 81
Chris@0 82 typedef std::map<QString, void *> LibraryHandleMap;
Chris@0 83 LibraryHandleMap m_libraryHandles;
Chris@0 84 };
Chris@0 85
Chris@0 86 #endif
Chris@0 87