major, substantive reworking of how we store GUI information (visibility, height...
[ardour.git] / libs / ardour / ardour / track.h
index 60e628af79c21e69caeb2bd9d8fab08f62ef7ebb..7f801b31ccb193cc107614aab7fbcc8c03e59903 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,25 +48,26 @@ class Track : public Route, public PublicDiskstream
        virtual bool can_use_mode (TrackMode /*m*/, bool& /*bounce_required*/) { return false; }
        PBD::Signal0<void> TrackModeChanged;
 
-       virtual int no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
-                       bool state_changing, bool can_record, bool rec_monitors_input);
+       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);
 
-       int silent_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
-                         bool can_record, bool rec_monitors_input, bool& need_butler);
+       int silent_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
+                        bool can_record, bool rec_monitors_input, bool& need_butler);
 
-       virtual int roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
-                          int declick, bool can_record, bool rec_monitors_input, bool& need_butler) = 0;
+       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;
 
-        bool needs_butler() const { return _needs_butler; }
+       bool needs_butler() const { return _needs_butler; }
        void toggle_monitor_input ();
 
+       virtual DataType data_type () const = 0;
+
        bool can_record();
 
-        virtual void use_new_diskstream () = 0;
-        virtual void set_diskstream (boost::shared_ptr<Diskstream>);
+       virtual void use_new_diskstream () = 0;
+       virtual void set_diskstream (boost::shared_ptr<Diskstream>);
 
-       nframes_t update_total_latency();
-       void           set_latency_delay (nframes_t);
+       void set_latency_compensation (framecnt_t);
 
        enum FreezeState {
                NoFreeze,
@@ -80,7 +81,7 @@ class Track : public Route, public PublicDiskstream
        virtual void unfreeze () = 0;
 
        virtual boost::shared_ptr<Region> bounce (InterThreadInfo&) = 0;
-       virtual boost::shared_ptr<Region> bounce_range (nframes_t start, nframes_t end, InterThreadInfo&, bool enable_processing = true) = 0;
+       virtual boost::shared_ptr<Region> bounce_range (framepos_t start, framepos_t end, InterThreadInfo&, bool enable_processing = true) = 0;
 
        XMLNode&    get_state();
        XMLNode&    get_template();
@@ -90,12 +91,17 @@ class Track : public Route, public PublicDiskstream
        boost::shared_ptr<PBD::Controllable> rec_enable_control() { return _rec_enable_control; }
 
        bool record_enabled() const;
-       void set_record_enable (bool yn, void *src);
+       void set_record_enabled (bool yn, void *src);
 
        /* XXX: unfortunate that this is exposed */
        PBD::ID const & diskstream_id () const;
 
-       void set_block_size (nframes_t);
+       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 ();
@@ -103,7 +109,7 @@ class Track : public Route, public PublicDiskstream
        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;
@@ -112,36 +118,37 @@ class Track : public Route, public PublicDiskstream
        uint32_t read_data_count() const;
        uint32_t write_data_count() const;
        void set_pending_overwrite (bool);
-       int seek (nframes_t, bool complete_refill = false);
+       int seek (framepos_t, bool complete_refill = false);
        bool hidden () const;
-       int can_internal_playback_seek (nframes_t);
-       int internal_playback_seek (nframes_t);
+       int can_internal_playback_seek (framepos_t);
+       int internal_playback_seek (framepos_t);
        void non_realtime_input_change ();
-       void non_realtime_locate (nframes_t);
+       void non_realtime_locate (framepos_t);
        void non_realtime_set_speed ();
        int overwrite_existing_buffers ();
-       nframes_t get_captured_frames (uint32_t n = 0);
+       framecnt_t get_captured_frames (uint32_t n = 0) const;
        int set_loop (Location *);
-       void transport_looped (nframes_t);
+       void transport_looped (framepos_t);
        bool realtime_set_speed (double, bool);
        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 ();
-       nframes_t get_capture_start_frame (uint32_t n = 0);
+       framepos_t get_capture_start_frame (uint32_t n = 0) const;
        AlignStyle alignment_style () const;
-       void set_record_enabled (bool);
-       nframes_t current_capture_start () const;
-       nframes_t current_capture_end () const;
+       AlignChoice alignment_choice () const;
+       framepos_t current_capture_start () const;
+       framepos_t current_capture_end () const;
        void playlist_modified ();
        int use_playlist (boost::shared_ptr<Playlist>);
-       void set_align_style (AlignStyle);
+       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;
@@ -156,9 +163,7 @@ class Track : public Route, public PublicDiskstream
        boost::shared_ptr<Diskstream> _diskstream;
        MeterPoint  _saved_meter_point;
        TrackMode   _mode;
-        bool        _needs_butler;
-
-        ChanCount input_streams () const;
+       bool        _needs_butler;
 
        //private: (FIXME)
        struct FreezeRecordProcessorInfo {
@@ -186,8 +191,8 @@ class Track : public Route, public PublicDiskstream
        struct RecEnableControllable : public PBD::Controllable {
                RecEnableControllable (Track&);
 
-               void set_value (float);
-               float get_value (void) const;
+               void set_value (double);
+               double get_value (void) const;
 
                Track& track;
        };
@@ -198,6 +203,10 @@ class Track : public Route, public PublicDiskstream
        XMLNode*              pending_state;
        bool                  _destructive;
 
+       void maybe_declick (BufferSet&, framecnt_t, int);
+
+       virtual bool send_silence () const;
+
        boost::shared_ptr<RecEnableControllable> _rec_enable_control;
 
 private: