playwave.c
author Sam Lantinga <slouken@libsdl.org>
Sat, 31 Dec 2011 10:27:48 -0500
changeset 518 8bc9b5fd2aae
parent 503 0c77794aaef2
child 601 05123263dab3
child 887 e49459791ae8
permissions -rw-r--r--
Happy New Year!
slouken@0
     1
/*
slouken@518
     2
  PLAYWAVE:  A test application for the SDL mixer library.
slouken@518
     3
  Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
slouken@0
     4
slouken@518
     5
  This software is provided 'as-is', without any express or implied
slouken@518
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@518
     7
  arising from the use of this software.
slouken@0
     8
slouken@518
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@518
    10
  including commercial applications, and to alter it and redistribute it
slouken@518
    11
  freely, subject to the following restrictions:
slouken@0
    12
slouken@518
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@518
    14
     claim that you wrote the original software. If you use this software
slouken@518
    15
     in a product, an acknowledgment in the product documentation would be
slouken@518
    16
     appreciated but is not required.
slouken@518
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@518
    18
     misrepresented as being the original software.
slouken@518
    19
  3. This notice may not be removed or altered from any source distribution.
slouken@0
    20
*/
slouken@0
    21
slouken@140
    22
/* $Id$ */
slouken@138
    23
slouken@0
    24
#include <stdlib.h>
slouken@0
    25
#include <stdio.h>
slouken@0
    26
#include <string.h>
slouken@488
    27
slouken@47
    28
#ifdef unix
slouken@0
    29
#include <unistd.h>
slouken@0
    30
#endif
slouken@0
    31
slouken@24
    32
#include "SDL.h"
slouken@34
    33
#include "SDL_mixer.h"
slouken@0
    34
slouken@503
    35
#ifdef HAVE_SIGNAL_H
slouken@503
    36
#include <signal.h>
slouken@503
    37
#endif
slouken@503
    38
slouken@0
    39
slouken@113
    40
/*
slouken@113
    41
 * rcg06132001 various mixer tests. Define the ones you want.
slouken@113
    42
 */
icculus@391
    43
/*#define TEST_MIX_DECODERS*/
slouken@127
    44
/*#define TEST_MIX_VERSIONS*/
slouken@127
    45
/*#define TEST_MIX_CHANNELFINISHED*/
slouken@113
    46
/*#define TEST_MIX_PANNING*/
slouken@113
    47
/*#define TEST_MIX_DISTANCE*/
slouken@127
    48
/*#define TEST_MIX_POSITION*/
slouken@113
    49
slouken@113
    50
slouken@113
    51
#if (defined TEST_MIX_POSITION)
slouken@113
    52
slouken@113
    53
#if (defined TEST_MIX_PANNING)
slouken@113
    54
#error TEST_MIX_POSITION interferes with TEST_MIX_PANNING.
slouken@113
    55
#endif
slouken@113
    56
slouken@113
    57
#if (defined TEST_MIX_DISTANCE)
slouken@113
    58
#error TEST_MIX_POSITION interferes with TEST_MIX_DISTANCE.
slouken@113
    59
#endif
slouken@113
    60
slouken@113
    61
#endif
slouken@113
    62
slouken@113
    63
slouken@113
    64
/* rcg06192001 for debugging purposes. */
slouken@113
    65
static void output_test_warnings(void)
slouken@113
    66
{
slouken@113
    67
#if (defined TEST_MIX_CHANNELFINISHED)
slouken@113
    68
	fprintf(stderr, "Warning: TEST_MIX_CHANNELFINISHED is enabled in this binary...\n");
slouken@113
    69
#endif
slouken@113
    70
#if (defined TEST_MIX_PANNING)
slouken@113
    71
	fprintf(stderr, "Warning: TEST_MIX_PANNING is enabled in this binary...\n");
slouken@113
    72
#endif
slouken@113
    73
#if (defined TEST_MIX_VERSIONS)
slouken@113
    74
	fprintf(stderr, "Warning: TEST_MIX_VERSIONS is enabled in this binary...\n");
slouken@113
    75
#endif
slouken@113
    76
#if (defined TEST_MIX_DISTANCE)
slouken@113
    77
	fprintf(stderr, "Warning: TEST_MIX_DISTANCE is enabled in this binary...\n");
slouken@113
    78
#endif
slouken@113
    79
#if (defined TEST_MIX_POSITION)
slouken@113
    80
	fprintf(stderr, "Warning: TEST_MIX_POSITION is enabled in this binary...\n");
slouken@113
    81
#endif
slouken@113
    82
}
slouken@113
    83
