void DeviceSource::Stop() { if(!bCapturing) return; bCapturing = false; control->Stop(); FlushSamples(); }
/* * MainDriver - message handler for sampler */ long __export FAR PASCAL MainDriver( HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam ) { FARPROC proc; switch (message) { case WM_TIMER: FlushSamples( (3*MAX_SAMPLES)/4 ); /* KLUDGE ALERT - flush tolerence should be done for real! */ break; case WM_CLOSE: if( SharedMemory->ShopClosed ) { KillTimer( MainWindowHandle, TIMER_ID ); DestroyWindow( MainWindowHandle ); return( 0 ); } MyOutput( MsgArray[MSG_SAMPLE_13-ERR_FIRST_MESSAGE] ); return( 0 ); break; case WM_COMMAND: switch( wparam ) { case MSG_ABOUT: proc = MakeProcInstance( (FARPROC)About, InstanceHandle ); DialogBox(InstanceHandle, ResName( "AboutBox" ), hwnd, (DLGPROC)proc); FreeProcInstance(proc); break; case MSG_OPT: Usage(); break; default: return( DefWindowProc( hwnd, message, wparam, lparam ) ); } break; case WM_DESTROY: PostQuitMessage( 0 ); break; default: return( DefWindowProc( hwnd, message, wparam, lparam ) ); } return( 0 ); } /* MainDriver */
DeviceSource::~DeviceSource() { Stop(); UnloadFilters(); FlushSamples(); SafeReleaseLogRef(capture); SafeReleaseLogRef(graph); if(hConvertThreads) Free(hConvertThreads); if(convertData) Free(convertData); if(hSampleMutex) OSCloseMutex(hSampleMutex); }