#include <ardour/plugin_state.h>
#include <ardour/buffer_set.h>
#include <ardour/automatable.h>
-
+#include <ardour/latent.h>
class XMLNode;
/* A mixer strip element - plugin, send, meter, etc.
*/
-class Processor : public Automatable
+class Processor : public Automatable, public Latent
{
public:
static const string state_node_name;
bool get_next_ab_is_active () const { return _next_ab_is_active; }
void set_next_ab_is_active (bool yn) { _next_ab_is_active = yn; }
- virtual nframes_t latency() { return 0; }
+ virtual nframes_t signal_latency() const { return 0; }
virtual void transport_stopped (nframes_t frame) {}
virtual void set_block_size (nframes_t nframes) {}
- virtual void run (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset) = 0;
+ virtual void run_in_place (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset) { assert(is_in_place()); }
+
+ virtual void run_out_of_place (BufferSet& input, BufferSet& output, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset) { assert(is_out_of_place()); }
+
virtual void silence (nframes_t nframes, nframes_t offset) {}
virtual void activate () { _active = true; ActiveChanged.emit(); }
virtual bool configure_io (ChanCount in, ChanCount out) { _configured_input = in; return (_configured = true); }
- /* Act as a pass through, if not overridden */
+ /* Derived classes should override these, or processor appears as an in-place pass-through */
+
+ /** In-place processors implement run_in_place and modify thee input buffer parameter */
+ virtual bool is_in_place () const { return true; }
+
+ /* Out-Of-Place processors implement run_out_of_place, don't modify the input parameter
+ * and write to their output parameter */
+ virtual bool is_out_of_place () const { return false; }
+
virtual bool can_support_input_configuration (ChanCount in) const { return true; }
virtual ChanCount output_for_input_configuration (ChanCount in) const { return in; }
virtual ChanCount output_streams() const { return _configured_input; }