Package dataPlotsFX.rawDataPlotFX
Class RawSoundPlotDataFX
java.lang.Object
dataPlotsFX.rawDataPlotFX.RawSoundPlotDataFX
Raw sound data is by default not stored in memory. There are good reasons for this, the first being that raw sound data is generally very large. That creates problems when trying to
 display raw sound data on a display. Only a second or so is available in memory for plotting. In order to have display which show a more than a second or so of data there needs to be
 an efficient way to store the display information for showing a sound data. 
 
This performs operations to plot one channel of raw sound data on a plot pane of a tdGraphFX. The data to display for each pixel is stored in an array and saved in memory.
RealTime: //TODO
Viewer Mode: //TODO
The array is filled with data for each pixel from incoming raw sound data. Once the array is filled
This performs operations to plot one channel of raw sound data on a plot pane of a tdGraphFX. The data to display for each pixel is stored in an array and saved in memory.
RealTime: //TODO
Viewer Mode: //TODO
The array is filled with data for each pixel from incoming raw sound data. Once the array is filled
- Author:
 - Jamie Macaulay
 
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddNewRawData(RawDataUnit rawDataUnit) Convert new RawDataUnit to pixels and then add toarray to be plotted on next repaint call.invalid reference
#soundDatavoidCheck whether the time scale is correct.voidcheckTimeGap(RawDataUnit rawSoundData) Check that the new rawdata is concurrent to the last fft.voidReset the array, clearing all data.voiddrawRawSoundData(javafx.scene.canvas.GraphicsContext g2d, javafx.scene.shape.Rectangle windowRect, javafx.geometry.Orientation orientation, PamAxisFX timeAxis, PamAxisFX dataAxis, double scrollStart, double wrapPix) Draw data from the array onto the screen.doublefloatGet the sample ratevoidnewRawData(RawDataUnit rawDataUnit, double binsPerPixel) Called whenever new raw sound data is to be added to display.voidrecalcSoundData(double binsPerPixel2) A new binsPerPixel value is being used.voidReset the raw sound data for loading.voidsetSampleRate(float sampleRate) Set the sample rate. 
- 
Constructor Details
- 
RawSoundPlotDataFX
 - 
RawSoundPlotDataFX
public RawSoundPlotDataFX() 
 - 
 - 
Method Details
- 
setSampleRate
public void setSampleRate(float sampleRate) Set the sample rate.- Parameters:
 sampleRate- sample rate in samples per second.
 - 
getSampleRate
public float getSampleRate()Get the sample rate- Returns:
 - the sample rate in bins per second
 
 - 
checkConfig
public void checkConfig()Check whether the time scale is correct. - 
addNewRawData
Convert new RawDataUnit to pixels and then add toarray to be plotted on next repaint call.invalid reference
#soundData- Parameters:
 rawDataUnit-
 - 
newRawData
Called whenever new raw sound data is to be added to display.- Parameters:
 rawDataUnit- - raw data unit.
 - 
checkTimeGap
Check that the new rawdata is concurrent to the last fft. If not fill the spectrogram with blank sapce. - 
recalcSoundData
public void recalcSoundData(double binsPerPixel2) A new binsPerPixel value is being used. In real time mode will need to convert the store In viewer model will need to reload data from the store.- Parameters:
 binsPerPixel2- - the new bins per pixel. The old bins per pixel is still stored in the binsPerPixel field.
 - 
drawRawSoundData
public void drawRawSoundData(javafx.scene.canvas.GraphicsContext g2d, javafx.scene.shape.Rectangle windowRect, javafx.geometry.Orientation orientation, PamAxisFX timeAxis, PamAxisFX dataAxis, double scrollStart, double wrapPix) Draw data from the array onto the screen. This functions assumes that thearray contains data with the correctinvalid reference
#soundDatafor the current time range on the display.invalid reference
#binsPerPixel- Parameters:
 g2d- - the graphics context to draw onto.windowRect- - rectangle describing the window.orientation- - the orientation of the display VERTICAL or HORIZONTAL.timeAxis- - the time axis.dataAxis- - the amplitude axis.scrollStart- - the start of the display in milliseconds datenum. The is the left most side of the display i.e. where the oldest visble data is displayed.wrapPix- - the wrap position on the time display -1 if not wrapping.l
 - 
resetForLoad
public void resetForLoad()Reset the raw sound data for loading. - 
clearRawData
public void clearRawData()Reset the array, clearing all data. - 
getBinsPerPixel
public double getBinsPerPixel() 
 -