Chris@49: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@0: Chris@0: /* Chris@52: Sonic Visualiser Chris@52: An audio file viewer and annotation editor. Chris@52: Centre for Digital Music, Queen Mary, University of London. Chris@0: Chris@52: This program is free software; you can redistribute it and/or Chris@52: modify it under the terms of the GNU General Public License as Chris@52: published by the Free Software Foundation; either version 2 of the Chris@52: License, or (at your option) any later version. See the file Chris@52: COPYING included with this distribution for more information. Chris@0: */ Chris@0: Chris@0: /* Chris@0: This is a modified version of a source file from the Chris@0: Rosegarden MIDI and audio sequencer and notation editor. Chris@17: This file copyright 2000-2006 Chris Cannam and Richard Bown. Chris@0: */ Chris@0: Chris@0: #ifndef _LADSPA_PLUGIN_FACTORY_H_ Chris@0: #define _LADSPA_PLUGIN_FACTORY_H_ Chris@0: Chris@0: #include "RealTimePluginFactory.h" Chris@0: #include "api/ladspa.h" Chris@0: Chris@1179: #include "PluginScan.h" Chris@1179: Chris@0: #include Chris@0: #include Chris@0: #include Chris@0: #include Chris@0: Chris@0: class LADSPAPluginInstance; Chris@0: Chris@0: class LADSPAPluginFactory : public RealTimePluginFactory Chris@0: { Chris@0: public: Chris@0: virtual ~LADSPAPluginFactory(); Chris@0: Chris@0: virtual void discoverPlugins(); Chris@0: Chris@0: virtual const std::vector &getPluginIdentifiers() const; Chris@0: Chris@0: virtual void enumeratePlugins(std::vector &list); Chris@0: Chris@60: virtual const RealTimePluginDescriptor *getPluginDescriptor(QString identifier) const; Chris@60: Chris@0: virtual RealTimePluginInstance *instantiatePlugin(QString identifier, Chris@1429: int clientId, Chris@1429: int position, Chris@1429: sv_samplerate_t sampleRate, Chris@1429: int blockSize, Chris@1429: int channels); Chris@0: Chris@165: virtual QString getPluginCategory(QString identifier); Chris@165: Chris@1464: virtual QString getPluginLibraryPath(QString identifier); Chris@1464: Chris@0: float getPortMinimum(const LADSPA_Descriptor *, int port); Chris@0: float getPortMaximum(const LADSPA_Descriptor *, int port); Chris@0: float getPortDefault(const LADSPA_Descriptor *, int port); Chris@57: float getPortQuantization(const LADSPA_Descriptor *, int port); Chris@0: int getPortDisplayHint(const LADSPA_Descriptor *, int port); Chris@0: Chris@0: protected: Chris@0: LADSPAPluginFactory(); Chris@0: friend class RealTimePluginFactory; Chris@0: Chris@1180: virtual PluginScan::PluginType getPluginType() const { Chris@1180: return PluginScan::LADSPAPlugin; Chris@1179: } Chris@1179: Chris@0: virtual std::vector getPluginPath(); Chris@0: Chris@0: virtual std::vector getLRDFPath(QString &baseUri); Chris@0: Chris@929: virtual void discoverPluginsFrom(QString soName); Chris@0: virtual void generateTaxonomy(QString uri, QString base); Chris@0: virtual void generateFallbackCategories(); Chris@0: Chris@0: virtual void releasePlugin(RealTimePluginInstance *, QString); Chris@0: Chris@0: virtual const LADSPA_Descriptor *getLADSPADescriptor(QString identifier); Chris@0: Chris@0: void loadLibrary(QString soName); Chris@0: void unloadLibrary(QString soName); Chris@0: void unloadUnusedLibraries(); Chris@0: Chris@0: std::vector m_identifiers; Chris@1464: std::map m_libraries; // identifier -> full file path Chris@60: std::map m_rtDescriptors; Chris@0: Chris@165: std::map m_taxonomy; Chris@165: std::map m_lrdfTaxonomy; Chris@0: std::map > m_portDefaults; Chris@0: Chris@0: std::set m_instances; Chris@0: Chris@0: typedef std::map LibraryHandleMap; Chris@0: LibraryHandleMap m_libraryHandles; Chris@0: }; Chris@0: Chris@0: #endif Chris@0: