* Test of the static equalizer preset data provided by the media player factory.
*/
public class EqualizerCapabilityTest extends VlcjTest {
public static void main(String[] args) {
MediaPlayerFactory factory = new MediaPlayerFactory();
if(!factory.isEqualizerAvailable()) {
System.out.println("Equalizer not available on this platform");
System.exit(0);
}
System.out.println("Preset names:");
List<String> presetNames = factory.getEqualizerPresetNames();
for(String presetName : presetNames) {
System.out.printf(" %s%n", presetName);
}
System.out.println();
System.out.println("Band frequencies:");
List<Float> bandFrequencies = factory.getEqualizerBandFrequencies();
for(Float freq : bandFrequencies) {
System.out.printf(" %f Hz%n", freq);
}
System.out.println();
// You can get individual presets by name, or get them all in one call as is done here...
Map<String, Equalizer> allPresets = factory.getAllPresetEqualizers();
for(String presetName : allPresets.keySet()) {
System.out.printf("%s:%n", presetName);
Equalizer preset = allPresets.get(presetName);
System.out.printf("%10s : %f Hz%n", "preamp", preset.getPreamp());
float[] amps = preset.getAmps();