#ifndef _SAMPLE_WAVEFORM_HPP_ #define _SAMPLE_WAVEFORM_HPP_ #ifndef _COMMON_STDIO_HPP_ #include #endif #ifndef _COMMON_WINDOWS_HPP_ #include #endif #ifndef _COMMON_STRING_HPP_ #include #endif #ifndef _COMMON_BLOCK_HPP_ #include #endif #ifndef _SAMPLE_PURESAMPLE_HPP_ #include #endif #ifndef _SAMPLE_DATACHUNK_HPP_ #include #endif #ifndef _SAMPLE_FORMATCHUNK_HPP_ #include #endif #ifndef _SAMPLE_GENERICCHUNK_HPP_ #include #endif class WaveForm { public: WaveForm(void); WaveForm(const String &wavePathFileName); WaveForm(const WaveForm &someWaveForm); virtual ~WaveForm(); bool open(String wavePathFileName); WaveForm &operator=(const WaveForm &someWaveForm); WaveForm &operator=(const String &wavePathFileName); WaveForm &operator+=(const WaveForm &someWaveForm); WaveForm operator+(const WaveForm &someWaveForm); bool operator==(const WaveForm &someWaveForm)const; bool operator<<(FileHandle &waveFile); FormatChunk &getFormatChunk(void); PureSample &getPureSample(void); bool save(String wavePathFileName,const PureSample &somePureSample,DWORD samplesPerSecond,DWORD avgBytesPerSecond); bool save(String wavePathFileName); const String &wavePathFileName(void)const; bool isOkay(void)const; String toString(void)const; private: enum {MaxLength=4}; void initWaveForm(void); char mHeaderString[MaxLength]; DWORD mLengthData; char mSubHeaderString[MaxLength]; FormatChunk mFormatChunk; Block mGenericChunks; DataChunk mDataChunk; PureSample mSampleData; String mWavePathFileName; String mExtensionString; String mWaveString; String mRiffString; }; inline WaveForm::WaveForm(void) { initWaveForm(); } inline WaveForm::WaveForm(const WaveForm &someWaveForm) { *this=someWaveForm; } inline WaveForm::~WaveForm() { } inline WaveForm &WaveForm::operator=(const String &wavePathFileName) { *this=WaveForm(wavePathFileName); return *this; } inline bool WaveForm::isOkay(void)const { return mSampleData.isOkay(); } inline const String &WaveForm::wavePathFileName(void)const { return mWavePathFileName; } inline FormatChunk &WaveForm::getFormatChunk(void) { return mFormatChunk; } inline PureSample &WaveForm::getPureSample(void) { return mSampleData; } #endif