summaryrefslogtreecommitdiff
path: root/src/pa-sink-ctl.h
blob: 4358c56885d5a6ae4f7fd7c61e70b55dcb13668f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef PA_SINK_CTL_H
#define PA_SINK_CTL_H

#include <glib.h>
#include <pulse/pulseaudio.h>
#include <ncurses.h>

struct context {
	pa_context *context;
	pa_operation *op;
	gboolean context_ready;

	WINDOW *menu_win;
	WINDOW *msg_win;

	guint resize_source_id;
#ifdef HAVE_SIGNALFD
	int signal_fd;
#endif
	guint input_source_id;

	gint chooser_sink;
	gint chooser_input;
	guint32 selected_index;

	guint max_name_len;

	gboolean info_callbacks_finished;
	gboolean info_callbacks_blocked;
	GMainLoop *loop;

	GList *sink_list;
	GList *tmp_sinks;

	gchar *status;
};

void collect_all_info(struct context *ctx);
void quit(struct context *ctx);

void context_state_callback(pa_context*, gpointer);
void get_sink_info_callback(pa_context *, const pa_sink_info *, gint, gpointer);
void get_sink_input_info_callback(pa_context *, const pa_sink_input_info*, gint, gpointer);
void change_callback(pa_context* c, gint success, gpointer);

#endif