//---------------------------------------------------------------------------- // Laser Guard Ltd. // Copyright © 2000-2002. All Rights Reserved. // Version 1.0 01/01/2000 // Last modification: 08/10/2003 // PROJECT: // SUBSYSTEM: // FILE: DeviceVM.cpp // AUTHOR: Sergey Chizhevskiy // OVERVIEW // ~~~~~~~~ // Source file of DeviceVM.cpp //---------------------------------------------------------------------------- // DeviceVM.cpp: implementation of the CDeviceVM class. // ////////////////////////////////////////////////////////////////////// #include "stdafx.h" //#include "chicago.h" #include "DeviceVM.h" #include "VideoMatrix.h" #include "..\..\LgLib\Version.h" #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW #endif ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// CDeviceVM::CDeviceVM() { m_pVideoMatrix = NULL; m_nInput = 0; m_nOutput = 0; m_pOutput = 0; LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CDeviceVM::CDeviceVM") ); } CDeviceVM::~CDeviceVM() { if( m_pOutput ) delete [] m_pOutput; LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CDeviceVM::~CDeviceVM") ); } void CDeviceVM::SetIOCount( int nInputCount, int nOutputCount ) { ASSERT( m_pOutput==NULL ); m_nInput = nInputCount; m_nOutput = nOutputCount; m_pOutput = new int[ m_nOutput ]; for( int i = 0; i < nOutputCount; i++ ) m_pOutput[i] = VI_UNDEFINED; PostInit(); } void CDeviceVM::SetVideoMatrix( CVideoMatrix *pVM ) { m_pVideoMatrix = pVM; } void CDeviceVM::PostConnect( int nInput, int nOutput ) { DVMEVENT event; event.id = DVMC_CONNECT; event.nInput = nInput; event.nOutput = nOutput; m_Queue.Push( event ); } void CDeviceVM::PostGetState() { DVMEVENT event; event.id = DVMC_GET_STATE; m_Queue.Push( event ); } void CDeviceVM::PostInit() { DVMEVENT event; event.id = DVMC_INIT; m_Queue.Push( event ); } void CDeviceVM::SetConnect( int nInput, int nOutput ) { ASSERT( m_pVideoMatrix!=NULL ); m_pVideoMatrix->PostConnect( nInput, nOutput ); }