|
|||||||||
| 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.UpdatingWaveForm
An updating WaveForm is a WaveForm that ia wrapped around another one and
forces to be not re-used by returning false for any call to
canProvide()
| Field Summary | |
|---|---|
WaveForm |
source
The wrapped WaveForm |
| Fields inherited from class com.groovemanager.sampled.waveform.AbstractWaveForm |
|---|
channels, displayWidth, intervallSize, nullWave, position, realLength |
| Constructor Summary | |
|---|---|
UpdatingWaveForm(WaveForm source)
Construct a new UpdatingWaveForm |
|
| 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 |
protected java.lang.String |
getAdditionalToString()
Get an additional String describing this WaveForm. |
int |
getChannels()
Get the number of channels in this WaveForm |
int |
getDisplayableLength()
Get the total displayable length 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. |
| Methods inherited from class com.groovemanager.sampled.waveform.AbstractWaveForm |
|---|
getData, getIntervallSize, subWaveForm, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public WaveForm source
| Constructor Detail |
|---|
public UpdatingWaveForm(WaveForm source)
source - The WaveForm to be wrapped| Method Detail |
|---|
public boolean canProvide(int begin,
int length,
int width)
WaveForm
canProvide in interface WaveFormcanProvide in class AbstractWaveFormbegin - 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.
WaveForm.canProvide(int, int, int)protected java.lang.String getAdditionalToString()
AbstractWaveFormtoString()
getAdditionalToString in class AbstractWaveFormpublic int getChannels()
WaveForm
getChannels in interface WaveFormgetChannels in class AbstractWaveFormWaveForm.getChannels()public int getDisplayableLength()
WaveForm
getDisplayableLength in interface WaveFormgetDisplayableLength in class AbstractWaveFormWaveForm.getDisplayableLength()public byte getMax(int channel)
WaveForm
channel - the zero-based index of the channel
public byte getMin(int channel)
WaveForm
channel - the zero-based index of the channel
public int getPosition()
WaveForm
getPosition in interface WaveFormgetPosition in class AbstractWaveFormWaveForm.getPosition()public int getRealLength()
WaveForm
getRealLength in interface WaveFormgetRealLength in class AbstractWaveFormWaveForm.getRealLength()public int getRealPosition()
WaveForm
getRealPosition in interface WaveFormgetRealPosition in class AbstractWaveFormWaveForm.getRealPosition()public double getZoomFactor()
WaveForm
getZoomFactor in interface WaveFormgetZoomFactor in class AbstractWaveFormgetRealLength() / (double)getDisplayableLength()WaveForm.getZoomFactor()public boolean next()
WaveForm
next in interface WaveFormnext in class AbstractWaveForm
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());WaveForm.next()public void rewind()
WaveForm
rewind in interface WaveFormrewind in class AbstractWaveFormWaveForm.rewind()public void setPosition(int pos)
WaveForm
setPosition in interface WaveFormsetPosition in class AbstractWaveFormpos - The new read positionWaveForm.setPosition(int)public void setRealPosition(int pos)
WaveForm
setRealPosition in interface WaveFormsetRealPosition in class AbstractWaveFormpos - The new position in the original sampleWaveForm.setRealPosition(int)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||