From 45a128512b6642d38cf88308154992e9ed5cbcdb Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sun, 22 Mar 2009 15:59:09 +0100 Subject: [PATCH] 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. (cherry picked from commit 5dd68ea7f33d2cd7fcba50ad4b8cb26fb4566c14) --- plugins/vestige/vestige.cpp | 9 ++------- plugins/vst_base/vst_plugin.cpp | 10 +++++++++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index 5292284be..6241b7e83 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -1,7 +1,7 @@ /* * vestige.cpp - instrument-plugin for hosting VST-instruments * - * Copyright (c) 2005-2008 Tobias Doerffel + * Copyright (c) 2005-2009 Tobias Doerffel * * 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() ); diff --git a/plugins/vst_base/vst_plugin.cpp b/plugins/vst_base/vst_plugin.cpp index 8b95e3b77..a7e51c1a6 100644 --- a/plugins/vst_base/vst_plugin.cpp +++ b/plugins/vst_base/vst_plugin.cpp @@ -1,7 +1,7 @@ /* * vst_plugin.cpp - implementation of vstPlugin class * - * Copyright (c) 2005-2008 Tobias Doerffel + * Copyright (c) 2005-2009 Tobias Doerffel * * 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() ) ); }