From 45733fe46cd3d51738f079d5931e8b5117dada41 Mon Sep 17 00:00:00 2001 From: hypperd Date: Wed, 9 Aug 2023 10:57:41 -0300 Subject: [PATCH] fix: change event types --- src/main.cpp | 8 ++++---- src/pulse.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index eb57c19..7512203 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -46,8 +46,8 @@ int main(int argc, char *argv[]) { } pa_subscription_mask_t all_mask = - (pa_subscription_mask_t)(PA_SUBSCRIPTION_MASK_SINK | - PA_SUBSCRIPTION_MASK_SOURCE); + (pa_subscription_mask_t)(PA_SUBSCRIPTION_MASK_SINK_INPUT | + PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT); if (!printSink && !printSource && !printBoth && !printBothWayBar) { return Pulse().init(SUBSCRIPTION_TYPE_IDLE, all_mask, EVENT_TYPE_IDLE); } else if (printBoth) { @@ -57,11 +57,11 @@ int main(int argc, char *argv[]) { return Pulse().init(SUBSCRIPTION_TYPE_DRY_BOTH_WAYBAR, all_mask, EVENT_TYPE_DRY_BOTH); } else if (printSink) { - return Pulse().init(SUBSCRIPTION_TYPE_DRY_SINK, PA_SUBSCRIPTION_MASK_SINK, + return Pulse().init(SUBSCRIPTION_TYPE_DRY_SINK, PA_SUBSCRIPTION_MASK_SINK_INPUT, EVENT_TYPE_DRY_SINK); } else if (printSource) { return Pulse().init(SUBSCRIPTION_TYPE_DRY_SOURCE, - PA_SUBSCRIPTION_MASK_SOURCE, EVENT_TYPE_DRY_SOURCE); + PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT, EVENT_TYPE_DRY_SOURCE); } return 0; } diff --git a/src/pulse.cpp b/src/pulse.cpp index ddc98a6..6009e21 100644 --- a/src/pulse.cpp +++ b/src/pulse.cpp @@ -77,10 +77,10 @@ void Pulse::subscribe_callback(pa_context *, pa_subscription_event_type_t type, Data *data = (Data *)userdata; EventType eventType; switch (type & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) { - case PA_SUBSCRIPTION_EVENT_SINK: + case PA_SUBSCRIPTION_EVENT_SINK_INPUT: eventType = EVENT_TYPE_DRY_SINK; break; - case PA_SUBSCRIPTION_EVENT_SOURCE: + case PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT: eventType = EVENT_TYPE_DRY_SOURCE; break; default: