Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1010 B

  1. #ifndef NAC_DTMF_H
  2. #define NAC_DTMF_H
  3. class DTMFQueue
  4. {
  5. private:
  6. BYTE **m_aTones; // array of tone signals
  7. bool m_bInitialized;
  8. WAVEFORMATEX m_WaveFormat;
  9. CRITICAL_SECTION m_cs;
  10. HANDLE m_hEvent;
  11. void ReleaseToneBank();
  12. void AddSignal(BYTE *pTone, int nFrequency, double dAmp, int nLength);
  13. void CreateDTMFTone(BYTE *pTone, int nToneLength, int toneID);
  14. HRESULT GenerateTones(WAVEFORMATEX *pWaveFormat);
  15. struct DTMF_TX_ELEMENT
  16. {
  17. int nToneID;
  18. int nBytesToCopy;
  19. int nOffsetStart;
  20. };
  21. #define DTMF_QUEUE_SIZE 100
  22. DTMF_TX_ELEMENT m_aTxQueue[DTMF_QUEUE_SIZE];
  23. int m_nQueueHead;
  24. int m_nQueueLength;
  25. public:
  26. DTMFQueue();
  27. ~DTMFQueue();
  28. HRESULT Initialize(WAVEFORMATEX *pWaveFormat);
  29. HRESULT ReadFromQueue(BYTE *pBuffer, UINT uSize);
  30. HRESULT ClearQueue();
  31. HRESULT AddDigitToQueue(int nDigit);
  32. HANDLE GetEvent() {return m_hEvent;}
  33. };
  34. // default length of the DTMF feedback beep (in ms)
  35. #define DTMF_FEEDBACK_BEEP_MS 64
  36. #endif