diff --git a/plugins/zynaddsubfx/zynaddsubfx.cpp b/plugins/zynaddsubfx/zynaddsubfx.cpp index 9b952af70..ffb0f136d 100644 --- a/plugins/zynaddsubfx/zynaddsubfx.cpp +++ b/plugins/zynaddsubfx/zynaddsubfx.cpp @@ -30,6 +30,8 @@ #include #include +#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()->loadFile( value ); + // TODO: replace by generic approach + // castModel()->loadFile( value ); _de->accept(); return; } diff --git a/plugins/zynaddsubfx/zynaddsubfx.h b/plugins/zynaddsubfx/zynaddsubfx.h index 91e59146f..d6a3d8356 100644 --- a/plugins/zynaddsubfx/zynaddsubfx.h +++ b/plugins/zynaddsubfx/zynaddsubfx.h @@ -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;