Annotation of src/usr.bin/aucat/wav.h, Revision 1.1
1.1 ! ratchov 1: /* $OpenBSD: file.h,v 1.3 2008/08/14 09:58:55 ratchov Exp $ */
! 2: /*
! 3: * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
! 4: *
! 5: * Permission to use, copy, modify, and distribute this software for any
! 6: * purpose with or without fee is hereby granted, provided that the above
! 7: * copyright notice and this permission notice appear in all copies.
! 8: *
! 9: * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
! 10: * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
! 11: * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
! 12: * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
! 13: * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
! 14: * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
! 15: * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
! 16: */
! 17: #ifndef WAV_H
! 18: #define WAV_H
! 19:
! 20: #include <sys/types.h>
! 21:
! 22: #include "pipe.h"
! 23: #include "aparams.h"
! 24:
! 25: struct wav {
! 26: struct pipe pipe;
! 27: #define HDR_AUTO 0 /* guess by looking at the file name */
! 28: #define HDR_RAW 1 /* no headers, ie openbsd native ;-) */
! 29: #define HDR_WAV 2 /* microsoft riff wave */
! 30: unsigned hdr; /* HDR_RAW or HDR_WAV */
! 31: struct aparams hpar; /* parameters to write on the header */
! 32: off_t rbytes; /* bytes to read, -1 if no limit */
! 33: off_t wbytes; /* bytes to write, -1 if no limit */
! 34: };
! 35:
! 36: extern struct fileops wav_ops;
! 37:
! 38: struct wav *wav_new_in(struct fileops *, int, char *,
! 39: struct aparams *, unsigned);
! 40: struct wav *wav_new_out(struct fileops *, int, char *,
! 41: struct aparams *, unsigned);
! 42: unsigned wav_read(struct file *, unsigned char *, unsigned);
! 43: unsigned wav_write(struct file *, unsigned char *, unsigned);
! 44: void wav_close(struct file *);
! 45: int wav_readhdr(int, struct aparams *, off_t *);
! 46: int wav_writehdr(int, struct aparams *);
! 47:
! 48: /* legacy */
! 49: int legacy_play(char *, char *);
! 50:
! 51: #endif /* !defined(WAV_H) */