source: roaraudio/roard/driver_roar.c @ 0:2a41d2f42394

Last change on this file since 0:2a41d2f42394 was 0:2a41d2f42394, checked in by phi, 16 years ago

Initial revision

File size: 1.0 KB
Line 
1//driver_esd.c:
2
3#include "roard.h"
4
5int driver_roar_open(DRIVER_USERDATA_T * inst, char * device, struct roar_audio_info * info) {
6/*
7 esd_format_t format = ESD_STREAM | ESD_PLAY;
8 char name[80] = "roard";
9
10 format |= info->bits     == 16 ? ESD_BITS16 : ESD_BITS8;
11 format |= info->channels ==  2 ? ESD_STEREO : ESD_MONO;
12
13 *(int*)inst = esd_play_stream_fallback(format, info->rate, device, name);
14
15 if ( *(int*)inst == -1 )
16  return -1;
17
18 return 0;
19*/
20
21 *(int*)inst =  roar_simple_play(info->rate, info->channels, info->bits, info->codec, device, "roard");
22
23 if ( *(int*)inst == -1 )
24  return -1;
25
26 return 0;
27}
28
29int driver_roar_close(DRIVER_USERDATA_T   inst) {
30 return roar_simple_close((int)inst);
31}
32
33int driver_roar_pause(DRIVER_USERDATA_T   inst, int newstate) {
34 return -1;
35}
36
37int driver_roar_write(DRIVER_USERDATA_T   inst, char * buf, int len) {
38 return write((int)inst, buf, len);
39}
40
41int driver_roar_read(DRIVER_USERDATA_T   inst, char * buf, int len) {
42 return read((int)inst, buf, len);
43}
44
45int driver_roar_flush(DRIVER_USERDATA_T   inst) {
46 return 0;
47}
48
49//ll
Note: See TracBrowser for help on using the repository browser.