Add EngineDevice class
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user