slouken@113
    84
slouken@0
    85
static int audio_open = 0;
slouken@0
    86
static Mix_Chunk *wave = NULL;
slouken@0
    87
icculus@390
    88
/* rcg06042009 Report available decoders. */
icculus@390
    89
#if (defined TEST_MIX_DECODERS)
icculus@390
    90
static void report_decoders(void)
icculus@390
    91
{
icculus@390
    92
	int i, total;
icculus@390
    93
icculus@390
    94
    printf("Supported decoders...\n");
slouken@466
    95
	total = Mix_GetNumChunkDecoders();
icculus@390
    96
	for (i = 0; i < total; i++) {
icculus@390
    97
		fprintf(stderr, " - chunk decoder: %s\n", Mix_GetChunkDecoder(i));
icculus@390
    98
	}
icculus@390
    99
slouken@466
   100
	total = Mix_GetNumMusicDecoders();
icculus@390
   101
	for (i = 0; i < total; i++) {
icculus@390
   102
		fprintf(stderr, " - music decoder: %s\n", Mix_GetMusicDecoder(i));
icculus@390
   103
	}
icculus@390
   104
}
icculus@390
   105
#endif
slouken@113
   106
slouken@113
   107
/* rcg06192001 Check new Mixer version API. */
slouken@113
   108
#if (defined TEST_MIX_VERSIONS)
slouken@113
   109
static void output_versions(const char *libname, const SDL_version *compiled,
slouken@113
   110
							const SDL_version *linked)
slouken@113
   111
{
slouken@113
   112
	fprintf(stderr,
slouken@113
   113
			"This program was compiled against %s %d.%d.%d,\n"
slouken@113
   114
			" and is dynamically linked to %d.%d.%d.\n", libname,
slouken@113
   115
			compiled->major, compiled->minor, compiled->patch,
slouken@113
   116
			linked->major, linked->minor, linked->patch);
slouken@113
   117
}
slouken@113
   118
slouken@113
   119
static void test_versions(void)
slouken@113
   120
{
slouken@113
   121
	SDL_version compiled;
slouken@113
   122
	const SDL_version *linked;
slouken@113
   123
slouken@113
   124
	SDL_VERSION(&compiled);
slouken@113
   125
	linked = SDL_Linked_Version();
slouken@113
   126
	output_versions("SDL", &compiled, linked);
slouken@113
   127
slouken@227
   128
	SDL_MIXER_VERSION(&compiled);
slouken@113
   129
	linked = Mix_Linked_Version();
slouken@113
   130
	output_versions("SDL_mixer", &compiled, linked);
slouken@113
   131
}
slouken@113
   132
#endif
slouken@113
   133
slouken@113
   134
slouken@113
   135
#ifdef TEST_MIX_CHANNELFINISHED  /* rcg06072001 */
slouken@113
   136
static volatile int channel_is_done = 0;
slouken@113
   137
static void channel_complete_callback(int chan)
slouken@113
   138
{
slouken@113
   139
	Mix_Chunk *done_chunk = Mix_GetChunk(chan);
slouken@113
   140
	fprintf(stderr, "We were just alerted that Mixer channel #%d is done.\n", chan);
slouken@113
   141
	fprintf(stderr, "Channel's chunk pointer is (%p).\n", done_chunk);
slouken@113
   142
	fprintf(stderr, " Which %s correct.\n", (wave == done_chunk) ? "is" : "is NOT");
slouken@113
   143
	channel_is_done = 1;
slouken@113
   144
}
slouken@113
   145
#endif
slouken@113
   146
slouken@113
   147
slouken@113
   148
/* rcg06192001 abstract this out for testing purposes. */
slouken@113
   149
static int still_playing(void)
slouken@113
   150
{
slouken@113
   151
#ifdef TEST_MIX_CHANNELFINISHED
slouken@113
   152
	return(!channel_is_done);
slouken@113
   153
#else
slouken@113
   154
	return(Mix_Playing(0));
slouken@113
   155
#endif
slouken@113
   156
}
slouken@113
   157
slouken@113
   158
slouken@113
   159
#if (defined TEST_MIX_PANNING)
slouken@113
   160
