Introduce PluginFactory class
This singleton class handles management of plugin search paths and plugin
discovery. Search paths are (if they exist):
* <lmms-exe-dir>/../lib/lmms: This is the common location on Unixoids
(Not included in Windows builds)
* <lmms-exe-dir>/plugins: For portable and Windows installations
* The path given by the compile define LMMS_PLUGIN_DIR
* Environment variable LMMS_PLUGIN_DIR if given
This commit also tweaks the build script to output built plugins to
"${CMAKE_BINARY_DIR}/plugins". This way lmms can find plugins during
development without the need to use `make install`.
Plugin::getDescriptorsOfAvailPlugins and ConfigManager::pluginDir were
removed.
This commit is contained in:
1 parent
d569015273
commit
7be47230e3
21 files changed
+321
-138
No files matched your search
@@ -28,6 +28,7 @@
|
||||
|
||||
#include "gui_templates.h"
|
||||
#include "embed.h"
|
||||
#include "PluginFactory.h"
|
||||
|
||||
|
||||
EffectSelectDialog::EffectSelectDialog( QWidget * _parent ) :
|
||||
@@ -42,31 +43,29 @@ EffectSelectDialog::EffectSelectDialog( QWidget * _parent ) :
|
||||
setWindowIcon( embed::getIconPixmap( "setup_audio" ) );
|
||||
|
||||
// query effects
|
||||
Plugin::getDescriptorsOfAvailPlugins( m_pluginDescriptors );
|
||||
|
||||
EffectKeyList subPluginEffectKeys;
|
||||
|
||||
for( Plugin::DescriptorList::ConstIterator it = m_pluginDescriptors.begin();
|
||||
it != m_pluginDescriptors.end(); ++it )
|
||||
for (const Plugin::Descriptor* desc: pluginFactory->descriptors())
|
||||
{
|
||||
if( it->type != Plugin::Effect )
|
||||
if( desc->type != Plugin::Effect )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if( it->subPluginFeatures )
|
||||
if( desc->subPluginFeatures )
|
||||
{
|
||||
it->subPluginFeatures->listSubPluginKeys(
|
||||
desc->subPluginFeatures->listSubPluginKeys(
|
||||
// as iterators are always stated to be not
|
||||
// equal with pointers, we dereference the
|
||||
// iterator and take the address of the item,
|
||||
// so we're on the safe side and the compiler
|
||||
// likely will reduce that to just "it"
|
||||
&( *it ),
|
||||
desc,
|
||||
subPluginEffectKeys );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_effectKeys << EffectKey( &( *it ), it->name );
|
||||
m_effectKeys << EffectKey( desc, desc->name );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user