MCPcopy Create free account
hub / github.com/VCVRack/Rack / getInputDeviceIds

Method getInputDeviceIds

src/rtmidi.cpp:270–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268 }
269 }
270 std::vector<int> getInputDeviceIds() override {
271 // TODO The IDs unfortunately jump around in RtMidi. Is there a way to keep them constant when a MIDI device is added/removed?
272 int count;
273 try {
274 count = rtMidiIn->getPortCount();
275 }
276 catch (RtMidiError& e) {
277 throw Exception("Failed to get RtMidi input device count: %s", e.what());
278 }
279
280 std::vector<int> deviceIds;
281 for (int i = 0; i < count; i++)
282 deviceIds.push_back(i);
283 return deviceIds;
284 }
285
286 std::string getInputDeviceName(int deviceId) override {
287 if (deviceId < 0)

Callers

nothing calls this directly

Calls 2

ExceptionClass · 0.85
whatMethod · 0.80

Tested by

no test coverage detected