From e30e5583d36004ce4928e0c1dbfb3603d5a85e64 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Thu, 21 Sep 2006 16:17:17 +0000 Subject: [PATCH] VST-effect-support git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@408 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 30 +++ TODO | 2 + configure.in | 6 +- include/effect_chain.h | 3 +- include/effect_control_dialog.h | 2 +- plugins/Makefile.am | 4 +- plugins/ladspa_base/Makefile.am | 2 +- plugins/ladspa_base/ladspa_2_lmms.cpp | 7 - plugins/ladspa_base/ladspa_2_lmms.h | 5 +- plugins/ladspa_base/ladspa_base.h | 5 - plugins/ladspa_base/ladspa_control.cpp | 10 +- plugins/ladspa_base/ladspa_control.h | 7 +- plugins/ladspa_base/ladspa_manager.cpp | 13 +- plugins/ladspa_base/ladspa_port_dialog.cpp | 10 +- plugins/ladspa_base/ladspa_port_dialog.h | 7 +- .../ladspa_base/ladspa_subplugin_features.cpp | 8 +- .../ladspa_base/ladspa_subplugin_features.h | 9 +- plugins/ladspa_effect/Makefile.am | 2 +- .../ladspa_effect/ladspa_control_dialog.cpp | 6 +- plugins/ladspa_effect/ladspa_control_dialog.h | 8 +- plugins/vestige/Makefile.am | 20 +- plugins/vestige/vestige.cpp | 10 +- plugins/vestige/vestige.h | 1 - plugins/vst_base/Makefile.am | 35 +++ plugins/{vestige => vst_base}/communication.h | 0 plugins/{vestige => vst_base}/lvsl_client.cpp | 18 +- plugins/{vestige => vst_base}/lvsl_client.h | 10 +- plugins/{vestige => vst_base}/lvsl_server.c | 0 plugins/vst_base/vst_base.cpp | 47 ++++ plugins/vst_effect/Makefile.am | 40 ++++ plugins/vst_effect/logo.png | Bin 0 -> 3280 bytes plugins/vst_effect/vst_control_dialog.cpp | 85 +++++++ plugins/vst_effect/vst_control_dialog.h | 59 +++++ plugins/vst_effect/vst_effect.cpp | 213 ++++++++++++++++++ plugins/vst_effect/vst_effect.h | 88 ++++++++ plugins/vst_effect/vst_subplugin_features.cpp | 103 +++++++++ plugins/vst_effect/vst_subplugin_features.h | 60 +++++ 37 files changed, 822 insertions(+), 113 deletions(-) create mode 100644 plugins/vst_base/Makefile.am rename plugins/{vestige => vst_base}/communication.h (100%) rename plugins/{vestige => vst_base}/lvsl_client.cpp (97%) rename plugins/{vestige => vst_base}/lvsl_client.h (96%) rename plugins/{vestige => vst_base}/lvsl_server.c (100%) create mode 100644 plugins/vst_base/vst_base.cpp create mode 100644 plugins/vst_effect/Makefile.am create mode 100644 plugins/vst_effect/logo.png create mode 100644 plugins/vst_effect/vst_control_dialog.cpp create mode 100644 plugins/vst_effect/vst_control_dialog.h create mode 100644 plugins/vst_effect/vst_effect.cpp create mode 100644 plugins/vst_effect/vst_effect.h create mode 100644 plugins/vst_effect/vst_subplugin_features.cpp create mode 100644 plugins/vst_effect/vst_subplugin_features.h diff --git a/ChangeLog b/ChangeLog index d91b43700..f140229ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,33 @@ +2006-09-21 Tobias Doerffel + + * plugins/vst_effect/Makefile.am: + * plugins/vst_effect/logo.png: + * plugins/vst_effect/vst_effect.h: + * plugins/vst_effect/vst_effect.cpp: + * plugins/vst_effect/vst_control_dialog.h: + * plugins/vst_effect/vst_control_dialog.cpp: + * plugins/vst_effect/vst_subplugin_features.h: + * plugins/vst_effect/vst_subplugin_features.cpp: + added plugin for supporting VST-effects inside LMMS - currently very + experimental and incomplete, but it compiles and works somehow ;-) + + * plugins/ladspa_effect/Makefile.am: + generating ladspa_effect.moc not needed ynmore + + * plugins/vestige/Makefile.am: + - use new vstbase-library + - do not link against X11, as not needed anymore + + * plugins/Makefile.am: + * plugins/vst_base/Makefile.am: + * plugins/vst_base/communication.h: + * plugins/vst_base/lvsl_client.h: + * plugins/vst_base/lvsl_client.cpp: + * plugins/vst_base/lvsl_server.c: + * plugins/vst_base/vst_base.cpp: + moved LVSL-code into separate library for allowing multiple + LMMS-plugins to deal with VST-plugins + 2006-09-20 Tobias Doerffel * plugins/*/*.png: diff --git a/TODO b/TODO index c435e91bd..99fa06cce 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,5 @@ +- try to make vestige-plugin-dlls relative +- do song-editor-tempo-connection to vst-plugin inside remoteVSTPlugin - do not duplicate recorded notes when clicking on them - add/remove-steps button in bb-editor for adding/removing according number of steps to/from all patterns of visible beat/baseline - replace rest of wizard by simple directory-selection-dialog for working-dir when running the first time diff --git a/configure.in b/configure.in index 688f5eb71..e52f9440c 100644 --- a/configure.in +++ b/configure.in @@ -2,8 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.50) -AC_INIT(lmms, 0.2.1-svn20060920, lmms-devel/at/lists/dot/sf/dot/net) -AM_INIT_AUTOMAKE(lmms, 0.2.1-svn20060920) +AC_INIT(lmms, 0.2.1-svn20060921, lmms-devel/at/lists/dot/sf/dot/net) +AM_INIT_AUTOMAKE(lmms, 0.2.1-svn20060921) AM_CONFIG_HEADER(config.h) @@ -516,6 +516,8 @@ AC_CONFIG_FILES([Makefile plugins/triple_oscillator/Makefile plugins/vestige/Makefile plugins/vibed/Makefile + plugins/vst_base/Makefile + plugins/vst_effect/Makefile lmms.spec]) AC_OUTPUT diff --git a/include/effect_chain.h b/include/effect_chain.h index 915647fcd..e8249c7b1 100644 --- a/include/effect_chain.h +++ b/include/effect_chain.h @@ -72,7 +72,8 @@ private: bool m_bypassed; QMutex m_processLock; -}; + +} ; #endif diff --git a/include/effect_control_dialog.h b/include/effect_control_dialog.h index 43271c379..441648aa9 100644 --- a/include/effect_control_dialog.h +++ b/include/effect_control_dialog.h @@ -48,13 +48,13 @@ class track; class effectControlDialog : public QWidget, public journallingObject { Q_OBJECT - public: effectControlDialog( QWidget * _parent, effect * _eff ); virtual ~effectControlDialog(); virtual ch_cnt_t getControlCount( void ) = 0; + signals: void closed(); diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 9fd966f7a..19407a2a4 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -1,5 +1,5 @@ if VST_SUPPORT -VESTIGE_SUBDIR=vestige +VST_DIRS=vst_base vst_effect vestige endif if LADSPA_SUPPORT @@ -10,5 +10,5 @@ if STK_SUPPORT STK_DIR=stk endif -SUBDIRS = audio_file_processor bit_invader flp_import $(LADSPA_DIRS) midi_import organic plucked_string_synth $(STK_DIR) triple_oscillator $(VESTIGE_SUBDIR) vibed +SUBDIRS = audio_file_processor bit_invader flp_import $(LADSPA_DIRS) midi_import organic plucked_string_synth $(STK_DIR) triple_oscillator $(VST_DIRS) vibed diff --git a/plugins/ladspa_base/Makefile.am b/plugins/ladspa_base/Makefile.am index 0b2a9000c..78e623858 100644 --- a/plugins/ladspa_base/Makefile.am +++ b/plugins/ladspa_base/Makefile.am @@ -22,7 +22,7 @@ CLEANFILES = $(MOC_FILES) -pkglib_LTLIBRARIES= libladspabase.la +pkglib_LTLIBRARIES = libladspabase.la libladspabase_la_SOURCES = ladspa_base.cpp \ ladspa_port_dialog.cpp \ diff --git a/plugins/ladspa_base/ladspa_2_lmms.cpp b/plugins/ladspa_base/ladspa_2_lmms.cpp index 803093758..d3496b4fa 100644 --- a/plugins/ladspa_base/ladspa_2_lmms.cpp +++ b/plugins/ladspa_base/ladspa_2_lmms.cpp @@ -1,5 +1,3 @@ -#ifndef SINGLE_SOURCE_COMPILE - /* * ladspa_2_lmms.cpp - class that identifies and instantiates LADSPA effects * for use with LMMS @@ -25,8 +23,6 @@ * */ -#include "ladspa_manager.h" -#ifdef LADSPA_SUPPORT #include "ladspa_2_lmms.h" @@ -141,6 +137,3 @@ QString ladspa2LMMS::getShortName( const ladspa_key_t & _key ) #undef indexOf -#endif - -#endif diff --git a/plugins/ladspa_base/ladspa_2_lmms.h b/plugins/ladspa_base/ladspa_2_lmms.h index 70c7ffbd5..caabc04d3 100644 --- a/plugins/ladspa_base/ladspa_2_lmms.h +++ b/plugins/ladspa_base/ladspa_2_lmms.h @@ -28,10 +28,9 @@ #include "ladspa_manager.h" -#ifdef LADSPA_SUPPORT - #include "engine.h" + class ladspa2LMMS: public ladspaManager { @@ -80,7 +79,5 @@ private: friend class engine; }; - -#endif #endif diff --git a/plugins/ladspa_base/ladspa_base.h b/plugins/ladspa_base/ladspa_base.h index c84bbf28c..0550af185 100644 --- a/plugins/ladspa_base/ladspa_base.h +++ b/plugins/ladspa_base/ladspa_base.h @@ -27,9 +27,6 @@ #define _LADSPA_BASE_H #include "ladspa_manager.h" - -#ifdef LADSPA_SUPPORT - #include "plugin.h" class ladspaControl; @@ -89,6 +86,4 @@ inline plugin::descriptor::subPluginFeatures::key ladspaKeyToSubPluginKey( } -#endif - #endif diff --git a/plugins/ladspa_base/ladspa_control.cpp b/plugins/ladspa_base/ladspa_control.cpp index 2020d5d03..163818150 100644 --- a/plugins/ladspa_base/ladspa_control.cpp +++ b/plugins/ladspa_base/ladspa_control.cpp @@ -1,5 +1,3 @@ -#ifndef SINGLE_SOURCE_COMPILE - /* * ladspa_control.cpp - widget for controlling a LADSPA port * @@ -24,8 +22,8 @@ * */ -#include "ladspa_manager.h" -#ifdef LADSPA_SUPPORT + +#include "qt3support.h" #ifdef QT4 @@ -395,7 +393,3 @@ void FASTCALL ladspaControl::setLink( bool _state ) #include "ladspa_control.moc" - -#endif - -#endif diff --git a/plugins/ladspa_base/ladspa_control.h b/plugins/ladspa_base/ladspa_control.h index 43d73ba81..7af464239 100644 --- a/plugins/ladspa_base/ladspa_control.h +++ b/plugins/ladspa_base/ladspa_control.h @@ -25,8 +25,7 @@ #ifndef _LADSPA_CONTROL_H #define _LADSPA_CONTROL_H -#include "ladspa_manager.h" -#ifdef LADSPA_SUPPORT +#include "qt3support.h" #ifdef QT4 @@ -47,6 +46,8 @@ #include "track.h" #include "knob.h" #include "led_checkbox.h" +#include "ladspa_manager.h" + typedef struct portDescription port_desc_t; @@ -112,5 +113,3 @@ private: }; #endif - -#endif diff --git a/plugins/ladspa_base/ladspa_manager.cpp b/plugins/ladspa_base/ladspa_manager.cpp index c40a62afa..9cae7df6d 100644 --- a/plugins/ladspa_base/ladspa_manager.cpp +++ b/plugins/ladspa_base/ladspa_manager.cpp @@ -1,5 +1,3 @@ -#ifndef SINGLE_SOURCE_COMPILE - /* * ladspa_manager.cpp - a class to manage loading and instantiation * of ladspa plugins @@ -26,10 +24,7 @@ */ -#include "ladspa_manager.h" - -#ifdef LADSPA_SUPPORT - +#include "qt3support.h" #ifdef QT4 @@ -51,6 +46,7 @@ #include #include "config_mgr.h" +#include "ladspa_manager.h" @@ -1015,8 +1011,3 @@ bool FASTCALL ladspaManager::cleanup( const ladspa_key_t & _plugin, #undef value - -#endif - - -#endif diff --git a/plugins/ladspa_base/ladspa_port_dialog.cpp b/plugins/ladspa_base/ladspa_port_dialog.cpp index 052e057e3..ce3266a1c 100644 --- a/plugins/ladspa_base/ladspa_port_dialog.cpp +++ b/plugins/ladspa_base/ladspa_port_dialog.cpp @@ -1,5 +1,3 @@ -#ifndef SINGLE_SOURCE_COMPILE - /* * ladspa_port_dialog.cpp - dialog to test a LADSPA plugin * @@ -26,9 +24,6 @@ #include "qt3support.h" -#include "ladspa_manager.h" -#ifdef LADSPA_SUPPORT - #ifdef QT4 #include @@ -269,8 +264,7 @@ ladspaPortDialog::~ ladspaPortDialog() { } + + #include "ladspa_port_dialog.moc" -#endif - -#endif diff --git a/plugins/ladspa_base/ladspa_port_dialog.h b/plugins/ladspa_base/ladspa_port_dialog.h index 7b010ed1d..cf00cf903 100644 --- a/plugins/ladspa_base/ladspa_port_dialog.h +++ b/plugins/ladspa_base/ladspa_port_dialog.h @@ -21,11 +21,12 @@ * Boston, MA 02110-1301 USA. * */ + #ifndef _LADSPA_PORT_DIALOG_H #define _LADSPA_PORT_DIALOG_H -#include "ladspa_manager.h" -#ifdef LADSPA_SUPPORT +#include "qt3support.h" + #ifdef QT4 @@ -57,5 +58,3 @@ private: #endif -#endif - diff --git a/plugins/ladspa_base/ladspa_subplugin_features.cpp b/plugins/ladspa_base/ladspa_subplugin_features.cpp index 8b713f8f2..53018b5ec 100644 --- a/plugins/ladspa_base/ladspa_subplugin_features.cpp +++ b/plugins/ladspa_base/ladspa_subplugin_features.cpp @@ -28,10 +28,6 @@ */ -#include "ladspa_manager.h" - -#ifdef LADSPA_SUPPORT - #ifdef QT4 @@ -50,7 +46,7 @@ #include "ladspa_subplugin_features.h" -#include "ladspa_base.h" +#include "ladspa_2_lmms.h" #include "mixer.h" #include "audio_device.h" @@ -188,5 +184,3 @@ void ladspaSubPluginFeatures::listSubPluginKeys( engine * _eng, #include "ladspa_subplugin_features.moc" #endif - -#endif diff --git a/plugins/ladspa_base/ladspa_subplugin_features.h b/plugins/ladspa_base/ladspa_subplugin_features.h index e52da63eb..ca3b7bbbb 100644 --- a/plugins/ladspa_base/ladspa_subplugin_features.h +++ b/plugins/ladspa_base/ladspa_subplugin_features.h @@ -30,12 +30,7 @@ #define _LADSPA_SUBPLUGIN_FEATURES_H #include "plugin.h" -#include "ladspa_2_lmms.h" - -#ifdef LADSPA_SUPPORT - -class QLabel; -class ladspa2LMMS; +#include "ladspa_base.h" class ladspaSubPluginDescriptionWidget : public QWidget @@ -64,5 +59,3 @@ public: } ; #endif - -#endif diff --git a/plugins/ladspa_effect/Makefile.am b/plugins/ladspa_effect/Makefile.am index 8aef4d9bc..8696fbe5d 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_effect.moc ./ladspa_control_dialog.moc +MOC_FILES = ./ladspa_control_dialog.moc BUILT_SOURCES = $(MOC_FILES) ./embedded_resources.h diff --git a/plugins/ladspa_effect/ladspa_control_dialog.cpp b/plugins/ladspa_effect/ladspa_control_dialog.cpp index 49222adb6..19f3b718e 100644 --- a/plugins/ladspa_effect/ladspa_control_dialog.cpp +++ b/plugins/ladspa_effect/ladspa_control_dialog.cpp @@ -1,5 +1,3 @@ -#ifndef SINGLE_SOURCE_COMPILE - /* * ladspa_control_dialog.cpp - dialog for displaying and editing control port * values for LADSPA plugins @@ -26,6 +24,8 @@ */ +#include "qt3support.h" + #ifdef QT4 #include @@ -281,5 +281,3 @@ void ladspaControlDialog::link( bool _state ) #include "ladspa_control_dialog.moc" -#endif - diff --git a/plugins/ladspa_effect/ladspa_control_dialog.h b/plugins/ladspa_effect/ladspa_control_dialog.h index d15b21882..848486b39 100644 --- a/plugins/ladspa_effect/ladspa_control_dialog.h +++ b/plugins/ladspa_effect/ladspa_control_dialog.h @@ -26,9 +26,7 @@ #ifndef _LADSPA_CONTROL_DIALOG_H #define _LADSPA_CONTROL_DIALOG_H -#include "ladspa_manager.h" - -#ifdef LADSPA_SUPPORT +#include "qt3support.h" #ifdef QT4 @@ -42,8 +40,6 @@ #endif -#include "qt3support.h" - #include "effect_control_dialog.h" #include "ladspa_control.h" #include "track.h" @@ -99,5 +95,3 @@ private: } ; #endif - -#endif diff --git a/plugins/vestige/Makefile.am b/plugins/vestige/Makefile.am index 2a32834c2..e353edb8b 100644 --- a/plugins/vestige/Makefile.am +++ b/plugins/vestige/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS = foreign 1.4 -INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src/lib -I. -I/usr/X11R6/include +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src/lib -I. -I../vst_base AM_CXXFLAGS := $(AM_CXXFLAGS) $(QT_CXXFLAGS) -DPLUGIN_NAME="vestige" @@ -24,22 +24,10 @@ EXTRA_DIST = $(EMBEDDED_RESOURCES) pkglib_LTLIBRARIES = libvestige.la -libvestige_la_SOURCES = vestige.cpp vestige.h lvsl_client.cpp lvsl_client.h +libvestige_la_SOURCES = vestige.cpp vestige.h +libvestige_la_LIBADD = -L../vst_base -lvstbase $(libvestige_la_SOURCES): ./embedded_resources.h - -CC = wineg++ -pkglib_PROGRAMS = lvsl_server -lvsl_server_SOURCES = lvsl_server.c communication.h -lvsl_server_LDFLAGS = -mwindows -L/usr/X11R6/lib -lX11 -lpthread -o $(pkglib_PROGRAMS) -lvsl_server_LINK = wineg++ -nobase_pkglib_DATA = $(pkglib_PROGRAMS).exe.so - -CLEANFILES = $(MOC_FILES) ./embedded_resources.h $(nobase_pkglib_DATA) - - -install-exec-hook: - cd $(DESTDIR)$(pkglibdir) ; \ - strip $(nobase_pkglib_DATA) +CLEANFILES = $(MOC_FILES) ./embedded_resources.h diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index 1ddd44cce..c60cb48db 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -108,9 +108,6 @@ vestigeInstrument::vestigeInstrument( instrumentTrack * _channel_track ) : setErasePixmap( *s_artwork ); #endif - connect( eng()->getSongEditor(), SIGNAL( tempoChanged( bpm_t ) ), - this, SLOT( changeTempo( bpm_t ) ) ); - m_openPluginButton = new pixmapButton( this, NULL, eng(), NULL ); m_openPluginButton->setCheckable( FALSE ); m_openPluginButton->setCursor( Qt::PointingHandCursor ); @@ -300,6 +297,9 @@ void vestigeInstrument::setParameter( const QString & _param, return; }*/ m_plugin->showEditor(); + connect( eng()->getSongEditor(), + SIGNAL( tempoChanged( bpm_t ) ), + m_plugin, SLOT( setTempo( bpm_t ) ) ); m_plugin->setTempo( eng()->getSongEditor()->getTempo() ); if( set_ch_name == TRUE ) { @@ -500,7 +500,7 @@ void vestigeInstrument::noteOffAll( void ) - +/* void vestigeInstrument::changeTempo( bpm_t _new_tempo ) { m_pluginMutex.lock(); @@ -510,7 +510,7 @@ void vestigeInstrument::changeTempo( bpm_t _new_tempo ) } m_pluginMutex.unlock(); } - +*/ diff --git a/plugins/vestige/vestige.h b/plugins/vestige/vestige.h index 2c42e6c29..82d96ed4e 100644 --- a/plugins/vestige/vestige.h +++ b/plugins/vestige/vestige.h @@ -89,7 +89,6 @@ protected slots: void openPlugin( void ); void toggleGUI( void ); void noteOffAll( void ); - void changeTempo( bpm_t _new_tempo ); protected: diff --git a/plugins/vst_base/Makefile.am b/plugins/vst_base/Makefile.am new file mode 100644 index 000000000..df22da7c3 --- /dev/null +++ b/plugins/vst_base/Makefile.am @@ -0,0 +1,35 @@ +AUTOMAKE_OPTIONS = foreign 1.4 + + +INCLUDES = -I$(top_srcdir)/include -I. + + +AM_CXXFLAGS := $(AM_CXXFLAGS) $(QT_CXXFLAGS) -DPLUGIN_NAME="vstbase" + +%.moc: ./%.h + $(MOC) -o $@ $< + + +MOC_FILES = ./lvsl_client.moc + +BUILT_SOURCES = $(MOC_FILES) + +pkglib_LTLIBRARIES = libvstbase.la + +libvstbase_la_SOURCES = vst_base.cpp \ + lvsl_client.cpp \ + lvsl_client.h + +CC = wineg++ +pkglib_PROGRAMS = lvsl_server +lvsl_server_SOURCES = lvsl_server.c communication.h +lvsl_server_LDFLAGS = -mwindows -lpthread -o $(pkglib_PROGRAMS) +lvsl_server_LINK = wineg++ +nobase_pkglib_DATA = $(pkglib_PROGRAMS).exe.so + +CLEANFILES = $(MOC_FILES) $(nobase_pkglib_DATA) + +install-exec-hook: + cd $(DESTDIR)$(pkglibdir) ; \ + strip $(nobase_pkglib_DATA) + diff --git a/plugins/vestige/communication.h b/plugins/vst_base/communication.h similarity index 100% rename from plugins/vestige/communication.h rename to plugins/vst_base/communication.h diff --git a/plugins/vestige/lvsl_client.cpp b/plugins/vst_base/lvsl_client.cpp similarity index 97% rename from plugins/vestige/lvsl_client.cpp rename to plugins/vst_base/lvsl_client.cpp index 3659efbad..0e886bc8e 100644 --- a/plugins/vestige/lvsl_client.cpp +++ b/plugins/vst_base/lvsl_client.cpp @@ -37,6 +37,7 @@ #include #include +#include #include "qxembed.h" @@ -85,6 +86,7 @@ remoteVSTPlugin::remoteVSTPlugin( const QString & _plugin, engine * _engine ) : + QObject(), engineObject( _engine ), m_failed( TRUE ), m_plugin( _plugin ), @@ -118,6 +120,7 @@ remoteVSTPlugin::remoteVSTPlugin( const QString & _plugin, engine * _engine ) : dup2( m_pipes[0][0], 0 ); dup2( m_pipes[1][1], 1 ); QString lvsl_server_exec = configManager::inst()->pluginDir() + + QDir::separator() + "lvsl_server"; execlp( lvsl_server_exec. #ifdef QT4 @@ -151,9 +154,15 @@ remoteVSTPlugin::remoteVSTPlugin( const QString & _plugin, engine * _engine ) : default: break; } writeValueS( hlang ); - + + QString p = m_plugin; + if( QFileInfo( p ).dir().isRelative() ) + { + p = configManager::inst()->vstDir() + QDir::separator() + p; + } + printf("loading %s\n", p.ascii()); writeValueS( VST_LOAD_PLUGIN ); - writeStringS( m_plugin. + writeStringS( p. #ifdef QT4 toAscii().constData() #else @@ -380,7 +389,7 @@ void remoteVSTPlugin::enqueueMidiEvent( const midiEvent & _event, -void remoteVSTPlugin::setTempo( const bpm_t _bpm ) +void remoteVSTPlugin::setTempo( bpm_t _bpm ) { lock(); writeValueS( VST_BPM ); @@ -585,3 +594,6 @@ Sint16 remoteVSTPlugin::processNextMessage( void ) } + +#include "lvsl_client.moc" + diff --git a/plugins/vestige/lvsl_client.h b/plugins/vst_base/lvsl_client.h similarity index 96% rename from plugins/vestige/lvsl_client.h rename to plugins/vst_base/lvsl_client.h index 8c0f1df80..58305898a 100644 --- a/plugins/vestige/lvsl_client.h +++ b/plugins/vst_base/lvsl_client.h @@ -48,11 +48,12 @@ -class remoteVSTPlugin : public engineObject +class remoteVSTPlugin : public QObject, public engineObject { + Q_OBJECT public: remoteVSTPlugin( const QString & _plugin, engine * _engine ); - ~remoteVSTPlugin(); + virtual ~remoteVSTPlugin(); void showEditor( void ); void hideEditor( void ); @@ -88,7 +89,6 @@ public: void FASTCALL enqueueMidiEvent( const midiEvent & _event, const f_cnt_t _frames_ahead ); - void FASTCALL setTempo( const bpm_t _bpm ); const QMap & parameterDump( void ); void setParameterDump( const QMap & _pdump ); @@ -115,6 +115,10 @@ public: } +public slots: + void setTempo( bpm_t _bpm ); + + private: template inline T readValueS( void ) const diff --git a/plugins/vestige/lvsl_server.c b/plugins/vst_base/lvsl_server.c similarity index 100% rename from plugins/vestige/lvsl_server.c rename to plugins/vst_base/lvsl_server.c diff --git a/plugins/vst_base/vst_base.cpp b/plugins/vst_base/vst_base.cpp new file mode 100644 index 000000000..9c4dbd10f --- /dev/null +++ b/plugins/vst_base/vst_base.cpp @@ -0,0 +1,47 @@ +/* + * vst_base.cpp - VST-base-code to be used by any LMMS-plugins dealing with VST- + * plugins + * + * Copyright (c) 2006 Tobias Doerffel + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + + +#include "plugin.h" + + +extern "C" +{ + +plugin::descriptor vstbase_plugin_descriptor = +{ + STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + "VST Base", + "library for all LMMS-plugins dealing with VST-plugins", + "Tobias Doerffel ", + 0x0100, + plugin::Library, + NULL, + NULL +} ; + +} + + diff --git a/plugins/vst_effect/Makefile.am b/plugins/vst_effect/Makefile.am new file mode 100644 index 000000000..8704875e6 --- /dev/null +++ b/plugins/vst_effect/Makefile.am @@ -0,0 +1,40 @@ +AUTOMAKE_OPTIONS = foreign 1.4 + + +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src/lib -I. -I../vst_base/ + + +AM_CXXFLAGS := $(AM_CXXFLAGS) $(QT_CXXFLAGS) -DPLUGIN_NAME="vsteffect" + + +%.moc: ./%.h + $(MOC) -o $@ $< + + +#MOC_FILES = ./vst_control_dialog.moc + + +BUILT_SOURCES = $(MOC_FILES) ./embedded_resources.h +EMBEDDED_RESOURCES = $(wildcard *png) + +./embedded_resources.h: $(EMBEDDED_RESOURCES) + $(top_builddir)/buildtools/bin2res $(EMBEDDED_RESOURCES) > $@ + +EXTRA_DIST = $(EMBEDDED_RESOURCES) + + +CLEANFILES = $(MOC_FILES) ./embedded_resources.h + + + +pkglib_LTLIBRARIES= libvsteffect.la + +libvsteffect_la_SOURCES = vst_effect.cpp \ + vst_control_dialog.cpp \ + vst_subplugin_features.cpp \ + vst_subplugin_features.h \ + vst_effect.h \ + vst_control_dialog.h +libvsteffect_la_LIBADD = -L../vst_base -lvstbase + +$(libvsteffect_la_SOURCES): ./embedded_resources.h diff --git a/plugins/vst_effect/logo.png b/plugins/vst_effect/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..6d757a2b04f134e5392f1384922633f11a039c46 GIT binary patch literal 3280 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 O0000 + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + + +#ifdef QT4 + +#include +#include + +#else + +#include +#include + +#endif + +#include "vst_effect.h" + + +vstControlDialog::vstControlDialog( QWidget * _parent, + vstEffect * _eff ) : + effectControlDialog( _parent, _eff ), + m_effect( _eff ) +{ + QVBoxLayout * l = new QVBoxLayout( this ); + QWidget * pw = m_effect->m_plugin->pluginWidget(); + if( pw ) + { + pw->reparent( this, QPoint( 0, 0 ) ); + pw->show(); + l->addWidget( pw ); + } +} + + + + +vstControlDialog::~vstControlDialog() +{ + QWidget * pw = m_effect->m_plugin->pluginWidget(); + if( pw ) + { + pw->reparent( parentWidget(), QPoint( 0, 0 ) ); + } +} + + + + +void FASTCALL vstControlDialog::saveSettings( QDomDocument & _doc, + QDomElement & _this ) +{ + // TODO: save settings of plugin +} + + + + +void FASTCALL vstControlDialog::loadSettings( const QDomElement & _this ) +{ + // TODO: load settings of plugin +} + + diff --git a/plugins/vst_effect/vst_control_dialog.h b/plugins/vst_effect/vst_control_dialog.h new file mode 100644 index 000000000..abe621a36 --- /dev/null +++ b/plugins/vst_effect/vst_control_dialog.h @@ -0,0 +1,59 @@ +/* + * vst_control_dialog.h - dialog for displaying GUI of VST-effect-plugin + * + * Copyright (c) 2006 Tobias Doerffel + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + +#ifndef _VST_CONTROL_DIALOG_H +#define _VST_CONTROL_DIALOG_H + +#include "effect_control_dialog.h" + + +class vstEffect; + + +class vstControlDialog : public effectControlDialog +{ +public: + vstControlDialog( QWidget * _parent, vstEffect * _eff ); + virtual ~vstControlDialog(); + + virtual void FASTCALL saveSettings( QDomDocument & _doc, + QDomElement & _parent ); + virtual void FASTCALL loadSettings( const QDomElement & _this ); + inline virtual QString nodeName( void ) const + { + return( "vstcontrols" ); + } + + virtual ch_cnt_t getControlCount( void ) + { + return( 1 ); + } + + +private: + vstEffect * m_effect; + +} ; + +#endif diff --git a/plugins/vst_effect/vst_effect.cpp b/plugins/vst_effect/vst_effect.cpp new file mode 100644 index 000000000..9bf162905 --- /dev/null +++ b/plugins/vst_effect/vst_effect.cpp @@ -0,0 +1,213 @@ +/* + * vst_effect.cpp - class for handling VST effect plugins + * + * Copyright (c) 2006 Tobias Doerffel + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + + +#ifdef QT4 + +#include + +#else + +#include + +#endif + + +#include "vst_effect.h" +#include "vst_subplugin_features.h" +#include "song_editor.h" +#include "text_float.h" +#include "buffer_allocator.h" + + +#undef SINGLE_SOURCE_COMPILE +#include "embed.cpp" + + +extern "C" +{ + +plugin::descriptor vsteffect_plugin_descriptor = +{ + STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + "VST Effect", + QT_TRANSLATE_NOOP( "pluginBrowser", + "plugin for using arbitrary VST-effects " + "inside LMMS." ), + "Tobias Doerffel ", + 0x0100, + plugin::Effect, + new QPixmap( PLUGIN_NAME::getIconPixmap( "logo" ) ), + new vstSubPluginFeatures( plugin::Effect ) +} ; + +} + + +vstEffect::vstEffect( effect::constructionData * _cdata ) : + effect( &vsteffect_plugin_descriptor, _cdata ), + m_plugin( NULL ), + m_pluginMutex(), + m_key( _cdata->key ) +{ + if( !m_key.user.toString().isEmpty() ) + { + openPlugin( m_key.user.toString() ); + } +} + + + + +vstEffect::~vstEffect() +{ + closePlugin(); +} + + + + +bool FASTCALL vstEffect::processAudioBuffer( surroundSampleFrame * _buf, + const fpab_t _frames ) +{ + if( isBypassed() || !isRunning () ) + { + return( FALSE ); + } + + if( m_plugin ) + { + sampleFrame * buf = bufferAllocator::alloc( + _frames ); + for( fpab_t f = 0; f < _frames; ++f ) + { + for( ch_cnt_t ch = 0; ch < DEFAULT_CHANNELS; ++ch ) + { + buf[f][ch] = _buf[f][ch]; + } + } + m_pluginMutex.lock(); + m_plugin->process( buf, buf, TRUE ); + m_pluginMutex.unlock(); + double out_sum = 0.0; + for( fpab_t f = 0; f < _frames; ++f ) + { + for( ch_cnt_t ch = 0; ch < SURROUND_CHANNELS; ++ch ) + { + _buf[f][ch] = getDryLevel() * _buf[f][ch] + + getWetLevel() * + buf[f][ch%DEFAULT_CHANNELS]; + out_sum += _buf[f][ch]*_buf[f][ch]; + } + } + bufferAllocator::free( buf ); + if( out_sum <= getGate() ) + { + incrementBufferCount(); + if( getBufferCount() > getTimeout() ) + { + stopRunning(); + resetBufferCount(); + } + } + else + { + resetBufferCount(); + } + } + return( isRunning() ); +} + + + + +void vstEffect::openPlugin( const QString & _plugin ) +{ + textFloat * tf = textFloat::displayMessage( + remoteVSTPlugin::tr( "Loading plugin" ), + remoteVSTPlugin::tr( + "Please wait while loading VST-plugin..." ), + PLUGIN_NAME::getIconPixmap( "logo", 24, 24 ), 0 ); + m_pluginMutex.lock(); + m_plugin = new remoteVSTPlugin( _plugin, eng() ); + if( m_plugin->failed() ) + { + m_pluginMutex.unlock(); + closePlugin(); + delete tf; + QMessageBox::information( NULL, + remoteVSTPlugin::tr( "Failed loading VST-plugin" ), + remoteVSTPlugin::tr( "The VST-plugin %1 could not " + "be loaded for some reason.\n" + "If it runs with other VST-" + "software under Linux, please " + "contact an LMMS-developer!" + ).arg( _plugin ), + QMessageBox::Ok ); + return; + } + m_plugin->showEditor(); + remoteVSTPlugin::connect( eng()->getSongEditor(), + SIGNAL( tempoChanged( bpm_t ) ), + m_plugin, SLOT( setTempo( bpm_t ) ) ); + m_plugin->setTempo( eng()->getSongEditor()->getTempo() ); + if( m_plugin->pluginWidget() != NULL ) + { +/*#ifdef QT4 + m_plugin->pluginWidget()->setWindowIcon( + getInstrumentTrack()->windowIcon() ); +#else + m_plugin->pluginWidget()->setWindowIcon( + *( getInstrumentTrack()->windowIcon() ) ); +#endif*/ + m_plugin->hideEditor(); + } + m_pluginMutex.unlock(); + delete tf; +} + + + +void vstEffect::closePlugin( void ) +{ + m_pluginMutex.lock(); + delete m_plugin; + m_plugin = NULL; + m_pluginMutex.unlock(); +} + + + +extern "C" +{ + +// neccessary for getting instance out of shared lib +plugin * lmms_plugin_main( void * _data ) +{ + return( new vstEffect( + static_cast( _data ) ) ); +} + +} + diff --git a/plugins/vst_effect/vst_effect.h b/plugins/vst_effect/vst_effect.h new file mode 100644 index 000000000..33707dbee --- /dev/null +++ b/plugins/vst_effect/vst_effect.h @@ -0,0 +1,88 @@ +/* + * vst_effect.h - class for handling VST effect plugins + * + * Copyright (c) 2006 Tobias Doerffel + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + + +#ifndef _VST_EFFECT_H +#define _VST_EFFECT_H + +#include "qt3support.h" + +#ifdef QT4 + +#include + +#else + +#include + +#endif + + +#include "effect.h" +#include "main_window.h" +#include "lvsl_client.h" +#include "vst_control_dialog.h" + + +class vstEffect : public effect +{ +public: + vstEffect( effect::constructionData * _cdata ); + virtual ~vstEffect(); + + virtual bool FASTCALL processAudioBuffer( surroundSampleFrame * _buf, + const fpab_t _frames ); + + virtual inline QString publicName( void ) const + { + return( m_plugin->name() ); + } + + virtual inline effectControlDialog * createControlDialog( track * ) + { + return( new vstControlDialog( + eng()->getMainWindow()->workspace(), + this ) ); + } + + inline virtual QString nodeName( void ) const + { + return( "vsteffect" ); + } + + +private: + void openPlugin( const QString & _plugin ); + void closePlugin( void ); + + remoteVSTPlugin * m_plugin; + QMutex m_pluginMutex; + effectKey m_key; + + friend class vstControlDialog; + +} ; + + +#endif diff --git a/plugins/vst_effect/vst_subplugin_features.cpp b/plugins/vst_effect/vst_subplugin_features.cpp new file mode 100644 index 000000000..06b1b3d66 --- /dev/null +++ b/plugins/vst_effect/vst_subplugin_features.cpp @@ -0,0 +1,103 @@ +/* + * vst_subplugin_features.cpp - derivation from + * plugin::descriptor::subPluginFeatures for + * hosting VST-plugins + * + * Copyright (c) 2006 Tobias Doerffel + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + + +#ifdef QT4 + +#include +#include +#include +#include + +#else + +#include +#include +#include +#include + +#endif + + +#include "vst_subplugin_features.h" +#include "config_mgr.h" + + +vstSubPluginDescriptionWidget::vstSubPluginDescriptionWidget( + QWidget * _parent, engine * _engine, + const effectKey & _key ) : + QWidget( _parent ) +{ + QVBoxLayout * l = new QVBoxLayout( this ); + +#ifndef QT3 + QGroupBox * groupbox = new QGroupBox( tr( "Description" ), this ); +#else + QGroupBox * groupbox = new QGroupBox( 9, Qt::Vertical, + tr( "Description" ), this ); +#endif + + new QLabel( tr( "Name: " ) + _key.name, groupbox ); + new QLabel( tr( "File: " ) + _key.user.toString(), groupbox ); + + l->addWidget( groupbox ); +} + + + + +vstSubPluginFeatures::vstSubPluginFeatures( plugin::pluginTypes _type ) : + subPluginFeatures( _type ) +{ +} + + + + +QWidget * vstSubPluginFeatures::createDescriptionWidget( + QWidget * _parent, engine * _eng, const key & _key ) +{ + return( new vstSubPluginDescriptionWidget( _parent, _eng, _key ) ); +} + + + + +void vstSubPluginFeatures::listSubPluginKeys( engine * _eng, + plugin::descriptor * _desc, keyList & _kl ) +{ + QStringList dlls = QDir( configManager::inst()->vstDir() ). + entryList( "*.dll", QDir::Files, QDir::Name ); + // TODO: eval m_type + for( QStringList::const_iterator it = dlls.begin(); + it != dlls.end(); ++it ) + { + _kl.push_back( key( _desc, QFileInfo( *it ).baseName(), + *it ) ); + } + +} + diff --git a/plugins/vst_effect/vst_subplugin_features.h b/plugins/vst_effect/vst_subplugin_features.h new file mode 100644 index 000000000..5d3c05428 --- /dev/null +++ b/plugins/vst_effect/vst_subplugin_features.h @@ -0,0 +1,60 @@ +/* + * vst_subplugin_features.h - derivation from + * plugin::descriptor::subPluginFeatures for + * hosting VST-plugins + * + * Copyright (c) 2006 Tobias Doerffel + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + + +#ifndef _VST_SUBPLUGIN_FEATURES_H +#define _VST_SUBPLUGIN_FEATURES_H + +#include "effect.h" + + +class vstSubPluginDescriptionWidget : public QWidget +{ +public: + vstSubPluginDescriptionWidget( QWidget * _parent, engine * _engine, + const effectKey & _key ); + + +} ; + + + +class vstSubPluginFeatures : public plugin::descriptor::subPluginFeatures +{ +public: + vstSubPluginFeatures( plugin::pluginTypes _type ); + + virtual QWidget * createDescriptionWidget( QWidget * _parent, + engine * _eng, + const key & _key ); + + virtual void listSubPluginKeys( engine * _eng, + plugin::descriptor * _desc, keyList & _kl ); + +} ; + +#endif +