3 Ann Hell Ex Machina - Music Software
4 Copyright (C) 2003/2005 Angel Ortega <angel@triptico.com>
6 out_esd.c - Output driver for the Enlightened Sound Daemon
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 http://www.triptico.com
28 #include "ss_output.h"
43 #ifndef ESD_BUFFER_SIZE
44 #define ESD_BUFFER_SIZE 65536
52 int _out_open_esd(char * file
)
56 /* ESD does not support more than stereo output */
60 format
= ESD_STREAM
| ESD_PLAY
| ESD_BITS16
;
61 format
|= ss_nchannels
== 2 ? ESD_STEREO
: ESD_MONO
;
63 _esd_fd
=esd_open_sound(file
);
68 _esd_fd
=esd_play_stream_fallback(format
, ss_frequency
, NULL
, "annhell");
73 return(ESD_BUFFER_SIZE
);
77 int _out_write_esd(short int * buffer
, int size
)
79 return(write(_esd_fd
, buffer
, size
* sizeof(short int)));
83 int _out_close_esd(void)
92 struct _output_driver _out_driver_esd
=
93 { "esd", NULL
, _out_open_esd
, _out_write_esd
, _out_close_esd
};
95 #else /* CONFOPT_ESD */
97 struct _output_driver _out_driver_esd
=
98 { "esd", NULL
, NULL
, NULL
, NULL
};
100 #endif /* CONFOPT_ESD */