~vilhalmer/pavc

b217883f333381da990d89335000eac76e60cdcd — Bill Doyle 8 months ago 7597bc4
Implement mute/unmute
1 files changed, 13 insertions(+), 1 deletions(-)

M pavc.c
M pavc.c => pavc.c +13 -1
@@ 50,9 50,21 @@ static void state_changed(pa_context * ctx, void * userdata) {
		break;
	case PA_CONTEXT_READY:
		// woohoo
		if (pavc->mode == PRINT) {
		switch (pavc->mode) {
		case PRINT:
			pa_context_get_sink_info_by_name(ctx, pavc->sink, query_volume_sink, pavc);
			return;  // Don't exit yet, need to get a response.
			break;
		case MUTE:
			pa_context_set_sink_mute_by_name(ctx, pavc->sink, true, NULL, NULL);
			break;
		case UNMUTE:
			pa_context_set_sink_mute_by_name(ctx, pavc->sink, false, NULL, NULL);
			break;
		default:
			break;
		}
		pa_mainloop_quit(pavc->loop, 0);
		break;
	case PA_CONTEXT_UNCONNECTED:
	case PA_CONTEXT_AUTHORIZING: