-
- if ((fd = (*pi)->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), *pi));
- psrc->attach (_main_loop->get_context());
-
- // glibmm hack: for now, store only the GSource*
-
- port_sources.push_back (psrc->gobj());
- g_source_ref (psrc->gobj());
- }
+ (*pi)->xthread().set_receive_handler (sigc::bind (sigc::mem_fun (this, &MidiControlUI::midi_input_handler), *pi));
+ (*pi)->xthread().attach (_main_loop->get_context());