Fix compilation with VST=1
authorCarl Hetherington <carl@carlh.net>
Fri, 11 May 2007 12:53:43 +0000 (12:53 +0000)
committerCarl Hetherington <carl@carlh.net>
Fri, 11 May 2007 12:53:43 +0000 (12:53 +0000)
git-svn-id: svn://localhost/ardour2/trunk@1834 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/ardour/vst_plugin.h
libs/ardour/vst_plugin.cc

index f7ec486d3652e09827c5531e9e8537e4e3b6bbe0..ffcb999183d4469f91284862b3d4f75c887f415b 100644 (file)
@@ -71,7 +71,7 @@ class VSTPlugin : public ARDOUR::Plugin
        void activate ();
        void deactivate ();
        void set_block_size (nframes_t nframes);
-       int connect_and_run (vector<Sample*>& bufs, uint32_t maxbuf, int32_t& in, int32_t& out, nframes_t nframes, nframes_t offset);
+       int connect_and_run (BufferSet&, uint32_t& in, uint32_t& out, nframes_t nframes, nframes_t offset);
        void store_state (ARDOUR::PluginState&);
        void restore_state (ARDOUR::PluginState&);
        string describe_parameter (uint32_t);
index 9ec6994e3c25937ac61138ee38cd9e3cbd2354b5..7c161cccf7d0a45d4d84fa455c9f1dd005323a77 100644 (file)
@@ -44,6 +44,7 @@
 #include <ardour/session.h>
 #include <ardour/audioengine.h>
 #include <ardour/vst_plugin.h>
+#include <ardour/buffer_set.h>
 
 #include <pbd/stl_delete.h>
 
@@ -365,19 +366,21 @@ VSTPlugin::automatable () const
 }
 
 int
-VSTPlugin::connect_and_run (vector<Sample*>& bufs, uint32_t maxbuf, int32_t& in_index, int32_t& out_index, nframes_t nframes, nframes_t offset)
+VSTPlugin::connect_and_run (BufferSet& bufs, uint32_t& in_index, uint32_t& out_index, nframes_t nframes, nframes_t offset)
 {
        float *ins[_plugin->numInputs];
        float *outs[_plugin->numOutputs];
        int32_t i;
 
+       const uint32_t nbufs = bufs.count().n_audio();
+
        for (i = 0; i < (int32_t) _plugin->numInputs; ++i) {
-               ins[i] = bufs[min((uint32_t) in_index,maxbuf - 1)] + offset;
+               ins[i] = bufs.get_audio(min((uint32_t) in_index, nbufs - 1)).data() + offset;
                in_index++;
        }
 
        for (i = 0; i < (int32_t) _plugin->numOutputs; ++i) {
-               outs[i] = bufs[min((uint32_t) out_index,maxbuf - 1)] + offset;
+               outs[i] = bufs.get_audio(min((uint32_t) out_index, nbufs - 1)).data() + offset;
 
                /* unbelievably, several VST plugins still rely on Cubase
                   behaviour and do not silence the buffer in processReplacing 
@@ -498,3 +501,15 @@ VSTPluginInfo::load (Session& session)
                return PluginPtr ((Plugin*) 0);
        }
 }
+
+void
+VSTPlugin::store_state (ARDOUR::PluginState& s)
+{
+
+}
+
+void
+VSTPlugin::restore_state (ARDOUR::PluginState& s)
+{
+
+}