Skip to content
Permalink
Browse files

*** empty log message ***

  • Loading branch information
slouken committed Dec 17, 2001
1 parent 0cca950 commit f1d51688a76a7203326b35145e34f74a61d9917e
Showing with 22 additions and 43 deletions.
  1. +0 −8 configure.in
  2. +7 −5 load_aiff.c
  3. +0 −13 load_voc.c
  4. +7 −7 mikmod/virtch_common.c
  5. +0 −2 mixer.c
  6. +2 −2 music.c
  7. +1 −1 native_midi/native_midi_mac.c
  8. +1 −1 timidity/playmidi.c
  9. +4 −4 wavestream.c
@@ -90,14 +90,6 @@ CFLAGS="$CFLAGS -DUSE_RWOPS"

dnl Check command-line options

dnl rcg06052001 VOC file support by Ryan C. Gordon (icculus@linuxgames.com).
AC_ARG_ENABLE(samples-voc,
[ --enable-samples-voc enable support for VOC samples [default=yes]],
, enable_samples_voc=yes)
if test x$enable_samples_voc = xyes; then
CFLAGS="$CFLAGS -DVOC_SAMPLES"
fi

AC_ARG_ENABLE(music-cmd,
[ --enable-music-cmd support an external music player [default=yes]],
, enable_music_cmd=yes)
@@ -26,8 +26,10 @@

/* $Id$ */

#include <stdlib.h>
#include <string.h>

#include "SDL_endian.h"
#include "SDL_mixer.h"
#include "load_aiff.h"

