-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 = i->total_latency ()) > 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 = i->total_latency ()) > 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 cnt = c->nchannels ();
-
- for (uint32_t n = 0; n < cnt; ++n) {
- const Bundle::PortList& pl = c->channel_ports (n);
-
- for (Bundle::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 cnt = c->nchannels ();
-
- for (uint32_t n = 0; n < cnt; ++n) {
-
- const Bundle::PortList& pl = c->channel_ports (n);
-
- for (Bundle::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 ();
-}
-
-void
-IO::bundle_configuration_changed ()
-{
- //XXX
-// connect_input_ports_to_bundle (_input_bundle, this);
-}
-
-void
-IO::bundle_ports_changed (int ignored)
-{
- //XXX
-// connect_output_ports_to_bundle (_output_bundle, this);
-}
-
-void
-IO::GainControl::set_value (float val)
-{
- // max gain at about +6dB (10.0 ^ ( 6 dB * 0.05))
- if (val > 1.99526231f)
- val = 1.99526231f;
-
- _io->set_gain (val, this);
-
- AutomationControl::set_value(val);
-}
-
-float
-IO::GainControl::get_value (void) const
-{
- return AutomationControl::get_value();
-}
-
-void
-IO::setup_peak_meters()
-{
- ChanCount max_streams = std::max (_inputs.count(), _outputs.count());
- _meter->configure_io (max_streams, max_streams);
-}
-
-/**
- Update the peak meters.
-
- The meter signal lock is taken to prevent modification of the
- Meter signal while updating the meters, taking the meter signal
- lock prior to taking the io_lock ensures that all IO will remain
- valid while metering.
-*/
-void
-IO::update_meters()
-{
- Glib::Mutex::Lock guard (m_meter_signal_lock);
- Meter(); /* EMIT SIGNAL */
-}
-
-void
-IO::meter ()