+ boost::shared_ptr<Bundle> b = bundle_for_type (session->the_auditioner()->output()->bundle(), type);
+ if (b->nchannels() != ChanCount::ZERO) {
+ ardour->add_bundle (b);
+ }
+
+ b = bundle_for_type (session->click_io()->bundle(), type);
+ if (b->nchannels() != ChanCount::ZERO) {
+ ardour->add_bundle (b);
+ }
+ }
+
+ /* Ardour's surfaces */
+
+ ControlProtocolManager& m = ControlProtocolManager::instance ();
+ for (list<ControlProtocolInfo*>::iterator i = m.control_protocol_info.begin(); i != m.control_protocol_info.end(); ++i) {
+ if ((*i)->protocol) {
+ list<boost::shared_ptr<Bundle> > b = (*i)->protocol->bundles ();
+ for (list<boost::shared_ptr<Bundle> >::iterator j = b.begin(); j != b.end(); ++j) {
+ if ((*j)->ports_are_inputs() == inputs) {
+ ardour->add_bundle (*j);
+ }
+ }
+ }
+ }
+
+ /* Ardour's sync ports */
+
+ MIDI::Manager* midi_manager = MIDI::Manager::instance ();
+ if (midi_manager && (type == DataType::MIDI || type == DataType::NIL)) {
+ boost::shared_ptr<Bundle> sync (new Bundle (_("Sync"), inputs));
+ MIDI::MachineControl* mmc = midi_manager->mmc ();
+ AudioEngine& ae = session->engine ();
+ if (inputs) {
+ sync->add_channel (
+ _("MTC in"), DataType::MIDI, ae.make_port_name_non_relative (midi_manager->mtc_input_port()->name())
+ );
+ sync->add_channel (
+ _("MIDI control in"), DataType::MIDI, ae.make_port_name_non_relative (midi_manager->midi_input_port()->name())
+ );
+ sync->add_channel (
+ _("MIDI clock in"), DataType::MIDI, ae.make_port_name_non_relative (midi_manager->midi_clock_input_port()->name())
+ );
+ sync->add_channel (
+ _("MMC in"), DataType::MIDI, ae.make_port_name_non_relative (mmc->input_port()->name())
+ );
+ } else {
+ sync->add_channel (
+ _("MTC out"), DataType::MIDI, ae.make_port_name_non_relative (midi_manager->mtc_output_port()->name())
+ );
+ sync->add_channel (
+ _("MIDI control out"), DataType::MIDI, ae.make_port_name_non_relative (midi_manager->midi_output_port()->name())
+ );
+ sync->add_channel (
+ _("MIDI clock out"), DataType::MIDI, ae.make_port_name_non_relative (midi_manager->midi_clock_output_port()->name())
+ );
+ sync->add_channel (
+ _("MMC out"), DataType::MIDI, ae.make_port_name_non_relative (mmc->output_port()->name())
+ );
+ }
+
+ ardour->add_bundle (sync);