| 435 | |
| 436 | |
| 437 | void ZynAddSubFxInstrument::initPlugin() |
| 438 | { |
| 439 | m_pluginMutex.lock(); |
| 440 | delete m_plugin; |
| 441 | delete m_remotePlugin; |
| 442 | m_plugin = NULL; |
| 443 | m_remotePlugin = NULL; |
| 444 | |
| 445 | if( m_hasGUI ) |
| 446 | { |
| 447 | m_remotePlugin = new ZynAddSubFxRemotePlugin(); |
| 448 | m_remotePlugin->lock(); |
| 449 | m_remotePlugin->waitForInitDone( false ); |
| 450 | |
| 451 | m_remotePlugin->sendMessage( |
| 452 | RemotePlugin::message( IdZasfLmmsWorkingDirectory ). |
| 453 | addString( |
| 454 | QSTR_TO_STDSTR( |
| 455 | QString( ConfigManager::inst()->workingDir() ) ) ) ); |
| 456 | m_remotePlugin->sendMessage( |
| 457 | RemotePlugin::message( IdZasfPresetDirectory ). |
| 458 | addString( |
| 459 | QSTR_TO_STDSTR( |
| 460 | QDir( ConfigManager::inst()->factoryPresetsDir() + |
| 461 | "/ZynAddSubFX" ).absolutePath() ) ) ); |
| 462 | |
| 463 | m_remotePlugin->updateSampleRate( Engine::mixer()->processingSampleRate() ); |
| 464 | |
| 465 | // temporary workaround until the VST synchronization feature gets stripped out of the RemotePluginClient class |
| 466 | // causing not to send buffer size information requests |
| 467 | m_remotePlugin->sendMessage( RemotePlugin::message( IdBufferSizeInformation ).addInt( Engine::mixer()->framesPerPeriod() ) ); |
| 468 | |
| 469 | m_remotePlugin->showUI(); |
| 470 | m_remotePlugin->unlock(); |
| 471 | } |
| 472 | else |
| 473 | { |
| 474 | m_plugin = new LocalZynAddSubFx; |
| 475 | m_plugin->setSampleRate( Engine::mixer()->processingSampleRate() ); |
| 476 | m_plugin->setBufferSize( Engine::mixer()->framesPerPeriod() ); |
| 477 | } |
| 478 | |
| 479 | m_pluginMutex.unlock(); |
| 480 | } |
| 481 | |
| 482 | |
| 483 |
nothing calls this directly
no test coverage detected