1. Create the connection
| 40 | |
| 41 | // 1. Create the connection |
| 42 | void open() |
| 43 | { |
| 44 | // Opening midi input and output |
| 45 | { |
| 46 | auto pi = obs.get_input_ports(); |
| 47 | if (pi.empty()) |
| 48 | { |
| 49 | throw "No MIDI 2 input device found\n"; |
| 50 | } |
| 51 | |
| 52 | for (const auto& port : pi) |
| 53 | { |
| 54 | std::cout << "In: " << port.port_name << " | " << port.display_name << std::endl; |
| 55 | } |
| 56 | |
| 57 | midiin.open_port(pi[1]); |
| 58 | } |
| 59 | |
| 60 | { |
| 61 | auto po = obs.get_output_ports(); |
| 62 | if (po.empty()) |
| 63 | { |
| 64 | throw "No MIDI 2 output device found\n"; |
| 65 | } |
| 66 | |
| 67 | for (const auto& port : po) |
| 68 | { |
| 69 | std::cout << "Out: " << port.port_name << " | " << port.display_name << std::endl; |
| 70 | } |
| 71 | midiout.open_port(po[1]); |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | // 2. Top-level UMP processing |
| 76 | void on_ump(const midi::universal_packet& pkt) |
no test coverage detected