@@ -62,7 +64,7 @@ SDL_AudioSpec *Mix_LoadAIFF_RW (SDL_RWops *src, int freesrc,
int was_error;
int found_SSND;
int found_COMM;
long start;
long start = 0;

Uint32 chunk_type;
Uint32 chunk_length;
@@ -77,11 +79,11 @@ SDL_AudioSpec *Mix_LoadAIFF_RW (SDL_RWops *src, int freesrc,
Uint32 blocksize;

/* COMM format chunk */
Uint16 channels;
Uint32 numsamples;
Uint16 samplesize;
Uint16 channels = 0;
Uint32 numsamples = 0;
Uint16 samplesize = 0;
Uint8 sane_freq[10];
Uint32 frequency;
Uint32 frequency = 0;

/* Make sure we are passed a valid data source */
was_error = 0;
@@ -40,8 +40,6 @@
#include "SDL_mixer.h"
#include "load_voc.h"

#ifdef VOC_SAMPLES

/* Private data for VOC file */
typedef struct vocstuff {
Uint32 rest; /* bytes remaining in current block */
@@ -458,15 +456,4 @@ SDL_AudioSpec *Mix_LoadVOC_RW (SDL_RWops *src, int freesrc,
return(spec);
} /* Mix_LoadVOC_RW */

#else

SDL_AudioSpec *Mix_LoadVOC_RW (SDL_RWops *src, int freesrc,
SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len)
{
SDL_SetError("VOC file loading not supported");
return(NULL);
}

#endif /* VOC_SAMPLES */

/* end of load_voc.c ... */
@@ -105,22 +105,22 @@ static ULONG (*VC_VoiceRealVolume_ptr)(UBYTE);

#ifdef __STDC__
#define VC_PROC0(suffix) \
void VC_##suffix##(void) { VC_##suffix##_ptr(); }
void VC_##suffix (void) { VC_##suffix##_ptr(); }

#define VC_FUNC0(suffix,ret) \
ret VC_##suffix##(void) { return VC_##suffix##_ptr(); }
ret VC_##suffix (void) { return VC_##suffix##_ptr(); }

#define VC_PROC1(suffix,typ1) \
void VC_##suffix##(typ1 a) { VC_##suffix##_ptr(a); }
void VC_##suffix (typ1 a) { VC_##suffix##_ptr(a); }

#define VC_FUNC1(suffix,ret,typ1) \
ret VC_##suffix##(typ1 a) { return VC_##suffix##_ptr(a); }
ret VC_##suffix (typ1 a) { return VC_##suffix##_ptr(a); }

#define VC_PROC2(suffix,typ1,typ2) \
void VC_##suffix##(typ1 a,typ2 b) { VC_##suffix##_ptr(a,b); }
void VC_##suffix (typ1 a,typ2 b) { VC_##suffix##_ptr(a,b); }

#define VC_FUNC2(suffix,ret,typ1,typ2) \
ret VC_##suffix##(typ1 a,typ2 b) { return VC_##suffix##_ptr(a,b); }
ret VC_##suffix (typ1 a,typ2 b) { return VC_##suffix##_ptr(a,b); }
#else
#define VC_PROC0(suffix) \
void VC_/**/suffix/**/(void) { VC_/**/suffix/**/_ptr(); }
@@ -141,7 +141,7 @@ void VC_/**/suffix/**/(typ1 a,typ2 b) { VC_/**/suffix/**/_ptr(a,b); }
ret VC_/**/suffix/**/(typ1 a,typ2 b) { return VC_/**/suffix/**/_ptr(a,b); }
#endif

VC_FUNC0(Init,BOOL)
VC_FUNC0(Init,BOOL);
VC_PROC0(Exit)
VC_FUNC0(SetNumVoices,BOOL)
VC_FUNC1(SampleSpace,ULONG,int)
@@ -105,8 +105,6 @@ const SDL_version *Mix_Linked_Version(void)
/* rcg06122001 Cleanup effect callbacks. */
static void Mix_ChannelDonePlaying(int channel)
{
effect_info *i = NULL;

if (channel_done_callback) {
channel_done_callback(channel);
}
@@ -81,7 +81,6 @@ int volatile music_active = 1;
static int volatile music_stopped = 0;
static int music_loops = 0;
static char *music_cmd = NULL;
static int samplesize;
static Mix_Music * volatile music_playing = NULL;
static int music_volume = MIX_MAX_VOLUME;
static int music_swap8;
@@ -130,6 +129,7 @@ struct _Mix_Music {
#ifdef MID_MUSIC
#ifdef USE_TIMIDITY_MIDI
static int timidity_ok;
static int samplesize;
#endif
#ifdef USE_NATIVE_MIDI
static int native_midi_ok;
@@ -338,7 +338,7 @@ int open_music(SDL_AudioSpec *mixer)
#endif
#ifdef MID_MUSIC
#ifdef USE_TIMIDITY_MIDI
samplesize = mixer->size/mixer->samples;
samplesize = mixer->size / mixer->samples;
if ( Timidity_Init(mixer->freq, mixer->format,
mixer->channels, mixer->samples) == 0 ) {
timidity_ok = 1;
@@ -498,7 +498,7 @@ Uint32 *BuildTuneSequence(MIDIEvent *evntlist, int ppqn, int part_poly_max[32],
but for QTMA, we specify it as a 8.8 fixed point of semitones
TODO: detect "pitch bend range changes" & honor them!
*/
bend = eventPos->data[0] & 0x7f | (eventPos->data[1] & 0x7f) << 7;
bend = (eventPos->data[0] & 0x7f) | ((eventPos->data[1] & 0x7f) << 7);

/* "Center" the bend */
bend -= 0x2000;
@@ -761,7 +761,7 @@ static int compute_data(void *stream, int32 count)

int Timidity_PlaySome(void *stream, int samples)
{
int rc;
int rc = RC_NONE;
int32 end_sample;

if ( ! midi_playing ) {
@@ -446,11 +446,11 @@ static FILE *LoadAIFFStream (const char *file, SDL_AudioSpec *spec,
Uint32 offset;
Uint32 blocksize;
/* COMM format chunk */
Uint16 channels;
Uint32 numsamples;
Uint16 samplesize;
Uint16 channels = 0;
Uint32 numsamples = 0;
Uint16 samplesize = 0;
Uint8 sane_freq[10];
Uint32 frequency;
Uint32 frequency = 0;


/* Make sure we are passed a valid data source */

0 comments on commit f1d5168

Please sign in to comment.