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

Method getOutputDevices

app/src/API/Handlers/AudioHandler.cpp:370–386  ·  view source on GitHub ↗

* @brief Get output devices list */

Source from the content-addressed store, hash-verified

368 * @brief Get output devices list
369 */
370API::CommandResponse API::Handlers::AudioHandler::getOutputDevices(const QString& id,
371 const QJsonObject& params)
372{
373 Q_UNUSED(params)
374
375 const auto& devices = IO::ConnectionManager::instance().audio()->outputDeviceList();
376
377 QJsonArray devices_array;
378 for (const auto& device : devices)
379 devices_array.append(device);
380
381 QJsonObject result;
382 result[QStringLiteral("devices")] = devices_array;
383 result[QStringLiteral("selectedIndex")] =
384 IO::ConnectionManager::instance().audio()->selectedOutputDevice();
385 return CommandResponse::makeSuccess(id, result);
386}
387
388/**
389 * @brief Get sample rates list

Callers

nothing calls this directly

Calls 4

outputDeviceListMethod · 0.80
audioMethod · 0.80
selectedOutputDeviceMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected