mirror of
https://github.com/alsa-project/alsa-tools.git
synced 2025-10-29 05:40:25 -04:00
Better names for control API
This commit is contained in:
parent
af4bfca9ea
commit
c4f5780e6e
6 changed files with 52 additions and 52 deletions
|
|
@ -19,9 +19,9 @@
|
||||||
|
|
||||||
#include "envy24control.h"
|
#include "envy24control.h"
|
||||||
|
|
||||||
static void control_value(snd_ctl_t *handle, void *private_data, snd_control_id_t *id)
|
static void control_value(snd_ctl_t *handle, void *private_data, snd_ctl_element_id_t *id)
|
||||||
{
|
{
|
||||||
if (id->iface == SND_CONTROL_IFACE_PCM) {
|
if (id->iface == SND_CTL_ELEMENT_IFACE_PCM) {
|
||||||
if (!strcmp(id->name, "Multi Track Route")) {
|
if (!strcmp(id->name, "Multi Track Route")) {
|
||||||
patchbay_update();
|
patchbay_update();
|
||||||
return;
|
return;
|
||||||
|
|
@ -47,7 +47,7 @@ static void control_value(snd_ctl_t *handle, void *private_data, snd_control_id_
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (id->iface == SND_CONTROL_IFACE_MIXER) {
|
if (id->iface == SND_CTL_ELEMENT_IFACE_MIXER) {
|
||||||
if (!strcmp(id->name, "Multi Playback Volume")) {
|
if (!strcmp(id->name, "Multi Playback Volume")) {
|
||||||
mixer_update_stream(id->index + 1, 1, 0);
|
mixer_update_stream(id->index + 1, 1, 0);
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
int card = 0;
|
int card = 0;
|
||||||
snd_ctl_t *card_ctl = NULL;
|
snd_ctl_t *card_ctl = NULL;
|
||||||
snd_ctl_info_t hw_info;
|
snd_ctl_card_info_t hw_info;
|
||||||
ice1712_eeprom_t card_eeprom;
|
ice1712_eeprom_t card_eeprom;
|
||||||
|
|
||||||
GtkWidget *window;
|
GtkWidget *window;
|
||||||
|
|
@ -1029,7 +1029,7 @@ int main(int argc, char **argv)
|
||||||
char name[32], title[128];
|
char name[32], title[128];
|
||||||
int err;
|
int err;
|
||||||
unsigned int cards_mask;
|
unsigned int cards_mask;
|
||||||
snd_control_t ctl;
|
snd_ctl_element_t ctl;
|
||||||
// snd_mixer_filter_t filter;
|
// snd_mixer_filter_t filter;
|
||||||
|
|
||||||
/* Go through gtk initialization */
|
/* Go through gtk initialization */
|
||||||
|
|
@ -1044,8 +1044,8 @@ int main(int argc, char **argv)
|
||||||
fprintf(stderr, "snd_ctl_open: %s\n", snd_strerror(err));
|
fprintf(stderr, "snd_ctl_open: %s\n", snd_strerror(err));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
if ((err = snd_ctl_info(card_ctl, &hw_info)) < 0) {
|
if ((err = snd_ctl_card_info(card_ctl, &hw_info)) < 0) {
|
||||||
fprintf(stderr, "snd_ctl_info: %s\n", snd_strerror(err));
|
fprintf(stderr, "snd_ctl_card_info: %s\n", snd_strerror(err));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
if (hw_info.type == SND_CARD_TYPE_ICE1712)
|
if (hw_info.type == SND_CARD_TYPE_ICE1712)
|
||||||
|
|
@ -1074,9 +1074,9 @@ int main(int argc, char **argv)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
memset(&ctl, 0, sizeof(ctl));
|
memset(&ctl, 0, sizeof(ctl));
|
||||||
ctl.id.iface = SND_CONTROL_IFACE_CARD;
|
ctl.id.iface = SND_CTL_ELEMENT_IFACE_CARD;
|
||||||
strcpy(ctl.id.name, "ICE1712 EEPROM");
|
strcpy(ctl.id.name, "ICE1712 EEPROM");
|
||||||
if ((err = snd_ctl_cread(card_ctl, &ctl)) < 0) {
|
if ((err = snd_ctl_element_read(card_ctl, &ctl)) < 0) {
|
||||||
fprintf(stderr, "Unable to read EEPROM contents: %s\n", snd_strerror(err));
|
fprintf(stderr, "Unable to read EEPROM contents: %s\n", snd_strerror(err));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,11 @@
|
||||||
|
|
||||||
#include "envy24control.h"
|
#include "envy24control.h"
|
||||||
|
|
||||||
static snd_control_t spdif_master;
|
static snd_ctl_element_t spdif_master;
|
||||||
static snd_control_t word_clock_sync;
|
static snd_ctl_element_t word_clock_sync;
|
||||||
static snd_control_t volume_rate;
|
static snd_ctl_element_t volume_rate;
|
||||||
static snd_control_t spdif_input;
|
static snd_ctl_element_t spdif_input;
|
||||||
static snd_control_t spdif_output;
|
static snd_ctl_element_t spdif_output;
|
||||||
|
|
||||||
#define toggle_set(widget, state) \
|
#define toggle_set(widget, state) \
|
||||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), state);
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), state);
|
||||||
|
|
@ -37,10 +37,10 @@ void master_clock_update(void)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
if ((err = snd_ctl_cread(card_ctl, &spdif_master)) < 0)
|
if ((err = snd_ctl_element_read(card_ctl, &spdif_master)) < 0)
|
||||||
g_print("Unable to read S/PDIF master state: %s\n", snd_strerror(err));
|
g_print("Unable to read S/PDIF master state: %s\n", snd_strerror(err));
|
||||||
if (card_eeprom.subvendor == ICE1712_SUBDEVICE_DELTA1010) {
|
if (card_eeprom.subvendor == ICE1712_SUBDEVICE_DELTA1010) {
|
||||||
if ((err = snd_ctl_cread(card_ctl, &word_clock_sync)) < 0)
|
if ((err = snd_ctl_element_read(card_ctl, &word_clock_sync)) < 0)
|
||||||
g_print("Unable to read word clock sync selection: %s\n", snd_strerror(err));
|
g_print("Unable to read word clock sync selection: %s\n", snd_strerror(err));
|
||||||
}
|
}
|
||||||
if (spdif_master.value.integer.value[0]) {
|
if (spdif_master.value.integer.value[0]) {
|
||||||
|
|
@ -60,7 +60,7 @@ static void master_clock_spdif_master(int on)
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
spdif_master.value.integer.value[0] = on ? 1 : 0;
|
spdif_master.value.integer.value[0] = on ? 1 : 0;
|
||||||
if ((err = snd_ctl_cwrite(card_ctl, &spdif_master)) < 0)
|
if ((err = snd_ctl_element_write(card_ctl, &spdif_master)) < 0)
|
||||||
g_print("Unable to write S/PDIF master state: %s\n", snd_strerror(err));
|
g_print("Unable to write S/PDIF master state: %s\n", snd_strerror(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -71,7 +71,7 @@ static void master_clock_word_select(int on)
|
||||||
if (card_eeprom.subvendor != ICE1712_SUBDEVICE_DELTA1010)
|
if (card_eeprom.subvendor != ICE1712_SUBDEVICE_DELTA1010)
|
||||||
return;
|
return;
|
||||||
word_clock_sync.value.integer.value[0] = on ? 1 : 0;
|
word_clock_sync.value.integer.value[0] = on ? 1 : 0;
|
||||||
if ((err = snd_ctl_cwrite(card_ctl, &word_clock_sync)) < 0)
|
if ((err = snd_ctl_element_write(card_ctl, &word_clock_sync)) < 0)
|
||||||
g_print("Unable to write word clock sync selection: %s\n", snd_strerror(err));
|
g_print("Unable to write word clock sync selection: %s\n", snd_strerror(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -96,15 +96,15 @@ void master_clock_toggled(GtkWidget *togglebutton, gpointer data)
|
||||||
|
|
||||||
gint master_clock_status_timeout_callback(gpointer data)
|
gint master_clock_status_timeout_callback(gpointer data)
|
||||||
{
|
{
|
||||||
snd_control_t sw;
|
snd_ctl_element_t sw;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (card_eeprom.subvendor != ICE1712_SUBDEVICE_DELTA1010)
|
if (card_eeprom.subvendor != ICE1712_SUBDEVICE_DELTA1010)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
memset(&sw, 0, sizeof(sw));
|
memset(&sw, 0, sizeof(sw));
|
||||||
sw.id.iface = SND_CONTROL_IFACE_PCM;
|
sw.id.iface = SND_CTL_ELEMENT_IFACE_PCM;
|
||||||
strcpy(sw.id.name, "Word Clock Status");
|
strcpy(sw.id.name, "Word Clock Status");
|
||||||
if ((err = snd_ctl_cread(card_ctl, &sw)) < 0)
|
if ((err = snd_ctl_element_read(card_ctl, &sw)) < 0)
|
||||||
g_print("Unable to determine word clock status: %s\n", snd_strerror(err));
|
g_print("Unable to determine word clock status: %s\n", snd_strerror(err));
|
||||||
gtk_label_set_text(GTK_LABEL(hw_master_clock_status_label),
|
gtk_label_set_text(GTK_LABEL(hw_master_clock_status_label),
|
||||||
sw.value.integer.value[0] ? "Locked" : "No signal");
|
sw.value.integer.value[0] ? "Locked" : "No signal");
|
||||||
|
|
@ -115,7 +115,7 @@ void volume_change_rate_update(void)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
if ((err = snd_ctl_cread(card_ctl, &volume_rate)) < 0)
|
if ((err = snd_ctl_element_read(card_ctl, &volume_rate)) < 0)
|
||||||
g_print("Unable to read volume change rate: %s\n", snd_strerror(err));
|
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]);
|
gtk_adjustment_set_value(GTK_ADJUSTMENT(hw_volume_change_adj), volume_rate.value.integer.value[0]);
|
||||||
}
|
}
|
||||||
|
|
@ -125,7 +125,7 @@ void volume_change_rate_adj(GtkAdjustment *adj, gpointer data)
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
volume_rate.value.integer.value[0] = adj->value;
|
volume_rate.value.integer.value[0] = adj->value;
|
||||||
if ((err = snd_ctl_cwrite(card_ctl, &volume_rate)) < 0)
|
if ((err = snd_ctl_element_write(card_ctl, &volume_rate)) < 0)
|
||||||
g_print("Unable to write volume change rate: %s\n", snd_strerror(err));
|
g_print("Unable to write volume change rate: %s\n", snd_strerror(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -135,7 +135,7 @@ void spdif_output_update(void)
|
||||||
|
|
||||||
if (card_eeprom.subvendor == ICE1712_SUBDEVICE_DELTA44)
|
if (card_eeprom.subvendor == ICE1712_SUBDEVICE_DELTA44)
|
||||||
return;
|
return;
|
||||||
if ((err = snd_ctl_cread(card_ctl, &spdif_output)) < 0)
|
if ((err = snd_ctl_element_read(card_ctl, &spdif_output)) < 0)
|
||||||
g_print("Unable to read Delta S/PDIF output state: %s\n", snd_strerror(err));
|
g_print("Unable to read Delta S/PDIF output state: %s\n", snd_strerror(err));
|
||||||
val = spdif_output.value.integer.value[0];
|
val = spdif_output.value.integer.value[0];
|
||||||
if (val & 1) { /* consumer */
|
if (val & 1) { /* consumer */
|
||||||
|
|
@ -186,7 +186,7 @@ static void spdif_output_write(void)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
if ((err = snd_ctl_cwrite(card_ctl, &spdif_output)) < 0)
|
if ((err = snd_ctl_element_write(card_ctl, &spdif_output)) < 0)
|
||||||
g_print("Unable to write Delta S/PDIF Output Defaults: %s\n", snd_strerror(err));
|
g_print("Unable to write Delta S/PDIF Output Defaults: %s\n", snd_strerror(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -359,7 +359,7 @@ void spdif_input_update(void)
|
||||||
|
|
||||||
if (card_eeprom.subvendor != ICE1712_SUBDEVICE_DELTADIO2496)
|
if (card_eeprom.subvendor != ICE1712_SUBDEVICE_DELTADIO2496)
|
||||||
return;
|
return;
|
||||||
if ((err = snd_ctl_cread(card_ctl, &spdif_input)) < 0)
|
if ((err = snd_ctl_element_read(card_ctl, &spdif_input)) < 0)
|
||||||
g_print("Unable to read S/PDIF input switch: %s\n", snd_strerror(err));
|
g_print("Unable to read S/PDIF input switch: %s\n", snd_strerror(err));
|
||||||
if (spdif_input.value.integer.value[0]) {
|
if (spdif_input.value.integer.value[0]) {
|
||||||
toggle_set(hw_spdif_input_optical_radio, TRUE);
|
toggle_set(hw_spdif_input_optical_radio, TRUE);
|
||||||
|
|
@ -379,30 +379,30 @@ void spdif_input_toggled(GtkWidget *togglebutton, gpointer data)
|
||||||
spdif_input.value.integer.value[0] = 1;
|
spdif_input.value.integer.value[0] = 1;
|
||||||
else
|
else
|
||||||
spdif_input.value.integer.value[0] = 0;
|
spdif_input.value.integer.value[0] = 0;
|
||||||
if ((err = snd_ctl_cwrite(card_ctl, &spdif_input)) < 0)
|
if ((err = snd_ctl_element_write(card_ctl, &spdif_input)) < 0)
|
||||||
g_print("Unable to write S/PDIF input switch: %s\n", snd_strerror(err));
|
g_print("Unable to write S/PDIF input switch: %s\n", snd_strerror(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
void hardware_init(void)
|
void hardware_init(void)
|
||||||
{
|
{
|
||||||
memset(&spdif_master, 0, sizeof(spdif_master));
|
memset(&spdif_master, 0, sizeof(spdif_master));
|
||||||
spdif_master.id.iface = SND_CONTROL_IFACE_PCM;
|
spdif_master.id.iface = SND_CTL_ELEMENT_IFACE_PCM;
|
||||||
strcpy(spdif_master.id.name, "Multi Track S/PDIF Master");
|
strcpy(spdif_master.id.name, "Multi Track S/PDIF Master");
|
||||||
|
|
||||||
memset(&word_clock_sync, 0, sizeof(spdif_master));
|
memset(&word_clock_sync, 0, sizeof(spdif_master));
|
||||||
word_clock_sync.id.iface = SND_CONTROL_IFACE_PCM;
|
word_clock_sync.id.iface = SND_CTL_ELEMENT_IFACE_PCM;
|
||||||
strcpy(word_clock_sync.id.name, "Word Clock Sync");
|
strcpy(word_clock_sync.id.name, "Word Clock Sync");
|
||||||
|
|
||||||
memset(&volume_rate, 0, sizeof(volume_rate));
|
memset(&volume_rate, 0, sizeof(volume_rate));
|
||||||
spdif_master.id.iface = SND_CONTROL_IFACE_PCM;
|
spdif_master.id.iface = SND_CTL_ELEMENT_IFACE_PCM;
|
||||||
strcpy(volume_rate.id.name, "Multi Track Volume Rate");
|
strcpy(volume_rate.id.name, "Multi Track Volume Rate");
|
||||||
|
|
||||||
memset(&spdif_input, 0, sizeof(spdif_input));
|
memset(&spdif_input, 0, sizeof(spdif_input));
|
||||||
spdif_master.id.iface = SND_CONTROL_IFACE_PCM;
|
spdif_master.id.iface = SND_CTL_ELEMENT_IFACE_PCM;
|
||||||
strcpy(spdif_input.id.name, "S/PDIF Input Optical");
|
strcpy(spdif_input.id.name, "S/PDIF Input Optical");
|
||||||
|
|
||||||
memset(&spdif_output, 0, sizeof(spdif_output));
|
memset(&spdif_output, 0, sizeof(spdif_output));
|
||||||
spdif_master.id.iface = SND_CONTROL_IFACE_PCM;
|
spdif_master.id.iface = SND_CTL_ELEMENT_IFACE_PCM;
|
||||||
strcpy(spdif_output.id.name, "Delta S/PDIF Output Defaults");
|
strcpy(spdif_output.id.name, "Delta S/PDIF Output Defaults");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,16 +26,16 @@ static GdkGC *penOrangeLight[21] = { NULL, };
|
||||||
static GdkGC *penRedShadow[21] = { NULL, };
|
static GdkGC *penRedShadow[21] = { NULL, };
|
||||||
static GdkGC *penRedLight[21] = { NULL, };
|
static GdkGC *penRedLight[21] = { NULL, };
|
||||||
static GdkPixmap *pixmap[21] = { NULL, };
|
static GdkPixmap *pixmap[21] = { NULL, };
|
||||||
static snd_control_t peaks;
|
static snd_ctl_element_t peaks;
|
||||||
|
|
||||||
static void update_peak_switch(void)
|
static void update_peak_switch(void)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
memset(&peaks, 0, sizeof(peaks));
|
memset(&peaks, 0, sizeof(peaks));
|
||||||
peaks.id.iface = SND_CONTROL_IFACE_MIXER;
|
peaks.id.iface = SND_CTL_ELEMENT_IFACE_MIXER;
|
||||||
strcpy(peaks.id.name, "Multi Track Peak");
|
strcpy(peaks.id.name, "Multi Track Peak");
|
||||||
if ((err = snd_ctl_cread(card_ctl, &peaks)) < 0)
|
if ((err = snd_ctl_element_read(card_ctl, &peaks)) < 0)
|
||||||
g_print("Unable to read peaks: %s\n", snd_strerror(err));
|
g_print("Unable to read peaks: %s\n", snd_strerror(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,15 +29,15 @@ static int is_active(GtkWidget *widget)
|
||||||
|
|
||||||
void mixer_update_stream(int stream, int vol_flag, int sw_flag)
|
void mixer_update_stream(int stream, int vol_flag, int sw_flag)
|
||||||
{
|
{
|
||||||
snd_control_t vol, sw;
|
snd_ctl_element_t vol, sw;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (vol_flag) {
|
if (vol_flag) {
|
||||||
memset(&vol, 0, sizeof(vol));
|
memset(&vol, 0, sizeof(vol));
|
||||||
vol.id.iface = SND_CONTROL_IFACE_MIXER;
|
vol.id.iface = SND_CTL_ELEMENT_IFACE_MIXER;
|
||||||
strcpy(vol.id.name, stream <= 10 ? "Multi Playback Volume" : "Multi Capture Volume");
|
strcpy(vol.id.name, stream <= 10 ? "Multi Playback Volume" : "Multi Capture Volume");
|
||||||
vol.id.index = (stream - 1) % 10;
|
vol.id.index = (stream - 1) % 10;
|
||||||
if ((err = snd_ctl_cread(card_ctl, &vol)) < 0)
|
if ((err = snd_ctl_element_read(card_ctl, &vol)) < 0)
|
||||||
g_print("Unable to read multi playback volume: %s\n", snd_strerror(err));
|
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][0]), 96 - vol.value.integer.value[0]);
|
||||||
gtk_adjustment_set_value(GTK_ADJUSTMENT(mixer_adj[stream-1][1]), 96 - vol.value.integer.value[1]);
|
gtk_adjustment_set_value(GTK_ADJUSTMENT(mixer_adj[stream-1][1]), 96 - vol.value.integer.value[1]);
|
||||||
|
|
@ -46,10 +46,10 @@ void mixer_update_stream(int stream, int vol_flag, int sw_flag)
|
||||||
}
|
}
|
||||||
if (sw_flag) {
|
if (sw_flag) {
|
||||||
memset(&sw, 0, sizeof(sw));
|
memset(&sw, 0, sizeof(sw));
|
||||||
sw.id.iface = SND_CONTROL_IFACE_MIXER;
|
sw.id.iface = SND_CTL_ELEMENT_IFACE_MIXER;
|
||||||
strcpy(sw.id.name, stream <= 10 ? "Multi Playback Switch" : "Multi Capture Switch");
|
strcpy(sw.id.name, stream <= 10 ? "Multi Playback Switch" : "Multi Capture Switch");
|
||||||
sw.id.index = (stream - 1) % 10;
|
sw.id.index = (stream - 1) % 10;
|
||||||
if ((err = snd_ctl_cread(card_ctl, &sw)) < 0)
|
if ((err = snd_ctl_element_read(card_ctl, &sw)) < 0)
|
||||||
g_print("Unable to read multi playback switch: %s\n", snd_strerror(err));
|
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][0], sw.value.integer.value[0] ? TRUE : FALSE);
|
||||||
toggle_set(mixer_solo_toggle[stream-1][1], sw.value.integer.value[1] ? TRUE : FALSE);
|
toggle_set(mixer_solo_toggle[stream-1][1], sw.value.integer.value[1] ? TRUE : FALSE);
|
||||||
|
|
@ -62,20 +62,20 @@ void mixer_update_stream(int stream, int vol_flag, int sw_flag)
|
||||||
|
|
||||||
static void set_switch1(int stream, int left, int right)
|
static void set_switch1(int stream, int left, int right)
|
||||||
{
|
{
|
||||||
snd_control_t sw;
|
snd_ctl_element_t sw;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
memset(&sw, 0, sizeof(sw));
|
memset(&sw, 0, sizeof(sw));
|
||||||
sw.id.iface = SND_CONTROL_IFACE_MIXER;
|
sw.id.iface = SND_CTL_ELEMENT_IFACE_MIXER;
|
||||||
strcpy(sw.id.name, stream <= 10 ? "Multi Playback Switch" : "Multi Capture Switch");
|
strcpy(sw.id.name, stream <= 10 ? "Multi Playback Switch" : "Multi Capture Switch");
|
||||||
sw.id.index = (stream - 1) % 10;
|
sw.id.index = (stream - 1) % 10;
|
||||||
if ((err = snd_ctl_cread(card_ctl, &sw)) < 0)
|
if ((err = snd_ctl_element_read(card_ctl, &sw)) < 0)
|
||||||
g_print("Unable to read multi switch: %s\n", snd_strerror(err));
|
g_print("Unable to read multi switch: %s\n", snd_strerror(err));
|
||||||
if (left >= 0)
|
if (left >= 0)
|
||||||
sw.value.integer.value[0] = left != 0;
|
sw.value.integer.value[0] = left != 0;
|
||||||
if (right >= 0)
|
if (right >= 0)
|
||||||
sw.value.integer.value[1] = right != 0;
|
sw.value.integer.value[1] = right != 0;
|
||||||
if ((err = snd_ctl_cwrite(card_ctl, &sw)) < 0 && err != -EBUSY)
|
if ((err = snd_ctl_element_write(card_ctl, &sw)) < 0 && err != -EBUSY)
|
||||||
g_print("Unable to write multi switch: %s\n", snd_strerror(err));
|
g_print("Unable to write multi switch: %s\n", snd_strerror(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -147,20 +147,20 @@ void mixer_toggled_mute(GtkWidget *togglebutton, gpointer data)
|
||||||
|
|
||||||
static void set_volume1(int stream, int left, int right)
|
static void set_volume1(int stream, int left, int right)
|
||||||
{
|
{
|
||||||
snd_control_t vol;
|
snd_ctl_element_t vol;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
memset(&vol, 0, sizeof(vol));
|
memset(&vol, 0, sizeof(vol));
|
||||||
vol.id.iface = SND_CONTROL_IFACE_MIXER;
|
vol.id.iface = SND_CTL_ELEMENT_IFACE_MIXER;
|
||||||
strcpy(vol.id.name, stream <= 10 ? "Multi Playback Volume" : "Multi Capture Volume");
|
strcpy(vol.id.name, stream <= 10 ? "Multi Playback Volume" : "Multi Capture Volume");
|
||||||
vol.id.index = (stream - 1) % 10;
|
vol.id.index = (stream - 1) % 10;
|
||||||
if ((err = snd_ctl_cread(card_ctl, &vol)) < 0)
|
if ((err = snd_ctl_element_read(card_ctl, &vol)) < 0)
|
||||||
g_print("Unable to read multi volume: %s\n", snd_strerror(err));
|
g_print("Unable to read multi volume: %s\n", snd_strerror(err));
|
||||||
if (left >= 0)
|
if (left >= 0)
|
||||||
vol.value.integer.value[0] = left;
|
vol.value.integer.value[0] = left;
|
||||||
if (right >= 0)
|
if (right >= 0)
|
||||||
vol.value.integer.value[1] = right;
|
vol.value.integer.value[1] = right;
|
||||||
if ((err = snd_ctl_cwrite(card_ctl, &vol)) < 0 && err != -EBUSY)
|
if ((err = snd_ctl_element_write(card_ctl, &vol)) < 0 && err != -EBUSY)
|
||||||
g_print("Unable to write multi volume: %s\n", snd_strerror(err));
|
g_print("Unable to write multi volume: %s\n", snd_strerror(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#include "envy24control.h"
|
#include "envy24control.h"
|
||||||
|
|
||||||
static snd_control_t routes;
|
static snd_ctl_element_t routes;
|
||||||
|
|
||||||
#define toggle_set(widget, state) \
|
#define toggle_set(widget, state) \
|
||||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), state);
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), state);
|
||||||
|
|
@ -95,7 +95,7 @@ void patchbay_update(void)
|
||||||
{
|
{
|
||||||
int stream, tidx, err;
|
int stream, tidx, err;
|
||||||
|
|
||||||
if ((err = snd_ctl_cread(card_ctl, &routes)) < 0) {
|
if ((err = snd_ctl_element_read(card_ctl, &routes)) < 0) {
|
||||||
g_print("Multi track routes read error: %s\n", snd_strerror(err));
|
g_print("Multi track routes read error: %s\n", snd_strerror(err));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -169,7 +169,7 @@ static void set_routes(int stream, int idx)
|
||||||
routes.value.bytes.data[6] = (capture >> 16) & 0xff;
|
routes.value.bytes.data[6] = (capture >> 16) & 0xff;
|
||||||
routes.value.bytes.data[7] = (capture >> 24) & 0xff;
|
routes.value.bytes.data[7] = (capture >> 24) & 0xff;
|
||||||
// g_print("psdout = 0x%x, spdout = 0x%x, capture = 0x%x\n", psdout, spdout, capture);
|
// g_print("psdout = 0x%x, spdout = 0x%x, capture = 0x%x\n", psdout, spdout, capture);
|
||||||
if ((err = snd_ctl_cwrite(card_ctl, &routes)) < 0)
|
if ((err = snd_ctl_element_write(card_ctl, &routes)) < 0)
|
||||||
g_print("Multi track route write error: %s\n", snd_strerror(err));
|
g_print("Multi track route write error: %s\n", snd_strerror(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -185,7 +185,7 @@ void patchbay_toggled(GtkWidget *togglebutton, gpointer data)
|
||||||
void patchbay_init(void)
|
void patchbay_init(void)
|
||||||
{
|
{
|
||||||
memset(&routes, 0, sizeof(routes));
|
memset(&routes, 0, sizeof(routes));
|
||||||
routes.id.iface = SND_CONTROL_IFACE_MIXER;
|
routes.id.iface = SND_CTL_ELEMENT_IFACE_MIXER;
|
||||||
strcpy(routes.id.name, "Multi Track Route");
|
strcpy(routes.id.name, "Multi Track Route");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue