From 61bdf0e089a3ae966d37cac1656a3e67291529a2 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sat, 6 Sep 2008 22:02:45 +0000 Subject: [PATCH] save LADSPA effect filenames without extension and add correct one (depending on platform built for) when loading settings - fixes missing effects when loading songs in Windows which were made in Linux and vice versa git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1561 0778d3d1-df1d-0410-868b-ea421aaaa00d --- include/ladspa_base.h | 4 +++- plugins/ladspa_effect/ladspa_subplugin_features.cpp | 11 +++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/include/ladspa_base.h b/include/ladspa_base.h index d290f7baf..ef8c98706 100644 --- a/include/ladspa_base.h +++ b/include/ladspa_base.h @@ -75,7 +75,9 @@ inline plugin::descriptor::subPluginFeatures::key ladspaKeyToSubPluginKey( const ladspa_key_t & _key ) { plugin::descriptor::subPluginFeatures::key::attributeMap m; - m["file"] = _key.first; + QString file = _key.first; + m["file"] = file.remove( QRegExp( "\\.so$" ) ). + remove( QRegExp( "\\.dll$" ) ); m["plugin"] = _key.second; return( plugin::descriptor::subPluginFeatures::key( _desc, _name, m ) ); diff --git a/plugins/ladspa_effect/ladspa_subplugin_features.cpp b/plugins/ladspa_effect/ladspa_subplugin_features.cpp index 873ef2da6..af107098a 100644 --- a/plugins/ladspa_effect/ladspa_subplugin_features.cpp +++ b/plugins/ladspa_effect/ladspa_subplugin_features.cpp @@ -162,7 +162,14 @@ void ladspaSubPluginFeatures::listSubPluginKeys( plugin::descriptor * _desc, ladspa_key_t ladspaSubPluginFeatures::subPluginKeyToLadspaKey( const key * _key ) { - return( ladspa_key_t( _key->attributes["file"], - _key->attributes["plugin"] ) ); + QString file = _key->attributes["file"].toLower(); + return( ladspa_key_t( file.remove( QRegExp( "\\.so$" ) ). + remove( QRegExp( "\\.dll$" ) ) + +#ifdef LMMS_BUILD_WIN32 + ".dll" +#else + ".so" +#endif + , _key->attributes["plugin"] ) ); }