summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2011-12-18 14:38:09 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2011-12-18 14:40:34 +0100
commit1e9081f969a292013f522d70fff8b10333aca2e8 (patch)
treec8552cbb784047d59e4bd5a82f814ab736832449
parentb215b29ace8de9c44d87c113d976934909a3302a (diff)
downloadpa-sink-ctl-1e9081f969a292013f522d70fff8b10333aca2e8.tar.gz
pa-sink-ctl-1e9081f969a292013f522d70fff8b10333aca2e8.tar.bz2
pa-sink-ctl-1e9081f969a292013f522d70fff8b10333aca2e8.zip
interface: print_volume can use vol_ctl parameter now
-rw-r--r--src/interface.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/interface.c b/src/interface.c
index d04f0de..009a0ca 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -111,16 +111,16 @@ interface_resize(gpointer data)
}
static void
-print_volume(struct context *ctx, pa_volume_t volume, int mute, int y)
+print_volume(struct context *ctx, struct vol_ctl *ctl, int y)
{
gint x = 2 /* left */ + 2 /* index num width */ + 1 /* space */ +
1 /* space */ + ctx->max_name_len + 1 /* space */;
/* mute button + brackets + space */
int volume_bar_len = getmaxx(ctx->menu_win) - x - 6;
- gint vol = (gint) (volume_bar_len * volume / PA_VOLUME_NORM);
+ gint vol = (gint) (volume_bar_len * ctl->vol / PA_VOLUME_NORM);
- mvwprintw(ctx->menu_win, y, x - 1, "[%c]", mute ? 'M' : ' ');
+ mvwprintw(ctx->menu_win, y, x - 1, "[%c]", ctl->mute ? 'M' : ' ');
x += 3;
mvwprintw(ctx->menu_win, y, x - 1 , "[");
@@ -157,7 +157,7 @@ print_input_list(struct context *ctx, struct sink_info *sink,
if (selected)
wattroff(ctx->menu_win, A_REVERSE);
- print_volume(ctx, input->base.vol, input->base.mute, offset);
+ print_volume(ctx, &input->base, offset);
offset++;
}
*poffset = offset;
@@ -212,7 +212,7 @@ interface_redraw(struct context *ctx)
if (selected)
wattroff(ctx->menu_win, A_REVERSE);
- print_volume(ctx, sink->base.vol, sink->base.mute, offset);
+ print_volume(ctx, &sink->base, offset);
offset++;
print_input_list(ctx, sink, i, &offset);