Add EngineDevice class
This commit is contained in:
@@ -32,11 +32,12 @@
|
||||
#include <QUuid>
|
||||
|
||||
#include "directsounddevicefinder.h"
|
||||
#include "enginedevice.h"
|
||||
#include "core/logging.h"
|
||||
|
||||
DirectSoundDeviceFinder::DirectSoundDeviceFinder() : DeviceFinder("directsound", { "directsound", "dsound", "directsoundsink", "directx", "directx2" }) {}
|
||||
|
||||
DeviceFinder::DeviceList DirectSoundDeviceFinder::ListDevices() {
|
||||
EngineDeviceList DirectSoundDeviceFinder::ListDevices() {
|
||||
State state;
|
||||
DirectSoundEnumerateA(&DirectSoundDeviceFinder::EnumerateCallback, &state);
|
||||
return state.devices;
|
||||
@@ -48,11 +49,11 @@ BOOL CALLBACK DirectSoundDeviceFinder::EnumerateCallback(LPGUID guid, LPCSTR des
|
||||
|
||||
State *state = reinterpret_cast<State*>(state_voidptr);
|
||||
|
||||
Device dev;
|
||||
dev.description = QString::fromLatin1(description);
|
||||
if (guid) dev.value = QUuid(*guid).toString();
|
||||
dev.iconname = GuessIconName(dev.description);
|
||||
state->devices.append(dev);
|
||||
EngineDevice device;
|
||||
device.description = QString::fromLatin1(description);
|
||||
if (guid) device.value = QUuid(*guid).toString();
|
||||
device.iconname = device.GuessIconName();
|
||||
state->devices.append(device);
|
||||
|
||||
return 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user