summaryrefslogtreecommitdiff
path: root/libs/ardour/auditioner.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-03-18 06:07:08 +0000
committerDavid Robillard <d@drobilla.net>2007-03-18 06:07:08 +0000
commit99904735e066804358f1d0bd138a84f1e9ecda91 (patch)
tree71a924cf1660b5b00231275bd481bbd27094dd9b /libs/ardour/auditioner.cc
parenteb270e70a12c410cdd98585ad25bb6d8e384a4f5 (diff)
Merged with trunk R1612.
git-svn-id: svn://localhost/ardour2/branches/midi@1614 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/auditioner.cc')
-rw-r--r--libs/ardour/auditioner.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/libs/ardour/auditioner.cc b/libs/ardour/auditioner.cc
index 7bbc4cd0ba..0ba30b2b8b 100644
--- a/libs/ardour/auditioner.cc
+++ b/libs/ardour/auditioner.cc
@@ -15,7 +15,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id$
*/
#include <glibmm/thread.h>
@@ -65,7 +64,7 @@ Auditioner::Auditioner (Session& s)
}
if (right.length()) {
- audio_diskstream()->add_channel();
+ audio_diskstream()->add_channel (1);
add_output_port (right, this, DataType::AUDIO);
}
@@ -141,12 +140,10 @@ Auditioner::audition_region (boost::shared_ptr<Region> region)
_diskstream->playlist()->clear ();
_diskstream->playlist()->add_region (the_region, 0, 1);
- while (_diskstream->n_channels().get(DataType::AUDIO) < the_region->n_channels()) {
- audio_diskstream()->add_channel ();
- }
-
- while (_diskstream->n_channels().get(DataType::AUDIO) > the_region->n_channels()) {
- audio_diskstream()->remove_channel ();
+ if (_diskstream->n_channels().get(DataType::AUDIO) < the_region->n_channels()) {
+ audio_diskstream()->add_channel (the_region->n_channels() - _diskstream->n_channels().get(DataType::AUDIO));
+ } else if (_diskstream->n_channels().get(DataType::AUDIO) > the_region->n_channels()) {
+ audio_diskstream()->remove_channel (_diskstream->n_channels().get(DataType::AUDIO) - the_region->n_channels());
}
/* force a panner reset now that we have all channels */