This is SoundHeader.h in view mode; [Download] [Up]
//
// Programmer: Craig Stuart Sapp <craig@ccrma.stanford.edu>
// Creation Date: Fri May 23 21:40:12 GMT-0800 1997
// Last Modified: Fri May 23 21:40:12 GMT-0800 1997
// Filename: .../src/SoundHeader/SoundHeader.h
// Syntax: C++
// $Smake: cc -Wall -g -c %b.cc -I../../include && rm -f %b.o
//
#ifndef _SOUNDHEADER_H_INCLUDED
#define _SOUNDHEADER_H_INCLUDED
#include <iostream.h>
#ifndef ulong
#define ulong unsigned long
#endif
#ifndef SND_FORMAT_LINEAR_16
#define SND_FORMAT_LINEAR_16 (3)
#endif
#define NONE_FORMAT (0)
#define SND_FORMAT (1)
#define WAV_FORMAT (2)
#define TXT_FORMAT (3)
#define DEFAULT_FORMAT (1)
class SoundHeader {
public:
SoundHeader (void);
SoundHeader (char* filename);
~SoundHeader ();
ulong getBitsPerSample (int format = DEFAULT_FORMAT);
ulong getChannels (int format = DEFAULT_FORMAT);
const char* getComment (int format = DEFAULT_FORMAT);
ulong getCommentSize (int format = DEFAULT_FORMAT);
ulong getDataByteOffset (int format = DEFAULT_FORMAT);
ulong getDataByteSize (int format = DEFAULT_FORMAT);
ulong getDataFormat (int format = DEFAULT_FORMAT);
ulong getMagic (int foramt = DEFAULT_FORMAT);
ulong getOutputFormat (void);
ulong getSamples (int format = DEFAULT_FORMAT);
ulong getSrate (int format = DEFAULT_FORMAT);
void inputHeader (char *filename);
SoundHeader& operator= (const SoundHeader& h);
void setChannels (int numChannels);
void setHighMono (char* comment = "");
void setHighStereo (char* comment = "");
void setNextFormat (int format = SND_FORMAT_LINEAR_16);
int setOutputFormat (int format = DEFAULT_FORMAT);
void setSamples (int numSamples);
void setSrate (int aSrate);
void setComment (const char* aString);
void print (void);
protected:
int inputType; // 1 = Next/Sun sound, 2 = Wav, 3 later for mac
int outputType; // format for operator<<
int channels;
int samplingRate;
char* commentString;
int commentLength;
int NeXT_DataFormat;
int samples; // number of samples in the data
int bitsPerSample;
// private functions:
int getType(char *string);
void processInSndFormat(char *filename);
void processInWavFormat(char *filename);
};
ostream& operator<<(ostream& output, SoundHeader& aSoundHeader);
#endif _SOUNDHEADER_H_INCLUDED
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.