source: roaraudio/roard/include/driver.h @ 4141:b36fa38ea35e

Last change on this file since 4141:b36fa38ea35e was 4141:b36fa38ea35e, checked in by phi, 14 years ago

enable new default behavor

File size: 4.3 KB
Line 
1//driver.h:
2
3/*
4 *      Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008-2010
5 *
6 *  This file is part of roard 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, 51 Franklin Street, Fifth Floor,
22 *  Boston, MA 02110-1301, USA.
23 *
24 */
25
26#ifndef _DRIVER_H_
27#define _DRIVER_H_
28
29#include <roaraudio.h>
30
31#define DRIVER_USERDATA_T void *
32
33#if 0
34#ifndef ROAR_DRIVER_DEFAULT
35
36#if defined(ROAR_HAVE_OSS_BSD) || defined(ROAR_HAVE_OSS)
37#define ROAR_DRIVER_DEFAULT "oss"
38#else
39
40#ifdef ROAR_HAVE_LIBWINMM
41#define ROAR_DRIVER_DEFAULT "wmm"
42#else
43
44#ifdef ROAR_HAVE_LIBAO
45#define ROAR_DRIVER_DEFAULT "ao"
46#else
47
48#ifdef ROAR_HAVE_ESD
49#define ROAR_DRIVER_DEFAULT "esd"
50#else
51
52#define ROAR_DRIVER_DEFAULT "null"
53#endif
54#endif
55#endif
56#endif
57
58#endif
59#endif
60
61#ifdef ROAR_HAVE_ESD
62#include <esd.h>
63#include "driver_esd.h"
64#endif
65
66#include "driver_roar.h"
67#include "driver_raw.h"
68#include "driver_dstr.h"
69#include "driver_dmx.h"
70#include "driver_pwmled.h"
71
72#if defined(ROAR_HAVE_GETTIMEOFDAY) && defined(ROAR_HAVE_USLEEP)
73#define ROAR_HAVE_DRIVER_SYSCLOCK
74#include "driver_sysclock.h"
75#endif
76
77#ifdef ROAR_HAVE_LIBAO
78#include <ao/ao.h>
79#include "driver_ao.h"
80#endif
81
82#ifdef ROAR_HAVE_LIBSHOUT
83#include <shout/shout.h>
84#include "driver_shout.h"
85#endif
86
87#ifdef ROAR_HAVE_LIBSNDIO
88#include <sndio.h>
89#include "driver_sndio.h"
90#endif
91
92#if defined(ROAR_HAVE_OSS_BSD) || defined(ROAR_HAVE_OSS)
93#if defined(__OpenBSD__) || defined(__NetBSD__)
94#include <soundcard.h>
95#else
96#include <sys/soundcard.h>
97#endif
98#include <sys/ioctl.h>
99
100#include "driver_oss.h"
101#endif
102
103#ifdef ROAR_HAVE_LIBRSOUND
104#ifdef _DRV_NEED_RSOUND_H
105#include <rsound.h>
106#endif
107#include "driver_rsound.h"
108#endif
109
110#ifdef ROAR_HAVE_LIBPORTAUDIO
111#include <portaudio.h>
112#ifdef ROAR_HAVE_LIBPABLIO
113#include <pablio/pablio.h>
114#endif
115#include "driver_portaudio.h"
116#endif
117
118#ifdef ROAR_HAVE_LIBASOUND
119#include <alsa/asoundlib.h>
120#include "driver_alsa.h"
121#endif
122
123#ifdef ROAR_HAVE_LIBWINMM
124#include <windows.h>
125#include <mmsystem.h>
126#include "driver_wmm.h"
127#endif
128
129#ifdef ROAR_HAVE_LIBPULSE
130#include <pulse/simple.h>
131#include "driver_pulsesimple.h"
132#endif
133
134#define DRV_FLAG_NONE           0x00
135#define DRV_FLAG_FHSEC          0x01
136
137struct roar_driver {
138 char * name;
139 char * desc;
140 char * devices;
141 unsigned int flags;
142 unsigned int subsystems;
143 int (*open )(DRIVER_USERDATA_T * inst, char * device, struct roar_audio_info * info);
144 int (*close)(DRIVER_USERDATA_T   inst);
145 int (*vio_init)(struct roar_vio_calls * calls, char * device, struct roar_audio_info * info, int fh, struct roar_stream_server * sstream);
146};
147
148void print_driverlist (void);
149
150int driver_open (DRIVER_USERDATA_T * inst,
151                 int * driver_id, char * driver /* NOTE: this is not part of struct roar_driver's def! */,
152                 char * device, struct roar_audio_info * info);
153int driver_openvio(struct roar_vio_calls * calls,
154                 int * driver_id, char * driver /* NOTE: this is not part of struct roar_driver's def! */,
155                 char * device, struct roar_audio_info * info, int fh,
156                 struct roar_stream_server * sstream);
157
158int driver_close(DRIVER_USERDATA_T   inst, int driver);
159int driver_closevio(struct roar_vio_calls * calls, int driver);
160int driver_pause(DRIVER_USERDATA_T   inst, int driver, int newstate);
161int driver_write(DRIVER_USERDATA_T   inst, int driver, char * buf, int len);
162int driver_read (DRIVER_USERDATA_T   inst, int driver, char * buf, int len);
163int driver_flush(DRIVER_USERDATA_T   inst, int driver);
164int driver_set_volume(int stream, struct roar_mixer_settings * mixer);
165
166// opening a cdriver
167#ifndef ROAR_WITHOUT_DCOMP_CDRIVER
168int driver_cdriver_open(struct roar_vio_calls * inst, char * device, struct roar_audio_info * info, int fh, struct roar_stream_server * sstream);
169#endif
170
171#endif
172
173//ll
Note: See TracBrowser for help on using the repository browser.