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:
Lukas W
2015-01-29 13:48:52 +01:00
parent d569015273
commit 7be47230e3
21 changed files with 321 additions and 138 deletions

View File

@@ -1,3 +1,6 @@
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
ADD_SUBDIRECTORY(Amplifier)
ADD_SUBDIRECTORY(audio_file_processor)
ADD_SUBDIRECTORY(BassBooster)

View File

@@ -1,3 +1,5 @@
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/ladspa")
IF(WANT_CAPS)
ADD_SUBDIRECTORY(caps)
ENDIF(WANT_CAPS)

View File

@@ -2,4 +2,5 @@ INCLUDE(BuildPlugin)
INCLUDE_DIRECTORIES(unrtf)
ADD_DEFINITIONS(--std=c++0x)
BUILD_PLUGIN(flpimport FlpImport.cpp unrtf.cpp FlpImport.h)

View File

@@ -51,6 +51,7 @@
#include "Oscillator.h"
#include "Pattern.h"
#include "Piano.h"
#include "PluginFactory.h"
#include "ProjectJournal.h"
#include "ProjectNotes.h"
#include "Song.h"
@@ -1637,22 +1638,19 @@ p->putValue( jt->pos, value, false );
// process all effects
EffectKeyList effKeys;
Plugin::DescriptorList pluginDescs;
Plugin::getDescriptorsOfAvailPlugins( pluginDescs );
for( Plugin::DescriptorList::ConstIterator it = pluginDescs.begin();
it != pluginDescs.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( &( *it ), effKeys );
desc->subPluginFeatures->listSubPluginKeys( desc, effKeys );
}
else
{
effKeys << EffectKey( &( *it ), it->name );
effKeys << EffectKey( desc, desc->name );
}
}