- _bundles_connected_to_outputs.push_back (UserBundleInfo (this, ub));
- }
- }
- }
-
- output_changed (IOChange (ConnectionsChanged|ConfigurationChanged), src); /* EMIT SIGNAL */
-
- return 0;
-}
-
-int
-IO::disconnect_output_ports_from_bundle (boost::shared_ptr<Bundle> c, void* src)
-{
- {
- BLOCK_PROCESS_CALLBACK ();
- Glib::Mutex::Lock lm2 (io_lock);
-
- c->disconnect (_bundle_for_outputs, _session.engine());
-
- /* 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) {
-
- 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()) {
- _bundles_connected_to_outputs.erase (i);
- }
- }
- }
-
- output_changed (IOChange (ConfigurationChanged|ConnectionsChanged), 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_changed (Bundle::Change c)
-{
- //XXX
-// connect_input_ports_to_bundle (_input_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 ()
-{
- // FIXME: Ugly. Meter should manage the lock, if it's necessary
-
- Glib::Mutex::Lock lm (io_lock); // READER: meter thread.
- _meter->meter();
-}
-
-void
-IO::clear_automation ()
-{
- data().clear (); // clears gain automation
- _panner->data().clear();
-}
-
-void
-IO::set_parameter_automation_state (Evoral::Parameter param, AutoState state)
-{
- // XXX: would be nice to get rid of this special hack
-
- if (param.type() == GainAutomation) {
-
- bool changed = false;
-
- {
- Glib::Mutex::Lock lm (control_lock());
-
- boost::shared_ptr<AutomationList> gain_auto
- = boost::dynamic_pointer_cast<AutomationList>(_gain_control->list());
-
- if (state != gain_auto->automation_state()) {
- changed = true;
- _last_automation_snapshot = 0;
- gain_auto->set_automation_state (state);
-
- if (state != Off) {
- // FIXME: shouldn't this use Curve?
- set_gain (gain_auto->eval (_session.transport_frame()), this);
- }