X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Ftrack.h;h=d33e24e4e684597bb35d0d88ed4da7c3250ebbeb;hb=0622a0cc3068a06d328119e90b7d9c5f5a84df32;hp=d2459779781749de118e0a094dc8e6b17209bc04;hpb=87d57a1de9125e9b2c2e0c46178906edaf7c122a;p=ardour.git diff --git a/libs/ardour/ardour/track.h b/libs/ardour/ardour/track.h index d245977978..d33e24e4e6 100644 --- a/libs/ardour/ardour/track.h +++ b/libs/ardour/ardour/track.h @@ -21,6 +21,7 @@ #include +#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,29 +44,37 @@ 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; } virtual bool can_use_mode (TrackMode /*m*/, bool& /*bounce_required*/) { return false; } PBD::Signal0 TrackModeChanged; + virtual void set_monitoring (MonitorChoice); + MonitorChoice monitoring_choice() const { return _monitoring; } + MonitorState monitoring_state () const; + PBD::Signal0 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 state_changing); int silent_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, - bool can_record, 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& need_butler) = 0; + int declick, bool& need_butler) = 0; 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; + void use_new_diskstream (); + virtual boost::shared_ptr create_diskstream() = 0; virtual void set_diskstream (boost::shared_ptr); void set_latency_compensation (framecnt_t); @@ -80,48 +90,48 @@ 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 endpoint, bool include_endpoint) const = 0; virtual boost::shared_ptr bounce (InterThreadInfo&) = 0; - virtual boost::shared_ptr bounce_range (framepos_t start, framepos_t end, InterThreadInfo&, bool enable_processing = true) = 0; + virtual boost::shared_ptr bounce_range (framepos_t start, framepos_t end, InterThreadInfo&, + boost::shared_ptr endpoint, bool include_endpoint) = 0; + virtual int export_stuff (BufferSet& bufs, framepos_t start_frame, framecnt_t nframes, + boost::shared_ptr 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) = 0; + virtual int set_state (const XMLNode&, int version); static void zero_diskstream_id_in_xml (XMLNode&); - boost::shared_ptr rec_enable_control() { return _rec_enable_control; } + boost::shared_ptr 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); - /* 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); - /** @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 (); - void monitor_input (bool); + void request_input_monitoring (bool); + void ensure_input_monitoring (bool); bool destructive () const; std::list > & last_capture_sources (); void set_capture_offset (); - std::list > 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; 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; - 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 (); @@ -152,18 +162,20 @@ class Track : public Route, public PublicDiskstream PBD::Signal0 DiskstreamChanged; PBD::Signal0 FreezeChange; + /* Emitted when our diskstream is set to use a different playlist */ PBD::Signal0 PlaylistChanged; PBD::Signal0 RecordEnableChanged; PBD::Signal0 SpeedChanged; PBD::Signal0 AlignmentStyleChanged; protected: - virtual XMLNode& state (bool full) = 0; + XMLNode& state (bool full); boost::shared_ptr _diskstream; - MeterPoint _saved_meter_point; - TrackMode _mode; - bool _needs_butler; + MeterPoint _saved_meter_point; + TrackMode _mode; + bool _needs_butler; + MonitorChoice _monitoring; //private: (FIXME) struct FreezeRecordProcessorInfo { @@ -188,13 +200,13 @@ class Track : public Route, public PublicDiskstream FreezeState state; }; - struct RecEnableControllable : public PBD::Controllable { - RecEnableControllable (Track&); + struct RecEnableControl : public AutomationControl { + RecEnableControl (boost::shared_ptr t); void set_value (double); double get_value (void) const; - Track& track; + boost::weak_ptr track; }; virtual void set_state_part_two () = 0; @@ -205,15 +217,21 @@ class Track : public Route, public PublicDiskstream void maybe_declick (BufferSet&, framecnt_t, int); - virtual bool send_silence () const; - - boost::shared_ptr _rec_enable_control; + boost::shared_ptr _rec_enable_control; + + framecnt_t check_initial_delay (framecnt_t nframes, framepos_t&); private: + + virtual boost::shared_ptr 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 const & p); + + std::string _diskstream_name; }; }; /* namespace ARDOUR*/