static void do_panning_update(void)
slouken@113
   161
{
slouken@113
   162
	static Uint8 leftvol = 128;
slouken@113
   163
	static Uint8 rightvol = 128;
slouken@113
   164
	static Uint8 leftincr = -1;
slouken@113
   165
	static Uint8 rightincr = 1;
slouken@113
   166
	static int panningok = 1;
slouken@113
   167
	static Uint32 next_panning_update = 0;
slouken@113
   168
slouken@113
   169
	if ((panningok) && (SDL_GetTicks() >= next_panning_update)) {
slouken@113
   170
		panningok = Mix_SetPanning(0, leftvol, rightvol);
slouken@113
   171
		if (!panningok) {
slouken@113
   172
			fprintf(stderr, "Mix_SetPanning(0, %d, %d) failed!\n",
slouken@113
   173
					(int) leftvol, (int) rightvol);
slouken@113
   174
			fprintf(stderr, "Reason: [%s].\n", Mix_GetError());
slouken@113
   175
		}
slouken@113
   176
slouken@113
   177
		if ((leftvol == 255) || (leftvol == 0)) {
slouken@113
   178
			if (leftvol == 255)
slouken@113
   179
				printf("All the way in the left speaker.\n");
slouken@113
   180
				leftincr *= -1;
slouken@113
   181
		}
slouken@113
   182
slouken@113
   183
		if ((rightvol == 255) || (rightvol == 0)) {
slouken@113
   184
			if (rightvol == 255)
slouken@113
   185
				printf("All the way in the right speaker.\n");
slouken@113
   186
			rightincr *= -1;
slouken@113
   187
		}
slouken@113
   188
slouken@113
   189
		leftvol += leftincr;
slouken@113
   190
		rightvol += rightincr;
slouken@113
   191
		next_panning_update = SDL_GetTicks() + 10;
slouken@113
   192
	}
slouken@113
   193
}
slouken@113
   194
#endif
slouken@113
   195
slouken@113
   196
slouken@113
   197
#if (defined TEST_MIX_DISTANCE)
slouken@113
   198
static void do_distance_update(void)
slouken@113
   199
{
slouken@113
   200
	static Uint8 distance = 1;
slouken@113
   201
	static Uint8 distincr = 1;
slouken@113
   202
	static int distanceok = 1;
slouken@113
   203
	static Uint32 next_distance_update = 0;
slouken@113
   204
slouken@113
   205
	if ((distanceok) && (SDL_GetTicks() >= next_distance_update)) {
slouken@113
   206
		distanceok = Mix_SetDistance(0, distance);
slouken@113
   207
		if (!distanceok) {
slouken@113
   208
			fprintf(stderr, "Mix_SetDistance(0, %d) failed!\n", (int) distance);
slouken@113
   209
			fprintf(stderr, "Reason: [%s].\n", Mix_GetError());
slouken@113
   210
		}
slouken@113
   211
slouken@113
   212
		if (distance == 0) {
slouken@113
   213
			printf("Distance at nearest point.\n");
slouken@113
   214
			distincr *= -1;
slouken@113
   215
		}
slouken@113
   216
		else if (distance == 255) {
slouken@113
   217
			printf("Distance at furthest point.\n");
slouken@113
   218
			distincr *= -1;
slouken@113
   219
		}
slouken@113
   220
slouken@113
   221
		distance += distincr;
slouken@113
   222
		next_distance_update = SDL_GetTicks() + 15;
slouken@113
   223
	}
slouken@113
   224
}
slouken@113
   225
#endif
slouken@113
   226
slouken@113
   227
slouken@113
   228
#if (defined TEST_MIX_POSITION)
slouken@113
   229
