default sound API. This saves e.g. uaudio_rtp being linked into
disorder-playrtp. It does mean that users need more knowledge of
available APIs, but since they need to know what options to set that's
not much of an extra burden.
mem_init();
if(!setlocale(LC_CTYPE, "")) fatal(errno, "error calling setlocale");
mem_init();
if(!setlocale(LC_CTYPE, "")) fatal(errno, "error calling setlocale");
- backend = uaudio_apis[0];
+ backend = &UAUDIO_DEFAULT;
while((n = getopt_long(argc, argv, "hVdD:m:b:x:L:R:M:aocC:re:", options, 0)) >= 0) {
switch(n) {
case 'h': help();
while((n = getopt_long(argc, argv, "hVdD:m:b:x:L:R:M:aocC:re:", options, 0)) >= 0) {
switch(n) {
case 'h': help();
uaudio_sample_size = bits / CHAR_BIT;
}
uaudio_sample_size = bits / CHAR_BIT;
}
-/** @brief List of known APIs
- *
- * Terminated by a null pointer.
- *
- * The first one will be used as a default, so putting ALSA before OSS
- * constitutes a policy decision.
- */
-const struct uaudio *uaudio_apis[] = {
-#if HAVE_COREAUDIO_AUDIOHARDWARE_H
- &uaudio_coreaudio,
-#endif
-#if HAVE_ALSA_ASOUNDLIB_H
- &uaudio_alsa,
-#endif
-#if HAVE_SYS_SOUNDCARD_H || EMPEG_HOST
- &uaudio_oss,
-#endif
- &uaudio_rtp,
- &uaudio_command,
- NULL,
-};
-
/*
Local Variables:
c-basic-offset:2
/*
Local Variables:
c-basic-offset:2
#if HAVE_COREAUDIO_AUDIOHARDWARE_H
extern const struct uaudio uaudio_coreaudio;
#if HAVE_COREAUDIO_AUDIOHARDWARE_H
extern const struct uaudio uaudio_coreaudio;
+#ifndef UAUDIO_DEFAULT
+# define UAUDIO_DEFAULT uaudio_coreaudio
+#endif
#endif
#if HAVE_ALSA_ASOUNDLIB_H
extern const struct uaudio uaudio_alsa;
#endif
#if HAVE_ALSA_ASOUNDLIB_H
extern const struct uaudio uaudio_alsa;
+#ifndef UAUDIO_DEFAULT
+# define UAUDIO_DEFAULT uaudio_alsa
+#endif
#endif
#if HAVE_SYS_SOUNDCARD_H || EMPEG_HOST
extern const struct uaudio uaudio_oss;
#endif
#if HAVE_SYS_SOUNDCARD_H || EMPEG_HOST
extern const struct uaudio uaudio_oss;
+#ifndef UAUDIO_DEFAULT
+# define UAUDIO_DEFAULT uaudio_oss
+#endif
#endif
extern const struct uaudio uaudio_rtp;
#endif
extern const struct uaudio uaudio_rtp;
-extern const struct uaudio uaudio_command;
+#ifndef UAUDIO_DEFAULT
+# define UAUDIO_DEFAULT uaudio_rtp
+#endif
-extern const struct uaudio *uaudio_apis[];
+extern const struct uaudio uaudio_command;