#include "envy24control.h"
-static void control_value(snd_ctl_t *handle, void *private_data, snd_ctl_element_id_t *id)
+static void control_value(snd_ctl_t *handle, void *private_data, snd_ctl_elem_id_t *id)
{
- if (id->iface == SND_CTL_ELEMENT_IFACE_PCM) {
+ if (id->iface == SND_CTL_ELEM_IFACE_PCM) {
if (!strcmp(id->name, "Multi Track Route")) {
patchbay_update();
return;
return;
}
}
- if (id->iface == SND_CTL_ELEMENT_IFACE_MIXER) {
+ if (id->iface == SND_CTL_ELEM_IFACE_MIXER) {
if (!strcmp(id->name, "Multi Playback Volume")) {
mixer_update_stream(id->index + 1, 1, 0);
return;
char name[32], title[128];
int err;
unsigned int cards_mask;
- snd_ctl_element_t ctl;
+ snd_ctl_elem_t ctl;
// snd_mixer_filter_t filter;
/* Go through gtk initialization */
#if 0
memset(&filter, 0, sizeof(filter));
- snd_mixer_set_bit(filter.read_cmds, SND_MIXER_READ_ELEMENT_VALUE, 1);
+ snd_mixer_set_bit(filter.read_cmds, SND_MIXER_READ_ELEM_VALUE, 1);
if ((err = snd_mixer_put_filter(card_mixer, &filter)) < 0) {
fprintf(stderr, "snd_mixer_set_filter: %s\n", snd_strerror(err));
exit(EXIT_FAILURE);
#endif
memset(&ctl, 0, sizeof(ctl));
- ctl.id.iface = SND_CTL_ELEMENT_IFACE_CARD;
+ ctl.id.iface = SND_CTL_ELEM_IFACE_CARD;
strcpy(ctl.id.name, "ICE1712 EEPROM");
- if ((err = snd_ctl_element_read(card_ctl, &ctl)) < 0) {
+ if ((err = snd_ctl_elem_read(card_ctl, &ctl)) < 0) {
fprintf(stderr, "Unable to read EEPROM contents: %s\n", snd_strerror(err));
exit(EXIT_FAILURE);
}
#include "envy24control.h"
-static snd_ctl_element_t spdif_master;
-static snd_ctl_element_t word_clock_sync;
-static snd_ctl_element_t volume_rate;
-static snd_ctl_element_t spdif_input;
-static snd_ctl_element_t spdif_output;
+static snd_ctl_elem_t spdif_master;
+static snd_ctl_elem_t word_clock_sync;
+static snd_ctl_elem_t volume_rate;
+static snd_ctl_elem_t spdif_input;
+static snd_ctl_elem_t spdif_output;
#define toggle_set(widget, state) \
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), state);
{
int err;
- if ((err = snd_ctl_element_read(card_ctl, &spdif_master)) < 0)
+ if ((err = snd_ctl_elem_read(card_ctl, &spdif_master)) < 0)
g_print("Unable to read S/PDIF master state: %s\n", snd_strerror(err));
if (card_eeprom.subvendor == ICE1712_SUBDEVICE_DELTA1010) {
- if ((err = snd_ctl_element_read(card_ctl, &word_clock_sync)) < 0)
+ if ((err = snd_ctl_elem_read(card_ctl, &word_clock_sync)) < 0)
g_print("Unable to read word clock sync selection: %s\n", snd_strerror(err));
}
if (spdif_master.value.integer.value[0]) {
int err;
spdif_master.value.integer.value[0] = on ? 1 : 0;
- if ((err = snd_ctl_element_write(card_ctl, &spdif_master)) < 0)
+ if ((err = snd_ctl_elem_write(card_ctl, &spdif_master)) < 0)
g_print("Unable to write S/PDIF master state: %s\n", snd_strerror(err));
}
if (card_eeprom.subvendor != ICE1712_SUBDEVICE_DELTA1010)
return;
word_clock_sync.value.integer.value[0] = on ? 1 : 0;
- if ((err = snd_ctl_element_write(card_ctl, &word_clock_sync)) < 0)
+ if ((err = snd_ctl_elem_write(card_ctl, &word_clock_sync)) < 0)
g_print("Unable to write word clock sync selection: %s\n", snd_strerror(err));
}
gint master_clock_status_timeout_callback(gpointer data)
{
- snd_ctl_element_t sw;
+ snd_ctl_elem_t sw;
int err;
if (card_eeprom.subvendor != ICE1712_SUBDEVICE_DELTA1010)
return FALSE;
memset(&sw, 0, sizeof(sw));
- sw.id.iface = SND_CTL_ELEMENT_IFACE_PCM;
+ sw.id.iface = SND_CTL_ELEM_IFACE_PCM;
strcpy(sw.id.name, "Word Clock Status");
- if ((err = snd_ctl_element_read(card_ctl, &sw)) < 0)
+ if ((err = snd_ctl_elem_read(card_ctl, &sw)) < 0)
g_print("Unable to determine word clock status: %s\n", snd_strerror(err));
gtk_label_set_text(GTK_LABEL(hw_master_clock_status_label),
sw.value.integer.value[0] ? "Locked" : "No signal");
{
int err;
- if ((err = snd_ctl_element_read(card_ctl, &volume_rate)) < 0)
+ if ((err = snd_ctl_elem_read(card_ctl, &volume_rate)) < 0)
g_print("Unable to read volume change rate: %s\n", snd_strerror(err));
gtk_adjustment_set_value(GTK_ADJUSTMENT(hw_volume_change_adj), volume_rate.value.integer.value[0]);
}
int err;
volume_rate.value.integer.value[0] = adj->value;
- if ((err = snd_ctl_element_write(card_ctl, &volume_rate)) < 0)
+ if ((err = snd_ctl_elem_write(card_ctl, &volume_rate)) < 0)
g_print("Unable to write volume change rate: %s\n", snd_strerror(err));
}
if (card_eeprom.subvendor == ICE1712_SUBDEVICE_DELTA44)
return;
- if ((err = snd_ctl_element_read(card_ctl, &spdif_output)) < 0)
+ if ((err = snd_ctl_elem_read(card_ctl, &spdif_output)) < 0)
g_print("Unable to read Delta S/PDIF output state: %s\n", snd_strerror(err));
val = spdif_output.value.integer.value[0];
if (val & 1) { /* consumer */
{
int err;
- if ((err = snd_ctl_element_write(card_ctl, &spdif_output)) < 0)
+ if ((err = snd_ctl_elem_write(card_ctl, &spdif_output)) < 0)
g_print("Unable to write Delta S/PDIF Output Defaults: %s\n", snd_strerror(err));
}
if (card_eeprom.subvendor != ICE1712_SUBDEVICE_DELTADIO2496)
return;
- if ((err = snd_ctl_element_read(card_ctl, &spdif_input)) < 0)
+ if ((err = snd_ctl_elem_read(card_ctl, &spdif_input)) < 0)
g_print("Unable to read S/PDIF input switch: %s\n", snd_strerror(err));
if (spdif_input.value.integer.value[0]) {
toggle_set(hw_spdif_input_optical_radio, TRUE);
spdif_input.value.integer.value[0] = 1;
else
spdif_input.value.integer.value[0] = 0;
- if ((err = snd_ctl_element_write(card_ctl, &spdif_input)) < 0)
+ if ((err = snd_ctl_elem_write(card_ctl, &spdif_input)) < 0)
g_print("Unable to write S/PDIF input switch: %s\n", snd_strerror(err));
}
void hardware_init(void)
{
memset(&spdif_master, 0, sizeof(spdif_master));
- spdif_master.id.iface = SND_CTL_ELEMENT_IFACE_PCM;
+ spdif_master.id.iface = SND_CTL_ELEM_IFACE_PCM;
strcpy(spdif_master.id.name, "Multi Track S/PDIF Master");
memset(&word_clock_sync, 0, sizeof(spdif_master));
- word_clock_sync.id.iface = SND_CTL_ELEMENT_IFACE_PCM;
+ word_clock_sync.id.iface = SND_CTL_ELEM_IFACE_PCM;
strcpy(word_clock_sync.id.name, "Word Clock Sync");
memset(&volume_rate, 0, sizeof(volume_rate));
- spdif_master.id.iface = SND_CTL_ELEMENT_IFACE_PCM;
+ spdif_master.id.iface = SND_CTL_ELEM_IFACE_PCM;
strcpy(volume_rate.id.name, "Multi Track Volume Rate");
memset(&spdif_input, 0, sizeof(spdif_input));
- spdif_master.id.iface = SND_CTL_ELEMENT_IFACE_PCM;
+ spdif_master.id.iface = SND_CTL_ELEM_IFACE_PCM;
strcpy(spdif_input.id.name, "S/PDIF Input Optical");
memset(&spdif_output, 0, sizeof(spdif_output));
- spdif_master.id.iface = SND_CTL_ELEMENT_IFACE_PCM;
+ spdif_master.id.iface = SND_CTL_ELEM_IFACE_PCM;
strcpy(spdif_output.id.name, "Delta S/PDIF Output Defaults");
}
static GdkGC *penRedShadow[21] = { NULL, };
static GdkGC *penRedLight[21] = { NULL, };
static GdkPixmap *pixmap[21] = { NULL, };
-static snd_ctl_element_t peaks;
+static snd_ctl_elem_t peaks;
static void update_peak_switch(void)
{
int err;
memset(&peaks, 0, sizeof(peaks));
- peaks.id.iface = SND_CTL_ELEMENT_IFACE_MIXER;
+ peaks.id.iface = SND_CTL_ELEM_IFACE_MIXER;
strcpy(peaks.id.name, "Multi Track Peak");
- if ((err = snd_ctl_element_read(card_ctl, &peaks)) < 0)
+ if ((err = snd_ctl_elem_read(card_ctl, &peaks)) < 0)
g_print("Unable to read peaks: %s\n", snd_strerror(err));
}
void mixer_update_stream(int stream, int vol_flag, int sw_flag)
{
- snd_ctl_element_t vol, sw;
+ snd_ctl_elem_t vol, sw;
int err;
if (vol_flag) {
memset(&vol, 0, sizeof(vol));
- vol.id.iface = SND_CTL_ELEMENT_IFACE_MIXER;
+ vol.id.iface = SND_CTL_ELEM_IFACE_MIXER;
strcpy(vol.id.name, stream <= 10 ? "Multi Playback Volume" : "Multi Capture Volume");
vol.id.index = (stream - 1) % 10;
- if ((err = snd_ctl_element_read(card_ctl, &vol)) < 0)
+ if ((err = snd_ctl_elem_read(card_ctl, &vol)) < 0)
g_print("Unable to read multi playback volume: %s\n", snd_strerror(err));
gtk_adjustment_set_value(GTK_ADJUSTMENT(mixer_adj[stream-1][0]), 96 - vol.value.integer.value[0]);
gtk_adjustment_set_value(GTK_ADJUSTMENT(mixer_adj[stream-1][1]), 96 - vol.value.integer.value[1]);
}
if (sw_flag) {
memset(&sw, 0, sizeof(sw));
- sw.id.iface = SND_CTL_ELEMENT_IFACE_MIXER;
+ sw.id.iface = SND_CTL_ELEM_IFACE_MIXER;
strcpy(sw.id.name, stream <= 10 ? "Multi Playback Switch" : "Multi Capture Switch");
sw.id.index = (stream - 1) % 10;
- if ((err = snd_ctl_element_read(card_ctl, &sw)) < 0)
+ if ((err = snd_ctl_elem_read(card_ctl, &sw)) < 0)
g_print("Unable to read multi playback switch: %s\n", snd_strerror(err));
toggle_set(mixer_solo_toggle[stream-1][0], sw.value.integer.value[0] ? TRUE : FALSE);
toggle_set(mixer_solo_toggle[stream-1][1], sw.value.integer.value[1] ? TRUE : FALSE);
static void set_switch1(int stream, int left, int right)
{
- snd_ctl_element_t sw;
+ snd_ctl_elem_t sw;
int err;
memset(&sw, 0, sizeof(sw));
- sw.id.iface = SND_CTL_ELEMENT_IFACE_MIXER;
+ sw.id.iface = SND_CTL_ELEM_IFACE_MIXER;
strcpy(sw.id.name, stream <= 10 ? "Multi Playback Switch" : "Multi Capture Switch");
sw.id.index = (stream - 1) % 10;
- if ((err = snd_ctl_element_read(card_ctl, &sw)) < 0)
+ if ((err = snd_ctl_elem_read(card_ctl, &sw)) < 0)
g_print("Unable to read multi switch: %s\n", snd_strerror(err));
if (left >= 0)
sw.value.integer.value[0] = left != 0;
if (right >= 0)
sw.value.integer.value[1] = right != 0;
- if ((err = snd_ctl_element_write(card_ctl, &sw)) < 0 && err != -EBUSY)
+ if ((err = snd_ctl_elem_write(card_ctl, &sw)) < 0 && err != -EBUSY)
g_print("Unable to write multi switch: %s\n", snd_strerror(err));
}
static void set_volume1(int stream, int left, int right)
{
- snd_ctl_element_t vol;
+ snd_ctl_elem_t vol;
int err;
memset(&vol, 0, sizeof(vol));
- vol.id.iface = SND_CTL_ELEMENT_IFACE_MIXER;
+ vol.id.iface = SND_CTL_ELEM_IFACE_MIXER;
strcpy(vol.id.name, stream <= 10 ? "Multi Playback Volume" : "Multi Capture Volume");
vol.id.index = (stream - 1) % 10;
- if ((err = snd_ctl_element_read(card_ctl, &vol)) < 0)
+ if ((err = snd_ctl_elem_read(card_ctl, &vol)) < 0)
g_print("Unable to read multi volume: %s\n", snd_strerror(err));
if (left >= 0)
vol.value.integer.value[0] = left;
if (right >= 0)
vol.value.integer.value[1] = right;
- if ((err = snd_ctl_element_write(card_ctl, &vol)) < 0 && err != -EBUSY)
+ if ((err = snd_ctl_elem_write(card_ctl, &vol)) < 0 && err != -EBUSY)
g_print("Unable to write multi volume: %s\n", snd_strerror(err));
}
#include "envy24control.h"
-static snd_ctl_element_t routes;
+static snd_ctl_elem_t routes;
#define toggle_set(widget, state) \
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), state);
{
int stream, tidx, err;
- if ((err = snd_ctl_element_read(card_ctl, &routes)) < 0) {
+ if ((err = snd_ctl_elem_read(card_ctl, &routes)) < 0) {
g_print("Multi track routes read error: %s\n", snd_strerror(err));
return;
}
routes.value.bytes.data[6] = (capture >> 16) & 0xff;
routes.value.bytes.data[7] = (capture >> 24) & 0xff;
// g_print("psdout = 0x%x, spdout = 0x%x, capture = 0x%x\n", psdout, spdout, capture);
- if ((err = snd_ctl_element_write(card_ctl, &routes)) < 0)
+ if ((err = snd_ctl_elem_write(card_ctl, &routes)) < 0)
g_print("Multi track route write error: %s\n", snd_strerror(err));
}
void patchbay_init(void)
{
memset(&routes, 0, sizeof(routes));
- routes.id.iface = SND_CTL_ELEMENT_IFACE_MIXER;
+ routes.id.iface = SND_CTL_ELEM_IFACE_MIXER;
strcpy(routes.id.name, "Multi Track Route");
}