Files
Work/avifile/FRMHDR.HPP
2024-08-07 09:12:07 -04:00

124 lines
2.8 KiB
C++

#ifndef _AVIFILE_FORMATHEADER_HPP_
#define _AVIFILE_FORMATHEADER_HPP_
#ifndef _COMMON_WINDOWS_HPP_
#include <common/windows.hpp>
#endif
#ifndef _COMMON_FILE_HPP_
#include <common/file.hpp>
#endif
#ifndef _COMMON_STRING_HPP_
#include <common/string.hpp>
#endif
#ifndef _COMMON_MMSYSTEM_HPP_
#include <common/mmsystem.hpp>
#endif
#ifndef _AVIFILE_AVILISTCHUNK_HPP_
#include <avifile/lstchnk.hpp>
#endif
#ifndef _AVIFILE_STREAMTYPE_HPP_
#include <avifile/strmtype.hpp>
#endif
#ifndef _AVIFILE_AVIBITMAP_HPP_
#include <avifile/avibmp.hpp>
#endif
#ifndef _AVIFILE_AVIWAVE_HPP_
#include <avifile/aviwave.hpp>
#endif
//#ifndef _AVIFILE_AVIDV_HPP_
//#include <avifile/avidv.hpp>
//#endif
class AVIFormatHeader : public StreamType
{
public:
AVIFormatHeader(void);
AVIFormatHeader(const StreamType &someStreamType);
AVIFormatHeader(const AVIFormatHeader &someAVIFormatHeader);
virtual ~AVIFormatHeader();
bool read(File &inFile);
bool write(File &outFile);
AVIFormatHeader &operator=(const StreamType &someStreamType);
AVIFormatHeader &operator=(const AVIFormatHeader &someAVIFormatHeader);
WORD operator==(const AVIFormatHeader &someAVIFormatHeader)const;
AVIBitmap &getBitmap(void);
AVIWaveFormatEx &getWave(void);
private:
AVIBitmap mAVIBitmap;
AVIWaveFormatEx mAVIWaveFormatEx;
// AVIDigitalVideo mAVIDigitalVideo;
};
inline
AVIFormatHeader::AVIFormatHeader(void)
{
}
inline
AVIFormatHeader::AVIFormatHeader(const StreamType &someStreamType)
: StreamType(someStreamType)
{
}
inline
AVIFormatHeader::AVIFormatHeader(const AVIFormatHeader &someAVIFormatHeader)
{
*this=someAVIFormatHeader;
}
inline
AVIFormatHeader::~AVIFormatHeader()
{
}
inline
AVIFormatHeader &AVIFormatHeader::operator=(const AVIFormatHeader &someAVIFormatHeader)
{
if(StreamType::Video==streamType())mAVIBitmap=someAVIFormatHeader.mAVIBitmap;
else if(StreamType::Audio==streamType())mAVIWaveFormatEx=someAVIFormatHeader.mAVIWaveFormatEx;
else if(StreamType::Text==streamType()){;}
return *this;
}
inline
AVIFormatHeader &AVIFormatHeader::operator=(const StreamType &someStreamType)
{
(StreamType&)*this=someStreamType;
return *this;
}
inline
WORD AVIFormatHeader::operator==(const AVIFormatHeader &someAVIFormatHeader)const
{
if(StreamType::Video==streamType())return mAVIBitmap==someAVIFormatHeader.mAVIBitmap;
else if(StreamType::Audio==streamType())return mAVIWaveFormatEx==someAVIFormatHeader.mAVIWaveFormatEx;
else if(StreamType::Text==streamType())return FALSE;
return FALSE;
}
inline
AVIBitmap &AVIFormatHeader::getBitmap(void)
{
return mAVIBitmap;
}
inline
AVIWaveFormatEx &AVIFormatHeader::getWave(void)
{
return mAVIWaveFormatEx;
}
/*
inline
AVIFormatHeader::operator AVIBitmap&(void)
{
return mAVIBitmap;
}
inline
AVIFormatHeader::operator AVIWaveFormatEx&(void)
{
return mAVIWaveFormatEx;
}
*/
#endif