WAVEX.H
资源名称:tapi3.zip [点击查看]
上传用户:chinamans
上传日期:2013-03-17
资源大小:202k
文件大小:2k
源码类别:
TAPI编程
开发平台:
Visual C++
- // A Header file for wave functions for dialer/talker
- // (c) Dialogic corp. 1995, 1996
- typedef struct _wavecashedinfo // for temporary storage
- {
- int nDeviceID;
- int nFormatID;
- WAVEFORMATEX WF;
- } CASHEDINFO, *PCASHEDINFO;
- class CTapiWave : public CObject
- {
- DECLARE_DYNAMIC(CTapiWave)
- // Attributes
- protected:
- CTapiWave();
- public:
- LPVOID m_lpvCall; // only one call
- LPVOID m_lpvLine; // line
- DWORD m_dwLineID;
- static WAVEFORMATEX wfDialogicFormats[12];
- protected:
- HWAVEIN m_hWaveIn;
- HWAVEOUT m_hWaveOut;
- DWORD m_dwState;
- DWORD m_dwVolume;
- char m_szRecFileName[16]; // file name for recording
- public:
- CTapiWave(LPVOID lpLine, LPVOID lpCall, DWORD dwLineID);
- //virtual ~CTapiWave();
- int ctwGetID(LPSTR); // Get ID by name
- BOOL ctwPlay(HWND, UINT, LPSTR); // play the WAVE file
- BOOL ctwRecord(HWND hWnd, UINT nID, int nFormatID=10, DWORD dwSize=65534); // record the Wave file
- BOOL ctwPause(); // Pause
- BOOL ctwResume(); // Resume
- BOOL ctwStop(); // Stop
- void ctwFinishPlay(WPARAM, LPARAM); // handle the driver notification
- void ctwFinishRecord(WPARAM wParam, LPARAM lParam, LPSTR lpName=NULL); // handle the driver notification
- DWORD ctwGetState() // Extract state
- {return m_dwState;}
- HWAVE ctwGetHWave(WORD wFlag)
- {return wFlag == WAVEIN ? (HWAVE)m_hWaveIn : wFlag == WAVEOUT ? (HWAVE)m_hWaveOut : (HWAVE)0xffffffff;}
- DWORD ctwGetVolume() {return m_dwVolume;}
- void ctwSetVolume(DWORD dwVol=0xffff);
- protected:
- HWAVEOUT WavexPlay(HWND, UINT, LPSTR); // play the WAVE file
- HWAVEIN WavexRecord(HWND hWnd, UINT nID, int nFormatID=10, DWORD dwBufSize=65534); // record the Wave file
- void WavexFinishPlay(WPARAM, LPARAM); // handle the driver notification
- void WavexFinishRecord(WPARAM, LPARAM, LPSTR); // handle the driver notification
- void WavexSaveData(LPWAVEHDR, LPSTR);
- DWORD ctwSetState(DWORD dwNewState) // Set state
- {return (DWORD)InterlockedExchange((LPLONG)&m_dwState, (LONG)dwNewState);}
- };