* @brief Get output devices list */
| 368 | * @brief Get output devices list |
| 369 | */ |
| 370 | API::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 |
nothing calls this directly
no test coverage detected