2000-10-29 21:51:51 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
|
driverevents.c - Events from the driver processing
|
2007-10-15 10:25:36 +02:00
|
|
|
Copyright (C) 2000 by Jaroslav Kysela <perex@perex.cz>
|
2000-10-29 21:51:51 +00:00
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
2017-11-14 14:46:35 +01:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2000-10-29 21:51:51 +00:00
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "envy24control.h"
|
|
|
|
|
|
2025-04-09 12:25:09 +02:00
|
|
|
gboolean control_input_callback(GIOChannel *source, GIOCondition condition, gpointer data)
|
2000-10-29 21:51:51 +00:00
|
|
|
{
|
2001-06-06 13:58:01 +00:00
|
|
|
snd_ctl_t *ctl = (snd_ctl_t *)data;
|
|
|
|
|
snd_ctl_event_t *ev;
|
|
|
|
|
const char *name;
|
|
|
|
|
int index;
|
2001-06-13 18:41:38 +00:00
|
|
|
unsigned int mask;
|
2001-06-06 13:58:01 +00:00
|
|
|
|
|
|
|
|
snd_ctl_event_alloca(&ev);
|
|
|
|
|
if (snd_ctl_read(ctl, ev) < 0)
|
2025-04-09 12:25:09 +02:00
|
|
|
return TRUE;
|
2001-06-06 13:58:01 +00:00
|
|
|
name = snd_ctl_event_elem_get_name(ev);
|
|
|
|
|
index = snd_ctl_event_elem_get_index(ev);
|
2001-06-13 18:41:38 +00:00
|
|
|
mask = snd_ctl_event_elem_get_mask(ev);
|
|
|
|
|
if (! (mask & (SND_CTL_EVENT_MASK_VALUE | SND_CTL_EVENT_MASK_INFO)))
|
2025-04-09 12:25:09 +02:00
|
|
|
return TRUE;
|
2001-06-13 18:41:38 +00:00
|
|
|
|
2001-06-06 13:58:01 +00:00
|
|
|
switch (snd_ctl_event_elem_get_interface(ev)) {
|
2001-07-16 13:51:03 +00:00
|
|
|
case SND_CTL_ELEM_IFACE_MIXER:
|
2001-07-12 16:36:25 +00:00
|
|
|
if (!strcmp(name, "Word Clock Sync"))
|
2000-10-29 21:51:51 +00:00
|
|
|
master_clock_update();
|
2001-06-06 13:58:01 +00:00
|
|
|
else if (!strcmp(name, "Multi Track Volume Rate"))
|
2000-10-29 21:51:51 +00:00
|
|
|
volume_change_rate_update();
|
2001-06-13 18:41:38 +00:00
|
|
|
else if (!strcmp(name, "IEC958 Input Optical"))
|
2000-10-29 21:51:51 +00:00
|
|
|
spdif_input_update();
|
2001-06-13 18:41:38 +00:00
|
|
|
else if (!strcmp(name, "Delta IEC958 Output Defaults"))
|
2000-10-29 21:51:51 +00:00
|
|
|
spdif_output_update();
|
2002-11-14 11:22:19 +00:00
|
|
|
else if (!strcmp(name, "Multi Track Internal Clock"))
|
2001-07-12 16:36:25 +00:00
|
|
|
master_clock_update();
|
2004-04-16 13:09:35 +00:00
|
|
|
else if (!strcmp(name, "Multi Track Internal Clock Default"))
|
|
|
|
|
master_clock_update();
|
2002-11-14 11:22:19 +00:00
|
|
|
else if (!strcmp(name, "Multi Track Rate Locking"))
|
|
|
|
|
rate_locking_update();
|
|
|
|
|
else if (!strcmp(name, "Multi Track Rate Reset"))
|
|
|
|
|
rate_reset_update();
|
2001-07-12 16:36:25 +00:00
|
|
|
else if (!strcmp(name, "Multi Playback Volume"))
|
2001-06-06 13:58:01 +00:00
|
|
|
mixer_update_stream(index + 1, 1, 0);
|
2004-03-05 09:10:01 +00:00
|
|
|
else if (!strcmp(name, "H/W Multi Capture Volume"))
|
2001-06-06 13:58:01 +00:00
|
|
|
mixer_update_stream(index + 11, 1, 0);
|
2004-03-05 09:10:01 +00:00
|
|
|
else if (!strcmp(name, "IEC958 Multi Capture Volume"))
|
|
|
|
|
mixer_update_stream(index + 19, 1, 0);
|
2001-06-06 13:58:01 +00:00
|
|
|
else if (!strcmp(name, "Multi Playback Switch"))
|
|
|
|
|
mixer_update_stream(index + 1, 0, 1);
|
2004-03-05 09:10:01 +00:00
|
|
|
else if (!strcmp(name, "H/W Multi Capture Switch"))
|
2001-06-06 13:58:01 +00:00
|
|
|
mixer_update_stream(index + 11, 0, 1);
|
2004-03-05 09:10:01 +00:00
|
|
|
else if (!strcmp(name, "IEC958 Multi Capture Switch"))
|
|
|
|
|
mixer_update_stream(index + 19, 0, 1);
|
2001-06-13 18:41:38 +00:00
|
|
|
else if (!strcmp(name, "H/W Playback Route"))
|
|
|
|
|
patchbay_update();
|
|
|
|
|
else if (!strcmp(name, "IEC958 Playback Route"))
|
|
|
|
|
patchbay_update();
|
2001-07-09 08:36:08 +00:00
|
|
|
else if (!strcmp(name, "DAC Volume"))
|
|
|
|
|
dac_volume_update(index);
|
|
|
|
|
else if (!strcmp(name, "ADC Volume"))
|
|
|
|
|
adc_volume_update(index);
|
2002-11-14 11:22:19 +00:00
|
|
|
else if (!strcmp(name, "IPGA Analog Capture Volume"))
|
|
|
|
|
ipga_volume_update(index);
|
2001-07-09 08:36:08 +00:00
|
|
|
else if (!strcmp(name, "Output Sensitivity Switch"))
|
|
|
|
|
dac_sense_update(index);
|
|
|
|
|
else if (!strcmp(name, "Input Sensitivity Switch"))
|
|
|
|
|
adc_sense_update(index);
|
2001-06-06 13:58:01 +00:00
|
|
|
break;
|
2025-03-29 07:16:31 +01:00
|
|
|
case SND_CTL_ELEM_IFACE_PCM:
|
|
|
|
|
if (!strcmp(name, "IEC958 Playback Default"))
|
|
|
|
|
spdif_output_update();
|
|
|
|
|
break;
|
2001-06-06 13:58:01 +00:00
|
|
|
default:
|
|
|
|
|
break;
|
2000-10-29 21:51:51 +00:00
|
|
|
}
|
2025-04-09 12:25:09 +02:00
|
|
|
return TRUE;
|
2000-10-29 21:51:51 +00:00
|
|
|
}
|
|
|
|
|
|