static void beatstep_midi_init(struct controller *controller) { /* Tell MIDI handler we want to receive CC. */ midi_connect(CTRLR_PORT, controller->remote_midi_device); midi_register_cc(CTRLR_PORT, beatstep_cc_receiver); beatstep_controls_init(); }
/* When Send Dump pressed, send patch dump to Blofeld. */ gboolean on_SendDump_pressed(GtkWidget *widget, GdkEvent *event, gpointer user_data) { dprintf("Pressed send dump, sending buffer no %d!\n", current_buffer_no); midi_connect(SYNTH_PORT, NULL); blofeld_send_dump(current_buffer_no, device_number); return FALSE; }
/* When Get Dump (or G) pressed, request dump from Blofeld. * Note that we don't actually wait for the dump to be received here. */ gboolean on_GetDump_pressed(GtkWidget *widget, GdkEvent *event, gpointer user_data) { dprintf("Pressed get dump, requesting buffer no %d!\n", current_buffer_no); midi_connect(SYNTH_PORT, NULL); blofeld_get_dump(current_buffer_no, device_number); return FALSE; /* let ui continue to press event (i.e. show button pressed) */ }