static void do_position_update(void)
slouken@113
   230
{
slouken@113
   231
	static Sint16 distance = 1;
slouken@113
   232
	static Sint8 distincr = 1;
slouken@113
   233
	static Uint16 angle = 0;
slouken@113
   234
	static Sint8 angleincr = 1;
slouken@113
   235
	static int positionok = 1;
slouken@113
   236
	static Uint32 next_position_update = 0;
slouken@113
   237
slouken@113
   238
	if ((positionok) && (SDL_GetTicks() >= next_position_update)) {
slouken@113
   239
		positionok = Mix_SetPosition(0, angle, distance);
slouken@113
   240
		if (!positionok) {
slouken@113
   241
			fprintf(stderr, "Mix_SetPosition(0, %d, %d) failed!\n",
slouken@113
   242
					(int) angle, (int) distance);
slouken@113
   243
			fprintf(stderr, "Reason: [%s].\n", Mix_GetError());
slouken@113
   244
		}
slouken@113
   245
slouken@113
   246
		if (angle == 0) {
slouken@113
   247
			printf("Due north; now rotating clockwise...\n");
slouken@113
   248
			angleincr = 1;
slouken@113
   249
		}
slouken@113
   250
slouken@113
   251
		else if (angle == 360) {
slouken@113
   252
			printf("Due north; now rotating counter-clockwise...\n");
slouken@113
   253
			angleincr = -1;
slouken@113
   254
		}
slouken@113
   255
slouken@113
   256
		distance += distincr;
slouken@113
   257
slouken@113
   258
		if (distance < 0) {
slouken@113
   259
			distance = 0;
slouken@113
   260
			distincr = 3;
slouken@113
   261
			printf("Distance is very, very near. Stepping away by threes...\n");
slouken@113
   262
		} else if (distance > 255) {
slouken@113
   263
			distance = 255;
slouken@113
   264
			distincr = -3;
slouken@113
   265
			printf("Distance is very, very far. Stepping towards by threes...\n");
slouken@113
   266
		}
slouken@113
   267
slouken@113
   268
		angle += angleincr;
slouken@113
   269
		next_position_update = SDL_GetTicks() + 30;
slouken@113
   270
	}
slouken@113
   271
}
slouken@113
   272
#endif
slouken@113
   273
slouken@113
   274
slouken@321
   275
static void CleanUp(int exitcode)
slouken@0
   276
{
megastep@21
   277
	if ( wave ) {
megastep@21
   278
		Mix_FreeChunk(wave);
megastep@21
   279
		wave = NULL;
megastep@21
   280
	}
slouken@0
   281
	if ( audio_open ) {
slouken@0
   282
		Mix_CloseAudio();
slouken@0
   283
		audio_open = 0;
slouken@0
   284
	}
slouken@0
   285
	SDL_Quit();
slouken@321
   286
slouken@321
   287
	exit(exitcode);
slouken@0
   288
}
slouken@0
   289
slouken@113
   290
slouken@113
   291
static void Usage(char *argv0)
slouken@0
   292
{
slouken@245
   293
	fprintf(stderr, "Usage: %s [-8] [-r rate] [-c channels] [-f] [-F] [-l] [-m] <wavefile>\n", argv0);
slouken@0
   294
}
slouken@92
   295
slouken@92
   296
slouken@113
   297
/*
slouken@113
   298
 * rcg06182001 This is sick, but cool.
slouken@113
   299
 *
slouken@113
   300
 *  Actually, it's meant to be an example of how to manipulate a voice
slouken@113
   301
 *  without having to use the mixer effects API. This is more processing
slouken@113
   302
 *  up front, but no extra during the mixing process. Also, in a case like
slouken@113
   303
 *  this, when you need to touch the whole sample at once, it's the only
slouken@113
   304
 *  option you've got. And, with the effects API, you are altering a copy of
slouken@113
   305
 *  the original sample for each playback, and thus, your changes aren't
slouken@113
   306
 *  permanent; here, you've got a reversed sample, and that's that until
slouken@113
   307
 *  you either reverse it again, or reload it.
slouken@113
   308
 */
slouken@113
   309
