mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
refactor(pulseaudio): only watch changes
This commit is contained in:
parent
f3fb955d75
commit
0b01b35c76
@ -128,6 +128,10 @@ void waybar::modules::Pulseaudio::subscribeCb(pa_context * conte
|
|||||||
pa_subscription_event_type_t type, uint32_t idx,
|
pa_subscription_event_type_t type, uint32_t idx,
|
||||||
void *data) {
|
void *data) {
|
||||||
unsigned facility = type & PA_SUBSCRIPTION_EVENT_FACILITY_MASK;
|
unsigned facility = type & PA_SUBSCRIPTION_EVENT_FACILITY_MASK;
|
||||||
|
unsigned operation = type & PA_SUBSCRIPTION_EVENT_TYPE_MASK;
|
||||||
|
if (operation != PA_SUBSCRIPTION_EVENT_CHANGE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (facility == PA_SUBSCRIPTION_EVENT_SINK) {
|
if (facility == PA_SUBSCRIPTION_EVENT_SINK) {
|
||||||
pa_context_get_sink_info_by_index(context, idx, sinkInfoCb, data);
|
pa_context_get_sink_info_by_index(context, idx, sinkInfoCb, data);
|
||||||
} else if (facility == PA_SUBSCRIPTION_EVENT_SOURCE) {
|
} else if (facility == PA_SUBSCRIPTION_EVENT_SOURCE) {
|
||||||
|
Loading…
Reference in New Issue
Block a user