toc filename handling patch from andreas r.
[ardour.git] / libs / ardour / ardour / track.h
index f92d11ab4c848f4aaaa4636447b375b9640e50b9..08bf170985e850fb9aeecd53f6bfbbeb7ef36b4f 100644 (file)
@@ -39,7 +39,7 @@ class Track : public Route, public PublicDiskstream
        Track (Session&, std::string name, Route::Flag f = Route::Flag (0), TrackMode m = Normal, DataType default_type = DataType::AUDIO);
        virtual ~Track ();
 
-        int init ();
+       int init ();
 
        bool set_name (const std::string& str);
 
@@ -48,24 +48,31 @@ class Track : public Route, public PublicDiskstream
        virtual bool can_use_mode (TrackMode /*m*/, bool& /*bounce_required*/) { return false; }
        PBD::Signal0<void> TrackModeChanged;
 
+       virtual void set_monitoring (MonitorChoice);
+       MonitorChoice monitoring_choice() const { return _monitoring; }
+       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, bool can_record, bool rec_monitors_input);
+                            bool state_changing);
 
        int silent_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
-                         bool can_record, bool rec_monitors_input, bool& need_butler);
+                        bool& need_butler);
 
        virtual int roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
-                          int declick, bool can_record, bool rec_monitors_input, bool& need_butler) = 0;
+                         int declick, bool& need_butler) = 0;
 
-        bool needs_butler() const { return _needs_butler; }
-       void toggle_monitor_input ();
+       bool needs_butler() const { return _needs_butler; }
 
        virtual DataType data_type () const = 0;
 
        bool can_record();
 
-        virtual void use_new_diskstream () = 0;
-        virtual void set_diskstream (boost::shared_ptr<Diskstream>);
+       void use_new_diskstream ();
+       virtual boost::shared_ptr<Diskstream> create_diskstream() = 0;
+       virtual void set_diskstream (boost::shared_ptr<Diskstream>);
 
        void set_latency_compensation (framecnt_t);
 
@@ -85,7 +92,7 @@ class Track : public Route, public PublicDiskstream
 
        XMLNode&    get_state();
        XMLNode&    get_template();
-       virtual int set_state (const XMLNode&, int version) = 0;
+       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; }
@@ -93,8 +100,7 @@ class Track : public Route, public PublicDiskstream
        bool record_enabled() const;
        void set_record_enabled (bool yn, void *src);
 
-       /* XXX: unfortunate that this is exposed */
-       PBD::ID const & diskstream_id () const;
+       bool using_diskstream_id (PBD::ID) const;
 
        void set_block_size (pframes_t);
 
@@ -105,18 +111,17 @@ class Track : public Route, public PublicDiskstream
 
        /* PublicDiskstream interface */
        boost::shared_ptr<Playlist> playlist ();
-       void monitor_input (bool);
+       void request_jack_monitors_input (bool);
+       void ensure_jack_monitors_input (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::list<boost::shared_ptr<Source> > steal_write_sources();
        void reset_write_sources (bool, bool force = false);
        float playback_buffer_load () const;
        float capture_buffer_load () const;
        int do_refill ();
        int do_flush (RunContext, bool force = false);
-       uint32_t read_data_count() const;
-       uint32_t write_data_count() const;
        void set_pending_overwrite (bool);
        int seek (framepos_t, bool complete_refill = false);
        bool hidden () const;
@@ -133,7 +138,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);
        void set_slaved (bool);
        ChanCount n_channels ();
        framepos_t get_capture_start_frame (uint32_t n = 0) const;
@@ -143,12 +148,12 @@ class Track : public Route, public PublicDiskstream
        framepos_t current_capture_end () const;
        void playlist_modified ();
        int use_playlist (boost::shared_ptr<Playlist>);
-       void set_align_style (AlignStyle);
-       void set_align_choice (AlignChoice);
+       void set_align_style (AlignStyle, bool force=false);
+       void set_align_choice (AlignChoice, bool force=false);
        int use_copy_playlist ();
        int use_new_playlist ();
-        void adjust_playback_buffering ();
-        void adjust_capture_buffering ();
+       void adjust_playback_buffering ();
+       void adjust_capture_buffering ();
 
        PBD::Signal0<void> DiskstreamChanged;
        PBD::Signal0<void> FreezeChange;
@@ -158,12 +163,17 @@ class Track : public Route, public PublicDiskstream
        PBD::Signal0<void> AlignmentStyleChanged;
 
   protected:
-       virtual XMLNode& state (bool full) = 0;
+       XMLNode& state (bool full);
 
        boost::shared_ptr<Diskstream> _diskstream;
-       MeterPoint  _saved_meter_point;
-       TrackMode   _mode;
-        bool        _needs_butler;
+       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;
 
        //private: (FIXME)
        struct FreezeRecordProcessorInfo {
@@ -203,17 +213,24 @@ class Track : public Route, public PublicDiskstream
        XMLNode*              pending_state;
        bool                  _destructive;
 
-        void maybe_declick (BufferSet&, framecnt_t, int);
-
-       virtual bool send_silence () const;
+       void maybe_declick (BufferSet&, framecnt_t, int);
 
        boost::shared_ptr<RecEnableControllable> _rec_enable_control;
+       
+       framecnt_t check_initial_delay (framecnt_t nframes, framecnt_t&);
 
 private:
+
+       virtual boost::shared_ptr<Diskstream> diskstream_factory (XMLNode const &) = 0;
+       
        void diskstream_playlist_changed ();
        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*/