+ /* Only look for non-user bundles if instructed to do so */
+ if (use_session_bundles) {
+ for (BundleList::iterator i = b->begin(); i != b->end(); ++i) {
+ if (boost::dynamic_pointer_cast<UserBundle> (*i) == 0 && (*i)->ports_are_inputs() == inputs) {
+ system->add_bundle (*i, allow_dups);
+ }
+ }
+ }
+
+ /* miscellany */
+
+ if (type == DataType::AUDIO || type == DataType::NIL) {
+ if (!inputs) {
+ program->add_bundle (session->the_auditioner()->output()->bundle());
+ program->add_bundle (session->click_io()->bundle());
+ /* Note: the LTC ports do not have the usual ":audio_out 1" postfix, so
+ * program->add_bundle (session->ltc_output_io()->bundle());
+ * won't work
+ */
+ boost::shared_ptr<Bundle> ltc (new Bundle (_("LTC Out"), inputs));
+ ltc->add_channel (_("LTC Out"), DataType::AUDIO, session->engine().make_port_name_non_relative (session->ltc_output_port()->name()));
+ program->add_bundle (ltc);
+ } else {
+ boost::shared_ptr<Bundle> ltc (new Bundle (_("LTC In"), inputs));
+ ltc->add_channel (_("LTC In"), DataType::AUDIO, session->engine().make_port_name_non_relative (session->ltc_input_port()->name()));
+ program->add_bundle (ltc);
+ }
+ }
+
+ /* our control surfaces */
+
+ /* XXX assume for now that all control protocols with ports use
+ * MIDI. If anyone created a control protocol that used audio ports,
+ * this will break.
+ */
+
+ if ((type == DataType::MIDI || type == DataType::NIL)) {
+ 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) {
+ program->add_bundle (*j);
+ }
+ }
+ }