www.pudn.com > AudioTest.rar > AudioTestView.h
// AudioTestView.h : interface of the CAudioTestView class
//
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INCLUDES()
//}}AFX_INCLUDES
#if !defined(AFX_AUDIOTESTVIEW_H__794F8B50_0BF8_48E9_BAF7_F31F333CD104__INCLUDED_)
#define AFX_AUDIOTESTVIEW_H__794F8B50_0BF8_48E9_BAF7_F31F333CD104__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define INP_BUFFER_SIZE 1024
#define BUF_TIMES 8
#define PI 3.1415927
class CAudioTestView : public CFormView
{
void DrawGrid(CPaintDC& dc, int xpos, int ypos, BOOL bErase=FALSE);
void DrawAudioData(CPaintDC& dc, int xpos, int ypos);
public:
BYTE draw_buffer[INP_BUFFER_SIZE];
BYTE draw_buffer_total[INP_BUFFER_SIZE*BUF_TIMES];
int timer3_elapse;
BOOL bDataRecorded;
int aSPS[4];
int aChans[2];
int aBytes[2];
BOOL bRecording,bPlaying,bReverse,bPaused,bEnding,bTerminating;
DWORD dwDataLength,dwRepetitions;
HWAVEIN hWaveIn;
HWAVEOUT hWaveOut;
PBYTE pBuffer1,pBuffer2,pSaveBuffer,pNewBuffer;
PWAVEHDR pWaveHdr1,pWaveHdr2;
/*
static TCHAR szOpenError[] =_T("Erro opening waveform audio!");
static TCHAR szMemError[] =_T("Erro allocationg memory!");*/
WAVEFORMATEX waveform;
private:
CWinThread* pThread;
protected: // create from serialization only
CAudioTestView();
DECLARE_DYNCREATE(CAudioTestView)
public:
//{{AFX_DATA(CAudioTestView)
enum { IDD = IDD_AUDIOTEST_FORM };
CComboBox m_cZoomTimes;
CEdit m_cPlayTime;
CEdit m_cRecTime;
CComboBox m_cOutChans;
CComboBox m_cInChans;
CComboBox m_cOutBytes;
CComboBox m_cInBytes;
CComboBox m_ctrlOutSPS;
CComboBox m_ctrlInSPS;
//}}AFX_DATA
// Attributes
public:
CAudioTestDoc* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAudioTestView)
public:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual void OnInitialUpdate(); // called first time after construct
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CAudioTestView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CAudioTestView)
afx_msg void OnStartRecord();
afx_msg void OnStopRecord();
afx_msg void OnPlayStart();
afx_msg void OnPlayPause();
afx_msg void OnPlayStop();
afx_msg void OnDestroy();
afx_msg void OnSelchangeInSps();
afx_msg void OnSelchangeOutSps();
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnSave();
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnMinimizeWindow();
afx_msg void OnStopStartDraw();
afx_msg void OnPaint();
afx_msg void OnLoadWave();
afx_msg void OnSelchangeZoomTimers();
afx_msg void OnChangeDataColor();
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnGenSineWaveAnalysis();
afx_msg void OnButton1();
afx_msg void OnReadWavFormat();
//}}AFX_MSG
afx_msg void OnMM_WIM_OPEN(UINT wParam,LONG lParam);
afx_msg void OnMM_WIM_DATA(UINT wParam,LONG lParam);
afx_msg void OnMM_WIM_CLOSE(UINT wParam,LONG lParam);
afx_msg void OnMM_WOM_OPEN(UINT wParam,LONG lParam);
afx_msg void OnMM_WOM_DONE(UINT wParam,LONG lParam);
afx_msg void OnMM_WOM_CLOSE(UINT wParam,LONG lParam);
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in AudioTestView.cpp
inline CAudioTestDoc* CAudioTestView::GetDocument()
{ return (CAudioTestDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_AUDIOTESTVIEW_H__794F8B50_0BF8_48E9_BAF7_F31F333CD104__INCLUDED_)