Dirk Kalis <Dirk.Kalis@t-online.de>

The second patch is for envy24control. this patch uses the new driver
design. it is not necessary to give the parameters for inputs and/or
outputs. only the available controls given by the driver will be displayed.
this patch needs the kernel driver patch.
This commit is contained in:
Jaroslav Kysela 2004-03-05 09:10:01 +00:00
parent 8e8896bcbe
commit 9a5420b76a
7 changed files with 236 additions and 65 deletions

View file

@ -28,7 +28,7 @@ static GdkGC *penRedLight[21] = { NULL, };
static GdkPixmap *pixmap[21] = { NULL, };
static snd_ctl_elem_value_t *peaks;
extern int input_channels, output_channels, spdif_channels;
extern int input_channels, output_channels, pcm_output_channels, spdif_channels, view_spdif_playback;
static void update_peak_switch(void)
{
@ -197,7 +197,7 @@ gint level_meters_timeout_callback(gpointer data)
int idx, l1, l2;
update_peak_switch();
for (idx = 0; idx <= output_channels; idx++) {
for (idx = 0; idx <= pcm_output_channels; idx++) {
get_levels(idx, &l1, &l2);
widget = idx == 0 ? mixer_mix_drawing : mixer_drawing[idx-1];
if (!GTK_WIDGET_VISIBLE(widget))
@ -210,7 +210,22 @@ gint level_meters_timeout_callback(gpointer data)
0, 0,
widget->allocation.width, widget->allocation.height);
}
for (idx = 11; idx <= input_channels + 10; idx++) {
if (view_spdif_playback) {
for (idx = MAX_PCM_OUTPUT_CHANNELS + 1; idx <= MAX_OUTPUT_CHANNELS + spdif_channels; idx++) {
get_levels(idx, &l1, &l2);
widget = idx == 0 ? mixer_mix_drawing : mixer_drawing[idx-1];
if (!GTK_WIDGET_VISIBLE(widget))
continue;
redraw_meters(idx, widget->allocation.width, widget->allocation.height, l1, l2);
gdk_draw_pixmap(widget->window,
widget->style->black_gc,
pixmap[idx],
0, 0,
0, 0,
widget->allocation.width, widget->allocation.height);
}
}
for (idx = MAX_PCM_OUTPUT_CHANNELS + MAX_SPDIF_CHANNELS + 1; idx <= input_channels + MAX_PCM_OUTPUT_CHANNELS + MAX_SPDIF_CHANNELS; idx++) {
get_levels(idx, &l1, &l2);
widget = idx == 0 ? mixer_mix_drawing : mixer_drawing[idx-1];
if (!GTK_WIDGET_VISIBLE(widget))
@ -223,7 +238,8 @@ gint level_meters_timeout_callback(gpointer data)
0, 0,
widget->allocation.width, widget->allocation.height);
}
for (idx = 19; idx <= spdif_channels + 18; idx++) {
for (idx = MAX_PCM_OUTPUT_CHANNELS + MAX_SPDIF_CHANNELS + MAX_INPUT_CHANNELS + 1; \
idx <= spdif_channels + MAX_PCM_OUTPUT_CHANNELS + MAX_SPDIF_CHANNELS + MAX_INPUT_CHANNELS; idx++) {
get_levels(idx, &l1, &l2);
widget = idx == 0 ? mixer_mix_drawing : mixer_drawing[idx-1];
if (!GTK_WIDGET_VISIBLE(widget))