MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / deviceIndexById

Function deviceIndexById

app/src/IO/Drivers/Audio.cpp:127–134  ·  view source on GitHub ↗

* @brief Returns the index of the device with the given ID, or -1 if absent. */

Source from the content-addressed store, hash-verified

125 * @brief Returns the index of the device with the given ID, or -1 if absent.
126 */
127static int deviceIndexById(const QVector<ma_device_info>& list, const ma_device_id& id)
128{
129 for (int i = 0; i < list.size(); ++i)
130 if (memcmp(&list[i].id, &id, sizeof(ma_device_id)) == 0)
131 return i;
132
133 return -1;
134}
135
136/**
137 * @brief Replaces the device list and capabilities, remapping the selected index by device ID

Callers 2

replaceDeviceListFunction · 0.85
checkAndUpdateDeviceListFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected