- ChanMapping in_map, ChanMapping out_map,
- pframes_t nframes, framecnt_t offset)
-{
- Plugin::connect_and_run (bufs, in_map, out_map, nframes, offset);
+ samplepos_t start, samplepos_t end, double speed,
+ ChanMapping in_map, ChanMapping out_map,
+ pframes_t nframes, samplecnt_t offset)
+{
+ Plugin::connect_and_run(bufs, start, end, speed, in_map, out_map, nframes, offset);
+
+ if (pthread_mutex_trylock (&_state->state_lock)) {
+ /* by convention 'effSetChunk' should not be called while processing
+ * http://www.reaper.fm/sdk/vst/vst_ext.php
+ *
+ * All VSTs don't use in-place, PluginInsert::connect_and_run()
+ * does clear output buffers, so we can just return.
+ */
+ return 0;
+ }
+
+ _transport_sample = start;
+ _transport_speed = speed;
+
+ ChanCount bufs_count;
+ bufs_count.set(DataType::AUDIO, 1);
+ bufs_count.set(DataType::MIDI, 1);
+ _midi_out_buf = 0;
+
+ BufferSet& silent_bufs = _session.get_silent_buffers(bufs_count);
+ BufferSet& scratch_bufs = _session.get_scratch_buffers(bufs_count);
+
+ /* VC++ doesn't support the C99 extension that allows
+
+ typeName foo[variableDefiningSize];
+
+ Use alloca instead of dynamic array (rather than std::vector which
+ allocs on the heap) because this is realtime code.
+ */