LVSL: track samplerate/tempo changes in VstPlugin base class

Up to now changes of samplerate or tempo only have been tracked by the
VeSTige plugin while e.g. the VstEffect didn't forward such changes to the
RemotePlugin. Moving according code from VeSTige to VstPlugin base class
fixes this issue.
This commit is contained in:
Tobias Doerffel
2009-03-22 15:59:09 +01:00
parent dce6ae9a7d
commit 5dd68ea7f3
2 changed files with 11 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
/*
* vestige.cpp - instrument-plugin for hosting VST-instruments
*
* Copyright (c) 2005-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -37,7 +37,6 @@
#include "instrument_track.h"
#include "vst_plugin.h"
#include "pixmap_button.h"
#include "song.h"
#include "text_float.h"
#include "tooltip.h"
@@ -163,11 +162,7 @@ void vestigeInstrument::loadFile( const QString & _file )
}
m_plugin->showEditor();
connect( engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ),
m_plugin, SLOT( setTempo( bpm_t ) ) );
m_plugin->setTempo( engine::getSong()->getTempo() );
connect( engine::getMixer(), SIGNAL( sampleRateChanged() ),
m_plugin, SLOT( updateSampleRate() ) );
if( set_ch_name )
{
getInstrumentTrack()->setName( m_plugin->name() );

View File

@@ -1,7 +1,7 @@
/*
* vst_plugin.cpp - implementation of vstPlugin class
*
* Copyright (c) 2005-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -48,6 +48,7 @@
#include "config_mgr.h"
#include "engine.h"
#include "main_window.h"
#include "song.h"
#include "templates.h"
@@ -152,6 +153,13 @@ vstPlugin::vstPlugin( const QString & _plugin ) :
delete helper;
}
#endif
setTempo( engine::getSong()->getTempo() );
connect( engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ),
this, SLOT( setTempo( bpm_t ) ) );
connect( engine::getMixer(), SIGNAL( sampleRateChanged() ),
this, SLOT( updateSampleRate() ) );
}