static void flip_sample(Mix_Chunk *wave)
slouken@92
   310
{
slouken@113
   311
	Uint16 format;
slouken@113
   312
	int channels, i, incr;
slouken@113
   313
	Uint8 *start = wave->abuf;
slouken@113
   314
	Uint8 *end = wave->abuf + wave->alen;
slouken@113
   315
slouken@113
   316
	Mix_QuerySpec(NULL, &format, &channels);
slouken@113
   317
	incr = (format & 0xFF) * channels;
slouken@113
   318
slouken@113
   319
	end -= incr;
slouken@113
   320
slouken@113
   321
	switch (incr) {
slouken@113
   322
		case 8:
slouken@113
   323
			for (i = wave->alen / 2; i >= 0; i -= 1) {
slouken@113
   324
				Uint8 tmp = *start;
slouken@113
   325
				*start = *end;
slouken@113
   326
				*end = tmp;
slouken@113
   327
				start++;
slouken@113
   328
				end--;
slouken@113
   329
			}
slouken@113
   330
			break;
slouken@113
   331
slouken@113
   332
		case 16:
slouken@113
   333
			for (i = wave->alen / 2; i >= 0; i -= 2) {
slouken@113
   334
				Uint16 tmp = *start;
slouken@113
   335
				*((Uint16 *) start) = *((Uint16 *) end);
slouken@113
   336
				*((Uint16 *) end) = tmp;
slouken@113
   337
				start += 2;
slouken@113
   338
				end -= 2;
slouken@113
   339
			}
slouken@113
   340
			break;
slouken@113
   341
slouken@113
   342
		case 32:
slouken@113
   343
			for (i = wave->alen / 2; i >= 0; i -= 4) {
slouken@113
   344
				Uint32 tmp = *start;
slouken@113
   345
				*((Uint32 *) start) = *((Uint32 *) end);
slouken@113
   346
				*((Uint32 *) end) = tmp;
slouken@113
   347
				start += 4;
slouken@113
   348
				end -= 4;
slouken@113
   349
			}
slouken@113
   350
			break;
slouken@113
   351
slouken@113
   352
		default:
slouken@113
   353
			fprintf(stderr, "Unhandled format in sample flipping.\n");
slouken@113
   354
			return;
slouken@113
   355
	}
slouken@92
   356
}
slouken@92
   357
slouken@92
   358
slouken@113
   359
int main(int argc, char *argv[])
slouken@0
   360
{
slouken@47
   361
	int audio_rate;
slouken@0
   362
	Uint16 audio_format;
slouken@0
   363
	int audio_channels;
megastep@21
   364
	int loops = 0;
slouken@0
   365
	int i;
slouken@113
   366
	int reverse_stereo = 0;
slouken@113
   367
	int reverse_sample = 0;
slouken@113
   368
slouken@488
   369
#ifdef HAVE_SETBUF
slouken@113
   370
	setbuf(stdout, NULL);    /* rcg06132001 for debugging purposes. */
slouken@113
   371
	setbuf(stderr, NULL);    /* rcg06192001 for debugging purposes, too. */
slouken@488
   372
#endif
slouken@113
   373
	output_test_warnings();
slouken@0
   374
slouken@0
   375
	/* Initialize variables */
slouken@70
   376
	audio_rate = MIX_DEFAULT_FREQUENCY;
slouken@70
   377
	audio_format = MIX_DEFAULT_FORMAT;
slouken@0
   378
	audio_channels = 2;
slouken@0
   379
slouken@0
   380
	/* Check command line usage */
slouken@0
   381
	for ( i=1; argv[i] && (*argv[i] == '-'); ++i ) {
slouken@0
   382
		if ( (strcmp(argv[i], "-r") == 0) && argv[i+1] ) {
slouken@0
   383
			++i;
slouken@0
   384
			audio_rate = atoi(argv[i]);
slouken@0
   385
		} else
slouken@0
   386
		if ( strcmp(argv[i], "-m") == 0 ) {
slouken@0
   387
			audio_channels = 1;
slouken@0
   388
		} else
slouken@245
   389
		if ( (strcmp(argv[i], "-c") == 0) && argv[i+1] ) {
slouken@245
   390
			++i;
slouken@245
   391
			audio_channels = atoi(argv[i]);
slouken@245
   392
		} else
megastep@21
   393
		if ( strcmp(argv[i], "-l") == 0 ) {
megastep@21
   394
			loops = -1;
megastep@21
   395
		} else
slouken@0
   396
		if ( strcmp(argv[i], "-8") == 0 ) {
slouken@0
   397
			audio_format = AUDIO_U8;
slouken@113
   398
		} else
slouken@113
   399
		if ( strcmp(argv[i], "-f") == 0 ) { /* rcg06122001 flip stereo */
slouken@113
   400
			reverse_stereo = 1;
slouken@113
   401
		} else
slouken@113
   402
		if ( strcmp(argv[i], "-F") == 0 ) { /* rcg06172001 flip sample */
slouken@113
   403
			reverse_sample = 1;
slouken@0
   404
		} else {
slouken@0
   405
			Usage(argv[0]);
slouken@83
   406
			return(1);
slouken@0
   407
		}
slouken@0
   408
	}
slouken@0
   409
	if ( ! argv[i] ) {
slouken@0
   410
		Usage(argv[0]);
slouken@83
   411
		return(1);
slouken@0
   412
	}
slouken@0
   413
slouken@0
   414
	/* Initialize the SDL library */
slouken@0
   415
	if ( SDL_Init(SDL_INIT_AUDIO) < 0 ) {
slouken@0
   416
		fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
slouken@83
   417
		return(255);
slouken@0
   418
	}
slouken@488
   419
#ifdef HAVE_SIGNAL_H
slouken@321
   420
	signal(SIGINT, CleanUp);
slouken@321
   421
	signal(SIGTERM, CleanUp);
slouken@488
   422
#endif
slouken@0
   423
slouken@0
   424
	/* Open the audio device */
slouken@0
   425
	if (Mix_OpenAudio(audio_rate, audio_format, audio_channels, 4096) < 0) {
slouken@0
   426
		fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
slouken@321
   427
		CleanUp(2);
slouken@0
   428
	} else {
slouken@0
   429
		Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels);
megastep@21
   430
		printf("Opened audio at %d Hz %d bit %s", audio_rate,
slouken@0
   431
			(audio_format&0xFF),
slouken@245
   432
			(audio_channels > 2) ? "surround" :
slouken@0
   433
			(audio_channels > 1) ? "stereo" : "mono");
megastep@21
   434
		if ( loops ) {
megastep@21
   435
		  printf(" (looping)\n");
megastep@21
   436
		} else {
megastep@21
   437
		  putchar('\n');
megastep@21
   438
		}
slouken@0
   439
	}
