//ファイルから音楽を読み込む BOOL CMusic::LoadMusicFile(LPCTSTR file_name) { Stop(); UnInit(); //フィルタグラフマネージャを作成する CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (LPVOID *)&m_lpGraph); //フィルタグラフを構築する m_hResult = m_lpGraph->RenderFile(file_name, NULL); if (FAILED(m_hResult)) return FALSE; //メディアコントロールインターフェイスを要求する m_hResult = m_lpGraph->QueryInterface(IID_IMediaControl, (LPVOID *)&m_lpMediaControl); if (FAILED(m_hResult)) return FALSE; //メディアイベントインターフェイスを要求する m_hResult = m_lpGraph->QueryInterface(IID_IMediaEventEx, (LPVOID *)&m_lpMediaEvent); if (FAILED(m_hResult)) return FALSE; //メディアシーキングインターフェイスを要求する m_hResult = m_lpGraph->QueryInterface(IID_IMediaSeeking, (LPVOID *)&m_lpMediaSeeking); if (FAILED(m_hResult)) return FALSE; //ビデオウィンドウインターフェイスを要求する m_hResult = m_lpGraph->QueryInterface(IID_IVideoWindow, (LPVOID *)&m_lpVideoWindow); if (FAILED(m_hResult)) return FALSE; //ベーシックビデオインターフェイスを要求する m_hResult = m_lpGraph->QueryInterface(IID_IBasicVideo, (LPVOID *)&m_lpBasicVideo); if (FAILED(m_hResult)) return FALSE; //ベーシックオーディオインターフェイスを要求する m_hResult = m_lpGraph->QueryInterface(IID_IBasicAudio, (LPVOID *)&m_lpBasicAudio); if (FAILED(m_hResult)) return FALSE; //ループ再生用のイベントを通知 m_lpMediaEvent->SetNotifyWindow((OAHWND)(*m_hWnd),WM_DIRECTSHOWMESSAGE,(LPARAM)this); return TRUE; }
bool KOccupyList::Init(int nSize) { if (nSize == m_nTotalCount) { FreeAll(); } else { UnInit(); m_pNodeList = (KOccupyListNode*)malloc(sizeof(KOccupyListNode) * nSize); if (m_pNodeList) { m_nTotalCount = nSize; for (int i = 0; i < m_nTotalCount; i++) { m_pNodeList[i].nItemIndex = i; m_pNodeList[i].nItemInListIndex = i; } } } return (m_pNodeList != NULL); }
CX264Encoder::~CX264Encoder() { UnInit(); }
CMatrixMultPoint2D::~CMatrixMultPoint2D() { UnInit(); }
KG3DSceneEntityGroup::~KG3DSceneEntityGroup(void) { UnInit(); }
BSocketAcceptor::~BSocketAcceptor() { UnInit(); }
KAwardSetting::~KAwardSetting() { UnInit(); }
OSSPECFNC::~OSSPECFNC() { UnInit(); }
CGTConfig::~CGTConfig() { UnInit(); }
KGTestMapDisuseResource::~KGTestMapDisuseResource() { UnInit(); }
//デストラクタ CMusic::~CMusic(void) { UnInit(); }
ShareInfo::~ShareInfo() { if (selfMode != NONE) ReleaseExclusive(); UnInit(); }
void CBaseObject::OnRecycle() { SetActive(false); UnInit(); }
CWinRenderer::~CWinRenderer() { UnInit(); }
bool alienFx::cAlienfx_device::Init() { if (lUsbContext != NULL) { std::cerr << "Init() called more than once, fix this!" << std::endl; exit(1); } libusb_init(&lUsbContext); for (auto fxDevice : gAlienfx_devices) { lDevice = &fxDevice; if (lVerbosity > 1) { std::cout << "Looking for " << lDevice->devName << "... "; } lAlienFx = libusb_open_device_with_vid_pid(lUsbContext, lDevice->VID, lDevice->PID); if (lAlienFx == NULL && (lVerbosity > 1)) { std::cout << "not found." << std::endl; } if (lAlienFx != NULL) { if (lVerbosity > 1) { std::cout << " found!" << std::endl; } // Steal device: int res = libusb_kernel_driver_active(lAlienFx, 0); if (res == 1) { if (lVerbosity > 1) { std::cout << "Another kernel driver is active, detaching it... "; } res = libusb_detach_kernel_driver(lAlienFx, 0); if (res == 0) { if (lVerbosity > 1) { std::cout << "success!" << std::endl; } } else { if (lVerbosity > 1) { std::cout << "failure!" << std::endl; } } } if (lVerbosity > 1) { std::cout << "Claiming interface... " << std::endl; } res = libusb_claim_interface(lAlienFx, 0); if (res == 0) { if (lVerbosity > 1) { std::cout << "success!" << std::endl; } if (lVerbosity > 0) { std::cout << "Found " << lDevice->devName << ", using it." << std::endl; } break; } else { std::cerr << "Could not claim interface!" << std::endl; UnInit(); exit(1); } if (res == LIBUSB_ERROR_NOT_FOUND) { std::cerr << "Failed to get USB device! Are you running two instances of this tool?" << std::endl; UnInit(); exit(1); } } } if (lAlienFx == NULL) { return false; } else { return true; } }
alienFx::cAlienfx_device::~cAlienfx_device() { UnInit(); }
CMessage::~CMessage() { UnInit(); }
CGSConfig::~CGSConfig() { UnInit() ; }
CMatrixMultPoint3D::~CMatrixMultPoint3D() { UnInit(); }
void KGObjectPropertyEditDlg::OnBnClickedCancel() { UnInit(); }
BOOL KAwardMgr::Reload() { UnInit(); return Init(); }
CDNSLookup::~CDNSLookup() { UnInit(); }
DataList::~DataList() { UnInit(); }
void HistHash::Clear() { UnInit(); Init(MAX_HISTHASH); top = end = lruTop = lruEnd = NULL; }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------ bool CameraRendererRGB565GL2::Render ( const uint8_t* img, uint16_t w, uint16_t h ) { if(w != mWidth || h != mHeight ) { mWidth = w; mHeight = h; UnInit(); } if(!mInitialized && !Init()) { EPRINTF("CameraRenderer::Initialize FAILED"); return false; } if(NULL == img) { EPRINTF("NULL Image Buffer. Can't render camera image."); return false; } mFPSCounter.FrameTick(); //Make sure that previous OpenGL Error have been cleaned. glGetError(); // needed for unity compatiblity glDisable(GL_DEPTH_TEST); glDisable(GL_CULL_FACE); //Unity does not unbind these buffers before we are called, so we have to do so. //This should shouldn't have an effect on other rendering solutions as long as //the programmer is binding these buffers properly glBindBuffer(GL_ARRAY_BUFFER, 0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); glUseProgram(mProgramObject); CameraUtil::checkGlError("glUseProgram"); // Load vertex data glVertexAttribPointer( mGL_av4_PositionLoc, 3, GL_FLOAT, GL_FALSE, 5 * sizeof(float), mVertices ); CameraUtil::checkGlError("glVertexAttribPointer"); glVertexAttribPointer( mGL_av2_TexCoordLoc, 2, GL_FLOAT, GL_FALSE, 5 * sizeof(float), &mVertices[3] ); CameraUtil::checkGlError("glVertexAttribPointer"); glEnableVertexAttribArray( mGL_av4_PositionLoc ); glEnableVertexAttribArray( mGL_av2_TexCoordLoc ); //Update Texture Image. UpdateTextures(img, w, h); glActiveTexture( GL_TEXTURE0 ); glBindTexture( GL_TEXTURE_2D, mTextureId[0] ); if(CameraUtil::checkGlError("glBindTexture-RGB")){} glUniform1i( mGL_u_ImgRGBLoc, 0); glDrawArrays( GL_TRIANGLE_STRIP, 0, 4 ); CameraUtil::checkGlError("glDrawArrays"); glDisableVertexAttribArray( mGL_av4_PositionLoc ); glDisableVertexAttribArray( mGL_av2_TexCoordLoc ); return true; }
KAwardManager::~KAwardManager() { UnInit(); }
CFirewallOpener::~CFirewallOpener(void) { UnInit(); }
HRESULT CDll_RS232::Init( CMacroString PortName , DWORD dwBaudRate , BYTE byParity , BYTE byStopBits , BYTE byByteSize ) { HRESULT hr = S_OK ; if ( m_bIsConnection ) UnInit( ) ; ATLASSERT( m_SignalDataReceive ); try{ m_hCommPort = CreateFile( PortName , GENERIC_READ | GENERIC_WRITE , NULL , NULL , OPEN_EXISTING , FILE_FLAG_OVERLAPPED , NULL ) ; if ( m_hCommPort == INVALID_HANDLE_VALUE ){ ATLTRACE( "COM port openning failed\r\n" ) ; return E_FAIL ; } ATLTRACE( "COM port openning successfully\r\n" ) ; if ( !SetCommMask( m_hCommPort , EV_RXCHAR ) ){ ATLASSERT( 0 ) ; ATLTRACE( "Get Comm Port Mask failed\r\n" ) ; return E_FAIL ; } DCB dcb = { 0 } ; if ( !GetCommState( m_hCommPort , &dcb ) ){ ATLASSERT( 0 ) ; ATLTRACE( "Get Comm Port State failed\r\n" ) ; return E_FAIL ; } dcb.BaudRate = dwBaudRate; dcb.ByteSize = byByteSize; dcb.Parity = byParity; if ( byStopBits == 1 ) dcb.StopBits = ONESTOPBIT; else if (byStopBits == 2 ) dcb.StopBits = TWOSTOPBITS; else dcb.StopBits = ONE5STOPBITS; dcb.fDsrSensitivity = 0; dcb.fDtrControl = DTR_CONTROL_ENABLE; dcb.fOutxDsrFlow = 0; if (!::SetCommState (m_hCommPort,&dcb)) { ATLASSERT( 0 ) ; ATLTRACE( "Set Comm Port State failed\r\n" ) ; return E_FAIL ; } COMMTIMEOUTS timeouts; timeouts.ReadIntervalTimeout = MAXDWORD; timeouts.ReadTotalTimeoutMultiplier = 0; timeouts.ReadTotalTimeoutConstant = 0; timeouts.WriteTotalTimeoutMultiplier = 0; timeouts.WriteTotalTimeoutConstant = 0; if (!SetCommTimeouts(m_hCommPort, &timeouts)) { ATLASSERT( 0 ) ; ATLTRACE( "Set Comm Port Timeouts failed\r\n" ) ; return E_FAIL ; } m_hTerminate = CreateEvent( NULL , NULL , NULL , NULL ) ; m_hThreadStarted = CreateEvent( NULL , NULL , NULL , NULL ) ; m_hThread = ( HANDLE )_beginthreadex( NULL , NULL , CDll_RS232::ThreadFn , ( void* )this , NULL , NULL ) ; DWORD dwWait = WaitForSingleObject( m_hThreadStarted , INFINITE ) ; ATLASSERT( dwWait == WAIT_OBJECT_0 ) ; CloseAndClearHandle( m_hThreadStarted ) ; m_bIsConnection = TRUE ; }catch(...) { ATLASSERT( 0 ) ; hr = E_FAIL ; } return hr ; }
KG3DTestLoadMesh::~KG3DTestLoadMesh(void) { UnInit(); }
KLevelMoneyDropList::~KLevelMoneyDropList(void) { UnInit(); }