01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/**
 * $Id: driff.h,v 1.1 2006/08/30 07:40:22 a-gamyl Exp a-gamyl $
 */
#ifndef __INCLUDE_DRIFF_H__
#define __INCLUDE_DRIFF_H__
//-----------------------------------------------------------------
#include "riffdef.h"
#include "cvideo.h"
#include "cwave.h"
#include "ipFilter/cimage.h"
#include "ipFilter/ifilter.h"
//-----------------------------------------------------------------
DWORD DG_thread(HWND hWnd);
//-----------------------------------------------------------------
// Class of AVI draw graphic and playing wave(PCM) sound
//-----------------------------------------------------------------
class DRIFF {
 private:
    FILE  *file;
    CVideo cvideo;
    CWave  cwave;
    HWND   paintHwnd,edHwnd,BtHwnd,scrHwnd;
    CImage in_image,out_image;
    HANDLE thread;
    DWORD  file_type;
    char   file_name[MAX_PATH];
 public:
    DRIFF();
    ~DRIFF();
    //-----------------------------------------------------------------
    ULONG DrawGraphic(int mode);
    int  Open(char* filename);
    int  FileOpen();
    int  FileOpen(char* filename);
    int  Close();
    int  Seek(double sec);
    void DrawClose();
    void DrawStart();
    void DrawStop();
    void FrameSave();
    //-----------------------------------------------------------------
    void setImageFilter(int ifilter);
    void setWaveDraw(int dgw);
    void setWaveInput();
    void setWindow(HWND mwh,HWND edwh,HWND btwh,HWND scrwh);
    //-----------------------------------------------------------------
    int  getVideoCurrent();
    int  getAudioCurrent();
    HWND getCanvas();
    HWND getEditor();
    HWND getButton();
    DWORD getType();
    double getFPS();
    char* getFPSS();
    char* getWaveInfo();
    LPBITMAPINFOHEADER getBmpHeader(int cur);
    //-----------------------------------------------------------------
    // SCROLL
    //-----------------------------------------------------------------
    void setScroll();
    void setScroll(int scrPos);
    void setWaveScroll(int spos);
    //-----------------------------------------------------------------
    // draw MIC wave input
    //-----------------------------------------------------------------
    void DrawWaveInput();
    //-----------------------------------------------------------------
    // VIDEO
    //-----------------------------------------------------------------
    int  AviRead(void** data);
    int  AviRead2(int current,void **data);
    //-----------------------------------------------------------------
    // WAVE
    //-----------------------------------------------------------------
    void volumeUp();
    void volumeDown();
    int  WavePlay(int type,double sec);
    void WavePlayDone();
    int  WaveEof();
    void WaveSeek(int wpos);
    // draw WAVE
    BOOL DrawWave(HDC hDC,RECT *pR);
};

//-----------------------------------------------------------------
extern DRIFF dr;
extern HDRAWDIB dg_DDib;
//-----------------------------------------------------------------

#endif //__INCLUDE_DRIFF_H__