[0] | 1 | //driver.h: |
---|
| 2 | |
---|
[668] | 3 | /* |
---|
[4708] | 4 | * Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008-2011 |
---|
[668] | 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 |
---|
[3517] | 21 | * the Free Software Foundation, 51 Franklin Street, Fifth Floor, |
---|
| 22 | * Boston, MA 02110-1301, USA. |
---|
[668] | 23 | * |
---|
| 24 | */ |
---|
| 25 | |
---|
[0] | 26 | #ifndef _DRIVER_H_ |
---|
| 27 | #define _DRIVER_H_ |
---|
| 28 | |
---|
| 29 | #include <roaraudio.h> |
---|
| 30 | |
---|
| 31 | #define DRIVER_USERDATA_T void * |
---|
| 32 | |
---|
[4141] | 33 | #if 0 |
---|
[1175] | 34 | #ifndef ROAR_DRIVER_DEFAULT |
---|
[2343] | 35 | |
---|
| 36 | #if defined(ROAR_HAVE_OSS_BSD) || defined(ROAR_HAVE_OSS) |
---|
| 37 | #define ROAR_DRIVER_DEFAULT "oss" |
---|
[0] | 38 | #else |
---|
[929] | 39 | |
---|
[2783] | 40 | #ifdef ROAR_HAVE_LIBWINMM |
---|
| 41 | #define ROAR_DRIVER_DEFAULT "wmm" |
---|
| 42 | #else |
---|
| 43 | |
---|
[929] | 44 | #ifdef ROAR_HAVE_LIBAO |
---|
| 45 | #define ROAR_DRIVER_DEFAULT "ao" |
---|
| 46 | #else |
---|
| 47 | |
---|
[2343] | 48 | #ifdef ROAR_HAVE_ESD |
---|
| 49 | #define ROAR_DRIVER_DEFAULT "esd" |
---|
[929] | 50 | #else |
---|
| 51 | |
---|
[0] | 52 | #define ROAR_DRIVER_DEFAULT "null" |
---|
| 53 | #endif |
---|
[929] | 54 | #endif |
---|
| 55 | #endif |
---|
[2783] | 56 | #endif |
---|
[2343] | 57 | |
---|
[1175] | 58 | #endif |
---|
[4141] | 59 | #endif |
---|
[0] | 60 | |
---|
| 61 | #ifdef ROAR_HAVE_ESD |
---|
| 62 | #include <esd.h> |
---|
| 63 | #include "driver_esd.h" |
---|
| 64 | #endif |
---|
| 65 | |
---|
| 66 | #include "driver_roar.h" |
---|
[10] | 67 | #include "driver_raw.h" |
---|
[3262] | 68 | #include "driver_dstr.h" |
---|
[1824] | 69 | #include "driver_dmx.h" |
---|
[1974] | 70 | #include "driver_pwmled.h" |
---|
[2209] | 71 | |
---|
[2803] | 72 | #if defined(ROAR_HAVE_GETTIMEOFDAY) && defined(ROAR_HAVE_USLEEP) |
---|
[2209] | 73 | #define ROAR_HAVE_DRIVER_SYSCLOCK |
---|
[2207] | 74 | #include "driver_sysclock.h" |
---|
[2209] | 75 | #endif |
---|
[0] | 76 | |
---|
| 77 | #ifdef ROAR_HAVE_LIBAO |
---|
| 78 | #include <ao/ao.h> |
---|
| 79 | #include "driver_ao.h" |
---|
| 80 | #endif |
---|
| 81 | |
---|
[950] | 82 | #ifdef ROAR_HAVE_LIBSHOUT |
---|
| 83 | #include <shout/shout.h> |
---|
| 84 | #include "driver_shout.h" |
---|
| 85 | #endif |
---|
| 86 | |
---|
[1543] | 87 | #ifdef ROAR_HAVE_LIBSNDIO |
---|
| 88 | #include <sndio.h> |
---|
| 89 | #include "driver_sndio.h" |
---|
| 90 | #endif |
---|
| 91 | |
---|
[915] | 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 |
---|
[10] | 102 | |
---|
[3725] | 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 | |
---|
[3751] | 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 | |
---|
[3692] | 118 | #ifdef ROAR_HAVE_LIBASOUND |
---|
| 119 | #include <alsa/asoundlib.h> |
---|
| 120 | #include "driver_alsa.h" |
---|
| 121 | #endif |
---|
| 122 | |
---|
[2800] | 123 | #ifdef ROAR_HAVE_LIBWINMM |
---|
[2801] | 124 | #include <windows.h> |
---|
[2773] | 125 | #include <mmsystem.h> |
---|
| 126 | #include "driver_wmm.h" |
---|
| 127 | #endif |
---|
| 128 | |
---|
[3839] | 129 | #ifdef ROAR_HAVE_LIBPULSE |
---|
| 130 | #include <pulse/simple.h> |
---|
[4764] | 131 | #include <pulse/error.h> |
---|
[3839] | 132 | #include "driver_pulsesimple.h" |
---|
| 133 | #endif |
---|
| 134 | |
---|
[4490] | 135 | #ifdef ROAR_HAVE_LIBJACK |
---|
| 136 | #include <jack/jack.h> |
---|
| 137 | #include <jack/transport.h> |
---|
| 138 | #include "driver_jack.h" |
---|
| 139 | #endif |
---|
| 140 | |
---|
[4809] | 141 | #ifdef ROAR_HAVE_LIBARTSC |
---|
| 142 | #include <kde/artsc/artsc.h> |
---|
| 143 | #include "driver_artsc.h" |
---|
| 144 | #endif |
---|
| 145 | |
---|
[1915] | 146 | #define DRV_FLAG_NONE 0x00 |
---|
| 147 | #define DRV_FLAG_FHSEC 0x01 |
---|
| 148 | |
---|
[0] | 149 | struct roar_driver { |
---|
| 150 | char * name; |
---|
| 151 | char * desc; |
---|
| 152 | char * devices; |
---|
[1915] | 153 | unsigned int flags; |
---|
[1918] | 154 | unsigned int subsystems; |
---|
[0] | 155 | int (*open )(DRIVER_USERDATA_T * inst, char * device, struct roar_audio_info * info); |
---|
| 156 | int (*close)(DRIVER_USERDATA_T inst); |
---|
[2367] | 157 | int (*vio_init)(struct roar_vio_calls * calls, char * device, struct roar_audio_info * info, int fh, struct roar_stream_server * sstream); |
---|
[0] | 158 | }; |
---|
| 159 | |
---|
| 160 | void print_driverlist (void); |
---|
| 161 | |
---|
[931] | 162 | int driver_openvio(struct roar_vio_calls * calls, |
---|
| 163 | int * driver_id, char * driver /* NOTE: this is not part of struct roar_driver's def! */, |
---|
[2364] | 164 | char * device, struct roar_audio_info * info, int fh, |
---|
| 165 | struct roar_stream_server * sstream); |
---|
[931] | 166 | |
---|
[937] | 167 | int driver_closevio(struct roar_vio_calls * calls, int driver); |
---|
[1590] | 168 | int driver_set_volume(int stream, struct roar_mixer_settings * mixer); |
---|
[0] | 169 | |
---|
[2345] | 170 | // opening a cdriver |
---|
[2507] | 171 | #ifndef ROAR_WITHOUT_DCOMP_CDRIVER |
---|
[2367] | 172 | int driver_cdriver_open(struct roar_vio_calls * inst, char * device, struct roar_audio_info * info, int fh, struct roar_stream_server * sstream); |
---|
[2507] | 173 | #endif |
---|
[2345] | 174 | |
---|
[0] | 175 | #endif |
---|
| 176 | |
---|
| 177 | //ll |
---|