Public Member Functions | |
void | setArea (float x1, float y1, float x2, float y2, boolean relative) |
void | process () throws PAVException |
void | setColor (int color) |
void | setColor (int a, int b, int mode) |
void | setColor (float[] thresholds, int[] colors, int mode) |
String | toString () |
void | dispose () |
Package Functions | |
void | drawTo (PApplet applet) throws PAVException |
A audio visualizer.
void pav::lib::visualizer::Visualizer::dispose | ( | ) |
Disposes this visualizer, releasing all resources that were used exclusively by this visualiter. Subsequent calls to any methods of the visualizer might cause exceptions.
Implemented in pav::lib::visualizer::Boxes, pav::lib::visualizer::Bubbles, pav::lib::visualizer::MelSpectrum, pav::lib::visualizer::Phasor, pav::lib::visualizer::Rainbow, pav::lib::visualizer::Spectogram, pav::lib::visualizer::Spectrum, and pav::lib::visualizer::Waveform.
void pav::lib::visualizer::Visualizer::drawTo | ( | PApplet | applet | ) | throws PAVException [package] |
Sets the PApplet to draw to. Must be called before process().
applet | Where to draw to. Must not be null |
PAVException | If the visualizer does not work with this applet |
Implemented in pav::lib::visualizer::Boxes, pav::lib::visualizer::Bubbles, and pav::lib::visualizer::VisualizerAbstract.
void pav::lib::visualizer::Visualizer::process | ( | ) | throws PAVException |
Draws to the PApplet specified by drawTo.
PAVException | If an error occures while drawing |
Implemented in pav::lib::visualizer::Boxes, pav::lib::visualizer::Bubbles, pav::lib::visualizer::MelSpectrum, pav::lib::visualizer::Phasor, pav::lib::visualizer::Rainbow, pav::lib::visualizer::Spectogram, pav::lib::visualizer::Spectrum, and pav::lib::visualizer::Waveform.
void pav::lib::visualizer::Visualizer::setArea | ( | float | x1, | |
float | y1, | |||
float | x2, | |||
float | y2, | |||
boolean | relative | |||
) |
Sets the area that can be used by this visualizer. If relative is set to false the visualizer will use the given values as its boundary, independent of the size of the PApplet. If relative is true, the values must be in the range [0,1] and represent an area relative to the size of the PApplet. Processings coordinate system is used, so (0,0) is the top left pixel.
x1 | Must be >= 0 and <= 1 if relative is true | |
y1 | Must be >= 0 and <= 1 if relative is true | |
x2 | Must be > x1 and <= 1 if relative is true | |
y2 | Must be > y1 and <= 1 if relative is true | |
relative | Whether or not the values are relative |
Implemented in pav::lib::visualizer::VisualizerAbstract.
void pav::lib::visualizer::Visualizer::setColor | ( | int | a, | |
int | b, | |||
int | mode | |||
) |
Sets two colors to interpolate between when drawing this visualizer. How a visualizer uses the colors specified is not defined. They might not be used at all.
a | The color to start from | |
b | The color to interpolate to | |
mode | The color mode to use. Must bei either PApplet.RGB or PApplet.HSB |
Implemented in pav::lib::visualizer::Boxes, and pav::lib::visualizer::VisualizerAbstract.
void pav::lib::visualizer::Visualizer::setColor | ( | int | color | ) |
Sets the color to use when drawing this visualizer. How a visualizer uses the color specified is not defined. It might not be used at all.
color | The color to use |
Implemented in pav::lib::visualizer::Boxes, and pav::lib::visualizer::VisualizerAbstract.
void pav::lib::visualizer::Visualizer::setColor | ( | float[] | thresholds, | |
int[] | colors, | |||
int | mode | |||
) |
Sets the colors to interpolate between when drawing this visualizer. How a visualizer uses the colors specified is not defined. They might not be used at all.
thresholds | The relative thresholds to use. Values must be between 0 and 1 and sorted. The first element must be 0, the last 1. Must be of same length as colors | |
colors | The The colors to use. Must be of same length as thresholds | |
mode | The color mode to use. Must be either PApplet.RGB or PApplet.HSB |
Implemented in pav::lib::visualizer::Boxes, and pav::lib::visualizer::VisualizerAbstract.
String pav::lib::visualizer::Visualizer::toString | ( | ) |
Returns a short string representation of this visualizer.
Implemented in pav::lib::visualizer::Boxes, pav::lib::visualizer::Bubbles, pav::lib::visualizer::MelSpectrum, pav::lib::visualizer::Phasor, pav::lib::visualizer::Rainbow, pav::lib::visualizer::Spectogram, pav::lib::visualizer::Spectrum, and pav::lib::visualizer::Waveform.