From c97b9a060d63ed1d88bec37a48bd20b4b7df160d Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Mon, 19 Dec 2011 09:58:46 +0100 Subject: Implement "up" for both sink and source list --- src/command.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/command.c b/src/command.c index 8cf5235..577932c 100644 --- a/src/command.c +++ b/src/command.c @@ -41,16 +41,19 @@ static void up(struct context *ctx, int key) { struct interface *ifc = &ctx->interface; - struct main_ctl *sink = NULL; + struct main_ctl *ctl = NULL; if (!ctx->context_ready) return; if (ifc->chooser_input == SELECTED_SINK && ifc->chooser_sink > 0) { - sink = g_list_nth_data(ctx->sink_list, --ifc->chooser_sink); + + --ifc->chooser_sink; + ctl = (struct main_ctl *) interface_get_current_ctl(ifc, NULL); + /* autoassigment to SELECTED_SINK (=-1) if length = 0 */ - ifc->chooser_input = main_ctl_childs_len(ctx, (struct main_ctl *) sink) - 1; + ifc->chooser_input = main_ctl_childs_len(ctx, ctl) - 1; } else if (ifc->chooser_input >= 0) --ifc->chooser_input; -- cgit