VstPlugin::VstPlugin( const QString & _plugin ) : m_plugin( _plugin ), m_pluginWindowID( 0 ), m_embedMethod( gui ? ConfigManager::inst()->vstEmbedMethod() : "headless" ), m_version( 0 ), m_currentProgram() { if( QDir::isRelativePath( m_plugin ) ) { m_plugin = ConfigManager::inst()->vstDir() + m_plugin; } setSplittedChannels( true ); PE::MachineType machineType; try { PE::FileInfo peInfo(m_plugin); machineType = peInfo.machineType(); } catch (std::runtime_error& e) { qCritical() << "Error while determining PE file's machine type: " << e.what(); machineType = PE::MachineType::unknown; } switch(machineType) { case PE::MachineType::amd64: tryLoad( REMOTE_VST_PLUGIN_FILEPATH_64 ); // Default: RemoteVstPlugin64 break; case PE::MachineType::i386: tryLoad( REMOTE_VST_PLUGIN_FILEPATH_32 ); // Default: 32/RemoteVstPlugin32 break; default: m_failed = true; return; } setTempo( Engine::getSong()->getTempo() ); connect( Engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ), this, SLOT( setTempo( bpm_t ) ) ); connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateSampleRate() ) ); // update once per second m_idleTimer.start( 1000 ); connect( &m_idleTimer, SIGNAL( timeout() ), this, SLOT( idleUpdate() ) ); }
VstPlugin::VstPlugin( const QString & _plugin ) : RemotePlugin(), JournallingObject(), m_plugin( _plugin ), m_pluginWidget( NULL ), m_pluginWindowID( 0 ), m_badDllFormat( false ), m_name(), m_version( 0 ), m_vendorString(), m_productString(), m_currentProgramName(), m_allProgramNames(), p_name(), m_currentProgram(), m_idleTimer() { setSplittedChannels( true ); tryLoad( REMOTE_VST_PLUGIN_FILEPATH ); #ifdef LMMS_BUILD_WIN64 if( m_badDllFormat ) { m_badDllFormat = false; tryLoad( "32/RemoteVstPlugin32" ); } #endif setTempo( Engine::getSong()->getTempo() ); connect( Engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ), this, SLOT( setTempo( bpm_t ) ) ); connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateSampleRate() ) ); // update once per second m_idleTimer.start( 1000 ); connect( &m_idleTimer, SIGNAL( timeout() ), this, SLOT( idleUpdate() ) ); }