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

Method subscribeOutput

src/rtmidi.cpp:360–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

358 }
359
360 midi::OutputDevice* subscribeOutput(int deviceId, midi::Output* output) override {
361 if (!(0 <= deviceId && deviceId < (int) rtMidiOut->getPortCount()))
362 return NULL;
363 RtMidiOutputDevice* device = get(outputDevices, deviceId, NULL);
364 if (!device) {
365 try {
366 outputDevices[deviceId] = device = new RtMidiOutputDevice(driverId, deviceId);
367 }
368 catch (RtMidiError& e) {
369 throw Exception("Failed to create RtMidi output device: %s", e.what());
370 }
371 }
372
373 device->subscribe(output);
374 return device;
375 }
376
377 void unsubscribeOutput(int deviceId, midi::Output* output) override {
378 auto it = outputDevices.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