ZynAddSubFX: adapted to resource framework

Adapted ZynAddSubFX plugin to new resource framework support in plugin
base class.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
This commit is contained in:
Tobias Doerffel
2009-06-29 14:25:04 +02:00
parent 40e6d26dbb
commit 9701ed5c31
2 changed files with 12 additions and 5 deletions

View File

@@ -30,6 +30,8 @@
#include <QtGui/QDropEvent>
#include <QtGui/QPushButton>
#include "ResourceFileMapper.h"
#include "zynaddsubfx.h"
#include "engine.h"
#include "mmp.h"
@@ -44,6 +46,9 @@
#include "moc_zynaddsubfx.cxx"
static const char * __supportedExts[] =
{ "xiz", NULL };
extern "C"
{
@@ -57,7 +62,7 @@ plugin::descriptor PLUGIN_EXPORT zynaddsubfx_plugin_descriptor =
0x0100,
plugin::Instrument,
new pluginPixmapLoader( "logo" ),
"xiz",
__supportedExts,
NULL,
} ;
@@ -156,12 +161,13 @@ void zynAddSubFx::loadSettings( const QDomElement & _this )
void zynAddSubFx::loadFile( const QString & _file )
void zynAddSubFx::loadResource( const ResourceItem * _item )
{
ResourceFileMapper mapper( _item );
m_plugin->lock();
m_plugin->sendMessage(
remotePlugin::message( IdLoadPresetFromFile ).
addString( _file.toStdString() ) );
addString( mapper.fileName().toStdString() ) );
m_plugin->waitForMessage( IdLoadPresetFromFile );
m_plugin->unlock();
@@ -315,7 +321,8 @@ void zynAddSubFxView::dropEvent( QDropEvent * _de )
const QString value = stringPairDrag::decodeValue( _de );
if( type == "pluginpresetfile" )
{
castModel<zynAddSubFx>()->loadFile( value );
// TODO: replace by generic approach
// castModel<zynAddSubFx>()->loadFile( value );
_de->accept();
return;
}

View File

@@ -55,7 +55,7 @@ public:
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
virtual void loadSettings( const QDomElement & _this );
virtual void loadFile( const QString & _file );
virtual void loadResource( const ResourceItem * _item );
virtual QString nodeName( void ) const;