home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
348.lha
/
chatterbox_v1.0
/
sources
/
blather.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-02-14
|
1KB
|
57 lines
/* sound effect gimmick player - blather (output) routine */
#include <exec/types.h>
#include <functions.h>
#include <exec/memory.h>
#include <exec/nodes.h>
#include <exec/lists.h>
#include <stdio.h>
#include <fcntl.h>
#include "assert.h"
#include "iff.h"
#include "8svx.h"
#include "sample.h"
#include "chatter.h"
extern int timer_noload;
extern struct gab_info gab_data[N_GAB_TYPES];
blather(gab_type)
int gab_type;
{
struct gab_info *gabp;
int nitems;
Sample *sampleptr;
/* if it's a timer event and they've specified deferred loading
* of samples for timer events, play a deferred sound.
*/
if ((gab_type == GAB_EVERY_SO_OFTEN) && (timer_noload))
{
PlayDeferredSound();
return;
}
/* otherwise play a loaded sound */
gabp = &gab_data[gab_type];
nitems = gabp->n_gab_items;
if (nitems == 0)
return;
sampleptr = gabp->Samples[gabp->next_play_gab_item++];
ASSERT_SAMPLE_MAGIC(sampleptr);
PlayChannelSample(sampleptr,64,rando(2));
if (gabp->next_play_gab_item >= gabp->n_gab_items)
rerandomize(gab_type);
}