/*
* This file is part of DisOrder.
- * Copyright (C) 2009 Richard Kettlewell
+ * Copyright (C) 2009, 2013 Richard Kettlewell
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include "common.h"
#include "uaudio.h"
+#include "log.h"
/** @brief List of known APIs
*
* The first one will be used as a default, so putting ALSA before OSS
* constitutes a policy decision.
*/
-const struct uaudio *uaudio_apis[] = {
+const struct uaudio *const uaudio_apis[] = {
#if HAVE_COREAUDIO_AUDIOHARDWARE_H
&uaudio_coreaudio,
#endif
+#if HAVE_PULSEAUDIO
+ &uaudio_pulseaudio,
+#endif
#if HAVE_ALSA_ASOUNDLIB_H
&uaudio_alsa,
#endif
NULL,
};
+/** @brief Look up an audio API by name */
+const struct uaudio *uaudio_find(const char *name) {
+ int n;
+
+ for(n = 0; uaudio_apis[n]; ++n)
+ if(!strcmp(uaudio_apis[n]->name, name))
+ return uaudio_apis[n];
+ if(!strcmp(name, "network"))
+ return &uaudio_rtp;
+ disorder_fatal(0, "cannot find audio API '%s'", name);
+}
+
/*
Local Variables:
c-basic-offset:2