source: roaraudio/roard/include/driver.h @ 6052:d48765b2475e

Last change on this file since 6052:d48765b2475e was 6052:d48765b2475e, checked in by phi, 9 years ago

updated copyright headers

File size: 4.6 KB
Line 
1//driver.h:
2
3/*
4 *      Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008-2015
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#if !defined(ROAR_WITHOUT_VIO_DSTR) && !defined(ROAR_WITHOUT_DCOMP_DMX) && defined(ROAR_HAVE_H_LINUX_I2C) && defined(ROAR_HAVE_H_LINUX_I2C_DEV) && defined(ROAR_HAVE_CONST_I2C_SMBUS_I2C_BLOCK_BROKEN)
118#define ROAR_HAVE_DRIVER_I2CDMX
119int driver_i2cdmx_open_vio  (struct roar_vio_calls * inst, char * device, struct roar_audio_info * info, int fh, struct roar_stream_server * sstream);
120#endif
121
122#define DRV_FLAG_NONE           0x00
123#define DRV_FLAG_FHSEC          0x01
124
125#define ROAR_DRIVER_CTL_NOOP            ROAR_STREAM_CTL_COMP_DRV|0x0000 /* noop... */
126#define ROAR_DRIVER_CTL_BASE            ROAR_STREAM_CTL_COMP_DRV|0x0000 /* Base ops... */
127
128#define ROAR_DRIVER_CTL_SET             0x0002
129#define ROAR_DRIVER_CTL_GET             0x0003
130
131#define ROAR_DRIVER_CTL_RECORD          0x0010
132#define ROAR_DRIVER_CTL_SET_RECORD      ROAR_DRIVER_CTL_BASE|ROAR_DRIVER_CTL_RECORD|ROAR_DRIVER_CTL_SET
133
134
135#define ROAR_DRIVER_CTL2CMD(x)          ((x) & (~ROAR_STREAM_CTL_COMP_DRV))
136
137
138
139struct roar_driver {
140 char * name;
141 char * desc;
142 char * devices;
143 unsigned int mode;
144 unsigned int flags;
145 unsigned int subsystems;
146 int (*open )(DRIVER_USERDATA_T * inst, char * device, struct roar_audio_info * info);
147 int (*close)(DRIVER_USERDATA_T   inst);
148 int (*vio_init)(struct roar_vio_calls * calls, char * device, struct roar_audio_info * info, int fh, struct roar_stream_server * sstream);
149};
150
151void print_driverlist (enum output_format format);
152
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_closevio(struct roar_vio_calls * calls, int driver);
159int driver_set_volume(int stream, struct roar_mixer_settings * mixer);
160
161// opening a cdriver
162#ifndef ROAR_WITHOUT_DCOMP_CDRIVER
163int driver_cdriver_open(struct roar_vio_calls * inst, char * device, struct roar_audio_info * info, int fh, struct roar_stream_server * sstream);
164#endif
165
166int  driver_dummy_ctl(struct roar_vio_calls * vio, roar_vio_ctl_t cmd, void * data);
167
168#endif
169
170//ll
Note: See TracBrowser for help on using the repository browser.