1 | //driver.h: |
---|
2 | |
---|
3 | /* |
---|
4 | * Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008-2011 |
---|
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 <pulse/error.h> |
---|
132 | #include "driver_pulsesimple.h" |
---|
133 | #endif |
---|
134 | |
---|
135 | #ifdef ROAR_HAVE_LIBJACK |
---|
136 | #include <jack/jack.h> |
---|
137 | #include <jack/transport.h> |
---|
138 | #include "driver_jack.h" |
---|
139 | #endif |
---|
140 | |
---|
141 | #ifdef ROAR_HAVE_LIBARTSC |
---|
142 | #include <kde/artsc/artsc.h> |
---|
143 | #include "driver_artsc.h" |
---|
144 | #endif |
---|
145 | |
---|
146 | #define DRV_FLAG_NONE 0x00 |
---|
147 | #define DRV_FLAG_FHSEC 0x01 |
---|
148 | |
---|
149 | #define ROAR_DRIVER_CTL_NOOP ROAR_STREAM_CTL_COMP_DRV|0x0000 /* noop... */ |
---|
150 | #define ROAR_DRIVER_CTL_BASE ROAR_STREAM_CTL_COMP_DRV|0x0000 /* Base ops... */ |
---|
151 | |
---|
152 | #define ROAR_DRIVER_CTL_SET 0x0002 |
---|
153 | #define ROAR_DRIVER_CTL_GET 0x0003 |
---|
154 | |
---|
155 | #define ROAR_DRIVER_CTL_RECORD 0x0010 |
---|
156 | #define ROAR_DRIVER_CTL_SET_RECORD ROAR_DRIVER_CTL_BASE|ROAR_DRIVER_CTL_RECORD|ROAR_DRIVER_CTL_SET |
---|
157 | |
---|
158 | |
---|
159 | #define ROAR_DRIVER_CTL2CMD(x) ((x) & (~ROAR_STREAM_CTL_COMP_DRV)) |
---|
160 | |
---|
161 | |
---|
162 | |
---|
163 | struct roar_driver { |
---|
164 | char * name; |
---|
165 | char * desc; |
---|
166 | char * devices; |
---|
167 | unsigned int mode; |
---|
168 | unsigned int flags; |
---|
169 | unsigned int subsystems; |
---|
170 | int (*open )(DRIVER_USERDATA_T * inst, char * device, struct roar_audio_info * info); |
---|
171 | int (*close)(DRIVER_USERDATA_T inst); |
---|
172 | int (*vio_init)(struct roar_vio_calls * calls, char * device, struct roar_audio_info * info, int fh, struct roar_stream_server * sstream); |
---|
173 | }; |
---|
174 | |
---|
175 | void print_driverlist (void); |
---|
176 | |
---|
177 | int driver_openvio(struct roar_vio_calls * calls, |
---|
178 | int * driver_id, char * driver /* NOTE: this is not part of struct roar_driver's def! */, |
---|
179 | char * device, struct roar_audio_info * info, int fh, |
---|
180 | struct roar_stream_server * sstream); |
---|
181 | |
---|
182 | int driver_closevio(struct roar_vio_calls * calls, int driver); |
---|
183 | int driver_set_volume(int stream, struct roar_mixer_settings * mixer); |
---|
184 | |
---|
185 | // opening a cdriver |
---|
186 | #ifndef ROAR_WITHOUT_DCOMP_CDRIVER |
---|
187 | int driver_cdriver_open(struct roar_vio_calls * inst, char * device, struct roar_audio_info * info, int fh, struct roar_stream_server * sstream); |
---|
188 | #endif |
---|
189 | |
---|
190 | #endif |
---|
191 | |
---|
192 | //ll |
---|