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
66 lines
1.4 KiB
//----------------------------------------------------------------------------
|
|
// Laser Guard Ltd.
|
|
// Copyright © 2000-2002. All Rights Reserved.
|
|
// Version 1.0 19/04/2000
|
|
// Last modification: 08/10/2003
|
|
// PROJECT:
|
|
// SUBSYSTEM: LgAlarm
|
|
// FILE: LgAlarm.h
|
|
// AUTHOR: Chizhevskiy Sergey
|
|
// OVERVIEW
|
|
// ~~~~~~~~
|
|
// Header file of class CLgAlarm
|
|
//----------------------------------------------------------------------------
|
|
#ifndef __LG__ALARM__H__INCLUDED__
|
|
#define __LG__ALARM__H__INCLUDED__
|
|
|
|
#include "..\LgLib\Thread.h"
|
|
#include "..\LgLib\Templ.h"
|
|
|
|
class CLgAlarm :
|
|
private CLgThread
|
|
{
|
|
public:
|
|
CLgAlarm();
|
|
virtual ~CLgAlarm();
|
|
|
|
public:
|
|
BOOL Create( LPCTSTR pWaveFile );
|
|
void Destroy();
|
|
|
|
void Enable( BOOL bEnable );
|
|
|
|
void Start();
|
|
void Stop();
|
|
void Beep();
|
|
|
|
private:
|
|
enum { BEEPER_SET_FREQUENCY_PORT = 0x42,
|
|
BEEPER_SET_TIMER_CHANNEL_PORT = 0x43,
|
|
BEEPER_PPI_PORT = 0x61 };
|
|
private:
|
|
void BuzzerOn( BOOL bOn );
|
|
void BuzzerFrequency( INT nFrequency );
|
|
INT Inp( WORD port );
|
|
INT Outp( WORD port, INT databyte );
|
|
BOOL Beep( DWORD dwFreq, DWORD dwDuration, HANDLE hEvent );
|
|
|
|
private:
|
|
virtual DWORD ThreadProc();
|
|
|
|
private:
|
|
DWORD m_dwVersion;
|
|
BOOL m_bEnabled;
|
|
BOOL m_bAlarmOn;
|
|
|
|
private:
|
|
CLgEvent m_EventBeep;
|
|
CLgEvent m_EventAlarm;
|
|
|
|
private:
|
|
BOOL m_bWaveAlarm;
|
|
TCHAR m_pWaveFile[MAX_PATH];
|
|
BOOL m_bWaveOn;
|
|
};
|
|
|
|
#endif
|