📄 vpblid.h
字号:
/* * vpblid.h * * Voicetronix VPB4 line interface device * * Copyright (c) 1999-2000 Equivalence Pty. Ltd. * * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. * * The Original Code is Open H323 Library. * * The Initial Developer of the Original Code is Equivalence Pty. Ltd. * * Contributor(s): ______________________________________. * * $Log: vpblid.h,v $ * Revision 1.3 2000/05/02 04:32:25 robertj * Fixed copyright notice comment. * * Revision 1.2 2000/01/07 08:28:09 robertj * Additions and changes to line interface device base class. * * Revision 1.1 1999/12/23 23:02:35 robertj * File reorganision for separating RTP from H.323 and creation of LID for VPB support. * */#ifndef __VPB_LID_H#define __VPB_LID_H#include "lid.h"/**This class describes the xJack line interface device. */class OpalVpbDevice : public OpalLineInterfaceDevice{ PCLASSINFO(OpalVpbDevice, OpalLineInterfaceDevice); public: /**Create a new, closed, device for a VPB card. */ OpalVpbDevice(); /**Destroy line interface device. This calls Close() on the device. */ ~OpalVpbDevice() { Close(); } /**Open the xJack device. */ virtual BOOL Open( const PString & device /// Device identifier name. ); /**Close the xJack device. */ virtual BOOL Close(); /**Get the device name. */ virtual PString GetName() const; /**Get the total number of lines supported by this device. */ virtual unsigned GetLineCount(); /**Determine if line is currently off hook. This returns TRUE if GetLineState() is a state that implies the line is off hook (eg OffHook or LineBusy). */ virtual BOOL IsLineOffHook( unsigned line /// Number of line ); /**Set the state of the line. Note that not be possible on a given line. */ virtual BOOL SetLineOffHook( unsigned line, /// Number of line BOOL newState = TRUE /// New state to set ); /**Determine if line is ringing. */ virtual BOOL IsLineRinging( unsigned line, /// Number of line DWORD * cadence = NULL /// Cadence of incoming ring ); /**Set the codec for reading. */ virtual BOOL SetReadCodec( unsigned line, /// Number of line RTP_DataFrame::PayloadTypes codec /// Codec type ); /**Set the codec for writing. */ virtual BOOL SetWriteCodec( unsigned line, /// Number of line RTP_DataFrame::PayloadTypes codec /// Codec type ); /**Stop the read codec. */ virtual BOOL StopReadCodec( unsigned line /// Number of line ); /**Stop the write codec. */ virtual BOOL StopWriteCodec( unsigned line /// Number of line ); /**Set the read frame size in bytes. Note that a LID may ignore this value so always use GetReadFrameSize() for I/O. */ virtual BOOL SetReadFrameSize( unsigned line, /// Number of line PINDEX frameSize /// New frame size ); /**Set the write frame size in bytes. Note that a LID may ignore this value so always use GetReadFrameSize() for I/O. */ virtual PINDEX SetWriteFrameSize( unsigned line, /// Number of line PINDEX frameSize /// New frame size ); /**Get the read frame size in bytes. All calls to ReadFrame() will return this number of bytes. */ virtual PINDEX GetReadFrameSize( unsigned line /// Number of line ); /**Get the write frame size in bytes. All calls to WriteFrame() must be this number of bytes. */ virtual PINDEX GetWriteFrameSize( unsigned line /// Number of line ); /**Low level read of a frame from the device. */ virtual BOOL ReadFrame( unsigned line, /// Number of line void * buf /// Pointer to a block of memory to receive the read bytes. ); /**Low level write frame to the device. */ virtual BOOL WriteFrame( unsigned line, /// Number of line const void * buf /// Pointer to a block of memory to write. ); /**Set volume level for recording. */ BOOL SetRecordVolume( unsigned line, /// Number of line unsigned volume /// Volume level from 0 to 0x100 ); /**Set volume level for playing. */ BOOL SetPlayVolume( unsigned line, /// Number of line unsigned volume /// Volume level from 0 to 0x100 ); /**Read a DTMF digit detected. This may be characters from the set 0-9, A-D, * or #. A null ('\0') character indicates that there are no tones in the queue. */ virtual char ReadDTMF( unsigned line /// Number of line ); /**Play a DTMF digit. Any characters that are not in the set 0-9, A-D, * or # will be ignored. */ virtual BOOL PlayDTMF( unsigned line, /// Number of line const char * digits, /// DTMF digits to be played DWORD onTime = 90, /// Number of milliseconds to play each DTMF digit DWORD offTime = 30 /// Number of milliseconds between digits ); /**See if a tone is detected. */ virtual CallProgressTones IsToneDetected( unsigned line /// Number of line ); protected: unsigned cardNumber; unsigned lineCount; enum { MaxLineCount = 8 }; struct LineState { BOOL Open(unsigned cardNumber, unsigned lineNumber); BOOL SetLineOffHook(BOOL newState); BOOL IsLineRinging(DWORD *); int handle; BOOL currentHookState; PINDEX readFrameSize; PINDEX writeFrameSize; BOOL readIdle; BOOL writeIdle; PTimer ringTimeout; } lineState[MaxLineCount];};#endif // __VPB_LID_H/////////////////////////////////////////////////////////////////////////////
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -