4 #include "audiodevice.h"
5 #include "condition.inc"
6 #include "playbackconfig.inc"
9 #include <sys/soundcard.h>
11 class OSSThread
: public Thread
14 OSSThread(AudioOSS
*device
);
18 void write_data(int fd
, unsigned char *data
, int bytes
);
19 void read_data(int fd
, unsigned char *data
, int bytes
);
20 // Must synchronize reads and writes
24 Condition
*input_lock
;
25 Condition
*output_lock
;
27 Condition
*write_lock
;
35 class AudioOSS
: public AudioLowLevel
38 AudioOSS(AudioDevice
*device
);
44 int write_buffer(char *buffer
, int bytes
);
45 int read_buffer(char *buffer
, int bytes
);
47 int64_t device_position();
49 int interrupt_playback();
52 int get_fmt(int bits
);
53 int sizetofrag(int samples
, int channels
, int bits
);
54 int set_cloexec_flag(int desc
, int value
);
55 int get_output(int number
);
56 int get_input(int number
);
57 int dsp_in
[MAXDEVICES
], dsp_out
[MAXDEVICES
], dsp_duplex
[MAXDEVICES
];
58 OSSThread
*thread
[MAXDEVICES
];
59 // Temp for each device
60 unsigned char *data
[MAXDEVICES
];
62 int data_allocated
[MAXDEVICES
];