dynamic_mp3.h
author Franc[e]sco <lolisamurai@tfwno.gf>
Thu, 20 Jul 2017 22:03:19 +0200
changeset 757 420f3b37dc95
parent 728 15571e1ac71f
permissions -rw-r--r--
add mpg123 support
     1 /*
     2   SDL_mixer:  An audio mixer library based on the SDL library
     3   Copyright (C) 1997-2017 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 #if SDL_VERSION_ATLEAST(2, 0, 0)
    25 /* Forward declaration for SDL 2.0  because struct is not available there but
    26    still used in a file included with smpeg.h. May not compile if missing. */
    27 typedef struct SDL_Overlay SDL_Overlay;
    28 #endif
    29 
    30 #include "smpeg.h"
    31 
    32 typedef struct {
    33     int loaded;
    34     void *handle;
    35     void (*SMPEG_actualSpec)( SMPEG *mpeg, SDL_AudioSpec *spec );
    36     void (*SMPEG_delete)( SMPEG* mpeg );
    37     void (*SMPEG_enableaudio)( SMPEG* mpeg, int enable );
    38     void (*SMPEG_enablevideo)( SMPEG* mpeg, int enable );
    39     SMPEG* (*SMPEG_new_rwops)(SDL_RWops *src, SMPEG_Info* info, int freesrc, int sdl_audio);
    40     void (*SMPEG_play)( SMPEG* mpeg );
    41     int (*SMPEG_playAudio)( SMPEG *mpeg, Uint8 *stream, int len );
    42     void (*SMPEG_rewind)( SMPEG* mpeg );
    43     void (*SMPEG_setvolume)( SMPEG* mpeg, int volume );
    44     void (*SMPEG_skip)( SMPEG* mpeg, float seconds );
    45     SMPEGstatus (*SMPEG_status)( SMPEG* mpeg );
    46     void (*SMPEG_stop)( SMPEG* mpeg );
    47 } smpeg_loader;
    48 
    49 extern smpeg_loader smpeg;
    50 
    51 #elif defined(MP3_MPG_MUSIC)
    52 
    53 #include "mpg123.h"
    54 
    55 #endif /* MUSIC_MP3 */
    56 
    57 extern int Mix_InitMP3();
    58 extern void Mix_QuitMP3();