From f2a7d5c44e061c9439e9182feb4bc4f5b5dae25a Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sat, 6 Sep 2008 22:01:31 +0000 Subject: [PATCH] only use MIDI anymore for controlling VST instruments git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1559 0778d3d1-df1d-0410-868b-ea421aaaa00d --- plugins/vestige/vestige.cpp | 66 +------------------------------------ plugins/vestige/vestige.h | 5 --- 2 files changed, 1 insertion(+), 70 deletions(-) diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index 78ed7016f..aa6fd2afa 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -1,5 +1,5 @@ /* - * vestige.cpp - instrument-plugin for hosting VST-plugins + * vestige.cpp - instrument-plugin for hosting VST-instruments * * Copyright (c) 2005-2008 Tobias Doerffel * @@ -36,7 +36,6 @@ #include "instrument_play_handle.h" #include "instrument_track.h" #include "vst_plugin.h" -#include "note_play_handle.h" #include "pixmap_button.h" #include "song.h" #include "text_float.h" @@ -74,11 +73,6 @@ vestigeInstrument::vestigeInstrument( instrumentTrack * _instrument_track ) : m_plugin( NULL ), m_pluginMutex() { - for( int i = 0; i < NumKeys; ++i ) - { - m_runningNotes[i] = 0; - } - // now we need a play-handle which cares for calling play() instrumentPlayHandle * iph = new instrumentPlayHandle( this ); engine::getMixer()->addPlayHandle( iph ); @@ -253,49 +247,6 @@ void vestigeInstrument::play( bool _try_parallelizing, sampleFrame * ) - - -void vestigeInstrument::playNote( notePlayHandle * _n, bool, sampleFrame * ) -{ - m_pluginMutex.lock(); - if( _n->totalFramesPlayed() == 0 && m_plugin != NULL ) - { - const int k = getInstrumentTrack()->masterKey( _n ); - if( m_runningNotes[k] > 0 ) - { - m_plugin->processMidiEvent( midiEvent( MidiNoteOff, 0, - k, 0 ), 0 ); - } - ++m_runningNotes[k]; - m_plugin->processMidiEvent( midiEvent( MidiNoteOn, 0, k, - _n->getVolume() ), _n->offset() ); - // notify when the handle stops, call to deleteNotePluginData - _n->m_pluginData = _n; - } - m_pluginMutex.unlock(); -} - - - - -void vestigeInstrument::deleteNotePluginData( notePlayHandle * _n ) -{ - m_pluginMutex.lock(); - if( m_plugin != NULL ) - { - const int k = getInstrumentTrack()->masterKey( _n ); - if( --m_runningNotes[k] <= 0 ) - { - m_plugin->processMidiEvent( - midiEvent( MidiNoteOff, 0, k, 0 ), 0 ); - } - } - m_pluginMutex.unlock(); -} - - - - bool vestigeInstrument::handleMidiEvent( const midiEvent & _me, const midiTime & _time ) { @@ -311,21 +262,6 @@ bool vestigeInstrument::handleMidiEvent( const midiEvent & _me, -/* -void vestigeInstrument::changeTempo( bpm_t _new_tempo ) -{ - m_pluginMutex.lock(); - if( m_plugin != NULL ) - { - m_plugin->setTempo( _new_tempo ); - } - m_pluginMutex.unlock(); -} -*/ - - - - void vestigeInstrument::closePlugin( void ) { m_pluginMutex.lock(); diff --git a/plugins/vestige/vestige.h b/plugins/vestige/vestige.h index dee258abb..62b18a0be 100644 --- a/plugins/vestige/vestige.h +++ b/plugins/vestige/vestige.h @@ -53,11 +53,6 @@ public: virtual void play( bool _try_parallelizing, sampleFrame * _working_buffer ); - virtual void playNote( notePlayHandle * _n, bool _try_parallelizing, - sampleFrame * _working_buffer ); - virtual void deleteNotePluginData( notePlayHandle * _n ); - - virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); virtual void loadSettings( const QDomElement & _this );