MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / getPortNameFromNumber

Function getPortNameFromNumber

plugins/midi/midi-helpers.cpp:384–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

382}
383
384static std::string getPortNameFromNumber(MidiDeviceType type, int port)
385{
386 if (port < 0) {
387 return "";
388 }
389
390 QStringList devices;
391 if (type == MidiDeviceType::INPUT) {
392 devices = getInputDeviceNames();
393 } else {
394 devices = getOutputDeviceNames();
395 }
396
397 if (port >= devices.size()) {
398 return "";
399 }
400 return devices.at(port).toStdString();
401}
402
403MidiDeviceInstance *MidiDeviceInstance::GetDeviceAndOpen(MidiDeviceType type,
404 int port)

Callers 1

GetDeviceAndOpenMethod · 0.85

Calls 3

getInputDeviceNamesFunction · 0.85
getOutputDeviceNamesFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected