diff --git a/ChangeLog b/ChangeLog index 7ded209f4..91cc8d7f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,12 +1,31 @@ 2006-09-23 Tobias Doerffel + * 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: diff --git a/plugins/ladspa_base/Makefile.am b/plugins/ladspa_base/Makefile.am index 78e623858..6a2237270 100644 --- a/plugins/ladspa_base/Makefile.am +++ b/plugins/ladspa_base/Makefile.am @@ -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 diff --git a/plugins/ladspa_effect/Makefile.am b/plugins/ladspa_effect/Makefile.am index 8696fbe5d..9c6959ec5 100644 --- a/plugins/ladspa_effect/Makefile.am +++ b/plugins/ladspa_effect/Makefile.am @@ -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 diff --git a/plugins/ladspa_effect/ladspa_control_dialog.h b/plugins/ladspa_effect/ladspa_control_dialog.h index 848486b39..62c328167 100644 --- a/plugins/ladspa_effect/ladspa_control_dialog.h +++ b/plugins/ladspa_effect/ladspa_control_dialog.h @@ -69,7 +69,7 @@ public: virtual void FASTCALL loadSettings( const QDomElement & _this ); inline virtual QString nodeName( void ) const { - return( "controls" ); + return( "ladspacontrols" ); } diff --git a/plugins/ladspa_base/ladspa_subplugin_features.cpp b/plugins/ladspa_effect/ladspa_subplugin_features.cpp similarity index 99% rename from plugins/ladspa_base/ladspa_subplugin_features.cpp rename to plugins/ladspa_effect/ladspa_subplugin_features.cpp index 969e76c63..9ec148736 100644 --- a/plugins/ladspa_base/ladspa_subplugin_features.cpp +++ b/plugins/ladspa_effect/ladspa_subplugin_features.cpp @@ -178,5 +178,3 @@ void ladspaSubPluginFeatures::listSubPluginKeys( engine * _eng, } - -#include "ladspa_subplugin_features.moc" diff --git a/plugins/ladspa_base/ladspa_subplugin_features.h b/plugins/ladspa_effect/ladspa_subplugin_features.h similarity index 100% rename from plugins/ladspa_base/ladspa_subplugin_features.h rename to plugins/ladspa_effect/ladspa_subplugin_features.h diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index c60cb48db..59ae95a91 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -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 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 & dump = m_plugin->parameterDump(); - _this.setAttribute( "numparams", dump.size() ); - for( QMap::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(); diff --git a/plugins/vst_base/lvsl_client.cpp b/plugins/vst_base/lvsl_client.cpp index b24fc53b4..a4041f43c 100644 --- a/plugins/vst_base/lvsl_client.cpp +++ b/plugins/vst_base/lvsl_client.cpp @@ -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 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 & dump = parameterDump(); + _this.setAttribute( "numparams", dump.size() ); + for( QMap::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(); diff --git a/plugins/vst_base/lvsl_client.h b/plugins/vst_base/lvsl_client.h index 58305898a..a75b89c62 100644 --- a/plugins/vst_base/lvsl_client.h +++ b/plugins/vst_base/lvsl_client.h @@ -32,11 +32,13 @@ #include #include +#include #else #include #include +#include #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 ); diff --git a/plugins/vst_effect/vst_control_dialog.cpp b/plugins/vst_effect/vst_control_dialog.cpp index ceca727a3..d3416d4d5 100644 --- a/plugins/vst_effect/vst_control_dialog.cpp +++ b/plugins/vst_effect/vst_control_dialog.cpp @@ -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 -} - -