globally remove all trailing whitespace from ardour code base.
[ardour.git] / libs / ardour / ardour / track.h
index 5e8ced7d42d8b7365daf9d46ed2074ec418e86cd..2d67a0aa75e821f4b7778b480839821fee3f4c5c 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,8 +33,9 @@ class RouteGroup;
 class Source;
 class Region;
 class Diskstream;
+class IO;
 
-class Track : public Route, public PublicDiskstream
+class LIBARDOUR_API Track : public Route, public PublicDiskstream
 {
   public:
        Track (Session&, std::string name, Route::Flag f = Route::Flag (0), TrackMode m = Normal, DataType default_type = DataType::AUDIO);
@@ -42,6 +44,7 @@ class Track : public Route, public PublicDiskstream
        int init ();
 
        bool set_name (const std::string& str);
+       void resync_track_name ();
 
        TrackMode mode () const { return _mode; }
        virtual int set_mode (TrackMode /*m*/) { return false; }
@@ -50,9 +53,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,35 +90,40 @@ 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, bool for_freeze) = 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;
+       bool record_safe () const;
        void set_record_enabled (bool yn, void *src);
+       void set_record_safe (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 monitor_input (bool);
+       void request_input_monitoring (bool);
+       void ensure_input_monitoring (bool);
        bool destructive () const;
        std::list<boost::shared_ptr<Source> > & last_capture_sources ();
        void set_capture_offset ();
-       std::list<boost::shared_ptr<Source> > steal_write_sources();
+       std::string steal_write_source_name ();
        void reset_write_sources (bool, bool force = false);
        float playback_buffer_load () const;
        float capture_buffer_load () const;
@@ -122,8 +132,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 ();
@@ -135,7 +145,7 @@ class Track : public Route, public PublicDiskstream
        void transport_stopped_wallclock (struct tm &, time_t, bool);
        bool pending_overwrite () const;
        double speed () const;
-       void prepare_to_stop (framepos_t);
+       void prepare_to_stop (framepos_t, framepos_t);
        void set_slaved (bool);
        ChanCount n_channels ();
        framepos_t get_capture_start_frame (uint32_t n = 0) const;
@@ -154,8 +164,10 @@ 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> RecordSafeChanged;
        PBD::Signal0<void> SpeedChanged;
        PBD::Signal0<void> AlignmentStyleChanged;
 
@@ -164,10 +176,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;
@@ -195,13 +203,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;
@@ -212,11 +220,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:
 
@@ -224,12 +230,12 @@ private:
        
        void diskstream_playlist_changed ();
        void diskstream_record_enable_changed ();
+       void diskstream_record_safe_changed ();
        void diskstream_speed_changed ();
        void diskstream_alignment_style_changed ();
+       void parameter_changed (std::string const & p);
 
-       void parameter_changed (std::string);
-       void deactivate_visible_processors ();
-       void activate_deactivated_processors ();
+       std::string _diskstream_name;
 };
 
 }; /* namespace ARDOUR*/