source: roaraudio/roard/include/driver.h @ 5381:430b1d26e12d

Last change on this file since 5381:430b1d26e12d was 5381:430b1d26e12d, checked in by phi, 12 years ago

updated copyright years

File size: 4.2 KB
Line 
1//driver.h:
2
3/*
4 *      Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008-2012
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#ifdef ROAR_HAVE_ESD
34#include <esd.h>
35#include "driver_esd.h"
36#endif
37
38#include "driver_roar.h"
39#include "driver_dstr.h"
40#include "driver_dmx.h"
41#include "driver_pwmled.h"
42
43#if defined(ROAR_HAVE_GETTIMEOFDAY) && defined(ROAR_HAVE_USLEEP)
44#define ROAR_HAVE_DRIVER_SYSCLOCK
45#include "driver_sysclock.h"
46#endif
47
48#ifdef ROAR_HAVE_LIBAO
49#include <ao/ao.h>
50#include "driver_ao.h"
51#endif
52
53#ifdef ROAR_HAVE_LIBSHOUT
54#include <shout/shout.h>
55#include "driver_shout.h"
56#endif
57
58#ifdef ROAR_HAVE_LIBSNDIO
59#include <sndio.h>
60#include "driver_sndio.h"
61#endif
62
63#if defined(ROAR_HAVE_OSS_BSD) || defined(ROAR_HAVE_OSS)
64#if defined(__OpenBSD__) || defined(__NetBSD__)
65#include <soundcard.h>
66#else
67#include <sys/soundcard.h>
68#endif
69#include <sys/ioctl.h>
70
71#include "driver_oss.h"
72#endif
73
74#ifdef ROAR_HAVE_LIBRSOUND
75#ifdef _DRV_NEED_RSOUND_H
76#include <rsound.h>
77#endif
78#include "driver_rsound.h"
79#endif
80
81#ifdef ROAR_HAVE_LIBPORTAUDIO
82#include <portaudio.h>
83#ifdef ROAR_HAVE_LIBPABLIO
84#include <pablio/pablio.h>
85#endif
86#include "driver_portaudio.h"
87#endif
88
89#ifdef ROAR_HAVE_LIBASOUND
90#include <alsa/asoundlib.h>
91#include "driver_alsa.h"
92#endif
93
94#ifdef ROAR_HAVE_LIBWINMM
95#include <windows.h>
96#include <mmsystem.h>
97#include "driver_wmm.h"
98#endif
99
100#ifdef ROAR_HAVE_LIBPULSE
101#include <pulse/simple.h>
102#include <pulse/error.h>
103#include "driver_pulsesimple.h"
104#endif
105
106#ifdef ROAR_HAVE_LIBJACK
107#include <jack/jack.h>
108#include <jack/transport.h>
109#include "driver_jack.h"
110#endif
111
112#ifdef ROAR_HAVE_LIBARTSC
113#include <kde/artsc/artsc.h>
114#include "driver_artsc.h"
115#endif
116
117#define DRV_FLAG_NONE           0x00
118#define DRV_FLAG_FHSEC          0x01
119
120#define ROAR_DRIVER_CTL_NOOP            ROAR_STREAM_CTL_COMP_DRV|0x0000 /* noop... */
121#define ROAR_DRIVER_CTL_BASE            ROAR_STREAM_CTL_COMP_DRV|0x0000 /* Base ops... */
122
123#define ROAR_DRIVER_CTL_SET             0x0002
124#define ROAR_DRIVER_CTL_GET             0x0003
125
126#define ROAR_DRIVER_CTL_RECORD          0x0010
127#define ROAR_DRIVER_CTL_SET_RECORD      ROAR_DRIVER_CTL_BASE|ROAR_DRIVER_CTL_RECORD|ROAR_DRIVER_CTL_SET
128
129
130#define ROAR_DRIVER_CTL2CMD(x)          ((x) & (~ROAR_STREAM_CTL_COMP_DRV))
131
132
133
134struct roar_driver {
135 char * name;
136 char * desc;
137 char * devices;
138 unsigned int mode;
139 unsigned int flags;
140 unsigned int subsystems;
141 int (*open )(DRIVER_USERDATA_T * inst, char * device, struct roar_audio_info * info);
142 int (*close)(DRIVER_USERDATA_T   inst);
143 int (*vio_init)(struct roar_vio_calls * calls, char * device, struct roar_audio_info * info, int fh, struct roar_stream_server * sstream);
144};
145
146void print_driverlist (enum output_format format);
147
148int driver_openvio(struct roar_vio_calls * calls,
149                 int * driver_id, char * driver /* NOTE: this is not part of struct roar_driver's def! */,
150                 char * device, struct roar_audio_info * info, int fh,
151                 struct roar_stream_server * sstream);
152
153int driver_closevio(struct roar_vio_calls * calls, int driver);
154int driver_set_volume(int stream, struct roar_mixer_settings * mixer);
155
156// opening a cdriver
157#ifndef ROAR_WITHOUT_DCOMP_CDRIVER
158int driver_cdriver_open(struct roar_vio_calls * inst, char * device, struct roar_audio_info * info, int fh, struct roar_stream_server * sstream);
159#endif
160
161int  driver_dummy_ctl(struct roar_vio_calls * vio, roar_vio_ctl_t cmd, void * data);
162
163#endif
164
165//ll
Note: See TracBrowser for help on using the repository browser.