Merge branch 'misc-lv2-preparation'
This commit is contained in:
@@ -74,6 +74,7 @@ class LMMS_EXPORT Knob : public QWidget, public FloatModelView
|
||||
public:
|
||||
Knob( knobTypes _knob_num, QWidget * _parent = NULL, const QString & _name = QString() );
|
||||
Knob( QWidget * _parent = NULL, const QString & _name = QString() ); //!< default ctor
|
||||
Knob( const Knob& other ) = delete;
|
||||
virtual ~Knob();
|
||||
|
||||
// TODO: remove
|
||||
|
||||
@@ -90,10 +90,12 @@ AutomatableModel * Plugin::childModel( const QString & )
|
||||
|
||||
|
||||
#include "PluginFactory.h"
|
||||
Plugin * Plugin::instantiate( const QString& pluginName, Model * parent,
|
||||
void * data )
|
||||
Plugin * Plugin::instantiate(const QString& pluginName, Model * parent,
|
||||
void *data)
|
||||
{
|
||||
const PluginFactory::PluginInfo& pi = pluginFactory->pluginInfo(pluginName.toUtf8());
|
||||
|
||||
Plugin* inst;
|
||||
if( pi.isNull() )
|
||||
{
|
||||
if( gui )
|
||||
@@ -104,23 +106,31 @@ Plugin * Plugin::instantiate( const QString& pluginName, Model * parent,
|
||||
arg( pluginName ).arg( pluginFactory->errorString(pluginName) ),
|
||||
QMessageBox::Ok | QMessageBox::Default );
|
||||
}
|
||||
return new DummyPlugin();
|
||||
inst = new DummyPlugin();
|
||||
}
|
||||
|
||||
InstantiationHook instantiationHook = ( InstantiationHook ) pi.library->resolve( "lmms_plugin_main" );
|
||||
if( instantiationHook == NULL )
|
||||
else
|
||||
{
|
||||
if( gui )
|
||||
InstantiationHook instantiationHook;
|
||||
if ((instantiationHook = ( InstantiationHook ) pi.library->resolve( "lmms_plugin_main" )))
|
||||
{
|
||||
QMessageBox::information( NULL,
|
||||
tr( "Error while loading plugin" ),
|
||||
tr( "Failed to load plugin \"%1\"!").arg( pluginName ),
|
||||
QMessageBox::Ok | QMessageBox::Default );
|
||||
inst = instantiationHook(parent, data);
|
||||
if(!inst) {
|
||||
inst = new DummyPlugin();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( gui )
|
||||
{
|
||||
QMessageBox::information( NULL,
|
||||
tr( "Error while loading plugin" ),
|
||||
tr( "Failed to load plugin \"%1\"!").arg( pluginName ),
|
||||
QMessageBox::Ok | QMessageBox::Default );
|
||||
}
|
||||
inst = new DummyPlugin();
|
||||
}
|
||||
return new DummyPlugin();
|
||||
}
|
||||
|
||||
Plugin * inst = instantiationHook( parent, data );
|
||||
return inst;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "ui_EffectSelectDialog.h"
|
||||
|
||||
#include "gui_templates.h"
|
||||
#include "DummyEffect.h"
|
||||
#include "embed.h"
|
||||
#include "PluginFactory.h"
|
||||
|
||||
@@ -147,12 +148,17 @@ EffectSelectDialog::~EffectSelectDialog()
|
||||
|
||||
Effect * EffectSelectDialog::instantiateSelectedPlugin( EffectChain * _parent )
|
||||
{
|
||||
if( !m_currentSelection.name.isEmpty() && m_currentSelection.desc )
|
||||
Effect* result = nullptr;
|
||||
if(!m_currentSelection.name.isEmpty() && m_currentSelection.desc)
|
||||
{
|
||||
return Effect::instantiate( m_currentSelection.desc->name,
|
||||
_parent, &m_currentSelection );
|
||||
result = Effect::instantiate(m_currentSelection.desc->name,
|
||||
_parent, &m_currentSelection);
|
||||
}
|
||||
return NULL;
|
||||
if(!result)
|
||||
{
|
||||
result = new DummyEffect(_parent, QDomElement());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user