jack: use a new JackPortIsMIDI2 flag

The JACK2 maintainer would prefer to use a new port flag to mark the
MIDI2 capability of the port and keep the port type as MIDI. Add the
proposed flags to the API.

If we register a MIDI port with the MIDI2 flag, promote it to UMP.
Expose v1 MIDI ports with the MIDI DSP property again.

If we see an UMP port, set the MIDI2 flag on the port.

This is functionaly equivalent to what we have. Old jack midi ports will
now however not have the UMP DSP format but the old MIDI format so that
we can, in the JACK API, make a distinction between MIDI1 and MIDI2 ports.
This commit is contained in:
Wim Taymans 2025-01-27 13:05:21 +01:00
parent 23ae55015d
commit 1a737a9fed
3 changed files with 32 additions and 3 deletions

View file

@ -91,8 +91,8 @@ int main(int argc, char *argv[])
/* the UMP port type allows both sending and receiving of UMP
* messages, which can contain MIDI 1.0 and MIDI 2.0 messages. */
data.out_port = jack_port_register (data.client, "output",
JACK_DEFAULT_UMP_TYPE,
JackPortIsOutput, 0);
JACK_DEFAULT_MIDI_TYPE,
JackPortIsOutput | JackPortIsMIDI2, 0);
if (data.out_port == NULL) {
fprintf(stderr, "no more JACK ports available\n");