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

Method subscribeInput

src/rtmidi.cpp:297–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295 }
296
297 midi::InputDevice* subscribeInput(int deviceId, midi::Input* input) override {
298 if (!(0 <= deviceId && deviceId < (int) rtMidiIn->getPortCount()))
299 return NULL;
300 RtMidiInputDevice* device = get(inputDevices, deviceId, NULL);
301 if (!device) {
302 try {
303 inputDevices[deviceId] = device = new RtMidiInputDevice(driverId, deviceId);
304 }
305 catch (RtMidiError& e) {
306 throw Exception("Failed to create RtMidi input device: %s", e.what());
307 }
308 }
309
310 device->subscribe(input);
311 return device;
312 }
313
314 void unsubscribeInput(int deviceId, midi::Input* input) override {
315 auto it = inputDevices.find(deviceId);

Callers

nothing calls this directly

Calls 4

getFunction · 0.85
ExceptionClass · 0.85
whatMethod · 0.80
subscribeMethod · 0.45

Tested by

no test coverage detected