use XML rather than binary blobs for saving plugin-/effect-key

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1433 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-08-04 17:59:44 +00:00
parent df86b4c81e
commit 64188a9b52
14 changed files with 148 additions and 62 deletions

View File

@@ -71,7 +71,7 @@ ladspaEffect::ladspaEffect( model * _parent,
if( manager->getDescription( m_key ) == NULL )
{
QMessageBox::warning( 0, "Effect",
"Unknown LADSPA plugin requested: " + m_key.first,
"Unknown LADSPA plugin requested: " + m_key.second,
QMessageBox::Ok, QMessageBox::NoButton );
setOkay( FALSE );
return;
@@ -437,7 +437,7 @@ void ladspaEffect::pluginInstantiation( void )
if( m_descriptor == NULL )
{
QMessageBox::warning( 0, "Effect",
"Can't get LADSPA descriptor function: " + m_key.first,
"Can't get LADSPA descriptor function: " + m_key.second,
QMessageBox::Ok, QMessageBox::NoButton );
setOkay( FALSE );
return;
@@ -445,7 +445,7 @@ void ladspaEffect::pluginInstantiation( void )
if( m_descriptor->run == NULL )
{
QMessageBox::warning( 0, "Effect",
"Plugin has no processor: " + m_key.first,
"Plugin has no processor: " + m_key.second,
QMessageBox::Ok, QMessageBox::NoButton );
setDontRun( TRUE );
}
@@ -456,7 +456,7 @@ void ladspaEffect::pluginInstantiation( void )
if( effect == NULL )
{
QMessageBox::warning( 0, "Effect",
"Can't get LADSPA instance: " + m_key.first,
"Can't get LADSPA instance: " + m_key.second,
QMessageBox::Ok, QMessageBox::NoButton );
setOkay( FALSE );
return;
@@ -475,7 +475,7 @@ void ladspaEffect::pluginInstantiation( void )
m_ports[proc][port]->buffer ) )
{
QMessageBox::warning( 0, "Effect",
"Failed to connect port: " + m_key.first,
"Failed to connect port: " + m_key.second,
QMessageBox::Ok, QMessageBox::NoButton );
setDontRun( TRUE );
return;

View File

@@ -4,7 +4,7 @@
* hosting LADSPA-plugins
*
* Copyright (c) 2006-2007 Danny McRae <khjklujn/at/users.sourceforge.net>
* Copyright (c) 2006-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2006-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -162,10 +162,7 @@ void ladspaSubPluginFeatures::listSubPluginKeys( plugin::descriptor * _desc,
ladspa_key_t ladspaSubPluginFeatures::subPluginKeyToLadspaKey(
const key * _key )
{
QStringList list = _key->user.toStringList();
if( list.empty() )
{
return( ladspa_key_t() );
}
return( ladspa_key_t( list.first(), list.last() ) );
return( ladspa_key_t( _key->attributes["file"],
_key->attributes["plugin"] ) );
}

View File

@@ -64,9 +64,9 @@ vstEffect::vstEffect( model * _parent,
m_key( *_key ),
m_vstControls( this )
{
if( !m_key.user.toString().isEmpty() )
if( !m_key.attributes["file"].isEmpty() )
{
openPlugin( m_key.user.toString() );
openPlugin( m_key.attributes["file"] );
}
}
@@ -152,6 +152,8 @@ void vstEffect::openPlugin( const QString & _plugin )
m_plugin->setTempo( engine::getSong()->getTempo() );
m_pluginMutex.unlock();
delete tf;
m_key.attributes["file"] = _plugin;
}

View File

@@ -56,7 +56,7 @@ void vstEffectControls::loadSettings( const QDomElement & _this )
void vstEffectControls::saveSettings( QDomDocument & _doc, QDomElement & _this )
{
_this.setAttribute( "plugin", m_effect->m_key.user.toString() );
_this.setAttribute( "plugin", m_effect->m_key.attributes["file"] );
m_effect->m_pluginMutex.lock();
if( m_effect->m_plugin != NULL )
{

View File

@@ -45,7 +45,8 @@ void vstSubPluginFeatures::fillDescriptionWidget( QWidget * _parent,
const key * _key )
{
new QLabel( QWidget::tr( "Name: " ) + _key->name, _parent );
new QLabel( QWidget::tr( "File: " ) + _key->user.toString(), _parent );
new QLabel( QWidget::tr( "File: " ) + _key->attributes["file"],
_parent );
}
@@ -61,8 +62,9 @@ void vstSubPluginFeatures::listSubPluginKeys( plugin::descriptor * _desc,
for( QStringList::const_iterator it = dlls.begin();
it != dlls.end(); ++it )
{
_kl.push_back( key( _desc, QFileInfo( *it ).baseName(),
*it ) );
effectKey::attributeMap am;
am["file"] = *it;
_kl.push_back( key( _desc, QFileInfo( *it ).baseName(), am ) );
}
}