From ce6388c4f44e9e76342a338954fff598372e06f0 Mon Sep 17 00:00:00 2001 From: llornkcor Date: Fri, 04 Apr 2003 03:03:38 +0000 Subject: bitches owe me money. initial commit. zaurus/vercel has sound drivers that doesnt actually change samplerates, so this kinda has problems, currently --- (limited to 'noncore/multimedia/opierec/wavFile.h') diff --git a/noncore/multimedia/opierec/wavFile.h b/noncore/multimedia/opierec/wavFile.h new file mode 100644 index 0000000..51366ec --- a/dev/null +++ b/noncore/multimedia/opierec/wavFile.h @@ -0,0 +1,56 @@ +//wavFile.h +#ifndef WAVFILE_H +#define WAVFILE_H + +#include +#include +#include +#include + +typedef struct { + char riffID[4]; + unsigned long riffLen; + char wavID[4]; + char fmtID[4]; + unsigned long fmtLen; + unsigned short fmtTag; + unsigned short nChannels; + unsigned long sampleRate; + unsigned long avgBytesPerSec; + unsigned short nBlockAlign; + unsigned short bitsPerSample; + char dataID[4]; + unsigned long dataLen; + } wavhdr; + + +class WavFile : public QObject { +Q_OBJECT +public: + WavFile( QObject * parent=0,const QString &fileName=0, bool newFile=true, int sampleRate = 0, + int channels = 0, int resolution = 0, int format=0); + ~WavFile(); + wavhdr hdr; + bool adjustHeaders(int fd, int total); + QString currentFileName; + QString trackName(); + + QFile track; + int wavHandle(); + int getFormat(); + int getResolution(); + int getSampleRate(); + int getNumberSamples(); + bool isTempFile(); + int openFile(const QString &); + bool newFile(); + void closeFile(); + +private: + int wavFormat, wavChannels, wavResolution, wavSampleRate, wavNumberSamples; + bool useTmpFile; + bool setWavHeader(int fd, wavhdr *hdr); + int parseWavHeader(int fd); +}; + +#endif -- cgit v0.9.0.2