- if (port_sources.empty()) {
- AsyncMIDIPort* async = dynamic_cast<AsyncMIDIPort*> (AudioEngine::instance()->midi_input_port());
-
- if (!async) {
- return;
- }
-
- int fd;
-
- if ((fd = async->selectable ()) >= 0) {
- Glib::RefPtr<IOSource> psrc = IOSource::create (fd, IO_IN|IO_HUP|IO_ERR);
-
- psrc->connect (sigc::bind (sigc::mem_fun (this, &MidiControlUI::midi_input_handler), async));
- psrc->attach (_main_loop->get_context());
-
- // glibmm hack: for now, store only the GSource*
+ vector<AsyncMIDIPort*> ports;
+ AsyncMIDIPort* p;
+
+ if ((p = dynamic_cast<AsyncMIDIPort*> (_session.midi_input_port()))) {
+ ports.push_back (p);
+ }
+
+
+ if ((p = dynamic_cast<AsyncMIDIPort*> (_session.mmc_input_port()))) {
+ ports.push_back (p);
+ }