diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-04-01 19:08:10 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-04-01 19:08:10 +0000 |
commit | d4ca31ada80a60a12461245feeb4aa7316a2695a (patch) | |
tree | b330e4d10fa39c890a387b1158b4aef024e332d5 /libs | |
parent | 1a4c362c98ffc8aa8418fc7330f11ff0039b2b59 (diff) |
clean up port insert port count/config mess, maybe
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3205 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/insert.cc | 30 | ||||
-rw-r--r-- | libs/ardour/io.cc | 2 | ||||
-rw-r--r-- | libs/ardour/route.cc | 1 |
3 files changed, 15 insertions, 18 deletions
diff --git a/libs/ardour/insert.cc b/libs/ardour/insert.cc index f9c20a35d1..ce538fc960 100644 --- a/libs/ardour/insert.cc +++ b/libs/ardour/insert.cc @@ -23,6 +23,7 @@ #include <pbd/failed_constructor.h> #include <pbd/xml++.h> +#include <pbd/stacktrace.h> #include <ardour/insert.h> #include <ardour/plugin.h> @@ -924,15 +925,6 @@ PortInsert::PortInsert (const PortInsert& other) void PortInsert::init () { - if (add_input_port ("", this)) { - error << _("PortInsert: cannot add input port") << endmsg; - throw failed_constructor(); - } - - if (add_output_port ("", this)) { - error << _("PortInsert: cannot add output port") << endmsg; - throw failed_constructor(); - } } PortInsert::PortInsert (Session& s, const XMLNode& node) @@ -1065,7 +1057,7 @@ PortInsert::can_support_input_configuration (int32_t in) const /* not configured yet */ - return 1; /* we can support anything the first time we're asked */ + return in; /* we can support anything the first time we're asked */ } else { @@ -1074,7 +1066,7 @@ PortInsert::can_support_input_configuration (int32_t in) const */ if (output_maximum() == in) { - return 1; + return in; } } @@ -1088,8 +1080,12 @@ PortInsert::configure_io (int32_t ignored_magic, int32_t in, int32_t out) the last request config. or something like that. */ + set_output_maximum (in); + set_output_minimum (in); + set_input_maximum (out); + set_input_minimum (out); - /* this is a bit odd: + /* this can be momentarily confusing: the number of inputs we are required to handle corresponds to the number of output ports we need. @@ -1098,11 +1094,6 @@ PortInsert::configure_io (int32_t ignored_magic, int32_t in, int32_t out) to the number of input ports we need. */ - set_output_maximum (in); - set_output_minimum (in); - set_input_maximum (out); - set_input_minimum (out); - if (in < 0) { in = n_outputs (); } @@ -1117,6 +1108,11 @@ PortInsert::configure_io (int32_t ignored_magic, int32_t in, int32_t out) int32_t PortInsert::compute_output_streams (int32_t cnt) const { + if (n_inputs() == 0) { + /* not configured yet */ + return cnt; + } + /* puzzling, eh? think about it ... */ return n_inputs (); } diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index 3f9a8b29e3..68a4128116 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -954,7 +954,7 @@ IO::add_input_port (string source, void* src, DataType type) { Glib::Mutex::Lock lm (io_lock); - + if (_input_maximum >= 0 && (int) _ninputs == _input_maximum) { return -1; } diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index f63524032d..991b3a5f23 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -24,6 +24,7 @@ #include <sigc++/bind.h> #include <pbd/xml++.h> #include <pbd/enumwriter.h> +#include <pbd/stacktrace.h> #include <ardour/timestamps.h> #include <ardour/buffer.h> |