Ticket #14675: midi_port_enable.diff

File midi_port_enable.diff, 1.9 KB (added by ToddAWalter, 7 months ago)

patch against backends/midi/alsa.cpp

Line 
1143c143
2< while ((found_port = snd_seq_query_next_port(seq_handle, pinfo)) >= 0) {
3---
4> while (found_port == -1 && snd_seq_query_next_port(seq_handle, pinfo) >= 0) {
5145c145,147
6< if (snd_seq_port_info_get_write_use(pinfo) == 0)
7---
8> if (first_port == -1)
9> first_port = snd_seq_port_info_get_port(pinfo);
10> if (found_port == -1 && snd_seq_port_info_get_write_use(pinfo) == 0)
11157d158
12<
13161d161
14<
15300c300
16< AlsaDevice(Common::String name, MusicType mt, int client, int port);
17---
18> AlsaDevice(Common::String name, MusicType mt, int client);
19304d303
20< int getPort();
21310d308
22< int _port;
23315,316c313,314
24< AlsaDevice::AlsaDevice(Common::String name, MusicType mt, int client, int port)
25< : _name(name), _type(mt), _client(client), _port(port) {
26---
27> AlsaDevice::AlsaDevice(Common::String name, MusicType mt, int client)
28> : _name(name), _type(mt), _client(client) {
29334,337d331
30< int AlsaDevice::getPort() {
31< return _port;
32< }
33<
34368d361
35<
36374,375c367
37< // removed found_valid_port as it's preventing enumerating all the ports; get info return being negative will break the loop instead
38< while (snd_seq_query_next_port(seq_handle, pinfo) >= 0) {
39---
40> while (!found_valid_port && snd_seq_query_next_port(seq_handle, pinfo) >= 0) {
41377,379c369,372
42< // added (pinfo) below to get port name to differentiate between devices on a multiplexer
43< const char *name = snd_seq_port_info_get_name(pinfo);
44< // TODO: Can we figure out the appropriate music type?| yes, with some sysex chicanery but limited to modernish gear
45---
46> found_valid_port = true;
47>
48> const char *name = snd_seq_client_info_get_name(cinfo);
49> // TODO: Can we figure out the appropriate music type?
50382,383c375
51< int port = snd_seq_port_info_get_port(pinfo);
52< devices.push_back(AlsaDevice(name, type, client, port));
53---
54> devices.push_back(AlsaDevice(name, type, client));
55470c462
56< seq_port = d->getPort();
57---
58> seq_port = -1;