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

Method load

plugins/vst_base/RemoteVstPlugin.cpp:826–883  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

824
825
826bool RemoteVstPlugin::load( const std::string & _plugin_file )
827{
828 if( ( m_libInst = LoadLibraryW( toWString(_plugin_file).c_str() ) ) == NULL )
829 {
830 // give VstPlugin class a chance to start 32 bit version of RemoteVstPlugin
831 if( GetLastError() == ERROR_BAD_EXE_FORMAT )
832 {
833 sendMessage( IdVstBadDllFormat );
834 }
835 return false;
836 }
837
838 typedef AEffect * ( __stdcall * mainEntryPointer )
839 ( audioMasterCallback );
840 mainEntryPointer mainEntry = (mainEntryPointer)
841 GetProcAddress( m_libInst, "VSTPluginMain" );
842 if( mainEntry == NULL )
843 {
844 mainEntry = (mainEntryPointer)
845 GetProcAddress( m_libInst, "VstPluginMain" );
846 }
847 if( mainEntry == NULL )
848 {
849 mainEntry = (mainEntryPointer)
850 GetProcAddress( m_libInst, "main" );
851 }
852 if( mainEntry == NULL )
853 {
854 debugMessage( "could not find entry point\n" );
855 return false;
856 }
857
858 m_plugin = mainEntry( hostCallback );
859 if( m_plugin == NULL )
860 {
861 debugMessage( "mainEntry procedure returned NULL\n" );
862 return false;
863 }
864
865 if( m_plugin->magic != kEffectMagic )
866 {
867 debugMessage( "File is not a VST plugin\n" );
868 return false;
869 }
870
871
872 char id[5];
873 sprintf( id, "%c%c%c%c", ((char *)&m_plugin->uniqueID)[3],
874 ((char *)&m_plugin->uniqueID)[2],
875 ((char *)&m_plugin->uniqueID)[1],
876 ((char *)&m_plugin->uniqueID)[0] );
877 id[4] = 0;
878 sendMessage( message( IdVstPluginUniqueID ).addString( id ) );
879
880 pluginDispatch( effOpen );
881
882 return true;
883}

Callers 6

LadspaManagerMethod · 0.80
discoverPluginsMethod · 0.80
loadTranslationFunction · 0.80
processCallbackMethod · 0.80
recalcFilterMethod · 0.80
initNoteMethod · 0.80

Calls 3

toWStringFunction · 0.85
addStringMethod · 0.80
messageFunction · 0.50

Tested by

no test coverage detected