|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.groovemanager.sampled.waveform.AbstractWaveForm
com.groovemanager.sampled.waveform.PeakWaveForm
com.groovemanager.sampled.waveform.DynamicPeakWaveForm
This class extends PeakWaveForm for being able to handle dynamically growing audio files especially for recording situations. This class is used by DynamicAudioFileWaveForm.
| Field Summary | |
|---|---|
private static int |
ARRAY_SIZE
size of one pool element |
private boolean |
bigEndian
endianess of the audio format |
private byte[] |
dataBuffer
Temporary buffer |
private int |
dataPos
Current write position for peak data to append |
private byte[][] |
datas
peak data pool |
private java.io.File |
f
The file into which the peak data should be written |
private int |
frameSize
Frame size of the audio format in bytes |
private int |
index
Current index inside the pool |
private int[] |
positions
peak data pool positions |
private java.io.RandomAccessFile |
raFile
RandomAccessFile wor reading and writing the peak data |
private int |
sampleSize
Frame size of the audio format in bytes |
private int |
tempCount
Temporary counter |
| Fields inherited from class com.groovemanager.sampled.waveform.PeakWaveForm |
|---|
data, DEFAULT_PEAKFILE_EXTENSION, source |
| Fields inherited from class com.groovemanager.sampled.waveform.AbstractWaveForm |
|---|
channels, displayWidth, intervallSize, nullWave, position, realLength |
| Constructor Summary | |
|---|---|
DynamicPeakWaveForm(javax.sound.sampled.AudioFormat format,
int iSize)
Construct a new DynamicPeakWaveForm |
|
| Method Summary | |
|---|---|
void |
append(byte[] data,
int offset,
int length)
Dynamically append audio data to this WaveForm |
void |
close(long lastModified)
Close this WaveForm indicating that no more data will be appended. |
private byte[] |
getCurrentData()
Get the peak data for the current position. |
private int |
getCurrentIndex()
Get the index of the peak data at the current position |
byte |
getMax(int channel)
Get the maximum value at the current read position in the given channel |
byte |
getMin(int channel)
Get the minimum value at the current read position in the given channel |
private void |
readDataAt(int index,
byte[] b)
Read peak data from the peak file at the given index |
| Methods inherited from class com.groovemanager.sampled.waveform.PeakWaveForm |
|---|
checkPeakFile, createPeakWaveForm, getAdditionalToString, getData, getHeader, getPeak, readFromFile, subWaveForm, writeToStream |
| Methods inherited from class com.groovemanager.sampled.waveform.AbstractWaveForm |
|---|
canProvide, getChannels, getDisplayableLength, getIntervallSize, getPosition, getRealLength, getRealPosition, getZoomFactor, next, rewind, setPosition, setRealPosition, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final int ARRAY_SIZE
private boolean bigEndian
private byte[] dataBuffer
private int dataPos
private byte[][] datas
private java.io.File f
private int frameSize
private int index
private int[] positions
private java.io.RandomAccessFile raFile
private int sampleSize
private int tempCount
| Constructor Detail |
|---|
public DynamicPeakWaveForm(javax.sound.sampled.AudioFormat format,
int iSize)
format - The format of the source audio formatiSize - The interval size to be used| Method Detail |
|---|
public void append(byte[] data,
int offset,
int length)
data - The audio data to appendoffset - Start position inside the data Arraylength - The length of data to appendpublic void close(long lastModified)
lastModified - The modification date of the audio file this WaveForm
belongs to id it is known, otherwise -1private byte[] getCurrentData()
private int getCurrentIndex()
public byte getMax(int channel)
WaveForm
getMax in interface WaveFormgetMax in class PeakWaveFormchannel - the zero-based index of the channel
public byte getMin(int channel)
WaveForm
getMin in interface WaveFormgetMin in class PeakWaveFormchannel - the zero-based index of the channel
private void readDataAt(int index,
byte[] b)
index - The index to readb - The byte Array to read the data into
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||