Partially sync files.el from XEmacs 21.5 for wildcard support.
[sxemacs] / src / media / sound-nas.h
1 /* sound-nas.c - play a sound over NAS
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 /* based largely on the ao_nas mplayer plugin by Tobias Diedrich */
24
25 #ifndef INCLUDED_sound_nas_h_
26 #define INCLUDED_sound_nas_h_
27
28 #include "sound.h"
29 #include <audio/audiolib.h>
30
31 #define NAS_FRAG_SIZE 4096
32
33 typedef struct sound_nas_data_s sound_nas_data_t;
34 typedef struct sound_nas_aj_data_s sound_nas_aj_data_t;
35
36 struct sound_nas_data_s {
37         AuServer *aud;
38         size_t proposed_buffer_size;
39 };
40
41 struct sound_nas_aj_data_s {
42         sound_nas_data_t *snd;
43         AuFlowID flow;
44         AuDeviceID dev;
45         AuFixedPoint gain;
46
47         size_t samplerate;      /* rate used on the device */
48         unsigned int channels;  /* channels used on the device */
49         unsigned int framesize;
50         int resolution;
51         int volume;
52
53         /* coercion stuff */
54         media_sample_format_t *msf;
55         int coe_ch_cnt;
56         audio_coerce_chain_t coe_chain[4];
57         mtype_audio_properties *mtap;
58         sxe_mse_volume_args *volargs;
59         sxe_mse_rerate_args *rrargs;
60
61         size_t writepos;
62         size_t readpos;
63         size_t overfill;
64         int underrun;
65         size_t buffer_size;
66
67         media_thread_play_state mtp;
68 };
69
70 extern void nas_wait_for_sounds(void);
71
72 extern Lisp_Object Qnas;                /* initialised in sound.c */
73
74 DECLARE_AUDIO_DEVICE(sound_nas);
75
76 #ifdef ALL_DEBUG_FLAGS
77 #undef NAS_DEBUG_FLAG
78 #define NAS_DEBUG_FLAG
79 #endif
80
81 #endif  /* INCLUDED_sound_nas_h_ */