⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 avifile.h

📁 G729语音压缩的很好的离子和示范 大家来下载吧
💻 H
字号:
#ifndef _AVIFILE_H_
#define _AVIFILE_H_
#include <afxwin.h>
#include <vfw.h>
#include "avitimer.h"

#define TEXT_HEIGHT	20
#define AVIIF_KEYFRAME	0x00000010L // this frame is a key frame.
#define BUFSIZE 260

class CAVIFile : public CObject
{
public:
	// Creates an avi file
	CAVIFile(LPCTSTR lpszFileName, LPBITMAPINFO bitmapinfo,int xdim = -1, int ydim = -1);
	// Closes the avi file
	virtual ~CAVIFile();

	// Adds a frame to the avi file
	bool AddFrame(LPVOID lpdata,int datalen,DWORD time);
	// Adds a frame to the avi file, but in a CBitmap format
	virtual bool AddFrame(CBitmap& bmp,LPBITMAPINFO lpbi,DWORD time);

	// returns the name of the avi file
	CString GetFName() const             {return FName;};
	// true if no error
	virtual bool IsOK() const            {return bOK;};
	// true if the file is compressed
	BOOL Compress();
protected:
	CString FName;
	int xDim;
	int yDim;

	AVISTREAMINFO strhdr;
	PAVIFILE pfile;
	PAVISTREAM ps;
	PAVISTREAM psCompressed;
	PAVISTREAM psText;
	AVICOMPRESSOPTIONS opts;
	AVICOMPRESSOPTIONS FAR * aopts[1];
	DWORD dwTextFormat;
	BITMAPINFO bmpinfo;
	char szText[BUFSIZE];
	int nFrames;
	bool bOK;
};

class TCLAVIFile: public CAVIFile {
public:
	// Creates an avi file
	TCLAVIFile(CString tcl_name,LPCTSTR lpszFileName, LPBITMAPINFO bitmapinfo,long microsecperframe,int xdim = -1, int ydim = -1);
	// retrieves an avifile object thanks to its tcl name
	virtual ~TCLAVIFile();
 	static TCLAVIFile *Find(const CString tclname);
		// Adds a frame to the avi file, but in a CBitmap format
	bool AddFrame(LPVOID lpdata,int datalen);
	// Like CAVIFile AddFrame but the time is calculated thanks to the timer and microsecperframe
protected:
	static void Add(TCLAVIFile* avf);
	static void Remove(const TCLAVIFile *avf);
	static class cell {
	public:
		TCLAVIFile *avf;
		cell * suiv;
		cell(TCLAVIFile *a,cell *s):avf(a),suiv(s) {};
	};
	static cell *_allAVFs;
	CString tclname;
	AVITimer *_timer;
};
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -