dynamic_ogg.h
author Sam Lantinga <slouken@libsdl.org>
Sun, 15 Jul 2007 03:38:33 +0000
changeset 353 21fe62f9c4c6
parent 312 8a536296ef3d
child 366 73d7c3d9bbe6
permissions -rw-r--r--
Fixed bug #297

Philippe Simons - Sat Jul 14 20:33:17 PDT 2007
* Added support for Ogg Vorbis playback with Tremor (an integer decoder)
slouken@312
     1
/*
slouken@312
     2
    SDL_mixer:  An audio mixer library based on the SDL library
slouken@312
     3
    Copyright (C) 1997-2004 Sam Lantinga
slouken@312
     4
slouken@312
     5
    This library is free software; you can redistribute it and/or
slouken@312
     6
    modify it under the terms of the GNU Library General Public
slouken@312
     7
    License as published by the Free Software Foundation; either
slouken@312
     8
    version 2 of the License, or (at your option) any later version.
slouken@312
     9
slouken@312
    10
    This library is distributed in the hope that it will be useful,
slouken@312
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@312
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@312
    13
    Library General Public License for more details.
slouken@312
    14
slouken@312
    15
    You should have received a copy of the GNU Library General Public
slouken@312
    16
    License along with this library; if not, write to the Free
slouken@312
    17
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
slouken@312
    18
slouken@312
    19
    Sam Lantinga
slouken@312
    20
    slouken@libsdl.org
slouken@312
    21
*/
slouken@312
    22
slouken@312
    23
#ifdef OGG_MUSIC
slouken@353
    24
#ifdef OGG_USE_TREMOR
slouken@353
    25
#include <tremor/ivorbisfile.h>
slouken@353
    26
#else
slouken@312
    27
#include <vorbis/vorbisfile.h>
slouken@353
    28
#endif
slouken@312
    29
slouken@312
    30
typedef struct {
slouken@312
    31
	int loaded;
slouken@312
    32
	void *handle;
slouken@312
    33
	int (*ov_clear)(OggVorbis_File *vf);
slouken@312
    34
	vorbis_info *(*ov_info)(OggVorbis_File *vf,int link);
slouken@312
    35
	int (*ov_open)(FILE *f,OggVorbis_File *vf,char *initial,long ibytes);
slouken@312
    36
	int (*ov_open_callbacks)(void *datasource, OggVorbis_File *vf, char *initial, long ibytes, ov_callbacks callbacks);
slouken@312
    37
	ogg_int64_t (*ov_pcm_total)(OggVorbis_File *vf,int i);
slouken@353
    38
#ifdef OGG_USE_TREMOR
slouken@353
    39
	long (*ov_read)(OggVorbis_File *vf,char *buffer,int length, int *bitstream);
slouken@353
    40
#else
slouken@312
    41
	long (*ov_read)(OggVorbis_File *vf,char *buffer,int length, int bigendianp,int word,int sgned,int *bitstream);
slouken@353
    42
#endif
slouken@312
    43
	int (*ov_time_seek)(OggVorbis_File *vf,double pos);
slouken@312
    44
} vorbis_loader;
slouken@312
    45
slouken@312
    46
extern vorbis_loader vorbis;
slouken@312
    47
slouken@312
    48
extern int Mix_InitOgg();
slouken@312
    49
extern void Mix_QuitOgg();
slouken@312
    50
slouken@312
    51
#endif