1 | 143c143
|
---|
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) {
|
---|
5 | 145c145,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)
|
---|
11 | 157d158
|
---|
12 | <
|
---|
13 | 161d161
|
---|
14 | <
|
---|
15 | 300c300
|
---|
16 | < AlsaDevice(Common::String name, MusicType mt, int client, int port);
|
---|
17 | ---
|
---|
18 | > AlsaDevice(Common::String name, MusicType mt, int client);
|
---|
19 | 304d303
|
---|
20 | < int getPort();
|
---|
21 | 310d308
|
---|
22 | < int _port;
|
---|
23 | 315,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) {
|
---|
29 | 334,337d331
|
---|
30 | < int AlsaDevice::getPort() {
|
---|
31 | < return _port;
|
---|
32 | < }
|
---|
33 | <
|
---|
34 | 368d361
|
---|
35 | <
|
---|
36 | 374,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) {
|
---|
41 | 377,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?
|
---|
50 | 382,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));
|
---|
55 | 470c462
|
---|
56 | < seq_port = d->getPort();
|
---|
57 | ---
|
---|
58 | > seq_port = -1;
|
---|