Add EngineDevice class

This commit is contained in:
Jonas Kvinge
2023-06-01 19:31:19 +02:00
parent a1dbbba1a1
commit 315073f9a7
20 changed files with 170 additions and 111 deletions

View File

@@ -28,14 +28,14 @@
#include <core/logging.h>
#include "devicefinder.h"
#include "alsadevicefinder.h"
#include "enginedevice.h"
AlsaDeviceFinder::AlsaDeviceFinder() : DeviceFinder("alsa", { "alsa", "alsasink" }) {}
DeviceFinder::DeviceList AlsaDeviceFinder::ListDevices() {
EngineDeviceList AlsaDeviceFinder::ListDevices() {
DeviceList ret;
EngineDeviceList devices;
snd_pcm_stream_name(SND_PCM_STREAM_PLAYBACK);
@@ -91,21 +91,21 @@ DeviceFinder::DeviceList AlsaDeviceFinder::ListDevices() {
continue;
}
Device device;
EngineDevice device;
device.description = QString("%1 %2").arg(snd_ctl_card_info_get_name(cardinfo), snd_pcm_info_get_name(pcminfo));
device.iconname = GuessIconName(device.description);
device.iconname = device.GuessIconName();
device.card = card;
device.device = dev;
device.value = QString("hw:%1,%2").arg(card).arg(dev);
ret.append(device);
devices.append(device);
device.value = QString("plughw:%1,%2").arg(card).arg(dev);
ret.append(device);
devices.append(device);
}
}
snd_config_update_free_global();
return ret;
return devices;
}