diff options
-rw-r--r-- | src/interface.c | 32 | ||||
-rw-r--r-- | src/pa-sink-ctl.c | 20 | ||||
-rw-r--r-- | src/sink.h | 8 |
3 files changed, 30 insertions, 30 deletions
diff --git a/src/interface.c b/src/interface.c index e2e8f48..1e3d41f 100644 --- a/src/interface.c +++ b/src/interface.c @@ -41,13 +41,13 @@ #define SELECTED_SINK -1 static int -sink_input_len(struct context *ctx, sink_info *sink) +sink_input_len(struct context *ctx, struct sink_info *sink) { int len = 0; GList *l; for (l = ctx->input_list; l; l = l->next) { - sink_input_info *input = l->data; + struct sink_input_info *input = l->data; if (input->sink == sink->index) len++; @@ -56,14 +56,14 @@ sink_input_len(struct context *ctx, sink_info *sink) return len; } -static sink_input_info * -sink_get_nth_input(struct context *ctx, sink_info *sink, int n) +static struct sink_input_info * +sink_get_nth_input(struct context *ctx, struct sink_info *sink, int n) { GList *l; int i = 0; for (l = ctx->input_list; l; l = l->next) { - sink_input_info *input = l->data; + struct sink_input_info *input = l->data; if (input->sink != sink->index) continue; if (i++ == n) @@ -122,7 +122,7 @@ print_volume(struct context *ctx, pa_volume_t volume, int mute, int y) } static void -print_input_list(struct context *ctx, sink_info *sink, +print_input_list(struct context *ctx, struct sink_info *sink, gint sink_num, gint *poffset) { GList *l; @@ -130,7 +130,7 @@ print_input_list(struct context *ctx, sink_info *sink, gint i; for (l = ctx->input_list, i = -1; l; l = l->next) { - sink_input_info *input = l->data; + struct sink_input_info *input = l->data; if (input->sink != sink->index) continue; gboolean selected = (ctx->chooser_sink == sink_num && @@ -161,7 +161,7 @@ set_max_name_len(struct context *ctx) ctx->max_name_len = len; for (l = ctx->sink_list; l; l = l->next) { - sink_info *sink = l->data; + struct sink_info *sink = l->data; len = strlen(sink->name); @@ -170,7 +170,7 @@ set_max_name_len(struct context *ctx) } for (l = ctx->input_list; l; l = l->next) { - sink_input_info *input = l->data; + struct sink_input_info *input = l->data; len = strlen(input->name) + 1 /* indentation */; @@ -194,7 +194,7 @@ print_sink_list(struct context *ctx) box(ctx->menu_win, 0, 0); for (l = ctx->sink_list, i = 0; l; l = l->next,++i) { - sink_info *sink = l->data; + struct sink_info *sink = l->data; gboolean selected = (i == ctx->chooser_sink && ctx->chooser_input == SELECTED_SINK); @@ -220,7 +220,7 @@ interface_get_input(GIOChannel *source, GIOCondition condition, gpointer data) struct context *ctx = data; gint c; gboolean volume_increment = TRUE; - sink_info *sink = NULL; + struct sink_info *sink = NULL; guint32 index; pa_operation *o; @@ -275,7 +275,7 @@ interface_get_input(GIOChannel *source, GIOCondition condition, gpointer data) pa_context_success_cb_t, gpointer); if (ctx->chooser_input >= 0) { - sink_input_info *input = + struct sink_input_info *input = sink_get_nth_input(ctx, sink, ctx->chooser_input); index = input->index; @@ -316,7 +316,7 @@ interface_get_input(GIOChannel *source, GIOCondition condition, gpointer data) pa_context_success_cb_t, void*); if (ctx->chooser_input >= 0) { - sink_input_info *input = + struct sink_input_info *input = sink_get_nth_input(ctx, sink, ctx->chooser_input); index = input->index; @@ -339,8 +339,8 @@ interface_get_input(GIOChannel *source, GIOCondition condition, gpointer data) if (ctx->chooser_input == SELECTED_SINK) break; sink = g_list_nth_data(ctx->sink_list, ctx->chooser_sink); - sink_input_info *input = sink_get_nth_input(ctx, sink, - ctx->chooser_input); + struct sink_input_info *input = + sink_get_nth_input(ctx, sink, ctx->chooser_input); if (g_list_length(ctx->sink_list) <= 1) break; if (ctx->chooser_sink < (gint)g_list_length(ctx->sink_list) - 1) @@ -360,7 +360,7 @@ interface_get_input(GIOChannel *source, GIOCondition condition, gpointer data) ctx->chooser_input = SELECTED_SINK; gint i = -1; for (GList *l = ctx->input_list; l; l = l->next) { - sink_input_info *t = l->data; + struct sink_input_info *t = l->data; if (t->index == input->index) { ctx->chooser_input = ++i; diff --git a/src/pa-sink-ctl.c b/src/pa-sink-ctl.c index e63da0a..24c9d6c 100644 --- a/src/pa-sink-ctl.c +++ b/src/pa-sink-ctl.c @@ -26,13 +26,13 @@ #include "config.h" #include "pa-sink-ctl.h" -static sink_input_info * +static struct sink_input_info * find_sink_input_by_idx(struct context *ctx, gint idx) { GList *l; for (l = ctx->input_list; l; l = l->next) { - sink_input_info *input = l->data; + struct sink_input_info *input = l->data; if (input->index == idx) return input; } @@ -40,13 +40,13 @@ find_sink_input_by_idx(struct context *ctx, gint idx) return NULL; } -static sink_info * +static struct sink_info * find_sink_by_idx(struct context *ctx, gint idx) { GList *l; for (l = ctx->sink_list; l; l = l->next) { - sink_info *sink = l->data; + struct sink_info *sink = l->data; if (sink->index == idx) return sink; } @@ -76,7 +76,7 @@ sink_input_info_cb(pa_context *c, const pa_sink_input_info *i, if (!(i->client != PA_INVALID_INDEX)) return; - sink_input_info sink_input = { + struct sink_input_info sink_input = { .index = i->index, .sink = i->sink, .name = pa_proplist_contains(i->proplist, "application.name") ? @@ -89,7 +89,7 @@ sink_input_info_cb(pa_context *c, const pa_sink_input_info *i, .pid = NULL /* maybe obsolete */ }; - sink_input_info *inlist = find_sink_input_by_idx(ctx, i->index); + struct sink_input_info *inlist = find_sink_input_by_idx(ctx, i->index); if (inlist) *inlist = sink_input; else @@ -117,8 +117,8 @@ get_sink_priority(struct context *ctx, const pa_sink_info *sink_info) static gint compare_sink_priority(gconstpointer new_data, gconstpointer el_data) { - const sink_info *new = new_data; - const sink_info *el = el_data; + const struct sink_info *new = new_data; + const struct sink_info *el = el_data; /* Add 1 to append at end of sinks if priority equals */ return el->priority - new->priority + 1; @@ -160,7 +160,7 @@ sink_info_cb(pa_context *c, const pa_sink_info *i, return; } - sink_info sink = { + struct sink_info sink = { .index = i->index, .mute = i->mute, .vol = pa_cvolume_avg(&i->volume), @@ -169,7 +169,7 @@ sink_info_cb(pa_context *c, const pa_sink_info *i, .priority = get_sink_priority(ctx, i), }; - sink_info *inlist = find_sink_by_idx(ctx, i->index); + struct sink_info *inlist = find_sink_by_idx(ctx, i->index); if (inlist) *inlist = sink; else @@ -23,16 +23,16 @@ #include <glib.h> #include <pulse/pulseaudio.h> -typedef struct _sink_info { +struct sink_info { guint32 index; gchar* name; gint mute; guint8 channels; pa_volume_t vol; gint priority; -} sink_info; +}; -typedef struct _sink_input_info { +struct sink_input_info { guint32 index; guint32 sink; gchar *name; @@ -40,6 +40,6 @@ typedef struct _sink_input_info { gint mute; guint8 channels; pa_volume_t vol; // TOTO: exchange with the channel-list -} sink_input_info; +}; #endif |