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

Method getOutputDeviceIds

src/rtmidi.cpp:333–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331 }
332
333 std::vector<int> getOutputDeviceIds() override {
334 // TODO The IDs unfortunately jump around in RtMidi. Is there a way to keep them constant when a MIDI device is added/removed?
335 int count;
336 try {
337 count = rtMidiOut->getPortCount();
338 }
339 catch (RtMidiError& e) {
340 throw Exception("Failed to get RtMidi output device count: %s", e.what());
341 }
342
343 std::vector<int> deviceIds;
344 for (int i = 0; i < count; i++)
345 deviceIds.push_back(i);
346 return deviceIds;
347 }
348
349 std::string getOutputDeviceName(int deviceId) override {
350 if (deviceId < 0)

Callers

nothing calls this directly

Calls 2

ExceptionClass · 0.85
whatMethod · 0.80

Tested by

no test coverage detected