Merge pull request #1478 from curlymorphic/i856

Proposed fix for 856 Recursive VST Effect Enhancement Request
This commit is contained in:
Tres Finocchiaro
2014-12-22 00:27:57 -05:00
4 changed files with 42 additions and 11 deletions

View File

@@ -31,6 +31,7 @@
#include "ConfigManager.h"
VstSubPluginFeatures::VstSubPluginFeatures( Plugin::PluginTypes _type ) :
SubPluginFeatures( _type )
{
@@ -52,16 +53,40 @@ void VstSubPluginFeatures::fillDescriptionWidget( QWidget * _parent,
void VstSubPluginFeatures::listSubPluginKeys( const Plugin::Descriptor * _desc,
KeyList & _kl ) const
{
QStringList dlls = QDir( ConfigManager::inst()->vstDir() ).
entryList( QStringList() << "*.dll",
QDir::Files, QDir::Name );
QStringList *dlls = new QStringList();
const QString path = QString("");
addPluginsFromDir(dlls, path );
// TODO: eval m_type
for( QStringList::ConstIterator it = dlls.begin();
it != dlls.end(); ++it )
for( QStringList::ConstIterator it = dlls->begin();
it != dlls->end(); ++it )
{
EffectKey::AttributeMap am;
am["file"] = *it;
_kl.push_back( Key( _desc, QFileInfo( *it ).baseName(), am ) );
}
delete dlls;
}
void VstSubPluginFeatures::addPluginsFromDir( QStringList* filenames, QString path ) const
{
QStringList dirs = QDir ( ConfigManager::inst()->vstDir() + path ).
entryList( QStringList() << "*" ,
QDir::Dirs, QDir::Name );
for(int i = 0; i < dirs.size(); i++)
{
if(dirs.at( i )[0] != '.' )
{
addPluginsFromDir( filenames, path+QDir::separator() + dirs.at( i ) );
}
}
QStringList dlls = QDir( ConfigManager::inst()->vstDir() + path ).
entryList( QStringList() << "*.dll",
QDir::Files, QDir::Name );
for( int i = 0; i < dlls.size(); i++ )
{
QString fName = path + QDir::separator() + dlls.at( i );
fName.remove( 0, 1 );
filenames->append( fName );
}
}

View File

@@ -40,8 +40,13 @@ public:
virtual void listSubPluginKeys( const Plugin::Descriptor * _desc,
KeyList & _kl ) const;
private:
void addPluginsFromDir(QStringList* filenames, QString path) const;
} ;
#endif

View File

@@ -172,10 +172,11 @@ void VstPlugin::tryLoad( const QString &remoteVstPluginExecutable )
QString p = m_plugin;
if( QFileInfo( p ).dir().isRelative() )
{
p = ConfigManager::inst()->vstDir() + QDir::separator() + p;
}
if( QFileInfo( p ).dir().isRelative() )
{
p = ConfigManager::inst()->vstDir() + p;
}
sendMessage( message( IdVstLoadPlugin ).addString( QSTR_TO_STDSTR( p ) ) );

View File

@@ -131,7 +131,7 @@ bool RemotePlugin::init( const QString &pluginExecutable,
m_failed = false;
}
QString exec = ConfigManager::inst()->pluginDir() +
QDir::separator() + pluginExecutable;
pluginExecutable;
QStringList args;
// swap in and out for bidirectional communication