oops, paul should remember to try an OSX build before releasing a tarball; fixed...
[jack.git] / drivers / oss / oss_driver.h
blobbcb2bd3d635e36c3eed98882485bd348783aa29c
1 /*
3 OSS driver for Jack
4 Copyright (C) 2003-2007 Jussi Laako <jussi@sonarnerd.net>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston,
19 MA 02111-1307 USA
24 #ifndef __JACK_OSS_DRIVER_H__
25 #define __JACK_OSS_DRIVER_H__
27 #include <sys/types.h>
28 #include <pthread.h>
29 #include <semaphore.h>
31 #include <jack/types.h>
32 #include <jack/jslist.h>
33 #include <jack/driver.h>
34 #include <jack/jack.h>
37 #define OSS_DRIVER_DEF_DEV "/dev/dsp"
38 #define OSS_DRIVER_DEF_FS 48000
39 #define OSS_DRIVER_DEF_BLKSIZE 1024
40 #define OSS_DRIVER_DEF_NPERIODS 2
41 #define OSS_DRIVER_DEF_BITS 16
42 #define OSS_DRIVER_DEF_INS 2
43 #define OSS_DRIVER_DEF_OUTS 2
46 typedef jack_default_audio_sample_t jack_sample_t;
48 typedef struct _oss_driver
50 JACK_DRIVER_DECL
52 jack_nframes_t sample_rate;
53 jack_nframes_t period_size;
54 unsigned int nperiods;
55 int bits;
56 unsigned int capture_channels;
57 unsigned int playback_channels;
59 char *indev;
60 char *outdev;
61 int infd;
62 int outfd;
63 int format;
64 int ignorehwbuf;
65 int trigger;
67 size_t indevbufsize;
68 size_t outdevbufsize;
69 size_t portbufsize;
70 void *indevbuf;
71 void *outdevbuf;
73 float iodelay;
74 jack_time_t last_periodtime;
75 jack_time_t next_periodtime;
76 jack_nframes_t sys_in_latency;
77 jack_nframes_t sys_out_latency;
79 JSList *capture_ports;
80 JSList *playback_ports;
82 jack_engine_t *engine;
83 jack_client_t *client;
85 volatile int run;
86 volatile int threads;
87 pthread_t thread_in;
88 pthread_t thread_out;
89 pthread_mutex_t mutex_in;
90 pthread_mutex_t mutex_out;
91 # ifdef USE_BARRIER
92 pthread_barrier_t barrier;
93 # endif
94 sem_t sem_start;
95 } oss_driver_t;
98 #endif