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