[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 | |
---|
| 33 | #ifdef ROAR_HAVE_ESD |
---|
| 34 | #include <esd.h> |
---|
| 35 | #include "driver_esd.h" |
---|
| 36 | #endif |
---|
| 37 | |
---|
| 38 | #include "driver_roar.h" |
---|
[3262] | 39 | #include "driver_dstr.h" |
---|
[1824] | 40 | #include "driver_dmx.h" |
---|
[1974] | 41 | #include "driver_pwmled.h" |
---|
[2209] | 42 | |
---|
[2803] | 43 | #if defined(ROAR_HAVE_GETTIMEOFDAY) && defined(ROAR_HAVE_USLEEP) |
---|
[2209] | 44 | #define ROAR_HAVE_DRIVER_SYSCLOCK |
---|
[2207] | 45 | #include "driver_sysclock.h" |
---|
[2209] | 46 | #endif |
---|
[0] | 47 | |
---|
| 48 | #ifdef ROAR_HAVE_LIBAO |
---|
| 49 | #include <ao/ao.h> |
---|
| 50 | #include "driver_ao.h" |
---|
| 51 | #endif |
---|
| 52 | |
---|
[950] | 53 | #ifdef ROAR_HAVE_LIBSHOUT |
---|
| 54 | #include <shout/shout.h> |
---|
| 55 | #include "driver_shout.h" |
---|
| 56 | #endif |
---|
| 57 | |
---|
[1543] | 58 | #ifdef ROAR_HAVE_LIBSNDIO |
---|
| 59 | #include <sndio.h> |
---|
| 60 | #include "driver_sndio.h" |
---|
| 61 | #endif |
---|
| 62 | |
---|
[915] | 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 |
---|
[10] | 73 | |
---|
[3725] | 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 | |
---|
[3751] | 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 | |
---|
[3692] | 89 | #ifdef ROAR_HAVE_LIBASOUND |
---|
| 90 | #include <alsa/asoundlib.h> |
---|
| 91 | #include "driver_alsa.h" |
---|
| 92 | #endif |
---|
| 93 | |
---|
[2800] | 94 | #ifdef ROAR_HAVE_LIBWINMM |
---|
[2801] | 95 | #include <windows.h> |
---|
[2773] | 96 | #include <mmsystem.h> |
---|
| 97 | #include "driver_wmm.h" |
---|
| 98 | #endif |
---|
| 99 | |
---|
[3839] | 100 | #ifdef ROAR_HAVE_LIBPULSE |
---|
| 101 | #include <pulse/simple.h> |
---|
[4764] | 102 | #include <pulse/error.h> |
---|
[3839] | 103 | #include "driver_pulsesimple.h" |
---|
| 104 | #endif |
---|
| 105 | |
---|
[4490] | 106 | #ifdef ROAR_HAVE_LIBJACK |
---|
| 107 | #include <jack/jack.h> |
---|
| 108 | #include <jack/transport.h> |
---|
| 109 | #include "driver_jack.h" |
---|
| 110 | #endif |
---|
| 111 | |
---|
[4809] | 112 | #ifdef ROAR_HAVE_LIBARTSC |
---|
| 113 | #include <kde/artsc/artsc.h> |
---|
| 114 | #include "driver_artsc.h" |
---|
| 115 | #endif |
---|
| 116 | |
---|
[1915] | 117 | #define DRV_FLAG_NONE 0x00 |
---|
| 118 | #define DRV_FLAG_FHSEC 0x01 |
---|
| 119 | |
---|
[4815] | 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 | |
---|
[0] | 134 | struct roar_driver { |
---|
| 135 | char * name; |
---|
| 136 | char * desc; |
---|
| 137 | char * devices; |
---|
[4812] | 138 | unsigned int mode; |
---|
[1915] | 139 | unsigned int flags; |
---|
[1918] | 140 | unsigned int subsystems; |
---|
[0] | 141 | int (*open )(DRIVER_USERDATA_T * inst, char * device, struct roar_audio_info * info); |
---|
| 142 | int (*close)(DRIVER_USERDATA_T inst); |
---|
[2367] | 143 | int (*vio_init)(struct roar_vio_calls * calls, char * device, struct roar_audio_info * info, int fh, struct roar_stream_server * sstream); |
---|
[0] | 144 | }; |
---|
| 145 | |
---|
[4955] | 146 | void print_driverlist (enum output_format format); |
---|
[0] | 147 | |
---|
[931] | 148 | int driver_openvio(struct roar_vio_calls * calls, |
---|
| 149 | int * driver_id, char * driver /* NOTE: this is not part of struct roar_driver's def! */, |
---|
[2364] | 150 | char * device, struct roar_audio_info * info, int fh, |
---|
| 151 | struct roar_stream_server * sstream); |
---|
[931] | 152 | |
---|
[937] | 153 | int driver_closevio(struct roar_vio_calls * calls, int driver); |
---|
[1590] | 154 | int driver_set_volume(int stream, struct roar_mixer_settings * mixer); |
---|
[0] | 155 | |
---|
[2345] | 156 | // opening a cdriver |
---|
[2507] | 157 | #ifndef ROAR_WITHOUT_DCOMP_CDRIVER |
---|
[2367] | 158 | int driver_cdriver_open(struct roar_vio_calls * inst, char * device, struct roar_audio_info * info, int fh, struct roar_stream_server * sstream); |
---|
[2507] | 159 | #endif |
---|
[2345] | 160 | |
---|
[5012] | 161 | int driver_dummy_nonblock(struct roar_vio_calls * vio, int state); |
---|
| 162 | |
---|
[0] | 163 | #endif |
---|
| 164 | |
---|
| 165 | //ll |
---|