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.

66 lines
1.4 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: 08/10/2003
  6. // PROJECT:
  7. // SUBSYSTEM: LgAlarm
  8. // FILE: LgAlarm.h
  9. // AUTHOR: Chizhevskiy Sergey
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of class CLgAlarm
  13. //----------------------------------------------------------------------------
  14. #ifndef __LG__ALARM__H__INCLUDED__
  15. #define __LG__ALARM__H__INCLUDED__
  16. #include "..\LgLib\Thread.h"
  17. #include "..\LgLib\Templ.h"
  18. class CLgAlarm :
  19. private CLgThread
  20. {
  21. public:
  22. CLgAlarm();
  23. virtual ~CLgAlarm();
  24. public:
  25. BOOL Create( LPCTSTR pWaveFile );
  26. void Destroy();
  27. void Enable( BOOL bEnable );
  28. void Start();
  29. void Stop();
  30. void Beep();
  31. private:
  32. enum { BEEPER_SET_FREQUENCY_PORT = 0x42,
  33. BEEPER_SET_TIMER_CHANNEL_PORT = 0x43,
  34. BEEPER_PPI_PORT = 0x61 };
  35. private:
  36. void BuzzerOn( BOOL bOn );
  37. void BuzzerFrequency( INT nFrequency );
  38. INT Inp( WORD port );
  39. INT Outp( WORD port, INT databyte );
  40. BOOL Beep( DWORD dwFreq, DWORD dwDuration, HANDLE hEvent );
  41. private:
  42. virtual DWORD ThreadProc();
  43. private:
  44. DWORD m_dwVersion;
  45. BOOL m_bEnabled;
  46. BOOL m_bAlarmOn;
  47. private:
  48. CLgEvent m_EventBeep;
  49. CLgEvent m_EventAlarm;
  50. private:
  51. BOOL m_bWaveAlarm;
  52. TCHAR m_pWaveFile[MAX_PATH];
  53. BOOL m_bWaveOn;
  54. };
  55. #endif