1 /* sound-alsa.c - play a sound over the alsa server
3 Copyright (C) 2006 Sebastian Freundt
5 This file is part of SXEmacs
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.
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.
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/>. */
21 /* Synched up with: Not in FSF. */
23 #ifndef INCLUDED_sound_alsa_h_
24 #define INCLUDED_sound_alsa_h_
27 #include <alsa/input.h>
28 #include <alsa/output.h>
29 #include <alsa/conf.h>
30 #include <alsa/global.h>
32 #include <alsa/error.h>
34 typedef struct sound_alsa_data_s sound_alsa_data_t;
35 typedef struct sound_alsa_aj_data_s sound_alsa_aj_data_t;
37 struct sound_alsa_data_s {
41 snd_pcm_hw_params_t *hwparams;
46 struct sound_alsa_aj_data_s {
48 size_t samplerate; /* rate used on the device */
49 unsigned int channels; /* channels used on the device */
50 size_t framesize; /* resulting framesize */
51 snd_pcm_format_t format;
53 media_sample_format_t *msf;
55 audio_coerce_chain_t coe_chain[4];
56 mtype_audio_properties *mtap;
59 extern Lisp_Object Qalsa; /* initialised in sound.c */
61 #define DEVICE_CONNECTED_TO_ALSA_P(x) 1 /* FIXME: better check */
63 DECLARE_AUDIO_DEVICE(sound_alsa);
65 #ifdef ALL_DEBUG_FLAGS
66 #undef ALSA_DEBUG_FLAG
67 #define ALSA_DEBUG_FLAG
70 #endif /* INCLUDED_sound_alsa_h_ */