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

Method loadFile

plugins/vestige/vestige.cpp:321–370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

319
320
321void vestigeInstrument::loadFile( const QString & _file )
322{
323 m_pluginMutex.lock();
324 const bool set_ch_name = ( m_plugin != NULL &&
325 instrumentTrack()->name() == m_plugin->name() ) ||
326 instrumentTrack()->name() == InstrumentTrack::tr( "Default preset" ) ||
327 instrumentTrack()->name() == displayName();
328
329 m_pluginMutex.unlock();
330
331 if ( m_plugin != NULL )
332 {
333 closePlugin();
334 }
335 m_pluginDLL = SampleBuffer::tryToMakeRelative( _file );
336 TextFloat * tf = NULL;
337 if( gui )
338 {
339 tf = TextFloat::displayMessage(
340 tr( "Loading plugin" ),
341 tr( "Please wait while loading VST-plugin..." ),
342 PLUGIN_NAME::getIconPixmap( "logo", 24, 24 ), 0 );
343 }
344
345 m_pluginMutex.lock();
346 m_plugin = new VstInstrumentPlugin( m_pluginDLL );
347 if( m_plugin->failed() )
348 {
349 m_pluginMutex.unlock();
350 closePlugin();
351 delete tf;
352 collectErrorForUI( VstPlugin::tr( "The VST plugin %1 could not be loaded." ).arg( m_pluginDLL ) );
353 m_pluginDLL = "";
354 return;
355 }
356
357 m_plugin->createUI(nullptr);
358 m_plugin->showUI();
359
360 if( set_ch_name )
361 {
362 instrumentTrack()->setName( m_plugin->name() );
363 }
364
365 m_pluginMutex.unlock();
366
367 emit dataChanged();
368
369 delete tf;
370}
371
372
373

Callers 2

openPluginMethod · 0.45
dropEventMethod · 0.45

Calls 9

getIconPixmapFunction · 0.85
instrumentTrackFunction · 0.50
displayNameFunction · 0.50
lockMethod · 0.45
nameMethod · 0.45
unlockMethod · 0.45
createUIMethod · 0.45
showUIMethod · 0.45
setNameMethod · 0.45

Tested by

no test coverage detected