1 /*
2  * Copyright 1993 Network Computing Devices, Inc.
3  *
4  * Permission to use, copy, modify, distribute, and sell this software and its
5  * documentation for any purpose is hereby granted without fee, provided that
6  * the above copyright notice appear in all copies and that both that
7  * copyright notice and this permission notice appear in supporting
8  * documentation, and that the name Network Computing Devices, Inc. not be
9  * used in advertising or publicity pertaining to distribution of this
10  * software without specific, written prior permission.
11  *
12  * THIS SOFTWARE IS PROVIDED 'AS-IS'.  NETWORK COMPUTING DEVICES, INC.,
13  * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT
14  * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
15  * PARTICULAR PURPOSE, OR NONINFRINGEMENT.  IN NO EVENT SHALL NETWORK
16  * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING
17  * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA,
18  * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF
19  * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN
20  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21  *
22  * $NCDId: @(#)8svx.h,v 1.3 1995/05/23 23:35:16 greg Exp $
23  */
24 
25 #ifndef _SVX_H_
26 #define _SVX_H_
27 
28 #include <audio/audio.h>			/* for AuInt32 and AuUint32 */
29 
30 #ifndef _SvxConst
31 #define _SvxConst const
32 #endif						/* _SvxConst */
33 
34 #ifndef _FUNCPROTOBEGIN
35 #ifdef __cplusplus			/* for C++ V2.0 */
36 #define _FUNCPROTOBEGIN extern "C" {	/* do not leave open across includes */
37 #define _FUNCPROTOEND }
38 #else
39 #define _FUNCPROTOBEGIN
40 #define _FUNCPROTOEND
41 #endif
42 #endif /* _FUNCPROTOBEGIN */
43 
44 #define SVX_FormID			"FORM"
45 #define SVX_8svxID			"8SVX"
46 #define SVX_NameID			"NAME"
47 #define SVX_VhdrID			"VHDR"
48 #define SVX_BodyID			"BODY"
49 
50 #define SVX_SizeofVhdrChunk		20
51 
52 #define	SVX_MaxVolume			65536
53 
54 typedef AuUint32 SVX_ID;
55 
56 typedef struct
57 {
58     SVX_ID          ckID;			/* chunk ID */
59     AuInt32         ckSize;			/* chunk data size, in bytes */
60 }               SvxChunk;
61 
62 typedef struct
63 {
64     FILE           *fp;
65     char           *comment;
66     AuInt32         sampleRate;
67     AuUint32        dataOffset,
68                     numSamples;
69 
70     /* private data */
71     AuUint32        fileSize,
72                     dataSize,
73                     sizeOffset;
74     unsigned int    writing;
75 }               SvxInfo;
76 
77 /*****************************************************************************
78  *			       PUBLIC INTERFACES			     *
79  *****************************************************************************/
80 
81 _FUNCPROTOBEGIN
82 
83 extern SvxInfo *
84 SvxOpenFileForReading(
85 		      const char *		/* file name */
86 );
87 
88 extern SvxInfo *
89 SvxOpenFileForWriting(
90 		      const char *,		/* file name */
91 		      SvxInfo *			/* info */
92 );
93 
94 extern int
95 SvxCloseFile(
96 	     SvxInfo *				/* info */
97 );
98 
99 extern int
100 SvxReadFile(
101 	    char *,				/* buffer */
102 	    int,				/* num bytes */
103 	    SvxInfo *				/* info */
104 );
105 
106 extern int
107 SvxWriteFile(
108 	     char *,				/* buffer */
109 	     int,				/* num bytes */
110 	     SvxInfo *				/* info */
111 );
112 
113 extern int
114 SvxSeekFile(
115 	      int,                              /* number of audio bytes */
116 	      SvxInfo *				/* info */
117 );
118 
119 extern int
120 SvxTellFile(
121 	      SvxInfo *				/* info */
122 );
123 
124 extern int
125 SvxFlushFile(
126 	      SvxInfo *				/* info */
127 );
128 
129 extern int
130 SvxRewindFile(
131 	      SvxInfo *				/* info */
132 );
133 
134 _FUNCPROTOEND
135 
136 #endif						/* _SVX_H_ */
137