summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2011-12-19 09:58:46 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2011-12-19 10:00:52 +0100
commitc97b9a060d63ed1d88bec37a48bd20b4b7df160d (patch)
treec106a5cc5d3014210426b1383737c3a5fdafb3f0 /src
parente649ebc7c77b3e552aa5e86a931927779222e6a6 (diff)
downloadpa-sink-ctl-c97b9a060d63ed1d88bec37a48bd20b4b7df160d.tar.gz
pa-sink-ctl-c97b9a060d63ed1d88bec37a48bd20b4b7df160d.tar.bz2
pa-sink-ctl-c97b9a060d63ed1d88bec37a48bd20b4b7df160d.zip
Implement "up" for both sink and source list
Diffstat (limited to 'src')
-rw-r--r--src/command.c9
1 files changed, 6 insertions, 3 deletions
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;