1 /* 2 * Audio Codecs: Adapted from ioquake3 with changes. 3 * For now, only handles streaming music, not sound effects. 4 * 5 * Copyright (C) 1999-2005 Id Software, Inc. 6 * Copyright (C) 2005 Stuart Dalton <badcdev@gmail.com> 7 * Copyright (C) 2010-2012 O.Sezer <sezero@users.sourceforge.net> 8 * 9 * $Id: snd_codeci.h 5242 2013-09-24 18:28:14Z sezero $ 10 * 11 * This program is free software; you can redistribute it and/or modify 12 * it under the terms of the GNU General Public License as published by 13 * the Free Software Foundation; either version 2 of the License, or (at 14 * your option) any later version. 15 * 16 * This program is distributed in the hope that it will be useful, but 17 * WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 19 * 20 * See the GNU General Public License for more details. 21 * 22 * You should have received a copy of the GNU General Public License along 23 * with this program; if not, write to the Free Software Foundation, Inc., 24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 25 * 26 */ 27 28 #ifndef _SND_CODECI_H_ 29 #define _SND_CODECI_H_ 30 31 /* Codec internals */ 32 typedef qboolean (*CODEC_INIT)(void); 33 typedef void (*CODEC_SHUTDOWN)(void); 34 typedef qboolean (*CODEC_OPEN)(snd_stream_t *stream); 35 typedef int (*CODEC_READ)(snd_stream_t *stream, int bytes, void *buffer); 36 typedef int (*CODEC_REWIND)(snd_stream_t *stream); 37 typedef void (*CODEC_CLOSE)(snd_stream_t *stream); 38 39 struct snd_codec_s 40 { 41 unsigned int type; /* handled data type. (1U << n) */ 42 qboolean initialized; /* init succeedded */ 43 const char *ext; /* expected extension */ 44 CODEC_INIT initialize; 45 CODEC_SHUTDOWN shutdown; 46 CODEC_OPEN codec_open; 47 CODEC_READ codec_read; 48 CODEC_REWIND codec_rewind; 49 CODEC_CLOSE codec_close; 50 snd_codec_t *next; 51 }; 52 53 qboolean S_CodecForwardStream (snd_stream_t *stream, unsigned int type); 54 /* Forward a stream to another codec of 'type' type. */ 55 56 #endif /* _SND_CODECI_H_ */ 57 58