source: roaraudio/roard/include/driver.h @ 5244:e97aa5907fa2

Last change on this file since 5244:e97aa5907fa2 was 5244:e97aa5907fa2, checked in by phi, 12 years ago

fully removed driver "raw"

File size: 4.6 KB
Line 
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_dstr.h"
68#include "driver_dmx.h"
69#include "driver_pwmled.h"
70
71#if defined(ROAR_HAVE_GETTIMEOFDAY) && defined(ROAR_HAVE_USLEEP)
72#define ROAR_HAVE_DRIVER_SYSCLOCK
73#include "driver_sysclock.h"
74#endif
75
76#ifdef ROAR_HAVE_LIBAO
77#include <ao/ao.h>
78#include "driver_ao.h"
79#endif
80
81#ifdef ROAR_HAVE_LIBSHOUT
82#include <shout/shout.h>
83#include "driver_shout.h"
84#endif
85
86#ifdef ROAR_HAVE_LIBSNDIO
87#include <sndio.h>
88#include "driver_sndio.h"
89#endif
90
91#if defined(ROAR_HAVE_OSS_BSD) || defined(ROAR_HAVE_OSS)
92#if defined(__OpenBSD__) || defined(__NetBSD__)
93#include <soundcard.h>
94#else
95#include <sys/soundcard.h>
96#endif
97#include <sys/ioctl.h>
98
99#include "driver_oss.h"
100#endif
101
102#ifdef ROAR_HAVE_LIBRSOUND
103#ifdef _DRV_NEED_RSOUND_H
104#include <rsound.h>
105#endif
106#include "driver_rsound.h"
107#endif
108
109#ifdef ROAR_HAVE_LIBPORTAUDIO
110#include <portaudio.h>
111#ifdef ROAR_HAVE_LIBPABLIO
112#include <pablio/pablio.h>
113#endif
114#include "driver_portaudio.h"
115#endif
116
117#ifdef ROAR_HAVE_LIBASOUND
118#include <alsa/asoundlib.h>
119#include "driver_alsa.h"
120#endif
121
122#ifdef ROAR_HAVE_LIBWINMM
123#include <windows.h>
124#include <mmsystem.h>
125#include "driver_wmm.h"
126#endif
127
128#ifdef ROAR_HAVE_LIBPULSE
129#include <pulse/simple.h>
130#include <pulse/error.h>
131#include "driver_pulsesimple.h"
132#endif
133
134#ifdef ROAR_HAVE_LIBJACK
135#include <jack/jack.h>
136#include <jack/transport.h>
137#include "driver_jack.h"
138#endif
139
140#ifdef ROAR_HAVE_LIBARTSC
141#include <kde/artsc/artsc.h>
142#include "driver_artsc.h"
143#endif
144
145#define DRV_FLAG_NONE           0x00
146#define DRV_FLAG_FHSEC          0x01
147
148#define ROAR_DRIVER_CTL_NOOP            ROAR_STREAM_CTL_COMP_DRV|0x0000 /* noop... */
149#define ROAR_DRIVER_CTL_BASE            ROAR_STREAM_CTL_COMP_DRV|0x0000 /* Base ops... */
150
151#define ROAR_DRIVER_CTL_SET             0x0002
152#define ROAR_DRIVER_CTL_GET             0x0003
153
154#define ROAR_DRIVER_CTL_RECORD          0x0010
155#define ROAR_DRIVER_CTL_SET_RECORD      ROAR_DRIVER_CTL_BASE|ROAR_DRIVER_CTL_RECORD|ROAR_DRIVER_CTL_SET
156
157
158#define ROAR_DRIVER_CTL2CMD(x)          ((x) & (~ROAR_STREAM_CTL_COMP_DRV))
159
160
161
162struct roar_driver {
163 char * name;
164 char * desc;
165 char * devices;
166 unsigned int mode;
167 unsigned int flags;
168 unsigned int subsystems;
169 int (*open )(DRIVER_USERDATA_T * inst, char * device, struct roar_audio_info * info);
170 int (*close)(DRIVER_USERDATA_T   inst);
171 int (*vio_init)(struct roar_vio_calls * calls, char * device, struct roar_audio_info * info, int fh, struct roar_stream_server * sstream);
172};
173
174void print_driverlist (enum output_format format);
175
176int driver_openvio(struct roar_vio_calls * calls,
177                 int * driver_id, char * driver /* NOTE: this is not part of struct roar_driver's def! */,
178                 char * device, struct roar_audio_info * info, int fh,
179                 struct roar_stream_server * sstream);
180
181int driver_closevio(struct roar_vio_calls * calls, int driver);
182int driver_set_volume(int stream, struct roar_mixer_settings * mixer);
183
184// opening a cdriver
185#ifndef ROAR_WITHOUT_DCOMP_CDRIVER
186int driver_cdriver_open(struct roar_vio_calls * inst, char * device, struct roar_audio_info * info, int fh, struct roar_stream_server * sstream);
187#endif
188
189int  driver_dummy_nonblock(struct roar_vio_calls * vio, int state);
190
191#endif
192
193//ll
Note: See TracBrowser for help on using the repository browser.