mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
@@ -18,7 +18,7 @@ static void paSinkInfoCallback(pa_context *c, const pa_sink_info *i, int eol, vo
|
||||
ffStrbufInitS(&device->name, i->description);
|
||||
ffStrbufTrimRightSpace(&device->name);
|
||||
ffStrbufTrimLeft(&device->name, ' ');
|
||||
device->volume = i->mute ? 0 : (uint8_t) (i->volume.values[0] * 100 / PA_VOLUME_NORM);
|
||||
device->volume = i->mute ? 0 : (uint8_t) ((i->volume.values[0] * 100 + PA_VOLUME_NORM / 2 /*round*/) / PA_VOLUME_NORM);
|
||||
device->active = i->active_port && i->active_port->available != PA_PORT_AVAILABLE_NO;
|
||||
device->main = false;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ const char* ffDetectSound(FFlist* devices)
|
||||
ffStrbufInitS(&device->name, ad.name);
|
||||
ffStrbufTrimRightSpace(&device->name);
|
||||
ffStrbufInitF(&device->platformApi, "%s", "SunAudio");
|
||||
device->volume = (uint8_t) (ai.play.gain * 100 / AUDIO_MAX_GAIN);
|
||||
device->volume = (uint8_t) ((ai.play.gain * 100 + AUDIO_MAX_GAIN / 2) / AUDIO_MAX_GAIN);
|
||||
device->active = true;
|
||||
device->main = defaultDev == idev;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ const char* ffDetectSound(FFlist* devices)
|
||||
if (!bundle.mute[i])
|
||||
totalLevel += bundle.level[i];
|
||||
}
|
||||
device->volume = (uint8_t) (totalLevel * 100 / bundle.iLevel);
|
||||
device->volume = (uint8_t) ((totalLevel * 100 + bundle.iLevel / 2) / bundle.iLevel);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user