| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- /*************************************************************************
- 【文件名】 IprControl.h
- 【功能模块和目的】 IPR控制类头文件
- 【开发者及日期】 郑石诺 2016/04/08
- 【版本】 V1.0.0
- 【版权信息】 Copyright (C)2016 河南华谊网络科技有限公司
- 【更改记录】
- *************************************************************************/
- #pragma once
- class CLine;
- class CLineRecordIprr;
- class CLineRecordIpra;
- /*************************************************************************
- 【类名】 CIprControl
- 【功能】
- 【接口说明】 IPR控制类
- 【开发者及日期】 郑石诺 2016/04/08
- 【版本】 V1.0.0
- 【版权信息】 Copyright (C)2016 河南华谊网络科技有限公司
- 【更改记录】
- *************************************************************************/
- class CIprControl
- {
- SINGLETON_DECLARE(CIprControl)
- public:
- ~CIprControl(void);
- int getIprrLineCount(void) const { return m_IprrLineArray.GetCount(); }
- int getIpraLineCount(void) const { return m_IpraLineArray.GetCount(); }
- void init(void);
- void release(void);
- void newIprrLine(int LineID);
- void newIpraLine(int LineID);
- CLine* findLineByID(int LineID); // 根据逻辑线号查找线路基类
- CLineRecordIprr* findLineByIPOLineID(int IpoLineID); // 根据IPO线路号查找线路基类
- // 录音线路命令处理
- void onCmdLineRecord(CLineRecordIprr* pLine, CPduEntity* pPdu); // 录音命令处理
- void onCmdLineControl(CLineRecordIprr* pLine, CPduEntity* pPdu); // 录音线路控制命令处理
- // 事件处理
- void onEventUsbKeyRemoved(PSSM_EVENT pEvent); // 授权狗被移除事件处理
- void onEventAuthOverflow(PSSM_EVENT pEvent); // 授权溢出事件处理
- void onEventSlaverConnected(PSSM_EVENT pEvent); // 录音slaver连接事件处理
- void onEventSlaverDisconnected(PSSM_EVENT pEvent); // 录音slaver连接中断事件处理
- void onEventStartSlaverCb(PSSM_EVENT pEvent); // 启动slaver反馈事件的处理
- void onEventCloseSlaverCb(PSSM_EVENT pEvent); // 关闭slaver反馈事件的处理
- void onEventStationAdd(PSSM_EVENT pEvent); // station添加事件的处理
- void onEventStationRemoved(PSSM_EVENT pEvent); // station删除事件的处理
- void onEventDChannel(PSSM_EVENT pEvent); // D通道信令事件处理
- void onEventIprState(CLineRecordIprr* pLine, int State); // IPR录音事件处理
- void onEventIpaState(CLineRecordIpra* pLine, int State); // IPR录音事件处理
- void onEventStartRecCb(CLineRecordIprr* pLine, PSSM_EVENT pEvent); // 开始录音反馈事件的处理
- void onEventStopRecCb(CLineRecordIprr* pLine, PSSM_EVENT pEvent); // 结束录音反馈事件的处理
- void onEventPauseRecCb(CLineRecordIprr* pLine, PSSM_EVENT pEvent); // 暂停录音反馈事件的处理
- void onEventRestartRecCb(CLineRecordIprr* pLine, PSSM_EVENT pEvent); // 重启录音反馈事件的处理
- void onEventActiveSessionCb(CLineRecordIprr* pLine, PSSM_EVENT pEvent); // 激活会话反馈事件的处理
- void onEventDeactiveSessionCb(CLineRecordIprr* pLine, PSSM_EVENT pEvent); // 去激活会话反馈事件的处理
- void onEventActiveAndRecCb(CLineRecordIprr* pLine, PSSM_EVENT pEvent); // 激活会话并录音反馈事件的处理
- void onEventDeactiveAndStopRecCb(CLineRecordIprr* pLine, PSSM_EVENT pEvent);// 去激活停止录音反馈事件的处理
- void onEventMediaSessionStarted(CLineRecordIpra* pLine, PSSM_EVENT pEvent); // 媒体会话开始事件的处理
- void onEventMediaSessionStoped(CLineRecordIpra* pLine, PSSM_EVENT pEvent); // 媒体会话结束事件的处理
- private:
- CIprControl(void);
- DWORD __checkRecFileEnv(LPCTSTR RecFile);
- void __scanIprSlaver(void);
- void __openIprSlaver(void);
- void __closeIprSlaver(void);
- CLineRecordIpra* __findLineIpraBySessionId(int SessionId);
- CLineRecordIprr* __findLineIprrByStationId(int StationId);
- bool __startRecord(CLineRecordIprr* pLine, LPCTSTR FileName); // 录音
- bool __stopRecord(CLineRecordIprr* pLine); // 停止留言/录音
- bool __pauseRecord(CLineRecordIprr* pLine); // 暂停录音
- bool __resumeRecord(CLineRecordIprr* pLine); // 继续录音
- private:
- int m_IprBoardId;
- int m_IpaBoardId;
- int m_SlaverCount;
- IPR_SLAVERADDR m_IprSlaver; // 目前仅考虑适用单路slaver
- CArray<CLineRecordIprr*, CLineRecordIprr*> m_IprrLineArray;
- CArray<CLineRecordIpra*, CLineRecordIpra*> m_IpraLineArray;
- };
|