MCPcopy Create free account
hub / github.com/LMMS/lmms / initPlugin

Method initPlugin

plugins/zynaddsubfx/ZynAddSubFx.cpp:437–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

435
436
437void 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

Callers

nothing calls this directly

Calls 13

mixerFunction · 0.85
sendMessageMethod · 0.80
addStringMethod · 0.80
processingSampleRateMethod · 0.80
messageFunction · 0.50
QStringClass · 0.50
instFunction · 0.50
lockMethod · 0.45
updateSampleRateMethod · 0.45
showUIMethod · 0.45
unlockMethod · 0.45
setSampleRateMethod · 0.45

Tested by

no test coverage detected