}
}
- if (info.type == SND_CONTROL_TYPE_BYTES) {
- char buf[info.values_count * 2 + 1];
- char *p = buf;
- char *hex = "0123456789abcdef";
- for (idx = 0; idx < info.values_count; idx++) {
- int v = ctl.value.bytes.data[idx];
- *p++ = hex[v >> 4];
- *p++ = hex[v & 0x0f];
- }
- *p = '\0';
- err = snd_config_string_add(control, "value", buf);
- if (err < 0) {
- error("snd_config_string_add: %s", snd_strerror(err));
- return err;
+ switch (info.type) {
+ case SND_CONTROL_TYPE_BYTES:
+ {
+ char buf[info.values_count * 2 + 1];
+ char *p = buf;
+ char *hex = "0123456789abcdef";
+ for (idx = 0; idx < info.values_count; idx++) {
+ int v = ctl.value.bytes.data[idx];
+ *p++ = hex[v >> 4];
+ *p++ = hex[v & 0x0f];
+ }
+ *p = '\0';
+ err = snd_config_string_add(control, "value", buf);
+ if (err < 0) {
+ error("snd_config_string_add: %s", snd_strerror(err));
+ return err;
+ }
+ return 0;
}
+ case SND_CONTROL_TYPE_IEC958:
+ error("An IEC958 control ignored");
return 0;
+ default:
+ break;
}
if (info.values_count == 1) {
error("bad control.%d.value.%d content", numid, idx);
return -EINVAL;
}
- ctl.value.integer.value[idx] = val;
+ ctl.value.bytes.data[idx] = val;
break;
default:
break;
static int buffer_pos = 0;
static size_t bits_per_sample, bits_per_frame;
static size_t buffer_bytes;
-int digital = SND_PCM_DIG_NONE;
static int count;
static int vocmajor, vocminor;
interleaved = 0;
break;
case 'C':
- digital = SND_PCM_DIG_AES_IEC958C;
+ // digital = SND_PCM_DIG_AES_IEC958C;
break;
case 'P':
- digital = SND_PCM_DIG_AES_IEC958P;
+ // digital = SND_PCM_DIG_AES_IEC958P;
break;
default:
fprintf(stderr, "Try `%s --help' for more information.\n", command);
return 1;
}
+#if 1
+#warning "The S/PDIF code needs to be recoded.."
+#else
if (digital != SND_PCM_DIG_NONE) {
snd_pcm_dig_params_t dig;
memset(&dig, 0, sizeof(dig));
return 1;
}
}
+#endif
if (nonblock) {
err = snd_pcm_nonblock(handle, 1);