|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
A WaveForm is a representation of audio data that can be used for displaying the data on the screen. The problem, is that it would make no sense if an audio source would have to be read completely for each redrawing of the data. To avoid this, minimum and maximum values of parts the audio data is stored in some way. Implementers of this interface represent an audio source and can display its content, but do not have to read through the whole data. To keep the memory costs low, each sample is represented as a byte value. That means, that only 256 different values are possible for the drawing position. For most cases this should be enough though.
| Method Summary | |
|---|---|
boolean |
canProvide(int begin,
int length,
int width)
Tells if this WaveForm sees itself capable of providing a SubWaveForm with the given parameters |
int |
getChannels()
Get the number of channels in this WaveForm |
byte[] |
getData()
Get the whole Peak data as array. |
int |
getDisplayableLength()
Get the total displayable length of this WaveForm. |
int |
getIntervallSize()
Get the number of samples of the original Sample which are represented by one step of this WaveForm. |
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 |
int |
getPosition()
Get the read position of this WaveForm |
int |
getRealLength()
Get the Length of the original sample which this WaveForm represents |
int |
getRealPosition()
Get the position inside the sample represented by this WaveForm corresponding to the actual read position of this WaveForm. |
double |
getZoomFactor()
Get the ratio between the length of the represented Sample and and the displayable length of this WaveForm. |
boolean |
next()
Tells the WaveForm to increase its position by one |
void |
rewind()
Sets the current read position to the beginning of this WaveForm |
void |
setPosition(int pos)
Set the read position of this WaveForm |
void |
setRealPosition(int pos)
Set the read position of this WaveForm to the value corresponding to the given real position of the represented sample. |
WaveForm |
subWaveForm(int begin,
int length,
int width)
Get a WaveForm Object that represents the part of this WaveForm specified by begin and
length and displays this part in the
specified width |
| Method Detail |
|---|
boolean canProvide(int begin,
int length,
int width)
begin - The offset to the beginning of this
WaveForm. May also be negative.length - The length in steps of this WaveForm
that should be represented by the returned WaveForm.width - The new width in which the part should
be displayed.
subWaveForm(int, int, int)int getChannels()
byte[] getData()
int getDisplayableLength()
int getIntervallSize()
byte getMax(int channel)
channel - the zero-based index of the channel
byte getMin(int channel)
channel - the zero-based index of the channel
int getPosition()
int getRealLength()
int getRealPosition()
double getZoomFactor()
getRealLength() / (double)getDisplayableLength()boolean next()
IWaveForm w = ...;
int channel = ...;
w.rewind();
do{
byte min = w.getMin(channel);
byte max = w.getMax(channel);
// ...(do something with those values)
} while(w.next());void rewind()
void setPosition(int pos)
pos - The new read positionvoid setRealPosition(int pos)
pos - The new position in the original sample
WaveForm subWaveForm(int begin,
int length,
int width)
begin and
length and displays this part in the
specified width
begin - The offset to the beginning of this
WaveForm. May also be negative.length - The length in steps of this WaveForm
that should be represented by the returned WaveForm.width - The new width in which the part should
be displayed.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||