on session-load: skip output-change-handler until IOs are restored
[ardour.git] / libs / ardour / ardour / track.h
index 8f68f63d05e12baa8a635fa5a890fa270eff6f81..7159261b510dd96db8e3627de768e920de4cb7cd 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <boost/shared_ptr.hpp>
 
+#include "ardour/interthread_info.h"
 #include "ardour/route.h"
 #include "ardour/public_diskstream.h"
 
@@ -32,6 +33,7 @@ class RouteGroup;
 class Source;
 class Region;
 class Diskstream;
+class IO;
 
 class Track : public Route, public PublicDiskstream
 {
@@ -50,9 +52,11 @@ class Track : public Route, public PublicDiskstream
 
        virtual void set_monitoring (MonitorChoice);
        MonitorChoice monitoring_choice() const { return _monitoring; }
-       MonitorState monitoring_state();
+        MonitorState monitoring_state () const;
        PBD::Signal0<void> MonitoringChanged;
 
+       MeterState metering_state () const;
+       
        virtual int no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
                             bool state_changing);
 
@@ -85,28 +89,30 @@ class Track : public Route, public PublicDiskstream
        virtual void freeze_me (InterThreadInfo&) = 0;
        virtual void unfreeze () = 0;
 
+       /** @return true if the track can be bounced, or false otherwise.
+        */
+       virtual bool bounceable (boost::shared_ptr<Processor> endpoint, bool include_endpoint) const = 0;
        virtual boost::shared_ptr<Region> bounce (InterThreadInfo&) = 0;
-       virtual boost::shared_ptr<Region> bounce_range (framepos_t start, framepos_t end, InterThreadInfo&, bool enable_processing = true) = 0;
+       virtual boost::shared_ptr<Region> bounce_range (framepos_t start, framepos_t end, InterThreadInfo&, 
+                                                       boost::shared_ptr<Processor> endpoint, bool include_endpoint) = 0;
+       virtual int export_stuff (BufferSet& bufs, framepos_t start_frame, framecnt_t nframes,
+                                 boost::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export) = 0;
 
        XMLNode&    get_state();
        XMLNode&    get_template();
        virtual int set_state (const XMLNode&, int version);
        static void zero_diskstream_id_in_xml (XMLNode&);
 
-       boost::shared_ptr<PBD::Controllable> rec_enable_control() { return _rec_enable_control; }
+       boost::shared_ptr<AutomationControl> rec_enable_control() { return _rec_enable_control; }
 
        bool record_enabled() const;
        void set_record_enabled (bool yn, void *src);
+       void prep_record_enabled (bool yn, void *src);
 
        bool using_diskstream_id (PBD::ID) const;
 
        void set_block_size (pframes_t);
 
-       /** @return true if the track can be bounced, or false if it cannot because
-        *  it has more outputs than diskstream channels.
-        */
-       virtual bool bounceable () const = 0;
-
        /* PublicDiskstream interface */
        boost::shared_ptr<Playlist> playlist ();
        void request_jack_monitors_input (bool);
@@ -123,8 +129,8 @@ class Track : public Route, public PublicDiskstream
        void set_pending_overwrite (bool);
        int seek (framepos_t, bool complete_refill = false);
        bool hidden () const;
-       int can_internal_playback_seek (framepos_t);
-       int internal_playback_seek (framepos_t);
+       int can_internal_playback_seek (framecnt_t);
+       int internal_playback_seek (framecnt_t);
        void non_realtime_input_change ();
        void non_realtime_locate (framepos_t);
        void non_realtime_set_speed ();
@@ -155,6 +161,7 @@ class Track : public Route, public PublicDiskstream
 
        PBD::Signal0<void> DiskstreamChanged;
        PBD::Signal0<void> FreezeChange;
+       /* Emitted when our diskstream is set to use a different playlist */
        PBD::Signal0<void> PlaylistChanged;
        PBD::Signal0<void> RecordEnableChanged;
        PBD::Signal0<void> SpeedChanged;
@@ -165,10 +172,6 @@ class Track : public Route, public PublicDiskstream
 
        boost::shared_ptr<Diskstream> _diskstream;
        MeterPoint    _saved_meter_point;
-       /** used to keep track of processors that we are deactivating during record,
-           if `do-not-record-plugins' is enabled.
-       */
-       std::list<boost::weak_ptr<Processor> > _deactivated_processors;
        TrackMode     _mode;
        bool          _needs_butler;
        MonitorChoice _monitoring;
@@ -196,13 +199,13 @@ class Track : public Route, public PublicDiskstream
                FreezeState                        state;
        };
 
-       struct RecEnableControllable : public PBD::Controllable {
-               RecEnableControllable (Track&);
+       struct RecEnableControl : public AutomationControl {
+               RecEnableControl (boost::shared_ptr<Track> t);
 
                void set_value (double);
                double get_value (void) const;
 
-               Track& track;
+               boost::weak_ptr<Track> track;
        };
 
        virtual void set_state_part_two () = 0;
@@ -213,11 +216,9 @@ class Track : public Route, public PublicDiskstream
 
        void maybe_declick (BufferSet&, framecnt_t, int);
 
-       virtual bool send_silence () const;
-
-       boost::shared_ptr<RecEnableControllable> _rec_enable_control;
+       boost::shared_ptr<RecEnableControl> _rec_enable_control;
        
-       framecnt_t check_initial_delay (framecnt_t nframes, framecnt_t&);
+       framecnt_t check_initial_delay (framecnt_t nframes, framepos_t&);
 
 private:
 
@@ -227,10 +228,6 @@ private:
        void diskstream_record_enable_changed ();
        void diskstream_speed_changed ();
        void diskstream_alignment_style_changed ();
-
-       void parameter_changed (std::string);
-       void deactivate_visible_processors ();
-       void activate_deactivated_processors ();
 };
 
 }; /* namespace ARDOUR*/