mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-06 13:14:21 +01:00
Sound: remove manufacturer detection
as it's only implemented on macOS
This commit is contained in:
@@ -9,7 +9,6 @@ typedef struct FFSoundDevice
|
||||
{
|
||||
FFstrbuf identifier;
|
||||
FFstrbuf name;
|
||||
FFstrbuf manufacturer;
|
||||
uint8_t volume; // 0-100%
|
||||
bool main;
|
||||
bool active;
|
||||
|
||||
@@ -42,7 +42,6 @@ const char* ffDetectSound(FF_MAYBE_UNUSED const FFinstance* instance, FFlist* de
|
||||
device->volume = 0;
|
||||
ffStrbufInitF(&device->identifier, "%u", (unsigned) deviceId);
|
||||
ffStrbufInit(&device->name);
|
||||
ffStrbufInit(&device->manufacturer);
|
||||
|
||||
uint32_t active;
|
||||
dataSize = sizeof(active);
|
||||
@@ -76,18 +75,6 @@ const char* ffDetectSound(FF_MAYBE_UNUSED const FFinstance* instance, FFlist* de
|
||||
ffCfStrGetString(name, &device->name);
|
||||
CFRelease(name);
|
||||
}
|
||||
|
||||
CFStringRef manufacturer;
|
||||
dataSize = sizeof(manufacturer);
|
||||
if(AudioObjectGetPropertyData(deviceId, &(AudioObjectPropertyAddress){
|
||||
kAudioObjectPropertyManufacturer,
|
||||
kAudioObjectPropertyScopeOutput,
|
||||
kAudioObjectPropertyElementMain
|
||||
}, 0, NULL, &dataSize, &manufacturer) == kAudioHardwareNoError)
|
||||
{
|
||||
ffCfStrGetString(manufacturer, &device->manufacturer);
|
||||
CFRelease(manufacturer);
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
@@ -14,7 +14,6 @@ static void paSinkInfoCallback(pa_context *c, const pa_sink_info *i, int eol, vo
|
||||
FFSoundDevice* device = ffListAdd(userdata);
|
||||
ffStrbufInitS(&device->identifier, i->name);
|
||||
ffStrbufInitS(&device->name, i->description);
|
||||
ffStrbufInitS(&device->manufacturer, i->driver);
|
||||
device->volume = i->mute ? 0 : (uint8_t) (i->volume.values[0] * 100 / PA_VOLUME_NORM);
|
||||
device->active = i->active_port && i->active_port->available != PA_PORT_AVAILABLE_NO;
|
||||
device->main = false;
|
||||
|
||||
@@ -65,7 +65,6 @@ const char* ffDetectSound(FF_MAYBE_UNUSED const FFinstance* instance, FF_MAYBE_U
|
||||
device->volume = 0;
|
||||
ffStrbufInit(&device->identifier);
|
||||
ffStrbufInit(&device->name);
|
||||
ffStrbufInit(&device->manufacturer);
|
||||
|
||||
ffStrbufSetWS(&device->identifier, immDeviceId);
|
||||
|
||||
@@ -74,8 +73,6 @@ const char* ffDetectSound(FF_MAYBE_UNUSED const FFinstance* instance, FF_MAYBE_U
|
||||
PropVariantInit(&friendlyName);
|
||||
if (SUCCEEDED(immPropStore->GetValue(PKEY_Device_FriendlyName, &friendlyName)))
|
||||
ffStrbufSetWS(&device->name, friendlyName.pwszVal);
|
||||
if (SUCCEEDED(immPropStore->GetValue(PKEY_DeviceInterface_FriendlyName, &friendlyName)))
|
||||
ffStrbufSetWS(&device->manufacturer, friendlyName.pwszVal);
|
||||
}
|
||||
|
||||
IAudioEndpointVolume* FF_AUTO_RELEASE_COM_OBJECT immEndpointVolume;
|
||||
|
||||
Reference in New Issue
Block a user