2 * This file is part of DisOrder.
3 * Copyright (C) 2009, 2013 Richard Kettlewell
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 /** @file lib/uaudio-apis.c
20 * @brief Audio API list
27 /** @brief List of known APIs
29 * Terminated by a null pointer.
31 * The first one will be used as a default, so putting ALSA before OSS
32 * constitutes a policy decision.
34 const struct uaudio
*const uaudio_apis
[] = {
35 #if HAVE_COREAUDIO_AUDIOHARDWARE_H
41 #if HAVE_ALSA_ASOUNDLIB_H
44 #if HAVE_SYS_SOUNDCARD_H || EMPEG_HOST
52 /** @brief Look up an audio API by name */
53 const struct uaudio
*uaudio_find(const char *name
) {
56 for(n
= 0; uaudio_apis
[n
]; ++n
)
57 if(!strcmp(uaudio_apis
[n
]->name
, name
))
58 return uaudio_apis
[n
];
59 if(!strcmp(name
, "network"))
61 disorder_fatal(0, "cannot find audio API '%s'", name
);