* @brief Get input devices list */
| 347 | * @brief Get input devices list |
| 348 | */ |
| 349 | API::CommandResponse API::Handlers::AudioHandler::getInputDevices(const QString& id, |
| 350 | const QJsonObject& params) |
| 351 | { |
| 352 | Q_UNUSED(params) |
| 353 | |
| 354 | const auto& devices = IO::ConnectionManager::instance().audio()->inputDeviceList(); |
| 355 | |
| 356 | QJsonArray devices_array; |
| 357 | for (const auto& device : devices) |
| 358 | devices_array.append(device); |
| 359 | |
| 360 | QJsonObject result; |
| 361 | result[QStringLiteral("devices")] = devices_array; |
| 362 | result[QStringLiteral("selectedIndex")] = |
| 363 | IO::ConnectionManager::instance().audio()->selectedInputDevice(); |
| 364 | return CommandResponse::makeSuccess(id, result); |
| 365 | } |
| 366 | |
| 367 | /** |
| 368 | * @brief Get output devices list |
nothing calls this directly
no test coverage detected