Optimize automation-event process splitting
[ardour.git] / libs / ardour / ardour / processor.h
index 3ba0730ba37b7fd4540557af10d21f315636439e..ea982035bc63dc375fe3d77288ab0a01cdd53cb1 100644 (file)
@@ -40,6 +40,7 @@ class PluginPinWindowProxy;
 
 namespace ARDOUR {
 
+class Location;
 class Session;
 class Route;
 
@@ -76,6 +77,12 @@ class LIBARDOUR_API Processor : public SessionObject, public Automatable, public
        virtual void set_output_latency (samplecnt_t cnt) { _output_latency = cnt; }
        samplecnt_t output_latency () const               { return _output_latency; }
 
+       virtual void set_capture_offset (samplecnt_t cnt) { _capture_offset = cnt; }
+       samplecnt_t capture_offset () const               { return _capture_offset; }
+
+       virtual void set_playback_offset (samplecnt_t cnt) { _playback_offset = cnt; }
+       samplecnt_t playback_offset () const               { return _playback_offset; }
+
        virtual int set_block_size (pframes_t /*nframes*/) { return 0; }
        virtual bool requires_fixed_sized_buffers() const { return false; }
 
@@ -102,6 +109,8 @@ class LIBARDOUR_API Processor : public SessionObject, public Automatable, public
        virtual void realtime_handle_transport_stopped () {}
        virtual void realtime_locate () {}
 
+       virtual void set_loop (Location *loc) { _loop_location = loc; }
+
        /* most processors won't care about this, but plugins that
           receive MIDI or similar data from an input source that
           may suddenly go "quiet" because of monitoring changes
@@ -114,8 +123,7 @@ class LIBARDOUR_API Processor : public SessionObject, public Automatable, public
           smoothly.
         */
 
-       virtual XMLNode& state (bool full);
-       XMLNode& get_state (void);
+       XMLNode& get_state ();
        int set_state (const XMLNode&, int version);
 
        virtual void set_pre_fader (bool);
@@ -141,8 +149,11 @@ class LIBARDOUR_API Processor : public SessionObject, public Automatable, public
        SessionObject* owner() const;
 
 protected:
+       virtual XMLNode& state ();
        virtual int set_state_2X (const XMLNode&, int version);
 
+       bool map_loop_range (samplepos_t& start, samplepos_t& end) const;
+
        int       _pending_active;
        bool      _active;
        bool      _next_ab_is_active;
@@ -155,8 +166,13 @@ protected:
        ProcessorWindowProxy *_window_proxy;
        PluginPinWindowProxy *_pinmgr_proxy;
        SessionObject* _owner;
+       // relative to route
        samplecnt_t _input_latency;
        samplecnt_t _output_latency;
+       // absolute alignment to session i/o
+       samplecnt_t _capture_offset;
+       samplecnt_t _playback_offset;
+       Location*   _loop_location;
 };
 
 } // namespace ARDOUR