Package Acquisition
Class RawDataBinaryDataSource
java.lang.Object
binaryFileStorage.BinaryDataSource
Acquisition.RawDataBinaryDataSource
Data source for Raw acoustic data. This is set up to NEVER
 be written to binary storage files - WAV files are way better
 for that. The purpose of this class is to enable sending of
 raw audio data over the network. Currently assumes 16 bit audio,
 but may make this more flexible in the future is higher res ADC's
 are in use within PAMGUARD.
- Author:
 - Doug Gillespie
 
- 
Field Summary
Fields inherited from class binaryFileStorage.BinaryDataSource
packSynchObject - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionbyte[]intGet a version number for the module.getPackedData(PamDataUnit pamDataUnit) Get packed binary data for either sending to file or over the networkintvoidnewFileOpened(File outputFile) Called from the BinaryOutputStream whenever a new output file is opened.voidreset()Reset anything needing resetting in the binary data source.sinkData(BinaryObjectData binaryObjectData, BinaryHeader bh, int moduleVersion) Convert data read back in in viewer mode into the correct type of PamDataUnit.sinkModuleFooter(BinaryObjectData binaryObjectData, BinaryHeader bh, ModuleHeader moduleHeader) Do something with module footer informationsinkModuleHeader(BinaryObjectData binaryObjectData, BinaryHeader bh) Do something with module header informationMethods inherited from class binaryFileStorage.BinaryDataSource
createFilenamePrefix, getBackgroundBinaryWriter, getBinaryStorageStream, getModuleFooterData, getModuleName, getModuleType, getSisterDataBlock, getSpecialDrawing, isDoBinaryStore, isSaveUpdates, isStoreData, saveData, setBinaryStorageStream, setDoBinaryStore, setSaveUpdates, setStoreData 
- 
Constructor Details
- 
RawDataBinaryDataSource
 
 - 
 - 
Method Details
- 
getModuleHeaderData
public byte[] getModuleHeaderData()- Specified by:
 getModuleHeaderDatain classBinaryDataSource- Returns:
 - Additional information (e.g. a control structure for a detector) to be stored in the Module Specific Control structure
 
 - 
getModuleVersion
public int getModuleVersion()Description copied from class:BinaryDataSourceGet a version number for the module.This is different to the version number in the main file header and allows individual modules to update their format and maintain backwards compatibility with old data
- Specified by:
 getModuleVersionin classBinaryDataSource- Returns:
 - integer module version number
 
 - 
getStreamName
- Specified by:
 getStreamNamein classBinaryDataSource- Returns:
 - Stream name to be stored in the file header
 
 - 
getStreamVersion
public int getStreamVersion()- Specified by:
 getStreamVersionin classBinaryDataSource- Returns:
 - Stream version name to be stored in the Module Specific Control structure
 
 - 
newFileOpened
Description copied from class:BinaryDataSourceCalled from the BinaryOutputStream whenever a new output file is opened.- Specified by:
 newFileOpenedin classBinaryDataSource- Parameters:
 outputFile- file information.
 - 
getPackedData
Description copied from class:BinaryDataSourceGet packed binary data for either sending to file or over the network- Specified by:
 getPackedDatain classBinaryDataSource- Parameters:
 pamDataUnit- data unit to pack- Returns:
 - packed binary data object
 
 - 
sinkData
Description copied from class:BinaryDataSourceConvert data read back in in viewer mode into the correct type of PamDataUnit.DO NOT add this unit directly to the datablock, but pass it back to the calling process which will add it to the datablock if necessary.
- Specified by:
 sinkDatain classBinaryDataSource- Parameters:
 binaryObjectData- Binary data read back from a file.bh- binary header from start of file.moduleVersion-- Returns:
 - the PamDataUnit created from these data
 
 - 
sinkModuleHeader
Description copied from class:BinaryDataSourceDo something with module header information- Specified by:
 sinkModuleHeaderin classBinaryDataSource- Parameters:
 binaryObjectData- data for the module header.bh- Binary header information
 - 
reset
public void reset()Description copied from class:BinaryDataSourceReset anything needing resetting in the binary data source. This get's called just before PamStart().- Overrides:
 resetin classBinaryDataSource
 
 -