use a note tracker to resolve notes cut off during render by the end of the region
[ardour.git] / libs / ardour / internal_send.cc
index 9749dab7603aacb0c84aa4404f6a4dcbea7c8ab0..16a144ca6e48c8e1e798fdc3909cb7625e45cbee 100644 (file)
@@ -1,21 +1,24 @@
 /*
-    Copyright (C) 2009 Paul Davis
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
+ * Copyright (C) 2009-2012 Carl Hetherington <carl@carlh.net>
+ * Copyright (C) 2009-2012 David Robillard <d@drobilla.net>
+ * Copyright (C) 2009-2017 Paul Davis <paul@linuxaudiosystems.com>
+ * Copyright (C) 2013-2017 Robin Gareus <robin@gareus.org>
+ * Copyright (C) 2018 Len Ovens <len@ovenwerks.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
 
 #include "pbd/error.h"
 #include "pbd/failed_constructor.h"
@@ -91,9 +94,9 @@ InternalSend::use_target (boost::shared_ptr<Route> sendto)
                _send_to->remove_send_from_internal_return (this);
        }
 
-        _send_to = sendto;
+       _send_to = sendto;
 
-        _send_to->add_send_to_internal_return (this);
+       _send_to->add_send_to_internal_return (this);
 
        mixbufs.ensure_buffers (_send_to->internal_return()->input_streams(), _session.get_block_size());
        mixbufs.set_count (_send_to->internal_return()->input_streams());
@@ -104,16 +107,16 @@ InternalSend::use_target (boost::shared_ptr<Route> sendto)
 
        reset_panner ();
 
-        set_name (sendto->name());
-        _send_to_id = _send_to->id();
+       set_name (sendto->name());
+       _send_to_id = _send_to->id();
 
-        target_connections.drop_connections ();
+       target_connections.drop_connections ();
 
-        _send_to->DropReferences.connect_same_thread (target_connections, boost::bind (&InternalSend::send_to_going_away, this));
-        _send_to->PropertyChanged.connect_same_thread (target_connections, boost::bind (&InternalSend::send_to_property_changed, this, _1));
-        _send_to->io_changed.connect_same_thread (target_connections, boost::bind (&InternalSend::target_io_changed, this));
+       _send_to->DropReferences.connect_same_thread (target_connections, boost::bind (&InternalSend::send_to_going_away, this));
+       _send_to->PropertyChanged.connect_same_thread (target_connections, boost::bind (&InternalSend::send_to_property_changed, this, _1));
+       _send_to->io_changed.connect_same_thread (target_connections, boost::bind (&InternalSend::target_io_changed, this));
 
-        return 0;
+       return 0;
 }
 
 void
@@ -134,7 +137,7 @@ InternalSend::send_from_going_away ()
 void
 InternalSend::send_to_going_away ()
 {
-        target_connections.drop_connections ();
+       target_connections.drop_connections ();
        _send_to.reset ();
        _send_to_id = "0";
 }
@@ -277,7 +280,7 @@ InternalSend::set_block_size (pframes_t nframes)
                mixbufs.ensure_buffers (_send_to->internal_return()->input_streams(), nframes);
        }
 
-        return 0;
+       return 0;
 }
 
 void
@@ -349,7 +352,7 @@ InternalSend::connect_when_legal ()
                return 0;
        }
 
-        boost::shared_ptr<Route> sendto;
+       boost::shared_ptr<Route> sendto;
 
        if ((sendto = _session.route_by_id (_send_to_id)) == 0) {
                error << string_compose (_("%1 - cannot find any track/bus with the ID %2 to connect to"), display_name(), _send_to_id) << endmsg;
@@ -357,7 +360,7 @@ InternalSend::connect_when_legal ()
                return -1;
        }
 
-        return use_target (sendto);
+       return use_target (sendto);
 }
 
 bool