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
This commit is contained in:
Paul Davis 2008-04-01 19:08:10 +00:00
parent 1a4c362c98
commit d4ca31ada8
4 changed files with 17 additions and 18 deletions

View file

@ -214,6 +214,8 @@ IOSelector::IOSelector (Session& sess, boost::shared_ptr<IO> ior, bool input)
io->output_changed.connect (mem_fun(*this, &IOSelector::ports_changed));
}
set_button_sensitivity ();
io->name_changed.connect (mem_fun(*this, &IOSelector::name_changed));
}

View file

@ -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 ();
}

View file

@ -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;
}

View file

@ -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>