Files
stk/RawShot.h
Gary Scavone 7c0ee03d60 Version 2.02
2013-09-29 22:40:37 +02:00

50 lines
1.2 KiB
C++

/*******************************************/
/* Non-Interpolating One-Shot Raw Sound- */
/* file Class, by Perry R. Cook, 1995-96 */
/* This Object can open a raw 16bit data */
/* (signed integers) file, and play back */
/* the data once, with no interpolation */
/* on playback. Once finished, it closes */
/* the file, the file is reopened with */
/* the reset() method. */
/* This is useful for small memory model, */
/* applications, or for streaming from */
/* disk (and generally non real-time */
/* applications). */
/*******************************************/
#if !defined(__RawShot_h)
#define __RawShot_h
#include "Object.h"
#include "RawWave.h"
class RawShot : public RawWave
{
protected:
long length;
long lastTime;
int finished;
short data;
char fileNm[128];
FILE *myFile;
MY_FLOAT rate;
MY_FLOAT time;
MY_FLOAT gain;
MY_FLOAT lastOutput;
public:
RawShot(char *fileName);
~RawShot();
void reset();
void normalize();
void normalize(MY_FLOAT newPeak);
void setRate(MY_FLOAT aRate);
void finish();
int isFinished();
MY_FLOAT tick();
int informTick();
MY_FLOAT lastOut();
};
#endif