improved VST-effect support
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@413 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
21
ChangeLog
21
ChangeLog
@@ -1,12 +1,31 @@
|
||||
2006-09-23 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* plugins/vst_effect/vst_control_dialog.cpp:
|
||||
save and load settings of VST-effect - with this VST-effect-support is
|
||||
complete for now
|
||||
|
||||
* plugins/vst_base/lvsl_client.h:
|
||||
* plugins/vst_base/lvsl_client.cpp:
|
||||
* plugins/vestige/vestige.cpp:
|
||||
moved code from vestigeInstrument::saveSettings() and
|
||||
vestigeInstrument::loadSettings() to remoteVSTPlugin
|
||||
|
||||
* plugins/ladspa_effect/ladspa_control_dialog.h:
|
||||
changed node-name from "controls" to "ladspacontrols" to be more
|
||||
consistent with naming-conventions
|
||||
|
||||
* plugins/ladspa_effect/ladspa_subplugin_features.h:
|
||||
* plugins/ladspa_effect/ladspa_subplugin_features.cpp:
|
||||
moved ladspaSubPluginFeatures-code from LADSPA-base to where it
|
||||
belongs/is used - in LADSPA-effect
|
||||
|
||||
* data/projects/demos/Zvonsully-RaceTheZBeat.mmp:
|
||||
* data/projects/cool_songs/Malex-Horizon4.mmp:
|
||||
added two projects
|
||||
|
||||
* plugins/ladspa_base/ladspa_browser.cpp:
|
||||
* plugins/ladspa_base/ladspa_subplugin_features.cpp:
|
||||
removed #ifdef SINGLE_SOURCE_COMPILE, as this doesn't effect plugins -
|
||||
removed #ifdef SINGLE_SOURCE_COMPILE, as this doesn't affect plugins -
|
||||
fixes bug with undefined symbol in libladspaeffect.so
|
||||
|
||||
* configure.in:
|
||||
|
||||
@@ -12,8 +12,7 @@ AM_CXXFLAGS := $(AM_CXXFLAGS) $(QT_CXXFLAGS) -DPLUGIN_NAME="ladspabase"
|
||||
|
||||
|
||||
MOC_FILES = ./ladspa_control.moc \
|
||||
./ladspa_port_dialog.moc \
|
||||
./ladspa_subplugin_features.moc
|
||||
./ladspa_port_dialog.moc
|
||||
|
||||
BUILT_SOURCES = $(MOC_FILES)
|
||||
|
||||
@@ -26,7 +25,6 @@ pkglib_LTLIBRARIES = libladspabase.la
|
||||
|
||||
libladspabase_la_SOURCES = ladspa_base.cpp \
|
||||
ladspa_port_dialog.cpp \
|
||||
ladspa_subplugin_features.cpp \
|
||||
ladspa_2_lmms.cpp \
|
||||
ladspa_manager.cpp \
|
||||
ladspa_control.cpp \
|
||||
@@ -34,6 +32,5 @@ libladspabase_la_SOURCES = ladspa_base.cpp \
|
||||
ladspa_2_lmms.h \
|
||||
ladspa_control.h \
|
||||
ladspa_port_dialog.h \
|
||||
ladspa_subplugin_features.h \
|
||||
ladspa_base.h
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ AM_CXXFLAGS := $(AM_CXXFLAGS) $(QT_CXXFLAGS) -DPLUGIN_NAME="ladspaeffect"
|
||||
$(MOC) -o $@ $<
|
||||
|
||||
|
||||
MOC_FILES = ./ladspa_control_dialog.moc
|
||||
MOC_FILES = ./ladspa_control_dialog.moc
|
||||
|
||||
|
||||
BUILT_SOURCES = $(MOC_FILES) ./embedded_resources.h
|
||||
@@ -29,6 +29,11 @@ CLEANFILES = $(MOC_FILES) ./embedded_resources.h
|
||||
|
||||
pkglib_LTLIBRARIES= libladspaeffect.la
|
||||
|
||||
libladspaeffect_la_SOURCES = ladspa_effect.cpp ladspa_control_dialog.cpp ladspa_effect.h ladspa_control_dialog.h
|
||||
libladspaeffect_la_SOURCES = ladspa_effect.cpp \
|
||||
ladspa_control_dialog.cpp \
|
||||
ladspa_subplugin_features.cpp \
|
||||
ladspa_effect.h \
|
||||
ladspa_control_dialog.h \
|
||||
ladspa_subplugin_features.h
|
||||
|
||||
$(libladspaeffect_la_SOURCES): ./embedded_resources.h
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
virtual void FASTCALL loadSettings( const QDomElement & _this );
|
||||
inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "controls" );
|
||||
return( "ladspacontrols" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -178,5 +178,3 @@ void ladspaSubPluginFeatures::listSubPluginKeys( engine * _eng,
|
||||
}
|
||||
|
||||
|
||||
|
||||
#include "ladspa_subplugin_features.moc"
|
||||
@@ -178,30 +178,7 @@ void vestigeInstrument::loadSettings( const QDomElement & _this )
|
||||
m_pluginMutex.lock();
|
||||
if( m_plugin != NULL )
|
||||
{
|
||||
if( m_plugin->pluginWidget() != NULL )
|
||||
{
|
||||
if( _this.attribute( "guivisible" ).toInt() )
|
||||
{
|
||||
m_plugin->pluginWidget()->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_plugin->pluginWidget()->hide();
|
||||
}
|
||||
}
|
||||
const Sint32 num_params = _this.attribute(
|
||||
"numparams" ).toInt();
|
||||
if( num_params > 0 )
|
||||
{
|
||||
QMap<QString, QString> dump;
|
||||
for( Sint32 i = 0; i < num_params; ++i )
|
||||
{
|
||||
const QString key = "param" +
|
||||
QString::number( i );
|
||||
dump[key] = _this.attribute( key );
|
||||
}
|
||||
m_plugin->setParameterDump( dump );
|
||||
}
|
||||
m_plugin->loadSettings( _this );
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
}
|
||||
@@ -215,22 +192,7 @@ void vestigeInstrument::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
m_pluginMutex.lock();
|
||||
if( m_plugin != NULL )
|
||||
{
|
||||
if( m_plugin->pluginWidget() != NULL )
|
||||
{
|
||||
_this.setAttribute( "guivisible",
|
||||
m_plugin->pluginWidget()->isVisible() );
|
||||
}
|
||||
const QMap<QString, QString> & dump = m_plugin->parameterDump();
|
||||
_this.setAttribute( "numparams", dump.size() );
|
||||
for( QMap<QString, QString>::const_iterator it = dump.begin();
|
||||
it != dump.end(); ++it )
|
||||
{
|
||||
#ifdef QT4
|
||||
_this.setAttribute( it.key(), it.value() );
|
||||
#else
|
||||
_this.setAttribute( it.key(), it.data() );
|
||||
#endif
|
||||
}
|
||||
m_plugin->saveSettings( _doc, _this );
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
}
|
||||
@@ -255,7 +217,7 @@ void vestigeInstrument::setParameter( const QString & _param,
|
||||
const bool set_ch_name = ( m_plugin != NULL &&
|
||||
getInstrumentTrack()->name() == m_plugin->name() ) ||
|
||||
getInstrumentTrack()->name() ==
|
||||
instrumentTrack::tr( "Default" );
|
||||
instrumentTrack::tr( "Default" );
|
||||
m_pluginMutex.unlock();
|
||||
|
||||
closePlugin();
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
remoteVSTPlugin::remoteVSTPlugin( const QString & _plugin, engine * _engine ) :
|
||||
QObject(),
|
||||
engineObject( _engine ),
|
||||
journallingObject( _engine ),
|
||||
m_failed( TRUE ),
|
||||
m_plugin( _plugin ),
|
||||
m_pluginWidget( NULL ),
|
||||
@@ -389,6 +389,58 @@ void remoteVSTPlugin::enqueueMidiEvent( const midiEvent & _event,
|
||||
|
||||
|
||||
|
||||
void remoteVSTPlugin::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
if( pluginWidget() != NULL )
|
||||
{
|
||||
if( _this.attribute( "guivisible" ).toInt() )
|
||||
{
|
||||
pluginWidget()->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
pluginWidget()->hide();
|
||||
}
|
||||
}
|
||||
const Sint32 num_params = _this.attribute( "numparams" ).toInt();
|
||||
if( num_params > 0 )
|
||||
{
|
||||
QMap<QString, QString> dump;
|
||||
for( Sint32 i = 0; i < num_params; ++i )
|
||||
{
|
||||
const QString key = "param" +
|
||||
QString::number( i );
|
||||
dump[key] = _this.attribute( key );
|
||||
}
|
||||
setParameterDump( dump );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void remoteVSTPlugin::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
{
|
||||
if( pluginWidget() != NULL )
|
||||
{
|
||||
_this.setAttribute( "guivisible", pluginWidget()->isVisible() );
|
||||
}
|
||||
const QMap<QString, QString> & dump = parameterDump();
|
||||
_this.setAttribute( "numparams", dump.size() );
|
||||
for( QMap<QString, QString>::const_iterator it = dump.begin();
|
||||
it != dump.end(); ++it )
|
||||
{
|
||||
#ifdef QT4
|
||||
_this.setAttribute( it.key(), it.value() );
|
||||
#else
|
||||
_this.setAttribute( it.key(), it.data() );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void remoteVSTPlugin::setTempo( bpm_t _bpm )
|
||||
{
|
||||
lock();
|
||||
|
||||
@@ -32,11 +32,13 @@
|
||||
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QMutex>
|
||||
#include <Qt/QtXml>
|
||||
|
||||
#else
|
||||
|
||||
#include <qstring.h>
|
||||
#include <qmutex.h>
|
||||
#include <qdom.h>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -44,11 +46,11 @@
|
||||
#include "mixer.h"
|
||||
#include "communication.h"
|
||||
#include "midi.h"
|
||||
#include "engine.h"
|
||||
#include "journalling_object.h"
|
||||
|
||||
|
||||
|
||||
class remoteVSTPlugin : public QObject, public engineObject
|
||||
class remoteVSTPlugin : public QObject, public journallingObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -114,6 +116,14 @@ public:
|
||||
return( m_failed );
|
||||
}
|
||||
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _this );
|
||||
|
||||
inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "vstplugin" );
|
||||
}
|
||||
|
||||
|
||||
public slots:
|
||||
void setTempo( bpm_t _bpm );
|
||||
|
||||
@@ -68,18 +68,33 @@ vstControlDialog::~vstControlDialog()
|
||||
|
||||
|
||||
|
||||
void FASTCALL vstControlDialog::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
m_effect->closePlugin();
|
||||
m_effect->openPlugin( _this.attribute( "plugin" ) );
|
||||
m_effect->m_pluginMutex.lock();
|
||||
if( m_effect->m_plugin != NULL )
|
||||
{
|
||||
m_effect->m_plugin->loadSettings( _this );
|
||||
}
|
||||
m_effect->m_pluginMutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void FASTCALL vstControlDialog::saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _this )
|
||||
{
|
||||
// TODO: save settings of plugin
|
||||
_this.setAttribute( "plugin", m_effect->m_key.user.toString() );
|
||||
m_effect->m_pluginMutex.lock();
|
||||
if( m_effect->m_plugin != NULL )
|
||||
{
|
||||
m_effect->m_plugin->saveSettings( _doc, _this );
|
||||
}
|
||||
m_effect->m_pluginMutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void FASTCALL vstControlDialog::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
// TODO: load settings of plugin
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user