// MgrNVE.cpp : Defines the initialization routines for the DLL. // #include "stdafx.h" #include "MgrNVE.h" #include "ConnectionManager.h" #include "PageAddServer.h" #include "PageServer.h" #include "PageVideoSettings.h" #include "PageCodecSettings.h" #include "PageAudioSettings.h" #include "PageAudioOutSettings.h" #include "PageSerialPort.h" #include "PageControlPtz.h" #include "PageEventSettings.h" #include "PageMDSettings.h" #include "PageNetwork.h" #include "PageSystemMgr.h" #include "PageMiscSettings.h" #include "PageSystemInfo.h" #include "PageUserMgr.h" #include "PageDDNS.h" #include "PageMulticast.h" #include "PageExtCmd.h" #include "PageRackInfo.h" #include "PageTraffic.h" #include "PageQoS.h" #include "PageOSDSettings.h" #include "PageArchiveData.h" #include "PageEncryption.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif // // Note! // // If this DLL is dynamically linked against the MFC // DLLs, any functions exported from this DLL which // call into MFC must have the AFX_MANAGE_STATE macro // added at the very beginning of the function. // // For example: // // extern "C" BOOL PASCAL EXPORT ExportedFunction() // { // AFX_MANAGE_STATE(AfxGetStaticModuleState()); // // normal function body here // } // // It is very important that this macro appear in each // function, prior to any calls into MFC. This means that // it must appear as the first statement within the // function, even before any object variable declarations // as their constructors may generate calls into the MFC // DLL. // // Please see MFC Technical Notes 33 and 58 for additional // details. // ///////////////////////////////////////////////////////////////////////////// // CMgrNVEApp BEGIN_MESSAGE_MAP(CMgrNVEApp, CWinApp) //{{AFX_MSG_MAP(CMgrNVEApp) // NOTE - the ClassWizard will add and remove mapping macros here. // DO NOT EDIT what you see in these blocks of generated code! //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CMgrNVEApp construction CMgrNVEApp::CMgrNVEApp() { // TODO: add construction code here, // Place all significant initialization in InitInstance m_bIgnoreEventComm = true; // - cjy, 07_0430 19:58 AfxEnableControlContainer(); // ÀÌ°É È£ÃâÇØÁà¾ß activeX¸¦ »ç¿ëÇÒ ¼ö ÀÖ´Ù. } ///////////////////////////////////////////////////////////////////////////// // The one and only CMgrNVEApp object CMgrNVEApp theApp; extern "C" BOOL PASCAL EXPORT IsPrismPlugIns(void) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); return TRUE; } extern "C" BOOL FAR WINAPI EXPORT GetPrismExtDllInfo(PRISMEXTDLLINFO* pCodecInfo) { pCodecInfo->extCategory=PRISMEXTDLL_CATEGORY_CARDMANAGER; lstrcpy(pCodecInfo->extName,"NVE"); lstrcpy(pCodecInfo->extDesc,"NVE Cardmanager"); return TRUE; } extern "C" BOOL PASCAL EXPORT CreateInstance(GUID& pGuid,void ** ppInterface) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); if(pGuid==IID_IPrismIICardManager){ * ppInterface = (void*)(new CMgrNVE); return TRUE; } return FALSE; } #define SAFE_DELETE(p) if(p!=NULL){delete p;p=NULL;} CMgrNVE::CMgrNVE() : m_refCount(1) { ZeroMemory(m_pConnection, sizeof(m_pConnection)); ZeroMemory(m_linCh, sizeof(m_linCh)); m_pCurConnection = NULL; m_uCurDlg = 0; m_pCurDlg = NULL; m_pStorage = NULL; m_pMsgManager = NULL; m_bSetup = FALSE; m_hModule = NULL; InitializeCriticalSection(&m_CS); } CMgrNVE::~CMgrNVE() { DeleteCriticalSection(&m_CS); if (m_uCurDlg == PT_AUDIO_OUT_SETTINGS) { ((CPageAudioOutSettings*)m_pCurDlg)->StopAudioOut(); } if(m_pCurDlg){ m_pCurDlg->DestroyWindow(); delete m_pCurDlg; } for(int i=0; iRelease(); m_pStorage = NULL; } if(m_pMsgManager){ m_pMsgManager->Release(); m_pMsgManager = NULL; } if (m_hModule) { FreeLibrary(m_hModule); } DestroyMediaInfo(); } //IUnknown HRESULT CMgrNVE::QueryInterface( REFIID riid,void __RPC_FAR *__RPC_FAR *ppvObject) { if(riid==IID_IUnknown){ *ppvObject = (IUnknown*)this; AddRef(); return S_OK; }else if(riid==IID_IPrismIICardManager){ AddRef(); *ppvObject = (IPrismIICardManager*)this; return S_OK; }else if(riid==IID_IProcessCtrl){ AddRef(); *ppvObject = (IProcessCtrl*)this; return S_OK; }else{ return E_NOINTERFACE; } } ULONG CMgrNVE::AddRef( void) { return InterlockedIncrement(&m_refCount); } ULONG CMgrNVE::Release( void) { LONG res= InterlockedDecrement(&m_refCount); if(res==0) { delete this; } return res; } HRESULT CMgrNVE::Load(IInstanceManager* pFrameApp,char *Dlls[],DVRAUTHINFO authInfo[],int authCount,ISettingStorage* pStorage,IMessageManager* pMsgMng) { m_pFrameApp = pFrameApp; m_pMsgManager = pMsgMng; m_pMsgManager->AddRef(); m_codvidChTypes.chMediaTypes = NULL; m_codvidChTypes1.chMediaTypes = NULL; m_codaudChTypes.chMediaTypes = NULL; m_textChTypes.chMediaTypes = NULL; m_DIChTypes.chMediaTypes = NULL; m_vidChTypes.chMediaTypes = NULL; m_MDChTypes.chMediaTypes = NULL; m_hModule = NULL; m_hModule = LoadLibrary(Dlls[3]); if(m_hModule){ *(FARPROC*)&m_Uda5Api.Cmn5CreateInstance = GetProcAddress(m_hModule,"Cmn5CreateInstance"); }else{ return E_FAIL; } CreateMediaInfo(); if(pStorage){ pStorage->MakeStorage("NVE", &m_pStorage); } pFrameApp->AddTreeViewItem(this,10,"Add Server",PT_ADD_SERVER,0,0); return S_OK; } BOOL CMgrNVE::ShowPropertyPage(HWND hWndSite,RECT rcPage,DWORD v1,DWORD v2,DWORD v3) { CWnd * pWnd=CWnd::FromHandle(hWndSite); m_pCurConnection = (CConnectionManager*)v2; m_uCurDlg = v1; switch(v1){ case PT_ADD_SERVER: m_pCurDlg= new CPageAddServer(pWnd, this, NULL); break; case PT_STATUS: m_pCurDlg= new CPageServer(pWnd, this, m_pCurConnection); break; case PT_VIDEO_SETTINGS: m_pCurDlg= new CPageVideoSettings(pWnd, this, m_pCurConnection); break; case PT_MPEG_SETTINGS: m_pCurDlg= new CPageCodecSettings(pWnd, this, m_pCurConnection); break; case PT_AUDIO_SETTINGS: m_pCurDlg= new CPageAudioSettings(pWnd, this, m_pCurConnection); break; case PT_AUDIO_OUT_SETTINGS: m_pCurDlg= new CPageAudioOutSettings(pWnd, this, m_pCurConnection); break; case PT_SERIAL_PORT: m_pCurDlg= new CPageSerialPort(pWnd, this, m_pCurConnection); break; case PT_CONTROL_PTZ: m_pCurDlg= new CPageControlPtz(pWnd, this, m_pCurConnection); break; case PT_EVENT_SETTINGS: m_pCurDlg= new CPageEventSettings(pWnd, this, m_pCurConnection); break; case PT_MD_SETTINGS: m_pCurDlg= new CPageMDSettings(pWnd, this, m_pCurConnection); break; case PT_OSD_SETTINGS: m_pCurDlg= new CPageOSDSettings(pWnd, this, m_pCurConnection); break; case PT_NETWORK: m_pCurDlg= new CPageNetwork(pWnd, this, m_pCurConnection); break; case PT_QOS: m_pCurDlg= new CPageQoS(pWnd, this, m_pCurConnection); break; case PT_SYSTEM_MGR: m_pCurDlg= new CPageSystemMgr(pWnd, this, m_pCurConnection); break; case PT_SYSTEM_INFO: m_pCurDlg= new CPageSystemInfo(pWnd, this, m_pCurConnection); break; case PT_TRAFFIC: m_pCurDlg= new CPageTraffic(pWnd, this, m_pCurConnection); break; case PT_RACK_INFO: m_pCurDlg= new CPageRackInfo(pWnd, this, m_pCurConnection); break; case PT_USER_MGR: m_pCurDlg= new CPageUserMgr(pWnd, this, m_pCurConnection); break; case PT_MULTICAST: m_pCurDlg= new CPageMulticast(pWnd, this, m_pCurConnection); break; case PT_DDNS: m_pCurDlg= new CPageDDNS(pWnd, this, m_pCurConnection); break; case PT_ENCRYPTION: m_pCurDlg= new CPageEncryption(pWnd, this, m_pCurConnection); break; case PT_MISC_SETTINGS: m_pCurDlg= new CPageMiscSettings(pWnd, this, m_pCurConnection); break; case PT_EXT_CMD: m_pCurDlg= new CPageExtCmd(pWnd, this, m_pCurConnection); break; /*case PT_ARCHIVE_DATA: m_pCurDlg= new CPageArchiveData(pWnd, this, m_pCurConnection); break;*/ case PT_NONE: m_pCurDlg= NULL; return TRUE; } TREE_PARAM t; //t.board=(BYTE)v2; t.channel=(BYTE)v3; m_pCurDlg->SetParam(t.lparam); m_pCurDlg->CreateWithDefaultTempalte(pWnd); m_pCurDlg->MoveWindow(&rcPage); m_pCurDlg->ShowWindow(SW_SHOW); m_pCurDlg->UpdateWindow(); return TRUE; } BOOL CMgrNVE::HidePropertyPage() { if(m_pCurDlg){ #if 0 // metalbrain m_pCurDlg->SaveSetting(); #endif m_pCurDlg->DestroyWindow(); delete m_pCurDlg; m_pCurDlg=NULL; m_uCurDlg = 0; } return TRUE; } HRESULT CMgrNVE::GetProcessState(UINT* pProcessState) { return S_OK; } HRESULT CMgrNVE::ProcessCommand(UINT uCmd,BOOL *bCheckState) { return S_OK; } HRESULT CMgrNVE::ProcessTimer(UINT nTimerID) { return S_OK; } HRESULT CMgrNVE::ProcessSetup() { for(int i=0; iProcessSetup(); } } m_bSetup = TRUE; /*if (m_uCurDlg == PT_ADD_SERVER) { ((CPageAddServer*)m_pCurDlg)->EnableProtocol(FALSE); }*/ return S_OK; } HRESULT CMgrNVE::ProcessEndup() { for(int i=0; iProcessEndup()) { #if 0 m_pFrameApp->SelectTreeViewItem(this,TRUE,PT_SERVER,(DWORD)m_pConnection[i],0); DeleteServerTreeView(m_pConnection[i]); #endif } } } m_bSetup = FALSE; /*if (m_uCurDlg == PT_ADD_SERVER) { ((CPageAddServer*)m_pCurDlg)->EnableProtocol(TRUE); }*/ return S_OK; } HRESULT CMgrNVE::ProcessRun() { for(int i=0;iProcessRun(); } } /*if (m_pCurDlg) { m_pCurDlg->UpdateSetting(); }*/ return S_OK; } HRESULT CMgrNVE::ProcessStop() { for(int i=0;iProcessStop(); } } /*if (m_pCurDlg) { m_pCurDlg->UpdateSetting(); }*/ return S_OK; } HRESULT CMgrNVE::SaveSetting() { if(m_pCurDlg) m_pCurDlg->SaveSetting(); #if 0 // Update media infomation when pressed Apply button if(m_pCurConnection){ char Addr[NVE_MAX_STR_LENGTH]; m_pCurConnection->GetServerAddr(); UpdateMediaInfo(m_pCurConnection->GetLinCh(), pSettings, Addr); } #endif return S_OK; } HRESULT CMgrNVE::RestoreSetting() { #if 0 if(m_pCurConnection) m_pCurConnection->RestoreSetting(); #endif return S_OK; } HRESULT CMgrNVE::ResetSetting() { if(m_pCurDlg) m_pCurDlg->ResetSetting(); return S_OK; } BOOL CMgrNVE::GetMediaTypes(LONG* mediaCount, MEDIATYPE_MULTICHANNEL** mediaTypes) { if(mediaCount) *mediaCount=4; if(mediaTypes){ mediaTypes[0]=&m_codvidChTypes; mediaTypes[1]=&m_codvidChTypes1; mediaTypes[2]=&m_codaudChTypes; mediaTypes[3]=&m_MDChTypes; } return TRUE; } BOOL CMgrNVE::CreateMediaInfo() { InitMultiChannel(m_codvidChTypes,MMEDIATYPE_VIDEO,MEDIATYPE_VIDEO_DIVX, "Net Video Encoded", 0,NVE_MAX_SERVER * NVE_MAX_CHANNEL); InitMultiChannel(m_codvidChTypes1,MMEDIATYPE_VIDEO,MEDIATYPE_VIDEO_MP4S, "Net Video Encoded", 0,NVE_MAX_SERVER * NVE_MAX_CHANNEL); InitMultiChannel(m_codaudChTypes,MMEDIATYPE_AUDIO,MEDIATYPE_AUDIO_PCM, "Net Audio Encoded", 0,NVE_MAX_SERVER * NVE_MAX_CHANNEL); InitMultiChannel(m_MDChTypes, MMEDIATYPE_AUX, MEDIATYPE_AUX_MOTIONDETECTION, "Motion Detection", 0,NVE_MAX_SERVER * NVE_MAX_CHANNEL); #if 0 InitMultiChannel(m_vidChTypes, MMEDIATYPE_VIDEO,MEDIATYPE_VIDEO_YUY2, "Net Video Raw", 0,NVE_MAX_SERVER * NVE_MAX_CHANNEL); InitMultiChannel(m_textChTypes, MMEDIATYPE_TEXT, MEDIATYPE_TEXT_ANSI, "Text", 0,NVE_MAX_SERVER * NVE_MAX_CHANNEL); InitMultiChannel(m_DIChTypes, MMEDIATYPE_AUX, MEDIATYPE_AUX_SENSOR, "Sensor", 0,NVE_MAX_SERVER * NVE_MAX_CHANNEL); #endif for(int i=0;iCodecSettings.uVideoCodec == COD5_VCT_MP4_ES) { sprintf(codType.channelName,"%s DIVX", m_pConnection[uIndex]->GetServerAddr()); codType.minorType = MEDIATYPE_VIDEO_DIVX; } else if (pSettings->CodecSettings.uVideoCodec == COD5_VCT_MJPEG) { sprintf(codType.channelName,"%s MJPEG", m_pConnection[uIndex]->GetServerAddr()); codType.minorType = MEDIATYPE_VIDEO_MJPEG; } else if (pSettings->CodecSettings.uVideoCodec == COD5_VCT_MP2_ES) { sprintf(codType.channelName,"%s MPEG2", m_pConnection[uIndex]->GetServerAddr()); codType.minorType = MEDIATYPE_VIDEO_MPEG2; } codType.imgSize.cx = CMN5_GETIMGWIDTH(pSettings->CodecSettings.uResolution); codType.imgSize.cy = CMN5_GETIMGHEIGHT(pSettings->CodecSettings.uResolution); codType.frameRate=pSettings->CodecSettings.uFrameRate; MEDIATYPE_VIDEO& codType1=m_codvidChTypes1.chVideoTypes[uIndex]; sprintf(codType1.channelName,"%s MP4S", m_pConnection[uIndex]->GetServerAddr()); codType1.channelID=uIndex; codType1.minorType = MEDIATYPE_VIDEO_MP4S; codType1.imgSize.cx = CMN5_GETIMGWIDTH(pSettings->CodecSettings.uResolution); codType1.imgSize.cy = CMN5_GETIMGHEIGHT(pSettings->CodecSettings.uResolution); codType1.frameRate=pSettings->CodecSettings.uFrameRate; MEDIATYPE_AUDIO& audType=m_codaudChTypes.chAudioTypes[uIndex]; sprintf(audType.channelName,"PCM %02d", uIndex); audType.channelID=uIndex; audType.wfx.wFormatTag = pSettings->AudioSettings.Wfx.wFormatTag; audType.wfx.nChannels = pSettings->AudioSettings.Wfx.nChannels; audType.wfx.nSamplesPerSec = pSettings->AudioSettings.Wfx.nSamplesPerSec; audType.wfx.wBitsPerSample = pSettings->AudioSettings.Wfx.wBitsPerSample; audType.wfx.nBlockAlign = (WORD)(pSettings->AudioSettings.Wfx.wBitsPerSample*pSettings->AudioSettings.Wfx.nChannels/8); audType.wfx.nAvgBytesPerSec = pSettings->AudioSettings.Wfx.nSamplesPerSec*(pSettings->AudioSettings.Wfx.wBitsPerSample/8); audType.wfx.cbSize = pSettings->AudioSettings.Wfx.cbSize; MEDIATYPE_MULTICHANNEL *mediaTypes[3]; mediaTypes[0]=&m_codvidChTypes; mediaTypes[1]=&m_codvidChTypes1; mediaTypes[2]=&m_codaudChTypes; EnterCriticalSection(&m_CS); m_pFrameApp->SetMediaTypeDetail(0, uIndex, &m_codvidChTypes.chVideoTypes[uIndex], TRUE); m_pFrameApp->SetMediaTypeDetail(1, uIndex, &m_codvidChTypes1.chVideoTypes[uIndex], TRUE); m_pFrameApp->SetMediaTypeDetail(2, uIndex, &m_codaudChTypes.chAudioTypes[uIndex], TRUE); m_pFrameApp->SetMediaTypes(3, mediaTypes, TRUE); LeaveCriticalSection(&m_CS); return TRUE; } BOOL CMgrNVE::DestroyMediaInfo() { if(m_codvidChTypes.chMediaTypes) free(m_codvidChTypes.chMediaTypes); if(m_codvidChTypes1.chMediaTypes) free(m_codvidChTypes1.chMediaTypes); if(m_codaudChTypes.chMediaTypes) free(m_codaudChTypes.chMediaTypes); if(m_MDChTypes.chMediaTypes) free(m_MDChTypes.chMediaTypes); #if 0 if(m_textChTypes.chMediaTypes) free(m_textChTypes.chMediaTypes); if(m_DIChTypes.chMediaTypes) free(m_DIChTypes.chMediaTypes); if(m_DIChTypes.chMediaTypes) free(m_vidChTypes.chMediaTypes); #endif return TRUE; } BOOL CMgrNVE::AddServer(ULONG uCh, LPCSTR Addr, ULONG uProtocol, LPCSTR ID, LPCSTR Pass) { if (!strcmp(Addr, "")) { m_pMsgManager->PushErrorCodeF("Insert server address"); m_pMsgManager->Show(TRUE); return FALSE; } #if 0 if(m_bSetup){ m_pMsgManager->PushErrorCodeF("Cannot connect server after Capture"); m_pMsgManager->Show(TRUE); return FALSE; } if(m_bConnecting){ m_pMsgManager->PushErrorCodeF("Connection trying..."); m_pMsgManager->Show(TRUE); return FALSE; } #endif ULONG i; for(i=0;iIsSameAddress(Addr)){ m_pMsgManager->PushErrorCodeF("This server is already added"); m_pMsgManager->Show(TRUE); return FALSE; } #endif } } for(i=0;iInit(pUnknown, Addr, uProtocol, ID, Pass, i,this, uCh)){ connection->Release(); delete connection; return FALSE; } //ÇöÀç¾ÆÀÌÅÛÀ».. Æ®¸®ºä¿¡ Ãß°¡ÇØ¾ß ÇÑ´Ù. m_pConnection[i] = connection; m_pCurConnection = connection; m_pFrameApp->SetTreeViewAddPosition(this,PT_ADD_SERVER,0,0); m_pFrameApp->AddTreeViewItemFormatted(this,12,PT_STATUS,(DWORD)m_pCurConnection,0,"%s",Addr); m_pFrameApp->SelectTreeViewItem(this,FALSE,PT_STATUS,(DWORD)m_pCurConnection,0); AddServerTreeView(Addr, m_pCurConnection); return TRUE; } } //ºó ½½·ÔÀÌ ¾ø´Ù. return FALSE; } BOOL CMgrNVE::DeleteServer(CConnectionManager *pConnection) { //LIST¿¡¼­ Á¦°Å... for(int i=0;iProcessStop(); m_pConnection[i]->ProcessEndup(); } if(m_bTreeView[i]){ m_pFrameApp->SelectTreeViewItem(this,TRUE,0,0,0); m_pFrameApp->DeleteTreeViewItem(this,PT_SERVER,(DWORD)m_pConnection[i],0); m_bTreeView[i] = FALSE; } #else m_pConnection[i]->ProcessStop(); m_pConnection[i]->ProcessEndup(); m_pFrameApp->SelectTreeViewItem(this,TRUE,0,0,0); m_pFrameApp->DeleteTreeViewItem(this,PT_STATUS,(DWORD)m_pConnection[i],0); DeleteServerTreeView(m_pConnection[i]); #endif m_pConnection[i]->Release(); if (m_pConnection[i]) { delete m_pConnection[i]; m_pConnection[i]=NULL; m_pCurConnection=NULL; } } } return TRUE; } BOOL CMgrNVE::AddServerTreeView(LPCSTR Addr, CConnectionManager *pConnection) { #if 0 DWORD j; #endif m_pFrameApp->SetTreeViewAddPosition(this,PT_STATUS,(DWORD)pConnection,0); m_pFrameApp->AddTreeViewItem(this,19,"Video Settings",PT_VIDEO_SETTINGS,(DWORD)pConnection,0xFF); #if 0 m_pFrameApp->AdjustTreeViewLevel(FALSE); for(j=0;jAddTreeViewItemFormatted(this,19,PT_VIDEO_SETTINGS,(DWORD)pConnection,j,"Channel %d",j); } m_pFrameApp->AdjustTreeViewLevel(TRUE); #endif m_pFrameApp->AddTreeViewItem(this,21,"Codec Settings",PT_MPEG_SETTINGS,(DWORD)pConnection,0xFF); #if 0 m_pFrameApp->AdjustTreeViewLevel(FALSE); for(j=0;jAddTreeViewItemFormatted(this,21,PT_MPEG_SETTINGS,(DWORD)pConnection,j,"Channel %d",j); } m_pFrameApp->AdjustTreeViewLevel(TRUE); #endif m_pFrameApp->AddTreeViewItem(this,13,"Audio Settings",PT_AUDIO_SETTINGS,(DWORD)pConnection,0xFF); #if 0 m_pFrameApp->AdjustTreeViewLevel(FALSE); for(j=0;jAddTreeViewItemFormatted(this,13,PT_AUDIO_SETTINGS,(DWORD)pConnection,j,"Channel %d",j); } m_pFrameApp->AdjustTreeViewLevel(TRUE); #endif if (m_pCurConnection->IsAudioOut()) { m_pFrameApp->AddTreeViewItem(this,13,"Audio Out Settings",PT_AUDIO_OUT_SETTINGS,(DWORD)pConnection,0xFF); } #if 0 m_pFrameApp->AdjustTreeViewLevel(FALSE); for(j=0;jAddTreeViewItemFormatted(this,13,PT_AUDIO_OUT_SETTINGS,(DWORD)pConnection,j,"Channel %d",j); } m_pFrameApp->AdjustTreeViewLevel(TRUE); #endif m_pFrameApp->AddTreeViewItem(this,5,"Serial Port",PT_SERIAL_PORT,(DWORD)pConnection,0xFF); m_pFrameApp->AddTreeViewItem(this,5,"Control PTZ",PT_CONTROL_PTZ,(DWORD)pConnection,0xFF); m_pFrameApp->AddTreeViewItem(this,22,"Event Settings",PT_EVENT_SETTINGS,(DWORD)pConnection,0xFF); m_pFrameApp->AddTreeViewItem(this,22,"MD Settings",PT_MD_SETTINGS,(DWORD)pConnection,0xFF); m_pFrameApp->AddTreeViewItem(this,16,"OSD Settings",PT_OSD_SETTINGS,(DWORD)pConnection,0xFF); m_pFrameApp->AddTreeViewItem(this,3,"Network Settings",PT_NETWORK,(DWORD)pConnection,0xFF); m_pFrameApp->AddTreeViewItem(this,3,"QoS Settings",PT_QOS,(DWORD)pConnection,0xFF); m_pFrameApp->AddTreeViewItem(this,3,"System Management",PT_SYSTEM_MGR,(DWORD)pConnection,0xFF); m_pFrameApp->AddTreeViewItem(this,4,"System Information",PT_SYSTEM_INFO,(DWORD)pConnection,0xFF); m_pFrameApp->AddTreeViewItem(this,4,"Traffic Information",PT_TRAFFIC,(DWORD)pConnection,0xFF); if (m_pCurConnection->IsRack()) { m_pFrameApp->AddTreeViewItem(this,4,"Rack Information",PT_RACK_INFO,(DWORD)pConnection,0xFF); } m_pFrameApp->AddTreeViewItem(this,12,"User Management",PT_USER_MGR,(DWORD)pConnection,0xFF); m_pFrameApp->AddTreeViewItem(this,17,"Multicast",PT_MULTICAST,(DWORD)pConnection,0xFF); m_pFrameApp->AddTreeViewItem(this,2,"DDNS",PT_DDNS,(DWORD)pConnection,0xFF); m_pFrameApp->AddTreeViewItem(this,14,"Encryption",PT_ENCRYPTION,(DWORD)pConnection,0xFF); m_pFrameApp->AddTreeViewItem(this,5,"Misc Settings",PT_MISC_SETTINGS,(DWORD)pConnection,0xFF); m_pFrameApp->AddTreeViewItem(this,8,"RTSP/CGI",PT_EXT_CMD,(DWORD)pConnection,0xFF); //m_pFrameApp->AddTreeViewItem(this,17,"USB Recording",PT_ARCHIVE_DATA,(DWORD)pConnection,0xFF); return TRUE; } BOOL CMgrNVE::DeleteServerTreeView(CConnectionManager *pConnection) { m_pFrameApp->SetTreeViewAddPosition(this,PT_STATUS,(DWORD)pConnection,0); m_pFrameApp->DeleteTreeViewItem(this,PT_VIDEO_SETTINGS,(DWORD)pConnection,0xFF); m_pFrameApp->DeleteTreeViewItem(this,PT_MPEG_SETTINGS,(DWORD)pConnection,0xFF); m_pFrameApp->DeleteTreeViewItem(this,PT_AUDIO_SETTINGS,(DWORD)pConnection,0xFF); m_pFrameApp->DeleteTreeViewItem(this,PT_AUDIO_OUT_SETTINGS,(DWORD)pConnection,0xFF); m_pFrameApp->DeleteTreeViewItem(this,PT_SERIAL_PORT,(DWORD)pConnection,0xFF); m_pFrameApp->DeleteTreeViewItem(this,PT_CONTROL_PTZ,(DWORD)pConnection,0xFF); m_pFrameApp->DeleteTreeViewItem(this,PT_EVENT_SETTINGS,(DWORD)pConnection,0xFF); m_pFrameApp->DeleteTreeViewItem(this,PT_MD_SETTINGS,(DWORD)pConnection,0xFF); m_pFrameApp->DeleteTreeViewItem(this,PT_OSD_SETTINGS,(DWORD)pConnection,0xFF); m_pFrameApp->DeleteTreeViewItem(this,PT_NETWORK,(DWORD)pConnection,0xFF); m_pFrameApp->DeleteTreeViewItem(this,PT_QOS,(DWORD)pConnection,0xFF); m_pFrameApp->DeleteTreeViewItem(this,PT_SYSTEM_MGR,(DWORD)pConnection,0xFF); m_pFrameApp->DeleteTreeViewItem(this,PT_SYSTEM_INFO,(DWORD)pConnection,0xFF); m_pFrameApp->DeleteTreeViewItem(this,PT_TRAFFIC,(DWORD)pConnection,0xFF); m_pFrameApp->DeleteTreeViewItem(this,PT_RACK_INFO,(DWORD)pConnection,0xFF); m_pFrameApp->DeleteTreeViewItem(this,PT_USER_MGR,(DWORD)pConnection,0xFF); m_pFrameApp->DeleteTreeViewItem(this,PT_MULTICAST,(DWORD)pConnection,0xFF); m_pFrameApp->DeleteTreeViewItem(this,PT_DDNS,(DWORD)pConnection,0xFF); m_pFrameApp->DeleteTreeViewItem(this,PT_ENCRYPTION,(DWORD)pConnection,0xFF); m_pFrameApp->DeleteTreeViewItem(this,PT_MISC_SETTINGS,(DWORD)pConnection,0xFF); m_pFrameApp->DeleteTreeViewItem(this,PT_EXT_CMD,(DWORD)pConnection,0xFF); //m_pFrameApp->DeleteTreeViewItem(this,PT_ARCHIVE_DATA,(DWORD)pConnection,0xFF); return TRUE; } HRESULT CMgrNVE::GetApiCount(UINT* pCount) { //*pCount = 3; return E_FAIL; } HRESULT CMgrNVE::GetApiInfo(UINT apiIndex,DVRAPIINFO* pApiInfo) { /*ZeroMemory(pApiInfo, sizeof(DVRAPIINFO)); if(apiIndex == 0) { pApiInfo->dwApiVer = MAKE_VERSION( 5, 0x0001 ); pApiInfo->dwApiMask = (0x01 << CAPAPI_DLL_INDEX); pApiInfo->pCapApi = (VOID*)m_pCurConnection->GetCap5Api(); pApiInfo->dwApiMask = (0x01 << CODAPI_DLL_INDEX); pApiInfo->pCapApi = (VOID*)m_pCurConnection->GetCod5Api(); pApiInfo->dwApiMask = (0x01 << NETAPI_DLL_INDEX); pApiInfo->pCapApi = (VOID*)m_pCurConnection->GetNet5Api(); return S_OK; } else { return E_FAIL; }*/ return E_FAIL; } BOOL CMgrNVE::ShowVStatus(CMN5_VIDEO_STATUS_INFO *pInfo, CConnectionManager *pConnMgr) { if (m_uCurDlg != PT_EVENT_SETTINGS) { return FALSE; } if (m_pCurDlg->GetConnMgr() != pConnMgr) { return FALSE; } CPageEventSettings *pDlg = (CPageEventSettings*)m_pCurDlg; pDlg->ShowVStatus(pInfo); return TRUE; } BOOL CMgrNVE::ShowDI(CMN5_SENSOR_STATUS_INFO *pInfo, CConnectionManager *pConnMgr) { if (m_uCurDlg != PT_EVENT_SETTINGS) { return FALSE; } if (m_pCurDlg->GetConnMgr() != pConnMgr) { return FALSE; } CPageEventSettings *pDlg = (CPageEventSettings*)m_pCurDlg; pDlg->ShowDI(pInfo); return TRUE; }