comparison plugin/LADSPAPluginFactory.h @ 0:da6937383da8

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