Optimize automation-event process splitting
[ardour.git] / libs / ardour / ardour / disk_io.h
index 2c34cbfacf5d50fc77125cdd59fbd82f341ba295..0f79930654d25ac7c552b10a65d5fa16b1e58235 100644 (file)
@@ -45,7 +45,7 @@ template<typename T> class MidiRingBuffer;
 
 class LIBARDOUR_API DiskIOProcessor : public Processor
 {
-  public:
+public:
        enum Flag {
                Recordable  = 0x1,
                Hidden      = 0x2,
@@ -56,6 +56,7 @@ class LIBARDOUR_API DiskIOProcessor : public Processor
        static const std::string state_node_name;
 
        DiskIOProcessor (Session&, const std::string& name, Flag f);
+       virtual ~DiskIOProcessor ();
 
        void set_route (boost::shared_ptr<Route>);
        void drop_route ();
@@ -80,18 +81,12 @@ class LIBARDOUR_API DiskIOProcessor : public Processor
 
        virtual void non_realtime_locate (samplepos_t);
 
-       void non_realtime_speed_change ();
-       bool realtime_speed_change ();
-
        virtual void punch_in()  {}
        virtual void punch_out() {}
 
        bool slaved() const      { return _slaved; }
        void set_slaved(bool yn) { _slaved = yn; }
 
-       int set_loop (Location *loc);
-
-       PBD::Signal1<void,Location *> LoopSet;
        PBD::Signal0<void>            SpeedChanged;
        PBD::Signal0<void>            ReverseChanged;
 
@@ -111,18 +106,16 @@ class LIBARDOUR_API DiskIOProcessor : public Processor
 
        virtual void adjust_buffering() = 0;
 
-  protected:
+protected:
        friend class Auditioner;
        virtual int  seek (samplepos_t which_sample, bool complete_refill = false) = 0;
 
-  protected:
+protected:
        Flag         _flags;
        uint32_t      i_am_the_modifier;
        double       _actual_speed;
        double       _target_speed;
-       bool         _seek_required;
        bool         _slaved;
-       Location*     loop_location;
        bool          in_set_state;
        samplepos_t   playback_sample;
        bool         _need_butler;
@@ -154,31 +147,35 @@ class LIBARDOUR_API DiskIOProcessor : public Processor
        struct ChannelInfo : public boost::noncopyable {
 
                ChannelInfo (samplecnt_t buffer_size);
-               ~ChannelInfo ();
+               virtual ~ChannelInfo ();
+
+               /** Ringbuffer for data to be played back.
+                * written to in the butler thread, read from in the process thread.
+                */
+               PBD::RingBufferNPT<Sample>* rbuf;
 
-               /** A ringbuffer for data to be played back, written to in the
-                   butler thread, read from in the process thread.
-               */
-               PBD::RingBufferNPT<Sample>* buf;
+               /** A ringbuffer for data to be recorded back, written to in the
+                * process thread, read from in the butler thread.
+                */
+               PBD::RingBufferNPT<Sample>* wbuf;
                PBD::RingBufferNPT<Sample>::rw_vector rw_vector;
 
                /* used only by capture */
                boost::shared_ptr<AudioFileSource> write_source;
-               PBD::RingBufferNPT<CaptureTransition> * capture_transition_buf;
-               // the following are used in the butler thread only
-               samplecnt_t                     curr_capture_cnt;
+               PBD::RingBufferNPT<CaptureTransition>* capture_transition_buf;
 
-               void resize (samplecnt_t);
+               /* used in the butler thread only */
+               samplecnt_t curr_capture_cnt;
+
+               virtual void resize (samplecnt_t) = 0;
        };
 
        typedef std::vector<ChannelInfo*> ChannelList;
        SerializedRCUManager<ChannelList> channels;
 
-       int add_channel_to (boost::shared_ptr<ChannelList>, uint32_t how_many);
+       virtual int add_channel_to (boost::shared_ptr<ChannelList>, uint32_t how_many) = 0;
        int remove_channel_from (boost::shared_ptr<ChannelList>, uint32_t how_many);
 
-       CubicInterpolation interpolation;
-
        boost::shared_ptr<Playlist> _playlists[DataType::num_types];
        PBD::ScopedConnectionList playlist_connections;
 
@@ -191,7 +188,6 @@ class LIBARDOUR_API DiskIOProcessor : public Processor
        MidiRingBuffer<samplepos_t>*  _midi_buf;
        gint                         _samples_written_to_ringbuffer;
        gint                         _samples_read_from_ringbuffer;
-       CubicMidiInterpolation        midi_interpolation;
 
        static void get_location_times (const Location* location, samplepos_t* start, samplepos_t* end, samplepos_t* length);
 };