diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index b6631298d1..d0ded19878 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -711,6 +711,8 @@ protected: SlavableControlList slavables () const; + void fill_buffers_with_input (BufferSet& bufs, boost::shared_ptr io, pframes_t nframes); + private: /* no copy construction */ Route (Route const &); @@ -751,7 +753,6 @@ private: pframes_t latency_preroll (pframes_t nframes, samplepos_t& start_sample, samplepos_t& end_sample); void run_route (samplepos_t start_sample, samplepos_t end_sample, pframes_t nframes, bool gain_automation_ok, bool run_disk_reader); - void fill_buffers_with_input (BufferSet& bufs, boost::shared_ptr io, pframes_t nframes); void reset_instrument_info (); void solo_control_changed (bool self, PBD::Controllable::GroupControlDisposition); diff --git a/libs/ardour/ardour/trigger_track.h b/libs/ardour/ardour/trigger_track.h index 5a022e9571..d3e226e3e4 100644 --- a/libs/ardour/ardour/trigger_track.h +++ b/libs/ardour/ardour/trigger_track.h @@ -46,7 +46,7 @@ class LIBARDOUR_API Trigger { Trigger() {} virtual ~Trigger() {} - virtual void bang (TriggerTrack&, Evoral::Beats, framepos_t) = 0; + virtual void bang (TriggerTrack&, Temporal::Beats const &, samplepos_t) = 0; }; class LIBARDOUR_API AudioTrigger : public Trigger { @@ -54,15 +54,15 @@ class LIBARDOUR_API AudioTrigger : public Trigger { AudioTrigger (boost::shared_ptr); ~AudioTrigger (); - void bang (TriggerTrack&, Evoral::Beats, framepos_t); - Sample* run (uint32_t channel, pframes_t& nframes, framepos_t start_frame, framepos_t end_frame, bool& need_butler); + void bang (TriggerTrack&, Temporal::Beats const & , samplepos_t); + Sample* run (uint32_t channel, pframes_t& nframes, samplepos_t start_frame, samplepos_t end_frame, bool& need_butler); private: boost::shared_ptr region; bool running; std::vector data; - framecnt_t read_index; - framecnt_t length; + samplecnt_t read_index; + samplecnt_t length; }; class LIBARDOUR_API TriggerTrack : public Track @@ -73,25 +73,21 @@ public: int init (); - int roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool& need_butler); + int roll (pframes_t nframes, samplepos_t start_frame, samplepos_t end_frame, int declick, bool& need_butler); void realtime_handle_transport_stopped (); - void realtime_locate (); - void non_realtime_locate (framepos_t); - - boost::shared_ptr create_diskstream (); - void set_diskstream (boost::shared_ptr); + void realtime_locate (bool); + void non_realtime_locate (samplepos_t); int set_mode (TrackMode m); bool can_use_mode (TrackMode m, bool& bounce_required); void freeze_me (ARDOUR::InterThreadInfo&); void unfreeze (); - boost::shared_ptr bounce (ARDOUR::InterThreadInfo&); - boost::shared_ptr bounce_range (framepos_t, framepos_t, ARDOUR::InterThreadInfo&, boost::shared_ptr, bool); - int export_stuff (BufferSet&, framepos_t, framecnt_t, boost::shared_ptr, bool, bool, bool); + boost::shared_ptr bounce (ARDOUR::InterThreadInfo&, std::string const &); + boost::shared_ptr bounce_range (samplepos_t, samplepos_t, ARDOUR::InterThreadInfo&, boost::shared_ptr, bool, std::string const &); + int export_stuff (BufferSet&, samplepos_t, samplecnt_t, boost::shared_ptr, bool, bool, bool, MidiStateTracker&); void set_state_part_two (); - boost::shared_ptr diskstream_factory (const XMLNode&); DataType data_type () const { return DataType::AUDIO; @@ -110,14 +106,14 @@ protected: private: boost::shared_ptr _midi_port; - RingBuffer _trigger_queue; + PBD::RingBuffer _trigger_queue; typedef std::vector Triggers; Triggers active_triggers; Glib::Threads::Mutex trigger_lock; Triggers all_triggers; - int no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, bool state_changing); + int no_roll (pframes_t nframes, samplepos_t start_frame, samplepos_t end_frame, bool state_changing); void note_on (int note_number, int velocity); void note_off (int note_number, int velocity); diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index c93eb561db..cabf0e400b 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -2774,22 +2774,6 @@ Session::new_trigger_track (const ChanCount& input_channels, const ChanCount& ou track->set_strict_io (true); } - if (ARDOUR::Profile->get_trx ()) { - // TRACKS considers it's not a USE CASE, it's - // a piece of behavior of the session model: - // - // Gain for a newly created route depends on - // the current output_auto_connect mode: - // - // 0 for Stereo Out mode - // 0 Multi Out mode - if (Config->get_output_auto_connect() & AutoConnectMaster) { - track->gain_control()->set_value (dB_to_coefficient (0), Controllable::NoGroup); - } - } - - track->use_new_diskstream(); - BOOST_MARK_TRACK (track); { @@ -2816,9 +2800,6 @@ Session::new_trigger_track (const ChanCount& input_channels, const ChanCount& ou route_group->add (track); } - track->non_realtime_input_change(); - - track->DiskstreamChanged.connect_same_thread (*this, boost::bind (&Session::resort_routes, this)); new_routes.push_back (track); ret.push_back (track); @@ -2841,11 +2822,7 @@ Session::new_trigger_track (const ChanCount& input_channels, const ChanCount& ou failed: if (!new_routes.empty()) { StateProtector sp (this); - if (Profile->get_trx()) { - add_routes (new_routes, false, false, false, order); - } else { - add_routes (new_routes, true, true, false, order); - } + add_routes (new_routes, true, true, order); } return ret; diff --git a/libs/ardour/trigger_track.cc b/libs/ardour/trigger_track.cc index a828afa9fc..17a68d3dd4 100644 --- a/libs/ardour/trigger_track.cc +++ b/libs/ardour/trigger_track.cc @@ -20,7 +20,6 @@ #include "ardour/audio_buffer.h" #include "ardour/audioengine.h" -#include "ardour/audio_diskstream.h" #include "ardour/audio_port.h" #include "ardour/audioregion.h" #include "ardour/io.h" @@ -114,14 +113,14 @@ TriggerTrack::queue_trigger (Trigger* trigger) } int -TriggerTrack::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, bool state_changing) +TriggerTrack::no_roll (pframes_t nframes, samplepos_t start_frame, samplepos_t end_frame, bool state_changing) { bool ignored; return roll (nframes, start_frame, end_frame, state_changing, ignored); } int -TriggerTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool& need_butler) +TriggerTrack::roll (pframes_t nframes, samplepos_t start_frame, samplepos_t end_frame, int declick, bool& need_butler) { /* check MIDI port input buffers for triggers */ @@ -139,8 +138,8 @@ TriggerTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_fr /* find offset to next bar * and beat start */ - framepos_t next_beat = 0; - Evoral::Beats beats_now; + samplepos_t next_beat = 0; + Temporal::Beats beats_now; /* if next beat occurs in this process cycle, see if we have any triggers waiting */ @@ -179,12 +178,9 @@ TriggerTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_fr need_butler = false; - uint32_t nchans = _diskstream->n_channels().n_audio(); - boost::shared_ptr ads = boost::dynamic_pointer_cast (_diskstream); - - if (!ads) { - return 0; - } + uint32_t nchans = 1; /* XXX used to get this from the diskstream + * .. where now? + */ bool err = false; @@ -233,32 +229,15 @@ TriggerTrack::realtime_handle_transport_stopped () } void -TriggerTrack::realtime_locate () +TriggerTrack::realtime_locate (bool) { } void -TriggerTrack::non_realtime_locate (framepos_t) +TriggerTrack::non_realtime_locate (samplepos_t) { } -boost::shared_ptr -TriggerTrack::create_diskstream () -{ - return boost::shared_ptr (new AudioDiskstream (_session, name(), AudioDiskstream::Recordable)); -} - -void -TriggerTrack::set_diskstream (boost::shared_ptr ds) -{ - Track::set_diskstream (ds); - _diskstream->set_track (this); - _diskstream->set_record_enabled (false); - _diskstream->request_input_monitoring (false); - - DiskstreamChanged (); /* EMIT SIGNAL */ -} - int TriggerTrack::set_state (const XMLNode& root, int version) { @@ -314,19 +293,19 @@ TriggerTrack::unfreeze () } boost::shared_ptr -TriggerTrack::bounce (ARDOUR::InterThreadInfo&) +TriggerTrack::bounce (ARDOUR::InterThreadInfo&, std::string const &) { return boost::shared_ptr (); } boost::shared_ptr -TriggerTrack::bounce_range (framepos_t, framepos_t, ARDOUR::InterThreadInfo&, boost::shared_ptr, bool) +TriggerTrack::bounce_range (samplepos_t, samplepos_t, ARDOUR::InterThreadInfo&, boost::shared_ptr, bool, std::string const &) { return boost::shared_ptr (); } int -TriggerTrack::export_stuff (BufferSet&, framepos_t, framecnt_t, boost::shared_ptr, bool, bool, bool) +TriggerTrack::export_stuff (BufferSet&, samplepos_t, samplecnt_t, boost::shared_ptr, bool, bool, bool, MidiStateTracker&) { return 0; } @@ -336,13 +315,6 @@ TriggerTrack::set_state_part_two () { } -boost::shared_ptr -TriggerTrack::diskstream_factory (const XMLNode& node) -{ - return boost::shared_ptr (new AudioDiskstream (_session, node)); -} - - /*--------------------*/ AudioTrigger::AudioTrigger (boost::shared_ptr r) @@ -374,7 +346,7 @@ AudioTrigger::~AudioTrigger () } void -AudioTrigger::bang (TriggerTrack& /*track*/, Evoral::Beats bangpos, framepos_t framepos) +AudioTrigger::bang (TriggerTrack& /*track*/, Temporal::Beats const &, samplepos_t) { /* user triggered this, and we need to get things set up for calls to * run() @@ -385,7 +357,7 @@ AudioTrigger::bang (TriggerTrack& /*track*/, Evoral::Beats bangpos, framepos_t f } Sample* -AudioTrigger::run (uint32_t channel, pframes_t& nframes, framepos_t start_frame, framepos_t end_frame, bool& need_butler) +AudioTrigger::run (uint32_t channel, pframes_t& nframes, samplepos_t start_frame, samplepos_t end_frame, bool& need_butler) { if (!running) { return 0; @@ -399,7 +371,7 @@ AudioTrigger::run (uint32_t channel, pframes_t& nframes, framepos_t start_frame, return 0; } - nframes = (pframes_t) std::min ((framecnt_t) nframes, (length - read_index)); + nframes = (pframes_t) std::min ((samplecnt_t) nframes, (length - read_index)); Sample* ret = data[channel] + read_index;