?? voicepool.cpp
字號:
// VoicePool.cpp: implementation of the CVoicePool class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "mdf.h"
#include "VoicePool.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
#define VOICE_MAX 500 ;
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
extern CMDFApp theApp ;
//##ModelId=44B6F88301C6
CVoicePool::CVoicePool()
{
hEvent = CreateEvent ( NULL , FALSE , TRUE , NULL ) ; //建立信號狀態
m_nCount = 0 ;
m_nMax = VOICE_MAX ;
}
//##ModelId=44B6F88301C7
CVoicePool::~CVoicePool()
{
}
//##ModelId=44B6F88301A9
int CVoicePool::AddVoice(CString strEQName, CString strAddr, int nPort, HWND hWnd,CString strName,CString strPhone)
{
CString strTip ;
sVoice f_Voice ;
f_Voice.strEQName = strEQName ;
f_Voice.strEQAddr = strAddr ;
f_Voice.strName = strName ;
f_Voice.strPhone = strPhone ;
f_Voice.nEQPort = nPort ;
f_Voice.nFault = 0 ;
f_Voice.hWnd = hWnd ;
WaitForSingleObject ( hEvent , INFINITE ) ;
strTip.Format("程序:添加一條語音 接收:%s",f_Voice.strName) ;
theApp.TestWriteLog(strTip) ;
m_VoiceList.AddTail(f_Voice) ;
m_nCount = m_VoiceList.GetCount() ;
SetEvent ( hEvent ) ;
return 0 ;
}
//##ModelId=44B6F88301A8
int CVoicePool::DelVoice()
{
CString strTip ;
sVoice f_Voice ;
WaitForSingleObject( hEvent , INFINITE ) ;
if( !m_VoiceList.IsEmpty() )
{
f_Voice = m_VoiceList.GetHead() ;
strTip.Format("程序:刪除一條語音 接收:%s",f_Voice.strName) ;
theApp.TestWriteLog(strTip) ;
m_VoiceList.RemoveHead() ;
}
m_nCount = m_VoiceList.GetCount() ;
SetEvent( hEvent ) ;
return 0 ;
}
//##ModelId=44B6F88301A6
int CVoicePool::GetVoice(sVoice &f_Voice)
{
WaitForSingleObject( hEvent,INFINITE) ;
if( !m_VoiceList.IsEmpty() )
f_Voice = m_VoiceList.GetHead() ;
else
return -1 ;
SetEvent( hEvent ) ;
return 0 ;
}
//##ModelId=44B6F88301A5
int CVoicePool::GetCount()
{
return m_nCount ;
}
//##ModelId=44B6F8830197
int CVoicePool::AddSVoice(sVoice f_Voice)
{
CString strTip ;
WaitForSingleObject ( hEvent , INFINITE ) ;
strTip.Format("程序:添加一條語音 接收:%s",f_Voice.strName) ;
theApp.TestWriteLog(strTip) ;
m_VoiceList.AddTail(f_Voice) ;
m_nCount = m_VoiceList.GetCount() ;
SetEvent ( hEvent ) ;
return 0 ;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -