BitReader::BitReader(std::string fname) { data = NULL; dataSize = 0; resetPointers(); readFile(fname.c_str()); }
void filter::deleteBuffers() { // if(coefZPtr!=NULL) delete [] coefZPtr; // if(coefPPtr!=NULL) delete [] coefPPtr; if(sampleBufferIPtr!=NULL) delete [] sampleBufferIPtr; if(sampleBufferQPtr!=NULL) delete [] sampleBufferQPtr; if(sampleBufferYIPtr!=NULL) delete [] sampleBufferYIPtr; if(filteredPtr!=NULL) delete [] filteredPtr; if(volumePtr!=NULL) delete [] volumePtr; if(demodPtr!=NULL) delete [] demodPtr; resetPointers(); }
BitReader::BitReader(unsigned char * dataIn, int lengthIn) { data = NULL; dataSize = 0; resetPointers(); dataSize = lengthIn; data = new LByte[dataSize]; for(int i = 0; i < dataSize; i++) { data[i] = dataIn[i]; } }
void BitReader::print(int num) //prints all bytes read by this construct up to num { int savedBitPointer = bitPointer; int savedBytePointer = bytePointer; resetPointers(); for(int i = 0; i < num && i < dataSize; i++) { LByte byte = readByte(); print(byte); } bitPointer = savedBitPointer; bytePointer = savedBytePointer; }
void BitReader::saveRaw(char* fname) { int savedBitPointer = bitPointer; int savedBytePointer = bytePointer; resetPointers(); FILE* fi = fopen(fname, "wb"); //fopen_s(&fi, fname, "wb"); for(int i = 0; i < dataSize; i++) { LByte byte = readByte(); fwrite(&byte, sizeof(unsigned char), 1, fi); } fclose(fi); bitPointer = savedBitPointer; bytePointer = savedBytePointer; }
void VEditDLL::LoadDll( const char *dllname, WString *errmsg ) { _hdl = WSystemService::loadLibrary( dllname ); if( _hdl == 0 ) { errmsg->printf( "Unable to find editor dll '%s'. Editor functionality will be unavailable.", dllname ); } else { _connect = (ConnectFn)WSystemService::getProcAddr( _hdl, EDITCONNECT ); _file = (FileFn)WSystemService::getProcAddr( _hdl, EDITFILE ); _locate = (LocFn)WSystemService::getProcAddr( _hdl, EDITLOCATE ); _locateError = (LocErrFn)WSystemService::getProcAddr( _hdl, EDITLOCATEERROR ); _showWindow = (ShowFn)WSystemService::getProcAddr( _hdl, EDITSHOWWINDOW ); _disconnect = (DisconnectFn)WSystemService::getProcAddr( _hdl, EDITDISCONNECT ); _saveAll = (SaveAllFn)WSystemService::getProcAddr( _hdl, EDITSAVEALL ); _saveThis = (SaveThisFileFn)WSystemService::getProcAddr( _hdl, EDITSAVETHIS ); _isFileInBuf = (IsFileInBufFn)WSystemService::getProcAddr( _hdl, EDITISFILEINBUF ); if( _connect == NULL || _file == NULL || _locate == NULL || _locateError == NULL || _showWindow == NULL || _disconnect == NULL ) { errmsg->printf( "Invalid editor DLL '%s' found. Editor functionality will be unavailable.", dllname ); resetPointers(); } } }
void VEditDLL::UnloadDll( void ) { EDITDisconnect(); resetPointers(); }
VEditDLL::~VEditDLL() { resetPointers(); }
VEditDLL::VEditDLL() { _hdl = 0; resetPointers(); }
filter::filter(efilterType fType, uint dataLenght) { filterType=fType; resetPointers(); dataLen=dataLenght; }