Old fashion design for PC-104
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.

74 lines
1.7 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 19/04/2000
  5. // Last modification: 01/05/2003
  6. // Project Intruder Position Indicator
  7. // SUBSYSTEM: Alarm
  8. // FILE: Alarm.h
  9. // AUTHOR: Chizhevskiy Sergey
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of class CAlarm
  13. //----------------------------------------------------------------------------
  14. #ifndef __ALARM__H__INCLUDED__
  15. #define __ALARM__H__INCLUDED__
  16. #define BEEPER_PPI_PORT 0X61
  17. #define BEEPER_SET_TIMER_CHANNEL_PORT 0X43
  18. #define BEEPER_SET_FREQUENCY_PORT 0X42
  19. #include "..\..\LgLib\Templ.h"
  20. class CAlarm
  21. {
  22. public:
  23. CAlarm();
  24. ~CAlarm();
  25. public:
  26. // play waveforms
  27. void WaveStop();
  28. void WaveStart( LPCTSTR *ppFileNames, int nCount, BOOL bStopPrev = FALSE );
  29. public:
  30. void Enable( BOOL fEnable );
  31. public: // regular beep
  32. void AlarmBegin( void );
  33. void AlarmEnd( void );
  34. void Beep();
  35. private:
  36. DWORD m_dwVersion;
  37. int Inp( WORD port );
  38. INT Outp( WORD port, INT databyte );
  39. private:
  40. BYTE m_BeeperOff;
  41. BYTE m_BeeperOn;
  42. private:
  43. HANDLE m_hEventClose;
  44. BOOL m_fEnabled;
  45. private:
  46. friend static DWORD CALLBACK ThreadProcAlarmBeep( LPVOID lpvParam )
  47. { return ((CAlarm*)lpvParam)->ThreadProcBeep(); }
  48. DWORD ThreadProcBeep();
  49. HANDLE m_hEventBeep;
  50. HANDLE m_hThreadBeep;
  51. HANDLE m_hEventAlarm;
  52. private:
  53. friend static DWORD CALLBACK ThreadProcAlarmWave( LPVOID lpvParam )
  54. { return ((CAlarm*)lpvParam)->ThreadProcWave(); }
  55. DWORD ThreadProcWave();
  56. HANDLE m_hEventWave;
  57. HANDLE m_hThreadWave;
  58. CLgQueueP<LPCTSTR,100> m_WaveQueue;
  59. };
  60. #endif