slouken@0
   440
	audio_open = 1;
slouken@0
   441
slouken@113
   442
#if (defined TEST_MIX_VERSIONS)
icculus@389
   443
	test_versions();
slouken@113
   444
#endif
slouken@113
   445
icculus@390
   446
#if (defined TEST_MIX_DECODERS)
icculus@390
   447
	report_decoders();
icculus@390
   448
#endif
icculus@390
   449
slouken@0
   450
	/* Load the requested wave file */
slouken@0
   451
	wave = Mix_LoadWAV(argv[i]);
slouken@0
   452
	if ( wave == NULL ) {
slouken@0
   453
		fprintf(stderr, "Couldn't load %s: %s\n",
slouken@0
   454
						argv[i], SDL_GetError());
slouken@321
   455
		CleanUp(2);
slouken@0
   456
	}
slouken@0
   457
slouken@113
   458
	if (reverse_sample) {
slouken@113
   459
		flip_sample(wave);
slouken@113
   460
	}
slouken@113
   461
slouken@92
   462
#ifdef TEST_MIX_CHANNELFINISHED  /* rcg06072001 */
slouken@92
   463
	Mix_ChannelFinished(channel_complete_callback);
slouken@92
   464
#endif
slouken@92
   465
slouken@113
   466
	if ( (!Mix_SetReverseStereo(MIX_CHANNEL_POST, reverse_stereo)) &&
slouken@113
   467
		 (reverse_stereo) )
slouken@113
   468
	{
slouken@113
   469
		printf("Failed to set up reverse stereo effect!\n");
slouken@113
   470
		printf("Reason: [%s].\n", Mix_GetError());
slouken@113
   471
	}
slouken@113
   472
slouken@0
   473
	/* Play and then exit */
megastep@21
   474
	Mix_PlayChannel(0, wave, loops);
slouken@92
   475
slouken@113
   476
	while (still_playing()) {
slouken@113
   477
slouken@113
   478
#if (defined TEST_MIX_PANNING)  /* rcg06132001 */
slouken@113
   479
		do_panning_update();
slouken@92
   480
#endif
slouken@92
   481
slouken@113
   482
#if (defined TEST_MIX_DISTANCE) /* rcg06192001 */
slouken@113
   483
		do_distance_update();
slouken@113
   484
#endif
slouken@113
   485
slouken@113
   486
#if (defined TEST_MIX_POSITION) /* rcg06202001 */
slouken@113
   487
		do_position_update();
slouken@113
   488
#endif
slouken@113
   489
slouken@113
   490
		SDL_Delay(1);
slouken@113
   491
slouken@113
   492
	} /* while still_playing() loop... */
slouken@113
   493
slouken@321
   494
	CleanUp(0);
slouken@321
   495
slouken@321
   496
	/* Not reached, but fixes compiler warnings */
slouken@321
   497
	return 0;
slouken@0
   498
}
slouken@113
   499
slouken@113
   500
/* end of playwave.c ... */
slouken@113
   501