dynamic_mp3.h
author Ozkan Sezer <sezeroz@gmail.com>
Sat, 14 Dec 2019 18:21:50 +0300
branchSDL-1.2
changeset 1082 83da6758753b
parent 902 6c862e733898
permissions -rw-r--r--
fixed make dist
     1 /*
     2   SDL_mixer:  An audio mixer library based on the SDL library
     3   Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
     4 
     5   This software is provided 'as-is', without any express or implied
     6   warranty.  In no event will the authors be held liable for any damages
     7   arising from the use of this software.
     8 
     9   Permission is granted to anyone to use this software for any purpose,
    10   including commercial applications, and to alter it and redistribute it
    11   freely, subject to the following restrictions:
    12 
    13   1. The origin of this software must not be misrepresented; you must not
    14      claim that you wrote the original software. If you use this software
    15      in a product, an acknowledgment in the product documentation would be
    16      appreciated but is not required.
    17   2. Altered source versions must be plainly marked as such, and must not be
    18      misrepresented as being the original software.
    19   3. This notice may not be removed or altered from any source distribution.
    20 */
    21 
    22 #ifdef MP3_MUSIC
    23 
    24 #include <mpg123.h>
    25 
    26 typedef struct {
    27 	int loaded;
    28 	void *handle;
    29 
    30 	int (*mpg123_close)(mpg123_handle *mh);
    31 	void (*mpg123_delete)(mpg123_handle *mh);
    32 	void (*mpg123_exit)(void);
    33 	int (*mpg123_format)( mpg123_handle *mh, long rate, int channels, int encodings );
    34 	int (*mpg123_format_none)(mpg123_handle *mh);
    35 	int (*mpg123_getformat)( mpg123_handle *mh, long *rate, int *channels, int *encoding );
    36 	int (*mpg123_init)(void);
    37 	mpg123_handle *(*mpg123_new)(const char* decoder, int *error);
    38 	int (*mpg123_open_handle)(mpg123_handle *mh, void *iohandle);
    39 	const char* (*mpg123_plain_strerror)(int errcode);
    40 	void (*mpg123_rates)(const long **list, size_t *number);
    41 	int (*mpg123_read)(mpg123_handle *mh, unsigned char *outmemory, size_t outmemsize, size_t *done );
    42 	int (*mpg123_replace_reader_handle)( mpg123_handle *mh, ssize_t (*r_read) (void *, void *, size_t), off_t (*r_lseek)(void *, off_t, int), void (*cleanup)(void*) );
    43 	off_t (*mpg123_seek)( mpg123_handle *mh, off_t sampleoff, int whence );
    44 	const char* (*mpg123_strerror)(mpg123_handle *mh);
    45 } mpg123_loader;
    46 
    47 extern mpg123_loader mpg123;
    48 
    49 extern int Mix_InitMP3 (void);
    50 extern void Mix_QuitMP3 (void);
    51 
    52 #endif /* MUSIC_MP3 */