#ifndef _SOUND_H
#include "sound.h"
#endif
#include "defs.h"

#define NORIFF 1            // Keine RIFF-Datei
#define NOWAVE 2            // Keine WAVE-Datei

typedef unsigned char FOURCC[4];   // Four Character Code (fr WAVE)

typedef struct
{
  FOURCC Name;    // Name des Chunks
  DWORD  Laenge;  // Lnge des Chunks
} HEADER;         // Header, den JEDER WAVE-Block besitzen muá

typedef struct
{
  HEADER Header;
  FOURCC Type;    // "WAVE"
} RIFF;           // Container-Chunk, in dem sich alle anderen Chunks befinden

typedef struct
{
  WORD  FmtTyp;         // normalerweise immer 1; => PCM - Format
  WORD  Kanalzahl;      // 1 = Mono, 2 = Stereo
  DWORD SampleRate;     // <= 44100 Hz
  DWORD BytePerSec;
  WORD  BytePerSample;  // '1' => 8 Bit Mono
			// '2' => 8 Bit Stereo od. 16 Bit Mono, ...
  WORD  BitsPerSample;
} FMT;                  // Format-Chunk; enthlt Informationen zur
			// Interpretation der SoundDaten
typedef struct
{
  HEADER Header;
} DATA;                 // DATA-Chunk; enthlt nur SoundDaten

class Wave : public Sound
{
  public:
    Wave(char *FileName);
    virtual ~Wave() {};

    virtual char Read();

  private:
    int Handle;
    char *FN;
};