diff options
-rw-r--r-- | libs/ardour/ardour/diskstream.h | 10 | ||||
-rw-r--r-- | libs/ardour/audio_track.cc | 2 | ||||
-rw-r--r-- | libs/ardour/delivery.cc | 1 | ||||
-rw-r--r-- | libs/ardour/diskstream.cc | 32 | ||||
-rw-r--r-- | libs/ardour/midi_track.cc | 2 | ||||
-rw-r--r-- | libs/ardour/route.cc | 11 | ||||
-rw-r--r-- | libs/ardour/session_butler.cc | 2 |
7 files changed, 29 insertions, 31 deletions
diff --git a/libs/ardour/ardour/diskstream.h b/libs/ardour/ardour/diskstream.h index ea5e748ebd..8a51a3d570 100644 --- a/libs/ardour/ardour/diskstream.h +++ b/libs/ardour/ardour/diskstream.h @@ -54,6 +54,7 @@ class IO; class Playlist; class Processor; class Region; +class Route; class Send; class Session; @@ -73,8 +74,8 @@ class Diskstream : public SessionObject, public boost::noncopyable bool set_name (const std::string& str); - ARDOUR::IO* io() const { return _io; } - void set_io (ARDOUR::IO& io); + boost::shared_ptr<ARDOUR::IO> io() const { return _io; } + void set_route (ARDOUR::Route&); virtual float playback_buffer_load() const = 0; virtual float capture_buffer_load() const = 0; @@ -250,7 +251,8 @@ class Diskstream : public SessionObject, public boost::noncopyable uint32_t i_am_the_modifier; - ARDOUR::IO* _io; + boost::shared_ptr<ARDOUR::IO> _io; + Route* _route; ChanCount _n_channels; boost::shared_ptr<Playlist> _playlist; @@ -312,6 +314,8 @@ class Diskstream : public SessionObject, public boost::noncopyable sigc::connection plregion_connection; Flag _flags; + + void route_going_away (); }; }; /* namespace ARDOUR */ diff --git a/libs/ardour/audio_track.cc b/libs/ardour/audio_track.cc index 1db1147205..aa327e1eba 100644 --- a/libs/ardour/audio_track.cc +++ b/libs/ardour/audio_track.cc @@ -176,7 +176,7 @@ int AudioTrack::set_diskstream (boost::shared_ptr<AudioDiskstream> ds, void *src) { _diskstream = ds; - _diskstream->set_io (*(_input.get())); + _diskstream->set_route (*this); _diskstream->set_destructive (_mode == Destructive); _diskstream->set_non_layered (_mode == NonLayered); diff --git a/libs/ardour/delivery.cc b/libs/ardour/delivery.cc index 45e70eb4a2..d49236f785 100644 --- a/libs/ardour/delivery.cc +++ b/libs/ardour/delivery.cc @@ -407,7 +407,6 @@ Delivery::target_gain () */ if (_no_outs_cuz_we_no_monitor) { - std::cerr << this << " no outs cuz we no monitor\n"; return 0.0; } diff --git a/libs/ardour/diskstream.cc b/libs/ardour/diskstream.cc index e262fe240f..27c6bb260c 100644 --- a/libs/ardour/diskstream.cc +++ b/libs/ardour/diskstream.cc @@ -87,7 +87,7 @@ void Diskstream::init (Flag f) { _flags = f; - _io = 0; + _route = 0; _alignment_style = ExistingMaterial; _persistent_alignment_style = ExistingMaterial; first_input_change = true; @@ -133,12 +133,15 @@ Diskstream::~Diskstream () } void -Diskstream::set_io (IO& io) +Diskstream::set_route (Route& r) { - _io = &io; + _route = &r; + _io = _route->input(); input_change_pending = ConfigurationChanged; non_realtime_input_change (); set_align_style_from_io (); + + _route->GoingAway.connect (mem_fun (*this, &Diskstream::route_going_away)); } void @@ -420,12 +423,7 @@ Diskstream::remove_region_from_last_capture (boost::weak_ptr<Region> wregion) void Diskstream::playlist_ranges_moved (list< Evoral::RangeMove<nframes_t> > const & movements_frames) { -#if 0 - - XXX THIS HAS TO BE FIXED FOR 3.0 - - - if (Config->get_automation_follows_regions () == false) { + if (!_route || Config->get_automation_follows_regions () == false) { return; } @@ -436,7 +434,7 @@ Diskstream::playlist_ranges_moved (list< Evoral::RangeMove<nframes_t> > const & } /* move gain automation */ - boost::shared_ptr<AutomationList> gain_alist = _io->gain_control()->list(); + boost::shared_ptr<AutomationList> gain_alist = _route->gain_control()->alist(); XMLNode & before = gain_alist->get_state (); gain_alist->move_ranges (movements); _session.add_command ( @@ -446,7 +444,7 @@ Diskstream::playlist_ranges_moved (list< Evoral::RangeMove<nframes_t> > const & ); /* move panner automation */ - boost::shared_ptr<Panner> p = _io->panner (); + boost::shared_ptr<Panner> p = _route->main_outs()->panner (); if (p) { for (uint32_t i = 0; i < p->npanners (); ++i) { boost::shared_ptr<AutomationList> pan_alist = p->streampanner(i).pan_control()->alist(); @@ -459,11 +457,8 @@ Diskstream::playlist_ranges_moved (list< Evoral::RangeMove<nframes_t> > const & /* move processor automation */ /* XXX: ewww */ - Route * route = dynamic_cast<Route*> (_io); - if (route) { - route->foreach_processor (sigc::bind (sigc::mem_fun (*this, &Diskstream::move_processor_automation), movements_frames)); - } -#endif + + _route->foreach_processor (sigc::bind (sigc::mem_fun (*this, &Diskstream::move_processor_automation), movements_frames)); } void @@ -495,3 +490,8 @@ Diskstream::move_processor_automation (boost::weak_ptr<Processor> p, } } +void +Diskstream::route_going_away () +{ + _io.reset (); +} diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc index a6ff1b93f4..fc106194a2 100644 --- a/libs/ardour/midi_track.cc +++ b/libs/ardour/midi_track.cc @@ -95,7 +95,7 @@ int MidiTrack::set_diskstream (boost::shared_ptr<MidiDiskstream> ds) { _diskstream = ds; - _diskstream->set_io (*(_input.get())); + _diskstream->set_route (*this); _diskstream->set_destructive (_mode == Destructive); _diskstream->set_record_enabled (false); diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 68f6107b45..575cad8e0b 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -2490,17 +2490,12 @@ Route::set_name (const string& str) for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) { - /* rename all processors with outputs to reflect our new name */ + /* rename all I/O processors that have inputs or outputs */ boost::shared_ptr<IOProcessor> iop = boost::dynamic_pointer_cast<IOProcessor> (*i); - if (iop) { - string iop_name = name; - iop_name += '['; - iop_name += "XXX FIX ME XXX"; - iop_name += ']'; - - if (!iop->set_name (iop_name)) { + if (iop && (iop->output() || iop->input())) { + if (!iop->set_name (name)) { ret = false; } } diff --git a/libs/ardour/session_butler.cc b/libs/ardour/session_butler.cc index 1c31bc2e26..59fe9e29a8 100644 --- a/libs/ardour/session_butler.cc +++ b/libs/ardour/session_butler.cc @@ -266,7 +266,7 @@ Session::butler_thread_work () /* don't read inactive tracks */ - IO* io = ds->io(); + boost::shared_ptr<IO> io = ds->io(); if (io && !io->active()) { continue; |