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