Partially sync files.el from XEmacs 21.5 for wildcard support.
[sxemacs] / src / media / sound-oss.h
1 /* sound-linuxplay.h - play a sound natively
2
3    Copyright (C) 2006 Sebastian Freundt
4
5 This file is part of SXEmacs
6
7 SXEmacs is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 SXEmacs is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
19
20
21 /* Synched up with: Not in FSF. */
22
23 #ifndef INCLUDED_sound_oss_h_
24 #define INCLUDED_sound_oss_h_
25
26 #include "sound.h"
27 #if defined HAVE_MACHINE_SOUNDCARD_H && HAVE_MACHINE_SOUNDCARD_H
28 #include <machine/soundcard.h>
29 #elif defined HAVE_SYS_SOUNDCARD_H && HAVE_SYS_SOUNDCARD_H
30 #include <sys/soundcard.h>
31 #elif defined HAVE_LINUX_SOUNDCARD_H && HAVE_LINUX_SOUNDCARD_H
32 #include <linux/soundcard.h>
33 #else
34 #include <soundcard.h>
35 #endif
36
37 typedef struct sound_oss_data_s sound_oss_data_t;
38 typedef struct sound_oss_aj_data_s sound_oss_aj_data_t;
39
40 extern Lisp_Object Qoss;                /* initialised in sound.c */
41
42 struct sound_oss_data_s {
43         Lisp_Object device;
44         int desc;
45         int lock;
46         int keep_open;
47         int device_fd;
48         sxe_mutex_t mtx;
49 };
50
51 struct sound_oss_aj_data_s {
52         int paused;
53         int volume;
54         /* stream props */
55         size_t samplerate;      /* rate used on the device */
56         unsigned int channels;  /* channels used on the device */
57         unsigned int framesize;
58         /* coercion stuff */
59         media_sample_format_t *msf;
60         int coe_ch_cnt;
61         audio_coerce_chain_t coe_chain[4];
62         mtype_audio_properties *mtap;
63 };
64
65 #define DEVICE_CONNECTED_TO_OSS_P(x) 1  /* FIXME: better check */
66
67 DECLARE_AUDIO_DEVICE(sound_oss);
68
69 #ifdef ALL_DEBUG_FLAGS
70 #undef OSS_DEBUG_FLAG
71 #define OSS_DEBUG_FLAG
72 #endif
73
74 #endif  /* INCLUDED_sound_oss_h_ */