Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pulseaudio: track only the default sink and source #603

Merged
merged 1 commit into from
Feb 24, 2020

Conversation

layus
Copy link
Contributor

@layus layus commented Feb 24, 2020

When you have multiple sinks (resp. sources), the module used to display
the state of the most recently changed one. This changes remembers the
default sink name, and only records changes to that one.

When you have multiple sinks (resp. sources), the module used to display
the state of the most recently changed one. This changes remembers the
default sink name, and only records changes to that one.
@Alexays
Copy link
Owner

Alexays commented Feb 24, 2020

Nice!
serverInfoCb handle default change or the default sink is assigned only one time?

@layus
Copy link
Contributor Author

layus commented Feb 24, 2020

Not sure I understand.

serverInfoCb is called everytime a serverInfo changes, and once at startup. Changes to serverInfo include changes to default sink/source name.

      pa_context_get_server_info(c, serverInfoCb, data);
      pa_context_set_subscribe_callback(c, subscribeCb, data);
      pa_context_subscribe(...
void waybar::modules::Pulseaudio::subscribeCb(...) {
  // ...
  if (facility == PA_SUBSCRIPTION_EVENT_SERVER) {
    pa_context_get_server_info(context, serverInfoCb, data);
  } 

@Alexays
Copy link
Owner

Alexays commented Feb 24, 2020

Just checked and it's ok.
Thanks, nice stuff 😃

@Alexays Alexays merged commit 37b1b35 into Alexays:master Feb 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants