*** empty log message ***
authorSam Lantinga <slouken@lokigames.com>
Fri, 14 Jan 2000 18:59:44 +0000
changeset 3425e00090b15c
parent 33 f7004679e34d
child 35 38b7b8e93dc6
*** empty log message ***
CHANGES
Makefile.am
Makefile.in
SDL_mixer.h
configure
configure.in
mixer.c
mixer.h
music.c
music_cmd.c
playmus.c
playwave.c
     1.1 --- a/CHANGES	Mon Jan 10 21:40:35 2000 +0000
     1.2 +++ b/CHANGES	Fri Jan 14 18:59:44 2000 +0000
     1.3 @@ -1,3 +1,9 @@
     1.4 +
     1.5 +1.0.3:
     1.6 +Sam Lantinga - Fri Jan 14 11:06:56 PST 2000
     1.7 + * Made the CHANGELOG entries Y2K compliant. :)
     1.8 + * Changed the name of the library from "mixer" to "SDLmixer"
     1.9 +   Instead of including "mixer.h", include "SDL_mixer.h"
    1.10  
    1.11  1.0.2:
    1.12  FXJ -	Updated the mikmod support to MikMod 3.1.8
     2.1 --- a/Makefile.am	Mon Jan 10 21:40:35 2000 +0000
     2.2 +++ b/Makefile.am	Fri Jan 14 18:59:44 2000 +0000
     2.3 @@ -1,15 +1,15 @@
     2.4  # Makefile.am for the SDL sample mixer library and players
     2.5  
     2.6 -lib_LTLIBRARIES = libmixer.la
     2.7 +lib_LTLIBRARIES = libSDLmixer.la
     2.8  
     2.9  SUBDIRS = @MUSIC_SUBDIRS@
    2.10  DIST_SUBIDRS = mikmod timidity
    2.11  
    2.12 -libmixerincludedir = $(includedir)
    2.13 -libmixerinclude_HEADERS =	\
    2.14 -	mixer.h
    2.15 +libSDLmixerincludedir = $(includedir)/SDL
    2.16 +libSDLmixerinclude_HEADERS =	\
    2.17 +	SDL_mixer.h
    2.18  
    2.19 -libmixer_la_SOURCES =	\
    2.20 +libSDLmixer_la_SOURCES =	\
    2.21  	mixer.c			\
    2.22  	music.c			\
    2.23  	music_cmd.c		\
    2.24 @@ -29,12 +29,12 @@
    2.25  TIMIDITY_LIB =
    2.26  endif
    2.27  
    2.28 -libmixer_la_LDFLAGS = 		\
    2.29 +libSDLmixer_la_LDFLAGS = 		\
    2.30          -release $(LT_RELEASE)	\
    2.31  	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
    2.32 -libmixer_la_LIBADD = $(MIKMOD_LIB) $(TIMIDITY_LIB)
    2.33 +libSDLmixer_la_LIBADD = $(MIKMOD_LIB) $(TIMIDITY_LIB)
    2.34  
    2.35  bin_PROGRAMS = playwave playmus
    2.36  
    2.37 -playwave_LDADD = libmixer.la
    2.38 -playmus_LDADD = libmixer.la
    2.39 +playwave_LDADD = libSDLmixer.la
    2.40 +playmus_LDADD = libSDLmixer.la
     3.1 --- a/Makefile.in	Mon Jan 10 21:40:35 2000 +0000
     3.2 +++ b/Makefile.in	Fri Jan 14 18:59:44 2000 +0000
     3.3 @@ -88,30 +88,30 @@
     3.4  SDL_LIBS = @SDL_LIBS@
     3.5  VERSION = @VERSION@
     3.6  
     3.7 -lib_LTLIBRARIES = libmixer.la
     3.8 +lib_LTLIBRARIES = libSDLmixer.la
     3.9  
    3.10  SUBDIRS = @MUSIC_SUBDIRS@
    3.11  DIST_SUBIDRS = mikmod timidity
    3.12  
    3.13 -libmixerincludedir = $(includedir)
    3.14 -libmixerinclude_HEADERS =  	mixer.h
    3.15 +libSDLmixerincludedir = $(includedir)/SDL
    3.16 +libSDLmixerinclude_HEADERS =  	SDL_mixer.h
    3.17  
    3.18  
    3.19 -libmixer_la_SOURCES =  	mixer.c				music.c				music_cmd.c			music_cmd.h			wave.h				wavestream.c			wavestream.h
    3.20 +libSDLmixer_la_SOURCES =  	mixer.c				music.c				music_cmd.c			music_cmd.h			wave.h				wavestream.c			wavestream.h
    3.21  
    3.22  @USE_MIKMOD_TRUE@MIKMOD_LIB = mikmod/libmikmod.la
    3.23  @USE_MIKMOD_FALSE@MIKMOD_LIB = 
    3.24  @USE_TIMIDITY_TRUE@TIMIDITY_LIB = timidity/libtimidity.la
    3.25  @USE_TIMIDITY_FALSE@TIMIDITY_LIB = 
    3.26  
    3.27 -libmixer_la_LDFLAGS =          -release $(LT_RELEASE)		-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
    3.28 +libSDLmixer_la_LDFLAGS =          -release $(LT_RELEASE)		-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
    3.29  
    3.30 -libmixer_la_LIBADD = $(MIKMOD_LIB) $(TIMIDITY_LIB)
    3.31 +libSDLmixer_la_LIBADD = $(MIKMOD_LIB) $(TIMIDITY_LIB)
    3.32  
    3.33  bin_PROGRAMS = playwave playmus
    3.34  
    3.35 -playwave_LDADD = libmixer.la
    3.36 -playmus_LDADD = libmixer.la
    3.37 +playwave_LDADD = libSDLmixer.la
    3.38 +playmus_LDADD = libSDLmixer.la
    3.39  ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
    3.40  mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
    3.41  CONFIG_CLEAN_FILES = 
    3.42 @@ -122,31 +122,31 @@
    3.43  CPPFLAGS = @CPPFLAGS@
    3.44  LDFLAGS = @LDFLAGS@
    3.45  LIBS = @LIBS@
    3.46 -@USE_TIMIDITY_FALSE@@USE_MIKMOD_FALSE@libmixer_la_DEPENDENCIES = 
    3.47 -@USE_TIMIDITY_TRUE@@USE_MIKMOD_TRUE@libmixer_la_DEPENDENCIES =  \
    3.48 +@USE_TIMIDITY_FALSE@@USE_MIKMOD_FALSE@libSDLmixer_la_DEPENDENCIES = 
    3.49 +@USE_TIMIDITY_TRUE@@USE_MIKMOD_TRUE@libSDLmixer_la_DEPENDENCIES =  \
    3.50  @USE_TIMIDITY_TRUE@@USE_MIKMOD_TRUE@mikmod/libmikmod.la \
    3.51  @USE_TIMIDITY_TRUE@@USE_MIKMOD_TRUE@timidity/libtimidity.la
    3.52 -@USE_TIMIDITY_TRUE@@USE_MIKMOD_FALSE@libmixer_la_DEPENDENCIES =  \
    3.53 +@USE_TIMIDITY_TRUE@@USE_MIKMOD_FALSE@libSDLmixer_la_DEPENDENCIES =  \
    3.54  @USE_TIMIDITY_TRUE@@USE_MIKMOD_FALSE@timidity/libtimidity.la
    3.55 -@USE_TIMIDITY_FALSE@@USE_MIKMOD_TRUE@libmixer_la_DEPENDENCIES =  \
    3.56 +@USE_TIMIDITY_FALSE@@USE_MIKMOD_TRUE@libSDLmixer_la_DEPENDENCIES =  \
    3.57  @USE_TIMIDITY_FALSE@@USE_MIKMOD_TRUE@mikmod/libmikmod.la
    3.58 -libmixer_la_OBJECTS =  mixer.lo music.lo music_cmd.lo wavestream.lo
    3.59 +libSDLmixer_la_OBJECTS =  mixer.lo music.lo music_cmd.lo wavestream.lo
    3.60  PROGRAMS =  $(bin_PROGRAMS)
    3.61  
    3.62  playwave_SOURCES = playwave.c
    3.63  playwave_OBJECTS =  playwave.o
    3.64 -playwave_DEPENDENCIES =  libmixer.la
    3.65 +playwave_DEPENDENCIES =  libSDLmixer.la
    3.66  playwave_LDFLAGS = 
    3.67  playmus_SOURCES = playmus.c
    3.68  playmus_OBJECTS =  playmus.o
    3.69 -playmus_DEPENDENCIES =  libmixer.la
    3.70 +playmus_DEPENDENCIES =  libSDLmixer.la
    3.71  playmus_LDFLAGS = 
    3.72  CFLAGS = @CFLAGS@
    3.73  COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
    3.74  LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
    3.75  CCLD = $(CC)
    3.76  LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
    3.77 -HEADERS =  $(libmixerinclude_HEADERS)
    3.78 +HEADERS =  $(libSDLmixerinclude_HEADERS)
    3.79  
    3.80  DIST_COMMON =  README COPYING Makefile.am Makefile.in acinclude.m4 \
    3.81  aclocal.m4 config.guess config.sub configure configure.in install-sh \
    3.82 @@ -159,8 +159,8 @@
    3.83  GZIP_ENV = --best
    3.84  DEP_FILES =  .deps/mixer.P .deps/music.P .deps/music_cmd.P \
    3.85  .deps/playmus.P .deps/playwave.P .deps/wavestream.P
    3.86 -SOURCES = $(libmixer_la_SOURCES) playwave.c playmus.c
    3.87 -OBJECTS = $(libmixer_la_OBJECTS) playwave.o playmus.o
    3.88 +SOURCES = $(libSDLmixer_la_SOURCES) playwave.c playmus.c
    3.89 +OBJECTS = $(libSDLmixer_la_OBJECTS) playwave.o playmus.o
    3.90  
    3.91  all: all-redirect
    3.92  .SUFFIXES:
    3.93 @@ -237,8 +237,8 @@
    3.94  
    3.95  maintainer-clean-libtool:
    3.96  
    3.97 -libmixer.la: $(libmixer_la_OBJECTS) $(libmixer_la_DEPENDENCIES)
    3.98 -	$(LINK) -rpath $(libdir) $(libmixer_la_LDFLAGS) $(libmixer_la_OBJECTS) $(libmixer_la_LIBADD) $(LIBS)
    3.99 +libSDLmixer.la: $(libSDLmixer_la_OBJECTS) $(libSDLmixer_la_DEPENDENCIES)
   3.100 +	$(LINK) -rpath $(libdir) $(libSDLmixer_la_LDFLAGS) $(libSDLmixer_la_OBJECTS) $(libSDLmixer_la_LIBADD) $(LIBS)
   3.101  
   3.102  mostlyclean-binPROGRAMS:
   3.103  
   3.104 @@ -273,19 +273,19 @@
   3.105  	@rm -f playmus
   3.106  	$(LINK) $(playmus_LDFLAGS) $(playmus_OBJECTS) $(playmus_LDADD) $(LIBS)
   3.107  
   3.108 -install-libmixerincludeHEADERS: $(libmixerinclude_HEADERS)
   3.109 +install-libSDLmixerincludeHEADERS: $(libSDLmixerinclude_HEADERS)
   3.110  	@$(NORMAL_INSTALL)
   3.111 -	$(mkinstalldirs) $(DESTDIR)$(libmixerincludedir)
   3.112 -	@list='$(libmixerinclude_HEADERS)'; for p in $$list; do \
   3.113 +	$(mkinstalldirs) $(DESTDIR)$(libSDLmixerincludedir)
   3.114 +	@list='$(libSDLmixerinclude_HEADERS)'; for p in $$list; do \
   3.115  	  if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
   3.116 -	  echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(libmixerincludedir)/$$p"; \
   3.117 -	  $(INSTALL_DATA) $$d$$p $(DESTDIR)$(libmixerincludedir)/$$p; \
   3.118 +	  echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(libSDLmixerincludedir)/$$p"; \
   3.119 +	  $(INSTALL_DATA) $$d$$p $(DESTDIR)$(libSDLmixerincludedir)/$$p; \
   3.120  	done
   3.121  
   3.122 -uninstall-libmixerincludeHEADERS:
   3.123 +uninstall-libSDLmixerincludeHEADERS:
   3.124  	@$(NORMAL_UNINSTALL)
   3.125 -	list='$(libmixerinclude_HEADERS)'; for p in $$list; do \
   3.126 -	  rm -f $(DESTDIR)$(libmixerincludedir)/$$p; \
   3.127 +	list='$(libSDLmixerinclude_HEADERS)'; for p in $$list; do \
   3.128 +	  rm -f $(DESTDIR)$(libSDLmixerincludedir)/$$p; \
   3.129  	done
   3.130  
   3.131  # This directory's subdirectories are mostly independent; you can cd
   3.132 @@ -483,14 +483,14 @@
   3.133  install-exec-am: install-libLTLIBRARIES install-binPROGRAMS
   3.134  install-exec: install-exec-recursive
   3.135  
   3.136 -install-data-am: install-libmixerincludeHEADERS
   3.137 +install-data-am: install-libSDLmixerincludeHEADERS
   3.138  install-data: install-data-recursive
   3.139  
   3.140  install-am: all-am
   3.141  	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
   3.142  install: install-recursive
   3.143  uninstall-am: uninstall-libLTLIBRARIES uninstall-binPROGRAMS \
   3.144 -		uninstall-libmixerincludeHEADERS
   3.145 +		uninstall-libSDLmixerincludeHEADERS
   3.146  uninstall: uninstall-recursive
   3.147  all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS)
   3.148  all-redirect: all-recursive
   3.149 @@ -499,7 +499,7 @@
   3.150  installdirs: installdirs-recursive
   3.151  installdirs-am:
   3.152  	$(mkinstalldirs)  $(DESTDIR)$(libdir) $(DESTDIR)$(bindir) \
   3.153 -		$(DESTDIR)$(libmixerincludedir)
   3.154 +		$(DESTDIR)$(libSDLmixerincludedir)
   3.155  
   3.156  
   3.157  mostlyclean-generic:
   3.158 @@ -549,8 +549,8 @@
   3.159  mostlyclean-libtool distclean-libtool clean-libtool \
   3.160  maintainer-clean-libtool mostlyclean-binPROGRAMS distclean-binPROGRAMS \
   3.161  clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \
   3.162 -install-binPROGRAMS uninstall-libmixerincludeHEADERS \
   3.163 -install-libmixerincludeHEADERS install-data-recursive \
   3.164 +install-binPROGRAMS uninstall-libSDLmixerincludeHEADERS \
   3.165 +install-libSDLmixerincludeHEADERS install-data-recursive \
   3.166  uninstall-data-recursive install-exec-recursive \
   3.167  uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
   3.168  all-recursive check-recursive installcheck-recursive info-recursive \
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/SDL_mixer.h	Fri Jan 14 18:59:44 2000 +0000
     4.3 @@ -0,0 +1,225 @@
     4.4 +/*
     4.5 +    MIXERLIB:  An audio mixer library based on the SDL library
     4.6 +    Copyright (C) 1997-1999  Sam Lantinga
     4.7 +
     4.8 +    This library is free software; you can redistribute it and/or
     4.9 +    modify it under the terms of the GNU Library General Public
    4.10 +    License as published by the Free Software Foundation; either
    4.11 +    version 2 of the License, or (at your option) any later version.
    4.12 +
    4.13 +    This library is distributed in the hope that it will be useful,
    4.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    4.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    4.16 +    Library General Public License for more details.
    4.17 +
    4.18 +    You should have received a copy of the GNU Library General Public
    4.19 +    License along with this library; if not, write to the Free
    4.20 +    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    4.21 +
    4.22 +    Sam Lantinga
    4.23 +    5635-34 Springhouse Dr.
    4.24 +    Pleasanton, CA 94588 (USA)
    4.25 +    slouken@devolution.com
    4.26 +*/
    4.27 +
    4.28 +#ifndef _MIXER_H_
    4.29 +#define _MIXER_H_
    4.30 +
    4.31 +#include "SDL_types.h"
    4.32 +#include "SDL_rwops.h"
    4.33 +#include "SDL_audio.h"
    4.34 +
    4.35 +#include <SDL/begin_code.h>
    4.36 +
    4.37 +/* Set up for C function definitions, even when using C++ */
    4.38 +#ifdef __cplusplus
    4.39 +extern "C" {
    4.40 +#endif
    4.41 +
    4.42 +/* The default mixer has 8 simultaneous mixing channels */
    4.43 +#ifndef MIX_CHANNELS
    4.44 +#define MIX_CHANNELS	8
    4.45 +#endif
    4.46 +
    4.47 +/* Good default values for a PC soundcard */
    4.48 +#define MIX_DEFAULT_FREQUENCY	22050
    4.49 +#define MIX_DEFAULT_FORMAT	AUDIO_S16
    4.50 +#define MIX_DEFAULT_CHANNELS	2
    4.51 +#define MIX_MAX_VOLUME		128	/* Volume of a chunk */
    4.52 +
    4.53 +/* The internal format for an audio chunk */
    4.54 +typedef struct {
    4.55 +	int allocated;
    4.56 +	Uint8 *abuf;
    4.57 +	Uint32 alen;
    4.58 +	Uint8 volume;		/* Per-sample volume, 0-128 */
    4.59 +} Mix_Chunk;
    4.60 +
    4.61 +/* The different fading types supported */
    4.62 +typedef enum {
    4.63 +	MIX_NO_FADING,
    4.64 +	MIX_FADING_OUT,
    4.65 +	MIX_FADING_IN
    4.66 +} Mix_Fading;
    4.67 +
    4.68 +/* The internal format for a music chunk interpreted via mikmod */
    4.69 +typedef struct _Mix_Music Mix_Music;
    4.70 +
    4.71 +/* Open the mixer with a certain audio format */
    4.72 +extern int Mix_OpenAudio(int frequency, Uint16 format, int channels,
    4.73 +							int chunksize);
    4.74 +
    4.75 +/* Dynamically change the number of channels managed by the mixer.
    4.76 +   If decreasing the number of channels, the upper channels are
    4.77 +   stopped.
    4.78 +   This function returns the new number of allocated channels.
    4.79 + */
    4.80 +extern int Mix_AllocateChannels(int numchans);
    4.81 +
    4.82 +/* Find out what the actual audio device parameters are.
    4.83 +   This function returns 1 if the audio has been opened, 0 otherwise.
    4.84 + */
    4.85 +extern int Mix_QuerySpec(int *frequency, Uint16 *format, int *channels);
    4.86 +
    4.87 +/* Load a wave file or a music (.mod .s3m .it .xm) file */
    4.88 +extern Mix_Chunk *Mix_LoadWAV_RW(SDL_RWops *src, int freesrc);
    4.89 +#define Mix_LoadWAV(file)	Mix_LoadWAV_RW(SDL_RWFromFile(file, "rb"), 1)
    4.90 +extern Mix_Music *Mix_LoadMUS(const char *file);
    4.91 +
    4.92 +/* Load a wave file of the mixer format from a memory buffer */
    4.93 +extern Mix_Chunk *Mix_QuickLoad_WAV(Uint8 *mem);
    4.94 +
    4.95 +/* Free an audio chunk previously loaded */
    4.96 +extern void Mix_FreeChunk(Mix_Chunk *chunk);
    4.97 +extern void Mix_FreeMusic(Mix_Music *music);
    4.98 +
    4.99 +/* Set a function that is called after all mixing is performed.
   4.100 +   This can be used to provide real-time visual display of the audio stream
   4.101 +   or add a custom mixer filter for the stream data.
   4.102 +*/
   4.103 +extern void Mix_SetPostMix(void (*mix_func)
   4.104 +                             (void *udata, Uint8 *stream, int len), void *arg);
   4.105 +
   4.106 +/* Add your own music player or additional mixer function.
   4.107 +   If 'mix_func' is NULL, the default music player is re-enabled.
   4.108 + */
   4.109 +extern void Mix_HookMusic(void (*mix_func)
   4.110 +                          (void *udata, Uint8 *stream, int len), void *arg);
   4.111 +
   4.112 +/* Add your own callback when the music has finished playing.
   4.113 + */
   4.114 +extern void Mix_HookMusicFinished(void (*music_finished)(void));
   4.115 +
   4.116 +/* Get a pointer to the user data for the current music hook */
   4.117 +extern void *Mix_GetMusicHookData(void);
   4.118 +
   4.119 +/* Reserve the first channels (0 -> n-1) for the application, i.e. don't allocate
   4.120 +   them dynamically to the next sample if requested with a -1 value below.
   4.121 +   Returns the number of reserved channels.
   4.122 + */
   4.123 +extern int Mix_ReserveChannels(int num);
   4.124 +
   4.125 +/* Channel grouping functions */
   4.126 +
   4.127 +/* Attach a tag to a channel. A tag can be assigned to several mixer
   4.128 +   channels, to form groups of channels.
   4.129 +   If 'tag' is -1, the tag is removed (actually -1 is the tag used to
   4.130 +   represent the group of all the channels).
   4.131 +   Returns true if everything was OK.
   4.132 + */
   4.133 +extern int Mix_GroupChannel(int which, int tag);
   4.134 +/* Assign several consecutive channels to a group */
   4.135 +extern int Mix_GroupChannels(int from, int to, int tag);
   4.136 +/* Finds the first available channel in a group of channels */
   4.137 +extern int Mix_GroupAvailable(int tag);
   4.138 +/* Returns the number of channels in a group. This is also a subtle
   4.139 +   way to get the total number of channels when 'tag' is -1
   4.140 + */
   4.141 +extern int Mix_GroupCount(int tag);
   4.142 +/* Finds the "oldest" sample playing in a group of channels */
   4.143 +extern int Mix_GroupOldest(int tag);
   4.144 +/* Finds the "most recent" (i.e. last) sample playing in a group of channels */
   4.145 +extern int Mix_GroupNewer(int tag);
   4.146 +
   4.147 +/* Play an audio chunk on a specific channel.
   4.148 +   If the specified channel is -1, play on the first free channel.
   4.149 +   If 'loops' is greater than zero, loop the sound that many times.
   4.150 +   If 'loops' is -1, loop inifinitely (~65000 times).
   4.151 +   Returns which channel was used to play the sound.
   4.152 +*/
   4.153 +#define Mix_PlayChannel(channel,chunk,loops) Mix_PlayChannelTimed(channel,chunk,loops,-1)
   4.154 +/* The same as above, but the sound is played at most 'ticks' milliseconds */
   4.155 +extern int Mix_PlayChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ticks);
   4.156 +extern int Mix_PlayMusic(Mix_Music *music, int loops);
   4.157 +
   4.158 +/* Fade in music or a channel over "ms" milliseconds, same semantics as the "Play" functions */
   4.159 +extern int Mix_FadeInMusic(Mix_Music *music, int loops, int ms);
   4.160 +#define Mix_FadeInChannel(channel,chunk,loops,ms) Mix_FadeInChannelTimed(channel,chunk,loops,ms,-1)
   4.161 +extern int Mix_FadeInChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ms, int ticks);
   4.162 +
   4.163 +/* Set the volume in the range of 0-128 of a specific channel or chunk.
   4.164 +   If the specified channel is -1, set volume for all channels.
   4.165 +   Returns the original volume.
   4.166 +   If the specified volume is -1, just return the current volume.
   4.167 +*/
   4.168 +extern int Mix_Volume(int channel, int volume);
   4.169 +extern int Mix_VolumeChunk(Mix_Chunk *chunk, int volume);
   4.170 +extern int Mix_VolumeMusic(int volume);
   4.171 +
   4.172 +/* Halt playing of a particular channel */
   4.173 +extern int Mix_HaltChannel(int channel);
   4.174 +extern int Mix_HaltGroup(int tag);
   4.175 +extern int Mix_HaltMusic(void);
   4.176 +
   4.177 +/* Change the expiration delay for a particular channel.
   4.178 +   The sample will stop playing after the 'ticks' milliseconds have elapsed,
   4.179 +   or remove the expiration if 'ticks' is -1
   4.180 +*/
   4.181 +extern int Mix_ExpireChannel(int channel, int ticks);
   4.182 +
   4.183 +/* Halt a channel, fading it out progressively till it's silent
   4.184 +   The ms parameter indicates the number of milliseconds the fading
   4.185 +   will take.
   4.186 + */
   4.187 +extern int Mix_FadeOutChannel(int which, int ms);
   4.188 +extern int Mix_FadeOutGroup(int tag, int ms);
   4.189 +extern int Mix_FadeOutMusic(int ms);
   4.190 +
   4.191 +/* Query the fading status of a channel */
   4.192 +extern Mix_Fading Mix_FadingMusic(void);
   4.193 +extern Mix_Fading Mix_FadingChannel(int which);
   4.194 +
   4.195 +/* Pause/Resume a particular channel */
   4.196 +extern void Mix_Pause(int channel);
   4.197 +extern void Mix_Resume(int channel);
   4.198 +extern int  Mix_Paused(int channel);
   4.199 +
   4.200 +/* Pause/Resume the music stream */
   4.201 +extern void Mix_PauseMusic(void);
   4.202 +extern void Mix_ResumeMusic(void);
   4.203 +extern void Mix_RewindMusic(void);
   4.204 +extern int  Mix_PausedMusic(void);
   4.205 +
   4.206 +/* Check the status of a specific channel.
   4.207 +   If the specified channel is -1, check all channels.
   4.208 +*/
   4.209 +extern int Mix_Playing(int channel);
   4.210 +extern int Mix_PlayingMusic(void);
   4.211 +
   4.212 +/* Stop music and set external music playback command */
   4.213 +extern int Mix_SetMusicCMD(const char *command);
   4.214 +
   4.215 +/* Close the mixer, halting all playing audio */
   4.216 +extern void Mix_CloseAudio(void);
   4.217 +
   4.218 +/* We'll use SDL for reporting errors */
   4.219 +#define Mix_SetError	SDL_SetError
   4.220 +#define Mix_GetError	SDL_GetError
   4.221 +
   4.222 +/* Ends C function definitions when using C++ */
   4.223 +#ifdef __cplusplus
   4.224 +};
   4.225 +#endif
   4.226 +#include <SDL/close_code.h>
   4.227 +
   4.228 +#endif /* _MIXER_H_ */
     5.1 --- a/configure	Mon Jan 10 21:40:35 2000 +0000
     5.2 +++ b/configure	Fri Jan 14 18:59:44 2000 +0000
     5.3 @@ -753,7 +753,7 @@
     5.4  
     5.5  
     5.6  
     5.7 -PACKAGE=mixer
     5.8 +PACKAGE=SDLmixer
     5.9  
    5.10  VERSION=$VERSION
    5.11  
     6.1 --- a/configure.in	Mon Jan 10 21:40:35 2000 +0000
     6.2 +++ b/configure.in	Fri Jan 14 18:59:44 2000 +0000
     6.3 @@ -37,7 +37,7 @@
     6.4  AC_SUBST(LT_AGE)
     6.5  
     6.6  dnl Setup for automake
     6.7 -AM_INIT_AUTOMAKE(mixer, $VERSION)
     6.8 +AM_INIT_AUTOMAKE(SDLmixer, $VERSION)
     6.9  
    6.10  dnl Check for tools
    6.11  
     7.1 --- a/mixer.c	Mon Jan 10 21:40:35 2000 +0000
     7.2 +++ b/mixer.c	Fri Jan 14 18:59:44 2000 +0000
     7.3 @@ -32,7 +32,7 @@
     7.4  #include "SDL_endian.h"
     7.5  #include "SDL_timer.h"
     7.6  
     7.7 -#include "mixer.h"
     7.8 +#include "SDL_mixer.h"
     7.9  
    7.10  static int audio_opened = 0;
    7.11  
     8.1 --- a/mixer.h	Mon Jan 10 21:40:35 2000 +0000
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,225 +0,0 @@
     8.4 -/*
     8.5 -    MIXERLIB:  An audio mixer library based on the SDL library
     8.6 -    Copyright (C) 1997-1999  Sam Lantinga
     8.7 -
     8.8 -    This library is free software; you can redistribute it and/or
     8.9 -    modify it under the terms of the GNU Library General Public
    8.10 -    License as published by the Free Software Foundation; either
    8.11 -    version 2 of the License, or (at your option) any later version.
    8.12 -
    8.13 -    This library is distributed in the hope that it will be useful,
    8.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    8.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    8.16 -    Library General Public License for more details.
    8.17 -
    8.18 -    You should have received a copy of the GNU Library General Public
    8.19 -    License along with this library; if not, write to the Free
    8.20 -    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    8.21 -
    8.22 -    Sam Lantinga
    8.23 -    5635-34 Springhouse Dr.
    8.24 -    Pleasanton, CA 94588 (USA)
    8.25 -    slouken@devolution.com
    8.26 -*/
    8.27 -
    8.28 -#ifndef _MIXER_H_
    8.29 -#define _MIXER_H_
    8.30 -
    8.31 -#include "SDL_types.h"
    8.32 -#include "SDL_rwops.h"
    8.33 -#include "SDL_audio.h"
    8.34 -
    8.35 -#include <SDL/begin_code.h>
    8.36 -
    8.37 -/* Set up for C function definitions, even when using C++ */
    8.38 -#ifdef __cplusplus
    8.39 -extern "C" {
    8.40 -#endif
    8.41 -
    8.42 -/* The default mixer has 8 simultaneous mixing channels */
    8.43 -#ifndef MIX_CHANNELS
    8.44 -#define MIX_CHANNELS	8
    8.45 -#endif
    8.46 -
    8.47 -/* Good default values for a PC soundcard */
    8.48 -#define MIX_DEFAULT_FREQUENCY	22050
    8.49 -#define MIX_DEFAULT_FORMAT	AUDIO_S16
    8.50 -#define MIX_DEFAULT_CHANNELS	2
    8.51 -#define MIX_MAX_VOLUME		128	/* Volume of a chunk */
    8.52 -
    8.53 -/* The internal format for an audio chunk */
    8.54 -typedef struct {
    8.55 -	int allocated;
    8.56 -	Uint8 *abuf;
    8.57 -	Uint32 alen;
    8.58 -	Uint8 volume;		/* Per-sample volume, 0-128 */
    8.59 -} Mix_Chunk;
    8.60 -
    8.61 -/* The different fading types supported */
    8.62 -typedef enum {
    8.63 -	MIX_NO_FADING,
    8.64 -	MIX_FADING_OUT,
    8.65 -	MIX_FADING_IN
    8.66 -} Mix_Fading;
    8.67 -
    8.68 -/* The internal format for a music chunk interpreted via mikmod */
    8.69 -typedef struct _Mix_Music Mix_Music;
    8.70 -
    8.71 -/* Open the mixer with a certain audio format */
    8.72 -extern int Mix_OpenAudio(int frequency, Uint16 format, int channels,
    8.73 -							int chunksize);
    8.74 -
    8.75 -/* Dynamically change the number of channels managed by the mixer.
    8.76 -   If decreasing the number of channels, the upper channels are
    8.77 -   stopped.
    8.78 -   This function returns the new number of allocated channels.
    8.79 - */
    8.80 -extern int Mix_AllocateChannels(int numchans);
    8.81 -
    8.82 -/* Find out what the actual audio device parameters are.
    8.83 -   This function returns 1 if the audio has been opened, 0 otherwise.
    8.84 - */
    8.85 -extern int Mix_QuerySpec(int *frequency, Uint16 *format, int *channels);
    8.86 -
    8.87 -/* Load a wave file or a music (.mod .s3m .it .xm) file */
    8.88 -extern Mix_Chunk *Mix_LoadWAV_RW(SDL_RWops *src, int freesrc);
    8.89 -#define Mix_LoadWAV(file)	Mix_LoadWAV_RW(SDL_RWFromFile(file, "rb"), 1)
    8.90 -extern Mix_Music *Mix_LoadMUS(const char *file);
    8.91 -
    8.92 -/* Load a wave file of the mixer format from a memory buffer */
    8.93 -extern Mix_Chunk *Mix_QuickLoad_WAV(Uint8 *mem);
    8.94 -
    8.95 -/* Free an audio chunk previously loaded */
    8.96 -extern void Mix_FreeChunk(Mix_Chunk *chunk);
    8.97 -extern void Mix_FreeMusic(Mix_Music *music);
    8.98 -
    8.99 -/* Set a function that is called after all mixing is performed.
   8.100 -   This can be used to provide real-time visual display of the audio stream
   8.101 -   or add a custom mixer filter for the stream data.
   8.102 -*/
   8.103 -extern void Mix_SetPostMix(void (*mix_func)
   8.104 -                             (void *udata, Uint8 *stream, int len), void *arg);
   8.105 -
   8.106 -/* Add your own music player or additional mixer function.
   8.107 -   If 'mix_func' is NULL, the default music player is re-enabled.
   8.108 - */
   8.109 -extern void Mix_HookMusic(void (*mix_func)
   8.110 -                          (void *udata, Uint8 *stream, int len), void *arg);
   8.111 -
   8.112 -/* Add your own callback when the music has finished playing.
   8.113 - */
   8.114 -extern void Mix_HookMusicFinished(void (*music_finished)(void));
   8.115 -
   8.116 -/* Get a pointer to the user data for the current music hook */
   8.117 -extern void *Mix_GetMusicHookData(void);
   8.118 -
   8.119 -/* Reserve the first channels (0 -> n-1) for the application, i.e. don't allocate
   8.120 -   them dynamically to the next sample if requested with a -1 value below.
   8.121 -   Returns the number of reserved channels.
   8.122 - */
   8.123 -extern int Mix_ReserveChannels(int num);
   8.124 -
   8.125 -/* Channel grouping functions */
   8.126 -
   8.127 -/* Attach a tag to a channel. A tag can be assigned to several mixer
   8.128 -   channels, to form groups of channels.
   8.129 -   If 'tag' is -1, the tag is removed (actually -1 is the tag used to
   8.130 -   represent the group of all the channels).
   8.131 -   Returns true if everything was OK.
   8.132 - */
   8.133 -extern int Mix_GroupChannel(int which, int tag);
   8.134 -/* Assign several consecutive channels to a group */
   8.135 -extern int Mix_GroupChannels(int from, int to, int tag);
   8.136 -/* Finds the first available channel in a group of channels */
   8.137 -extern int Mix_GroupAvailable(int tag);
   8.138 -/* Returns the number of channels in a group. This is also a subtle
   8.139 -   way to get the total number of channels when 'tag' is -1
   8.140 - */
   8.141 -extern int Mix_GroupCount(int tag);
   8.142 -/* Finds the "oldest" sample playing in a group of channels */
   8.143 -extern int Mix_GroupOldest(int tag);
   8.144 -/* Finds the "most recent" (i.e. last) sample playing in a group of channels */
   8.145 -extern int Mix_GroupNewer(int tag);
   8.146 -
   8.147 -/* Play an audio chunk on a specific channel.
   8.148 -   If the specified channel is -1, play on the first free channel.
   8.149 -   If 'loops' is greater than zero, loop the sound that many times.
   8.150 -   If 'loops' is -1, loop inifinitely (~65000 times).
   8.151 -   Returns which channel was used to play the sound.
   8.152 -*/
   8.153 -#define Mix_PlayChannel(channel,chunk,loops) Mix_PlayChannelTimed(channel,chunk,loops,-1)
   8.154 -/* The same as above, but the sound is played at most 'ticks' milliseconds */
   8.155 -extern int Mix_PlayChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ticks);
   8.156 -extern int Mix_PlayMusic(Mix_Music *music, int loops);
   8.157 -
   8.158 -/* Fade in music or a channel over "ms" milliseconds, same semantics as the "Play" functions */
   8.159 -extern int Mix_FadeInMusic(Mix_Music *music, int loops, int ms);
   8.160 -#define Mix_FadeInChannel(channel,chunk,loops,ms) Mix_FadeInChannelTimed(channel,chunk,loops,ms,-1)
   8.161 -extern int Mix_FadeInChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ms, int ticks);
   8.162 -
   8.163 -/* Set the volume in the range of 0-128 of a specific channel or chunk.
   8.164 -   If the specified channel is -1, set volume for all channels.
   8.165 -   Returns the original volume.
   8.166 -   If the specified volume is -1, just return the current volume.
   8.167 -*/
   8.168 -extern int Mix_Volume(int channel, int volume);
   8.169 -extern int Mix_VolumeChunk(Mix_Chunk *chunk, int volume);
   8.170 -extern int Mix_VolumeMusic(int volume);
   8.171 -
   8.172 -/* Halt playing of a particular channel */
   8.173 -extern int Mix_HaltChannel(int channel);
   8.174 -extern int Mix_HaltGroup(int tag);
   8.175 -extern int Mix_HaltMusic(void);
   8.176 -
   8.177 -/* Change the expiration delay for a particular channel.
   8.178 -   The sample will stop playing after the 'ticks' milliseconds have elapsed,
   8.179 -   or remove the expiration if 'ticks' is -1
   8.180 -*/
   8.181 -extern int Mix_ExpireChannel(int channel, int ticks);
   8.182 -
   8.183 -/* Halt a channel, fading it out progressively till it's silent
   8.184 -   The ms parameter indicates the number of milliseconds the fading
   8.185 -   will take.
   8.186 - */
   8.187 -extern int Mix_FadeOutChannel(int which, int ms);
   8.188 -extern int Mix_FadeOutGroup(int tag, int ms);
   8.189 -extern int Mix_FadeOutMusic(int ms);
   8.190 -
   8.191 -/* Query the fading status of a channel */
   8.192 -extern Mix_Fading Mix_FadingMusic(void);
   8.193 -extern Mix_Fading Mix_FadingChannel(int which);
   8.194 -
   8.195 -/* Pause/Resume a particular channel */
   8.196 -extern void Mix_Pause(int channel);
   8.197 -extern void Mix_Resume(int channel);
   8.198 -extern int  Mix_Paused(int channel);
   8.199 -
   8.200 -/* Pause/Resume the music stream */
   8.201 -extern void Mix_PauseMusic(void);
   8.202 -extern void Mix_ResumeMusic(void);
   8.203 -extern void Mix_RewindMusic(void);
   8.204 -extern int  Mix_PausedMusic(void);
   8.205 -
   8.206 -/* Check the status of a specific channel.
   8.207 -   If the specified channel is -1, check all channels.
   8.208 -*/
   8.209 -extern int Mix_Playing(int channel);
   8.210 -extern int Mix_PlayingMusic(void);
   8.211 -
   8.212 -/* Stop music and set external music playback command */
   8.213 -extern int Mix_SetMusicCMD(const char *command);
   8.214 -
   8.215 -/* Close the mixer, halting all playing audio */
   8.216 -extern void Mix_CloseAudio(void);
   8.217 -
   8.218 -/* We'll use SDL for reporting errors */
   8.219 -#define Mix_SetError	SDL_SetError
   8.220 -#define Mix_GetError	SDL_GetError
   8.221 -
   8.222 -/* Ends C function definitions when using C++ */
   8.223 -#ifdef __cplusplus
   8.224 -};
   8.225 -#endif
   8.226 -#include <SDL/close_code.h>
   8.227 -
   8.228 -#endif /* _MIXER_H_ */
     9.1 --- a/music.c	Mon Jan 10 21:40:35 2000 +0000
     9.2 +++ b/music.c	Fri Jan 14 18:59:44 2000 +0000
     9.3 @@ -28,7 +28,7 @@
     9.4  #include "SDL_audio.h"
     9.5  #include "SDL_timer.h"
     9.6  
     9.7 -#include "mixer.h"
     9.8 +#include "SDL_mixer.h"
     9.9  
    9.10  /* The music command hack is UNIX specific */
    9.11  #ifndef unix
    10.1 --- a/music_cmd.c	Mon Jan 10 21:40:35 2000 +0000
    10.2 +++ b/music_cmd.c	Fri Jan 14 18:59:44 2000 +0000
    10.3 @@ -34,7 +34,7 @@
    10.4  #include <string.h>
    10.5  #include <signal.h>
    10.6  
    10.7 -#include "mixer.h"
    10.8 +#include "SDL_mixer.h"
    10.9  #include "music_cmd.h"
   10.10  
   10.11  /* Unimplemented */
    11.1 --- a/playmus.c	Mon Jan 10 21:40:35 2000 +0000
    11.2 +++ b/playmus.c	Fri Jan 14 18:59:44 2000 +0000
    11.3 @@ -31,7 +31,7 @@
    11.4  #endif
    11.5  
    11.6  #include "SDL.h"
    11.7 -#include "mixer.h"
    11.8 +#include "SDL_mixer.h"
    11.9  
   11.10  
   11.11  static int audio_open = 0;
    12.1 --- a/playwave.c	Mon Jan 10 21:40:35 2000 +0000
    12.2 +++ b/playwave.c	Fri Jan 14 18:59:44 2000 +0000
    12.3 @@ -31,7 +31,7 @@
    12.4  #endif
    12.5  
    12.6  #include "SDL.h"
    12.7 -#include "mixer.h"
    12.8 +#include "SDL_mixer.h"
    12.9  
   12.10  
   12.11  static int audio_open = 0;