mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Sound (Windows): a small refactor
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
extern "C" {
|
||||
#include "sound.h"
|
||||
#include "common/windows/unicode.h"
|
||||
}
|
||||
#include "common/windows/unicode.hpp"
|
||||
#include "common/windows/com.hpp"
|
||||
#include "common/windows/variant.hpp"
|
||||
|
||||
#include <initguid.h>
|
||||
#include <mmdeviceapi.h>
|
||||
@@ -76,10 +77,9 @@ const char* ffDetectSound(FFlist* devices /* List of FFSoundDevice */)
|
||||
ffStrbufInitStatic(&device->platformApi, "Core Audio APIs");
|
||||
|
||||
{
|
||||
PROPVARIANT __attribute__((__cleanup__(PropVariantClear))) friendlyName;
|
||||
PropVariantInit(&friendlyName);
|
||||
FFPropVariant friendlyName;
|
||||
if (SUCCEEDED(immPropStore->GetValue(PKEY_Device_FriendlyName, &friendlyName)))
|
||||
ffStrbufSetWS(&device->name, friendlyName.pwszVal);
|
||||
ffStrbufSetWSV(&device->name, friendlyName.get<std::wstring_view>());
|
||||
}
|
||||
|
||||
IAudioEndpointVolume* FF_AUTO_RELEASE_COM_OBJECT immEndpointVolume;
|
||||
|
||||
Reference in New Issue
Block a user