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.

62 lines
1.4 KiB

  1. //
  2. // tones.h
  3. //
  4. #ifndef _TONES_H_
  5. #define _TONES_H_
  6. #include <windows.h>
  7. #include <mmsystem.h>
  8. #include <stdio.h>
  9. #include <wxdebug.h>
  10. #define WAVE_FILE_SIZE 1600
  11. #define NUM_DIGITS 12
  12. //////////////////////////////////////////////////////////////////////////////
  13. //
  14. // class CTonePlayer
  15. //
  16. // Implements tone player for a single phone device.
  17. //
  18. class CTonePlayer
  19. {
  20. public:
  21. CTonePlayer();
  22. ~CTonePlayer();
  23. HRESULT Initialize(void);
  24. HRESULT OpenWaveDevice(long lWaveId);
  25. void CloseWaveDevice(void);
  26. BOOL IsInUse(void) { return (m_hWaveOut != NULL); }
  27. HRESULT StartDialtone(void);
  28. HRESULT StopDialtone(void);
  29. BOOL DialtonePlaying(void) { return m_fDialtonePlaying; }
  30. HRESULT GenerateDTMF(long lDigit);
  31. private:
  32. // TRUE if Initialize has succeeded.
  33. BOOL m_fInitialized;
  34. BOOL m_fDialtonePlaying;
  35. // Handle to the wave out device. NULL when the device is not open.
  36. HWAVEOUT m_hWaveOut;
  37. // Header structure that we submit to the wave device.
  38. WAVEHDR m_WaveHeader;
  39. // buffer containing dialtone waveform
  40. BYTE m_abDialtoneWaveform[ WAVE_FILE_SIZE ];
  41. // buffer containing all dtmf waveforms, concatenated in order, 0-9,*,#
  42. BYTE m_abDigitWaveforms [ NUM_DIGITS * WAVE_FILE_SIZE ];
  43. };
  44. #endif // _TONES_H_