- bool const r = SessionObject::set_name(name);
-
- setup_bundles_for_inputs_and_outputs ();
-
- return r;
-}
-
-void
-IO::set_input_minimum (ChanCount n)
-{
- _input_minimum = n;
-}
-
-void
-IO::set_input_maximum (ChanCount n)
-{
- _input_maximum = n;
-}
-
-void
-IO::set_output_minimum (ChanCount n)
-{
- _output_minimum = n;
-}
-
-void
-IO::set_output_maximum (ChanCount n)
-{
- _output_maximum = n;
-}
-
-void
-IO::set_port_latency (nframes_t nframes)
-{
- Glib::Mutex::Lock lm (io_lock);
-
- for (PortSet::iterator i = _outputs.begin(); i != _outputs.end(); ++i) {
- i->set_latency (nframes);
- }
-}
-
-nframes_t
-IO::output_latency () const
-{
- nframes_t max_latency;
- nframes_t latency;
-
- max_latency = 0;
-
- /* io lock not taken - must be protected by other means */
-
- for (PortSet::const_iterator i = _outputs.begin(); i != _outputs.end(); ++i) {
- if ((latency = _session.engine().get_port_total_latency (*i)) > max_latency) {
- max_latency = latency;
- }
- }
-
- return max_latency;
-}
-
-nframes_t
-IO::input_latency () const
-{
- nframes_t max_latency;
- nframes_t latency;
-
- max_latency = 0;
-
- /* io lock not taken - must be protected by other means */
-
- for (PortSet::const_iterator i = _inputs.begin(); i != _inputs.end(); ++i) {
- if ((latency = _session.engine().get_port_total_latency (*i)) > max_latency) {
- max_latency = latency;
- }
- }
-
- return max_latency;
-}
-
-int
-IO::connect_input_ports_to_bundle (boost::shared_ptr<Bundle> c, void* src)
-{
- {
- BLOCK_PROCESS_CALLBACK ();
- Glib::Mutex::Lock lm2 (io_lock);
-
- /* Connect to the bundle, not worrying about any connections
- that are already made. */
-
- uint32_t const channels = c->nchannels ();
-
- for (uint32_t n = 0; n < channels; ++n) {
- const PortList& pl = c->channel_ports (n);
-
- for (PortList::const_iterator i = pl.begin(); i != pl.end(); ++i) {
-
- if (!_inputs.port(n)->connected_to (*i)) {
-
- if (_session.engine().connect (*i, _inputs.port(n)->name())) {
- return -1;
- }
- }
-
- }
- }
-
- /* If this is a UserBundle, make a note of what we've done */
-
- boost::shared_ptr<UserBundle> ub = boost::dynamic_pointer_cast<UserBundle> (c);
- if (ub) {
-
- /* See if we already know about this one */
- std::vector<UserBundleInfo>::iterator i = _bundles_connected_to_inputs.begin();
- while (i != _bundles_connected_to_inputs.end() && i->bundle != ub) {
- ++i;
- }
-
- if (i == _bundles_connected_to_inputs.end()) {
- /* We don't, so make a note */
- _bundles_connected_to_inputs.push_back (UserBundleInfo (this, ub));
- }
- }
- }
-
- input_changed (IOChange (ConfigurationChanged|ConnectionsChanged), src); /* EMIT SIGNAL */
- return 0;
-}
-
-int
-IO::connect_output_ports_to_bundle (boost::shared_ptr<Bundle> c, void* src)
-{
- {
- BLOCK_PROCESS_CALLBACK ();
- Glib::Mutex::Lock lm2 (io_lock);
-
- /* Connect to the bundle, not worrying about any connections
- that are already made. */
-
- uint32_t const channels = c->nchannels ();
-
- for (uint32_t n = 0; n < channels; ++n) {
-
- const PortList& pl = c->channel_ports (n);
-
- for (PortList::const_iterator i = pl.begin(); i != pl.end(); ++i) {
-
- if (!_outputs.port(n)->connected_to (*i)) {
-
- if (_session.engine().connect (_outputs.port(n)->name(), *i)) {
- return -1;
- }
- }
- }
- }
-
- /* If this is a UserBundle, make a note of what we've done */
-
- boost::shared_ptr<UserBundle> ub = boost::dynamic_pointer_cast<UserBundle> (c);
- if (ub) {
-
- /* See if we already know about this one */
- std::vector<UserBundleInfo>::iterator i = _bundles_connected_to_outputs.begin();
- while (i != _bundles_connected_to_outputs.end() && i->bundle != ub) {
- ++i;
- }
-
- if (i == _bundles_connected_to_outputs.end()) {
- /* We don't, so make a note */
- _bundles_connected_to_outputs.push_back (UserBundleInfo (this, ub));
- }
- }
- }
-
- output_changed (IOChange (ConnectionsChanged|ConfigurationChanged), src); /* EMIT SIGNAL */
-
- return 0;
-}
-
-int
-IO::disable_connecting ()
-{
- connecting_legal = false;
- return 0;
-}
-
-int
-IO::enable_connecting ()
-{
- connecting_legal = true;
- return ConnectingLegal ();
-}
-
-int
-IO::disable_ports ()
-{
- ports_legal = false;
- return 0;
-}
-
-int
-IO::enable_ports ()
-{
- ports_legal = true;
- return PortsLegal ();
-}
-
-int
-IO::disable_panners (void)
-{
- panners_legal = false;
- return 0;
-}
-
-int
-IO::reset_panners ()
-{
- panners_legal = true;
- return PannersLegal ();
-}