VstPlugin.cpp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781
  1. /*
  2. * VstPlugin.cpp - implementation of VstPlugin class
  3. *
  4. * Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
  5. *
  6. * This file is part of LMMS - https://lmms.io
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2 of the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public
  19. * License along with this program (see COPYING); if not, write to the
  20. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  21. * Boston, MA 02110-1301 USA.
  22. *
  23. */
  24. #include "VstPlugin.h"
  25. #include "communication.h"
  26. #include <QtCore/QtEndian>
  27. #include <QtCore/QDebug>
  28. #include <QDir>
  29. #include <QFileInfo>
  30. #include <QLocale>
  31. #include <QTemporaryFile>
  32. #include <QCloseEvent>
  33. #include <QMdiArea>
  34. #include <QMdiSubWindow>
  35. #ifdef LMMS_BUILD_LINUX
  36. # include <QX11Info>
  37. # include "X11EmbedContainer.h"
  38. #endif
  39. #include <QWindow>
  40. #include <QDomDocument>
  41. #ifdef LMMS_BUILD_WIN32
  42. # ifndef NOMINMAX
  43. # define NOMINMAX
  44. # endif
  45. # include <windows.h>
  46. # include <QLayout>
  47. #endif
  48. #include "ConfigManager.h"
  49. #include "GuiApplication.h"
  50. #include "LocaleHelper.h"
  51. #include "MainWindow.h"
  52. #include "Mixer.h"
  53. #include "Song.h"
  54. #include "FileDialog.h"
  55. #ifdef LMMS_BUILD_LINUX
  56. # include <X11/Xlib.h>
  57. #endif
  58. namespace PE
  59. {
  60. // Utilities for reading PE file machine type
  61. // See specification at https://msdn.microsoft.com/library/windows/desktop/ms680547(v=vs.85).aspx
  62. // Work around name conflict
  63. #ifdef i386
  64. # undef i386
  65. #endif
  66. enum class MachineType : uint16_t
  67. {
  68. unknown = 0x0,
  69. amd64 = 0x8664,
  70. i386 = 0x14c,
  71. };
  72. class FileInfo
  73. {
  74. public:
  75. FileInfo(QString filePath)
  76. : m_file(filePath)
  77. {
  78. m_file.open(QFile::ReadOnly);
  79. m_map = m_file.map(0, m_file.size());
  80. if (m_map == nullptr) {
  81. throw std::runtime_error("Cannot map file");
  82. }
  83. }
  84. ~FileInfo()
  85. {
  86. m_file.unmap(m_map);
  87. }
  88. MachineType machineType()
  89. {
  90. int32_t peOffset = qFromLittleEndian(* reinterpret_cast<int32_t*>(m_map + 0x3C));
  91. uchar* peSignature = m_map + peOffset;
  92. if (memcmp(peSignature, "PE\0\0", 4)) {
  93. throw std::runtime_error("Invalid PE file");
  94. }
  95. uchar * coffHeader = peSignature + 4;
  96. uint16_t machineType = qFromLittleEndian(* reinterpret_cast<uint16_t*>(coffHeader));
  97. return static_cast<MachineType>(machineType);
  98. }
  99. private:
  100. QFile m_file;
  101. uchar* m_map;
  102. };
  103. }
  104. VstPlugin::VstPlugin( const QString & _plugin ) :
  105. m_plugin( _plugin ),
  106. m_pluginWindowID( 0 ),
  107. m_embedMethod( gui
  108. ? ConfigManager::inst()->vstEmbedMethod()
  109. : "headless" ),
  110. m_version( 0 ),
  111. m_currentProgram()
  112. {
  113. if( QDir::isRelativePath( m_plugin ) )
  114. {
  115. m_plugin = ConfigManager::inst()->vstDir() + m_plugin;
  116. }
  117. setSplittedChannels( true );
  118. PE::MachineType machineType;
  119. try {
  120. PE::FileInfo peInfo(m_plugin);
  121. machineType = peInfo.machineType();
  122. } catch (std::runtime_error& e) {
  123. qCritical() << "Error while determining PE file's machine type: " << e.what();
  124. machineType = PE::MachineType::unknown;
  125. }
  126. switch(machineType)
  127. {
  128. case PE::MachineType::amd64:
  129. tryLoad( REMOTE_VST_PLUGIN_FILEPATH_64 ); // Default: RemoteVstPlugin64
  130. break;
  131. case PE::MachineType::i386:
  132. tryLoad( REMOTE_VST_PLUGIN_FILEPATH_32 ); // Default: 32/RemoteVstPlugin32
  133. break;
  134. default:
  135. m_failed = true;
  136. return;
  137. }
  138. setTempo( Engine::getSong()->getTempo() );
  139. connect( Engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ),
  140. this, SLOT( setTempo( bpm_t ) ), Qt::DirectConnection );
  141. connect( Engine::mixer(), SIGNAL( sampleRateChanged() ),
  142. this, SLOT( updateSampleRate() ) );
  143. // update once per second
  144. m_idleTimer.start( 1000 );
  145. connect( &m_idleTimer, SIGNAL( timeout() ),
  146. this, SLOT( idleUpdate() ) );
  147. }
  148. VstPlugin::~VstPlugin()
  149. {
  150. delete m_pluginWidget;
  151. }
  152. void VstPlugin::tryLoad( const QString &remoteVstPluginExecutable )
  153. {
  154. init( remoteVstPluginExecutable, false, {m_embedMethod} );
  155. waitForHostInfoGotten();
  156. if( failed() )
  157. {
  158. return;
  159. }
  160. lock();
  161. VstHostLanguages hlang = LanguageEnglish;
  162. switch( QLocale::system().language() )
  163. {
  164. case QLocale::French: hlang = LanguageFrench; break;
  165. case QLocale::German: hlang = LanguageGerman; break;
  166. case QLocale::Italian: hlang = LanguageItalian; break;
  167. case QLocale::Japanese: hlang = LanguageJapanese; break;
  168. case QLocale::Korean: hlang = LanguageKorean; break;
  169. case QLocale::Spanish: hlang = LanguageSpanish; break;
  170. default: break;
  171. }
  172. sendMessage( message( IdVstSetLanguage ).addInt( hlang ) );
  173. sendMessage( message( IdVstLoadPlugin ).addString( QSTR_TO_STDSTR( m_plugin ) ) );
  174. waitForInitDone();
  175. unlock();
  176. }
  177. void VstPlugin::loadSettings( const QDomElement & _this )
  178. {
  179. if( _this.hasAttribute( "program" ) )
  180. {
  181. setProgram( _this.attribute( "program" ).toInt() );
  182. }
  183. const int num_params = _this.attribute( "numparams" ).toInt();
  184. // if it exists try to load settings chunk
  185. if( _this.hasAttribute( "chunk" ) )
  186. {
  187. loadChunk( QByteArray::fromBase64(
  188. _this.attribute( "chunk" ).toUtf8() ) );
  189. }
  190. else if( num_params > 0 )
  191. {
  192. // no chunk, restore individual parameters
  193. QMap<QString, QString> dump;
  194. for( int i = 0; i < num_params; ++i )
  195. {
  196. const QString key = "param" +
  197. QString::number( i );
  198. dump[key] = _this.attribute( key );
  199. }
  200. setParameterDump( dump );
  201. }
  202. }
  203. void VstPlugin::saveSettings( QDomDocument & _doc, QDomElement & _this )
  204. {
  205. if ( m_embedMethod != "none" )
  206. {
  207. if( pluginWidget() != NULL )
  208. {
  209. _this.setAttribute( "guivisible", pluginWidget()->isVisible() );
  210. }
  211. }
  212. else
  213. {
  214. int visible = isUIVisible();
  215. if ( visible != -1 )
  216. {
  217. _this.setAttribute( "guivisible", visible );
  218. }
  219. }
  220. // try to save all settings in a chunk
  221. QByteArray chunk = saveChunk();
  222. if( !chunk.isEmpty() )
  223. {
  224. _this.setAttribute( "chunk", QString( chunk.toBase64() ) );
  225. }
  226. else
  227. {
  228. // plugin doesn't seem to support chunks, therefore save
  229. // individual parameters
  230. const QMap<QString, QString> & dump = parameterDump();
  231. _this.setAttribute( "numparams", dump.size() );
  232. for( QMap<QString, QString>::const_iterator it = dump.begin();
  233. it != dump.end(); ++it )
  234. {
  235. _this.setAttribute( it.key(), it.value() );
  236. }
  237. }
  238. _this.setAttribute( "program", currentProgram() );
  239. }
  240. void VstPlugin::toggleUI()
  241. {
  242. if ( m_embedMethod == "none" )
  243. {
  244. RemotePlugin::toggleUI();
  245. }
  246. else if (pluginWidget())
  247. {
  248. toggleEditorVisibility();
  249. }
  250. }
  251. void VstPlugin::setTempo( bpm_t _bpm )
  252. {
  253. lock();
  254. sendMessage( message( IdVstSetTempo ).addInt( _bpm ) );
  255. unlock();
  256. }
  257. void VstPlugin::updateSampleRate()
  258. {
  259. lock();
  260. sendMessage( message( IdSampleRateInformation ).
  261. addInt( Engine::mixer()->processingSampleRate() ) );
  262. waitForMessage( IdInformationUpdated, true );
  263. unlock();
  264. }
  265. int VstPlugin::currentProgram()
  266. {
  267. lock();
  268. sendMessage( message( IdVstCurrentProgram ) );
  269. waitForMessage( IdVstCurrentProgram, true );
  270. unlock();
  271. return m_currentProgram;
  272. }
  273. const QMap<QString, QString> & VstPlugin::parameterDump()
  274. {
  275. lock();
  276. sendMessage( IdVstGetParameterDump );
  277. waitForMessage( IdVstParameterDump, true );
  278. unlock();
  279. return m_parameterDump;
  280. }
  281. void VstPlugin::setParameterDump( const QMap<QString, QString> & _pdump )
  282. {
  283. message m( IdVstSetParameterDump );
  284. m.addInt( _pdump.size() );
  285. for( QMap<QString, QString>::ConstIterator it = _pdump.begin();
  286. it != _pdump.end(); ++it )
  287. {
  288. const VstParameterDumpItem item =
  289. {
  290. ( *it ).section( ':', 0, 0 ).toInt(),
  291. "",
  292. LocaleHelper::toFloat((*it).section(':', 2, -1))
  293. } ;
  294. m.addInt( item.index );
  295. m.addString( item.shortLabel );
  296. m.addFloat( item.value );
  297. }
  298. lock();
  299. sendMessage( m );
  300. unlock();
  301. }
  302. QWidget *VstPlugin::pluginWidget()
  303. {
  304. return m_pluginWidget;
  305. }
  306. bool VstPlugin::processMessage( const message & _m )
  307. {
  308. switch( _m.id )
  309. {
  310. case IdVstPluginWindowID:
  311. m_pluginWindowID = _m.getInt();
  312. if( m_embedMethod == "none"
  313. && ConfigManager::inst()->value(
  314. "ui", "vstalwaysontop" ).toInt() )
  315. {
  316. #ifdef LMMS_BUILD_WIN32
  317. // We're changing the owner, not the parent,
  318. // so this is legal despite MSDN's warning
  319. SetWindowLongPtr( (HWND)(intptr_t) m_pluginWindowID,
  320. GWLP_HWNDPARENT,
  321. (LONG_PTR) gui->mainWindow()->winId() );
  322. #endif
  323. #ifdef LMMS_BUILD_LINUX
  324. XSetTransientForHint( QX11Info::display(),
  325. m_pluginWindowID,
  326. gui->mainWindow()->winId() );
  327. #endif
  328. }
  329. break;
  330. case IdVstPluginEditorGeometry:
  331. m_pluginGeometry = QSize( _m.getInt( 0 ),
  332. _m.getInt( 1 ) );
  333. break;
  334. case IdVstPluginName:
  335. m_name = _m.getQString();
  336. break;
  337. case IdVstPluginVersion:
  338. m_version = _m.getInt();
  339. break;
  340. case IdVstPluginVendorString:
  341. m_vendorString = _m.getQString();
  342. break;
  343. case IdVstPluginProductString:
  344. m_productString = _m.getQString();
  345. break;
  346. case IdVstCurrentProgram:
  347. m_currentProgram = _m.getInt();
  348. break;
  349. case IdVstCurrentProgramName:
  350. m_currentProgramName = _m.getQString();
  351. break;
  352. case IdVstProgramNames:
  353. m_allProgramNames = _m.getQString();
  354. break;
  355. case IdVstPluginUniqueID:
  356. // TODO: display graphically in case of failure
  357. printf("unique ID: %s\n", _m.getString().c_str() );
  358. break;
  359. case IdVstParameterDump:
  360. {
  361. m_parameterDump.clear();
  362. const int num_params = _m.getInt();
  363. int p = 0;
  364. for( int i = 0; i < num_params; ++i )
  365. {
  366. VstParameterDumpItem item;
  367. item.index = _m.getInt( ++p );
  368. item.shortLabel = _m.getString( ++p );
  369. item.value = _m.getFloat( ++p );
  370. m_parameterDump["param" + QString::number( item.index )] =
  371. QString::number( item.index ) + ":" +
  372. /*uncomented*/ /*QString( item.shortLabel )*/ QString::fromStdString(item.shortLabel) + ":" +
  373. QString::number( item.value );
  374. }
  375. break;
  376. }
  377. default:
  378. return RemotePlugin::processMessage( _m );
  379. }
  380. return true;
  381. }
  382. QWidget *VstPlugin::editor()
  383. {
  384. return m_pluginWidget;
  385. }
  386. void VstPlugin::openPreset( )
  387. {
  388. FileDialog ofd( NULL, tr( "Open Preset" ), "",
  389. tr( "Vst Plugin Preset (*.fxp *.fxb)" ) );
  390. ofd.setFileMode( FileDialog::ExistingFiles );
  391. if( ofd.exec () == QDialog::Accepted &&
  392. !ofd.selectedFiles().isEmpty() )
  393. {
  394. lock();
  395. sendMessage( message( IdLoadPresetFile ).
  396. addString(
  397. QSTR_TO_STDSTR(
  398. QDir::toNativeSeparators( ofd.selectedFiles()[0] ) ) )
  399. );
  400. waitForMessage( IdLoadPresetFile, true );
  401. unlock();
  402. }
  403. }
  404. void VstPlugin::setProgram( int index )
  405. {
  406. lock();
  407. sendMessage( message( IdVstSetProgram ).addInt( index ) );
  408. waitForMessage( IdVstSetProgram, true );
  409. unlock();
  410. }
  411. void VstPlugin::rotateProgram( int offset )
  412. {
  413. lock();
  414. sendMessage( message( IdVstRotateProgram ).addInt( offset ) );
  415. waitForMessage( IdVstRotateProgram, true );
  416. unlock();
  417. }
  418. void VstPlugin::loadProgramNames()
  419. {
  420. lock();
  421. sendMessage( message( IdVstProgramNames ) );
  422. waitForMessage( IdVstProgramNames, true );
  423. unlock();
  424. }
  425. void VstPlugin::savePreset( )
  426. {
  427. QString presName = currentProgramName().isEmpty() ? tr(": default") : currentProgramName();
  428. presName.replace(tr("\""), tr("'")); // QFileDialog unable to handle double quotes properly
  429. FileDialog sfd( NULL, tr( "Save Preset" ), presName.section(": ", 1, 1) + tr(".fxp"),
  430. tr( "Vst Plugin Preset (*.fxp *.fxb)" ) );
  431. if( p_name != "" ) // remember last directory
  432. {
  433. sfd.setDirectory( QFileInfo( p_name ).absolutePath() );
  434. }
  435. sfd.setAcceptMode( FileDialog::AcceptSave );
  436. sfd.setFileMode( FileDialog::AnyFile );
  437. if( sfd.exec () == QDialog::Accepted &&
  438. !sfd.selectedFiles().isEmpty() && sfd.selectedFiles()[0] != "" )
  439. {
  440. QString fns = sfd.selectedFiles()[0];
  441. p_name = fns;
  442. if ((fns.toUpper().indexOf(tr(".FXP")) == -1) && (fns.toUpper().indexOf(tr(".FXB")) == -1))
  443. fns = fns + tr(".fxb");
  444. else fns = fns.left(fns.length() - 4) + (fns.right( 4 )).toLower();
  445. lock();
  446. sendMessage( message( IdSavePresetFile ).
  447. addString(
  448. QSTR_TO_STDSTR(
  449. QDir::toNativeSeparators( fns ) ) )
  450. );
  451. waitForMessage( IdSavePresetFile, true );
  452. unlock();
  453. }
  454. }
  455. void VstPlugin::setParam( int i, float f )
  456. {
  457. lock();
  458. sendMessage( message( IdVstSetParameter ).addInt( i ).addFloat( f ) );
  459. //waitForMessage( IdVstSetParameter, true );
  460. unlock();
  461. }
  462. void VstPlugin::idleUpdate()
  463. {
  464. lock();
  465. sendMessage( message( IdVstIdleUpdate ) );
  466. unlock();
  467. }
  468. void VstPlugin::showUI()
  469. {
  470. if ( m_embedMethod == "none" )
  471. {
  472. RemotePlugin::showUI();
  473. }
  474. else if ( m_embedMethod != "headless" )
  475. {
  476. if (! editor()) {
  477. qWarning() << "VstPlugin::showUI called before VstPlugin::createUI";
  478. }
  479. toggleEditorVisibility( true );
  480. }
  481. }
  482. void VstPlugin::hideUI()
  483. {
  484. if ( m_embedMethod == "none" )
  485. {
  486. RemotePlugin::hideUI();
  487. }
  488. else if ( pluginWidget() != nullptr )
  489. {
  490. toggleEditorVisibility( false );
  491. }
  492. }
  493. // X11Embed only
  494. void VstPlugin::handleClientEmbed()
  495. {
  496. lock();
  497. sendMessage( IdShowUI );
  498. unlock();
  499. }
  500. void VstPlugin::loadChunk( const QByteArray & _chunk )
  501. {
  502. QTemporaryFile tf;
  503. if( tf.open() )
  504. {
  505. tf.write( _chunk );
  506. tf.flush();
  507. lock();
  508. sendMessage( message( IdLoadSettingsFromFile ).
  509. addString(
  510. QSTR_TO_STDSTR(
  511. QDir::toNativeSeparators( tf.fileName() ) ) ).
  512. addInt( _chunk.size() ) );
  513. waitForMessage( IdLoadSettingsFromFile, true );
  514. unlock();
  515. }
  516. }
  517. QByteArray VstPlugin::saveChunk()
  518. {
  519. QByteArray a;
  520. QTemporaryFile tf;
  521. if( tf.open() )
  522. {
  523. lock();
  524. sendMessage( message( IdSaveSettingsToFile ).
  525. addString(
  526. QSTR_TO_STDSTR(
  527. QDir::toNativeSeparators( tf.fileName() ) ) ) );
  528. waitForMessage( IdSaveSettingsToFile, true );
  529. unlock();
  530. a = tf.readAll();
  531. }
  532. return a;
  533. }
  534. void VstPlugin::toggleEditorVisibility( int visible )
  535. {
  536. QWidget* w = editor();
  537. if ( ! w ) {
  538. return;
  539. }
  540. if ( visible < 0 ) {
  541. visible = ! w->isVisible();
  542. }
  543. w->setVisible( visible );
  544. }
  545. void VstPlugin::createUI( QWidget * parent )
  546. {
  547. if ( m_pluginWidget ) {
  548. qWarning() << "VstPlugin::createUI called twice";
  549. m_pluginWidget->setParent( parent );
  550. return;
  551. }
  552. if( m_pluginWindowID == 0 )
  553. {
  554. return;
  555. }
  556. QWidget* container = nullptr;
  557. #if QT_VERSION >= 0x050100
  558. if (m_embedMethod == "qt" )
  559. {
  560. QWindow* vw = QWindow::fromWinId(m_pluginWindowID);
  561. container = QWidget::createWindowContainer(vw, parent );
  562. container->installEventFilter(this);
  563. } else
  564. #endif
  565. #ifdef LMMS_BUILD_WIN32
  566. if (m_embedMethod == "win32" )
  567. {
  568. QWidget * helper = new QWidget;
  569. QHBoxLayout * l = new QHBoxLayout( helper );
  570. QWidget * target = new QWidget( helper );
  571. l->setSpacing( 0 );
  572. l->setMargin( 0 );
  573. l->addWidget( target );
  574. // we've to call that for making sure, Qt created the windows
  575. helper->winId();
  576. HWND targetHandle = (HWND)target->winId();
  577. HWND pluginHandle = (HWND)(intptr_t)m_pluginWindowID;
  578. DWORD style = GetWindowLong(pluginHandle, GWL_STYLE);
  579. style = style & ~(WS_POPUP);
  580. style = style | WS_CHILD;
  581. SetWindowLong(pluginHandle, GWL_STYLE, style);
  582. SetParent(pluginHandle, targetHandle);
  583. DWORD threadId = GetWindowThreadProcessId(pluginHandle, NULL);
  584. DWORD currentThreadId = GetCurrentThreadId();
  585. AttachThreadInput(currentThreadId, threadId, true);
  586. container = helper;
  587. RemotePlugin::showUI();
  588. } else
  589. #endif
  590. #ifdef LMMS_BUILD_LINUX
  591. if (m_embedMethod == "xembed" )
  592. {
  593. if (parent)
  594. {
  595. parent->setAttribute(Qt::WA_NativeWindow);
  596. }
  597. QX11EmbedContainer * embedContainer = new QX11EmbedContainer( parent );
  598. connect(embedContainer, SIGNAL(clientIsEmbedded()), this, SLOT(handleClientEmbed()));
  599. embedContainer->embedClient( m_pluginWindowID );
  600. container = embedContainer;
  601. } else
  602. #endif
  603. {
  604. qCritical() << "Unknown embed method" << m_embedMethod;
  605. return;
  606. }
  607. container->setFixedSize( m_pluginGeometry );
  608. container->setWindowTitle( name() );
  609. m_pluginWidget = container;
  610. }
  611. bool VstPlugin::eventFilter(QObject *obj, QEvent *event)
  612. {
  613. #if QT_VERSION >= 0x050100
  614. if (embedMethod() == "qt" && obj == m_pluginWidget)
  615. {
  616. if (event->type() == QEvent::Show) {
  617. RemotePlugin::showUI();
  618. }
  619. qDebug() << obj << event;
  620. }
  621. #endif
  622. return false;
  623. }
  624. QString VstPlugin::embedMethod() const
  625. {
  626. return m_embedMethod;
  627. }