2 * ESounD media addon for BeOS
4 * Copyright (c) 2006 François Revol (revol@free.fr)
6 * Based on Multi Audio addon for Haiku,
7 * Copyright (c) 2002, 2003 Jerome Duval (jerome.duval@free.fr)
10 * Redistribution and use in source and binary forms, with or without modification,
11 * are permitted provided that the following conditions are met:
13 * - Redistributions of source code must retain the above copyright notice,
14 * this list of conditions and the following disclaimer.
15 * - Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
25 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 * cf. http://www.jcraft.com/jesd/EsounD-protocol.txt
41 #define ESD_MAX_BUF (4 * 1024)
42 #define ESD_MAX_KEY 16
43 #define ESD_MAX_NAME 128
45 typedef uint32_t esd_rate_t
;
46 typedef uint32_t esd_format_t
;
47 typedef uint32_t esd_command_t
;
48 typedef char esd_key_t
[ESD_MAX_KEY
];
49 typedef char esd_name_t
[ESD_MAX_NAME
];
52 //#define ESD_DEFAULT_PORT 5001
53 #define ESD_DEFAULT_PORT 16001
55 #define ESD_DEFAULT_RATE 44100
56 //#define ESD_DEFAULT_RATE 22050
58 #define ESD_ENDIAN_TAG 'ENDN'
62 ESD_PROTO_CONNECT
= 0,
68 ESD_PROTO_STREAM_PLAY
,
72 ESD_PROTO_SAMPLE_CACHE
,
73 ESD_PROTO_SAMPLE_FREE
,
74 ESD_PROTO_SAMPLE_PLAY
,
75 ESD_PROTO_SAMPLE_LOOP
,
76 ESD_PROTO_SAMPLE_STOP
,
77 ESD_PROTO_SAMPLE_KILL
,
82 ESD_PROTO_SAMPLE_GETID
,
83 ESD_PROTO_STREAM_FILTER
,
85 ESD_PROTO_SERVER_INFO
,
86 ESD_PROTO_SERVER_ALL_INFO
,
88 ESD_PROTO_UNSUBSCRIBE
,
93 ESD_PROTO_STANDBY_MODE
,
98 #define ESD_MASK_BITS 0x000F
99 #define ESD_MASK_CHAN 0x00F0
100 #define ESD_MASK_MODE 0x0F00
101 #define ESD_MASK_FUNC 0xF000
104 #define ESD_BITS8 0x0000
105 #define ESD_BITS16 0x0001
108 #define ESD_MONO 0x0010
109 #define ESD_STEREO 0x0020
112 #define ESD_STREAM 0x0000
113 #define ESD_SAMPLE 0x0100
114 #define ESD_ADPCM 0x0200
117 #define ESD_FUNC_PLAY 0x1000
118 #define ESD_FUNC_MONITOR 0x0000
119 #define ESD_FUNC_RECORD 0x2000
120 #define ESD_FUNC_STOP 0x0000
121 #define ESD_FUNC_LOOP 0x2000
125 #define ESD_ERROR_STANDBY 1
126 #define ESD_ERROR_AUTOSTANDBY 2
127 #define ESD_ERROR_RUNNING 3
132 #endif /* _ESDPROTO_H */