source: roaraudio/libroareio/driver.c @ 2219:24f974256d95

Last change on this file since 2219:24f974256d95 was 2219:24f974256d95, checked in by phi, 15 years ago

only include OSS driver if we have OSS support

File size: 1.9 KB
Line 
1//driver.c:
2
3/*
4 *      Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2009
5 *
6 *  This file is part of roarclients a part of RoarAudio,
7 *  a cross-platform sound system for both, home and professional use.
8 *  See README for details.
9 *
10 *  This file is free software; you can redistribute it and/or modify
11 *  it under the terms of the GNU General Public License version 3
12 *  as published by the Free Software Foundation.
13 *
14 *  RoarAudio is distributed in the hope that it will be useful,
15 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 *  GNU General Public License for more details.
18 *
19 *  You should have received a copy of the GNU General Public License
20 *  along with this software; see the file COPYING.  If not, write to
21 *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
22 *
23 */
24
25#include <roaraudio.h>
26#include "driver.h"
27
28int roar_cdriver_null(struct roar_vio_calls * calls, char * name, char * dev, struct roar_audio_info * info, int dir) {
29 ROAR_DBG("roar_cdriver_null(calls=%p, name='%s', dev='%s', info=%p{...}, dir=%i(?)) = ?", calls, name, dev, info, dir);
30
31 memset(calls, 0, sizeof(struct roar_vio_calls));
32 calls->read  = roar_vio_null_rw;
33 calls->write = roar_vio_null_rw;
34
35 ROAR_DBG("roar_cdriver_null(calls=%p, name='%s', dev='%s', info=%p{...}, dir=%i(?)) = 0", calls, name, dev, info, dir);
36 return 0;
37}
38
39struct roar_cdriver _g_roar_cdriver[] = {
40 {"null", roar_cdriver_null},
41#if defined(ROAR_HAVE_OSS_BSD) || defined(ROAR_HAVE_OSS)
42 {"oss",  roar_cdriver_oss},
43#endif
44 {NULL, NULL}
45};
46
47int roar_cdriver_open(struct roar_vio_calls * calls, char * name, char * dev, struct roar_audio_info * info, int dir) {
48 int i;
49
50 for (i = 0; _g_roar_cdriver[i].name != NULL; i++) {
51  if ( !strcmp(_g_roar_cdriver[i].name, name) )
52   return _g_roar_cdriver[i].open(calls, name, dev, info, dir);
53 }
54
55 return -1;
56}
57
58//ll
Note: See TracBrowser for help on using the repository browser.