Java Code Examples for com.sun.media.sound.ModelStandardTransform#setPolarity()
The following examples show how to use
com.sun.media.sound.ModelStandardTransform#setPolarity() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TransformAbsolute.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
private static boolean checkLinearity(ModelStandardTransform transform) { double lastx = 0; for (int p = 0; p < 2; p++) for (int d = 0; d < 2; d++) for (double i = 0; i < 1.0; i+=0.001) { if(p == 0) transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); else transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); if(d == 0) transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); else transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); double x = transform.transform(i); if(i == 0) lastx = x; else { if(lastx - x > 0.2) return false; lastx = x; } } return true; }
Example 2
Source File: TransformLinear.java From hottub with GNU General Public License v2.0 | 6 votes |
private static boolean checkLinearity(ModelStandardTransform transform) { double lastx = 0; for (int p = 0; p < 2; p++) for (int d = 0; d < 2; d++) for (double i = 0; i < 1.0; i+=0.001) { if(p == 0) transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); else transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); if(d == 0) transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); else transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); double x = transform.transform(i); if(i == 0) lastx = x; else { if(lastx - x > 0.2) return false; lastx = x; } } return true; }
Example 3
Source File: TransformConvex.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
private static boolean checkLinearity(ModelStandardTransform transform) { double lastx = 0; for (int p = 0; p < 2; p++) for (int d = 0; d < 2; d++) for (double i = 0; i < 1.0; i+=0.001) { if(p == 0) transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); else transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); if(d == 0) transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); else transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); double x = transform.transform(i); if(i == 0) lastx = x; else { if(lastx - x > 0.2) return false; lastx = x; } } return true; }
Example 4
Source File: TransformConcave.java From hottub with GNU General Public License v2.0 | 6 votes |
private static boolean checkLinearity(ModelStandardTransform transform) { double lastx = 0; for (int p = 0; p < 2; p++) for (int d = 0; d < 2; d++) for (double i = 0; i < 1.0; i+=0.001) { if(p == 0) transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); else transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); if(d == 0) transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); else transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); double x = transform.transform(i); if(i == 0) lastx = x; else { if(lastx - x > 0.2) return false; lastx = x; } } return true; }
Example 5
Source File: TransformLinear.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { ModelStandardTransform transform = new ModelStandardTransform(); transform.setTransform(ModelStandardTransform.TRANSFORM_LINEAR); assertTrue(checkLinearity(transform)); transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); assertTrue(Math.abs(transform.transform(0.2f) - 0.2f) < 0.0001f); assertTrue(Math.abs(transform.transform(0.8f) - 0.8f) < 0.0001f); transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); assertTrue(Math.abs(transform.transform(0.2f) - 0.8f) < 0.0001f); assertTrue(Math.abs(transform.transform(0.8f) - 0.2f) < 0.0001f); transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); assertTrue(Math.abs(transform.transform(0.2f) - (-0.6f)) < 0.0001f); assertTrue(Math.abs(transform.transform(0.8f) - (0.6f)) < 0.0001f); transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); assertTrue(Math.abs(transform.transform(0.2f) - (0.6f)) < 0.0001f); assertTrue(Math.abs(transform.transform(0.8f) - (-0.6f)) < 0.0001f); }
Example 6
Source File: TransformAbsolute.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
private static boolean checkLinearity(ModelStandardTransform transform) { double lastx = 0; for (int p = 0; p < 2; p++) for (int d = 0; d < 2; d++) for (double i = 0; i < 1.0; i+=0.001) { if(p == 0) transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); else transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); if(d == 0) transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); else transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); double x = transform.transform(i); if(i == 0) lastx = x; else { if(lastx - x > 0.2) return false; lastx = x; } } return true; }
Example 7
Source File: TransformSwitch.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { ModelStandardTransform transform = new ModelStandardTransform(); transform.setTransform(ModelStandardTransform.TRANSFORM_SWITCH); transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); assertTrue(Math.abs(transform.transform(0.2f) - 0.0f) < 0.0001f); assertTrue(Math.abs(transform.transform(0.8f) - 1.0f) < 0.0001f); transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); assertTrue(Math.abs(transform.transform(0.2f) - 1.0f) < 0.0001f); assertTrue(Math.abs(transform.transform(0.8f) - 0.0f) < 0.0001f); transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); assertTrue(Math.abs(transform.transform(0.2f) + 1.0f) < 0.0001f); assertTrue(Math.abs(transform.transform(0.8f) - 1.0f) < 0.0001f); transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); assertTrue(Math.abs(transform.transform(0.2f) - 1.0f) < 0.0001f); assertTrue(Math.abs(transform.transform(0.8f) + 1.0f) < 0.0001f); }
Example 8
Source File: TransformLinear.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { ModelStandardTransform transform = new ModelStandardTransform(); transform.setTransform(ModelStandardTransform.TRANSFORM_LINEAR); assertTrue(checkLinearity(transform)); transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); assertTrue(Math.abs(transform.transform(0.2f) - 0.2f) < 0.0001f); assertTrue(Math.abs(transform.transform(0.8f) - 0.8f) < 0.0001f); transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); assertTrue(Math.abs(transform.transform(0.2f) - 0.8f) < 0.0001f); assertTrue(Math.abs(transform.transform(0.8f) - 0.2f) < 0.0001f); transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); assertTrue(Math.abs(transform.transform(0.2f) - (-0.6f)) < 0.0001f); assertTrue(Math.abs(transform.transform(0.8f) - (0.6f)) < 0.0001f); transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); assertTrue(Math.abs(transform.transform(0.2f) - (0.6f)) < 0.0001f); assertTrue(Math.abs(transform.transform(0.8f) - (-0.6f)) < 0.0001f); }
Example 9
Source File: TransformLinear.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
private static boolean checkLinearity(ModelStandardTransform transform) { double lastx = 0; for (int p = 0; p < 2; p++) for (int d = 0; d < 2; d++) for (double i = 0; i < 1.0; i+=0.001) { if(p == 0) transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); else transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); if(d == 0) transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); else transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); double x = transform.transform(i); if(i == 0) lastx = x; else { if(lastx - x > 0.2) return false; lastx = x; } } return true; }
Example 10
Source File: TransformConvex.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
private static boolean checkLinearity(ModelStandardTransform transform) { double lastx = 0; for (int p = 0; p < 2; p++) for (int d = 0; d < 2; d++) for (double i = 0; i < 1.0; i+=0.001) { if(p == 0) transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); else transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); if(d == 0) transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); else transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); double x = transform.transform(i); if(i == 0) lastx = x; else { if(lastx - x > 0.2) return false; lastx = x; } } return true; }
Example 11
Source File: TransformLinear.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
private static boolean checkLinearity(ModelStandardTransform transform) { double lastx = 0; for (int p = 0; p < 2; p++) for (int d = 0; d < 2; d++) for (double i = 0; i < 1.0; i+=0.001) { if(p == 0) transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); else transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); if(d == 0) transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); else transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); double x = transform.transform(i); if(i == 0) lastx = x; else { if(lastx - x > 0.2) return false; lastx = x; } } return true; }
Example 12
Source File: TransformLinear.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { ModelStandardTransform transform = new ModelStandardTransform(); transform.setTransform(ModelStandardTransform.TRANSFORM_LINEAR); assertTrue(checkLinearity(transform)); transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); assertTrue(Math.abs(transform.transform(0.2f) - 0.2f) < 0.0001f); assertTrue(Math.abs(transform.transform(0.8f) - 0.8f) < 0.0001f); transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); assertTrue(Math.abs(transform.transform(0.2f) - 0.8f) < 0.0001f); assertTrue(Math.abs(transform.transform(0.8f) - 0.2f) < 0.0001f); transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); assertTrue(Math.abs(transform.transform(0.2f) - (-0.6f)) < 0.0001f); assertTrue(Math.abs(transform.transform(0.8f) - (0.6f)) < 0.0001f); transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); assertTrue(Math.abs(transform.transform(0.2f) - (0.6f)) < 0.0001f); assertTrue(Math.abs(transform.transform(0.8f) - (-0.6f)) < 0.0001f); }
Example 13
Source File: TransformLinear.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
private static boolean checkLinearity(ModelStandardTransform transform) { double lastx = 0; for (int p = 0; p < 2; p++) for (int d = 0; d < 2; d++) for (double i = 0; i < 1.0; i+=0.001) { if(p == 0) transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); else transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); if(d == 0) transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); else transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); double x = transform.transform(i); if(i == 0) lastx = x; else { if(lastx - x > 0.2) return false; lastx = x; } } return true; }
Example 14
Source File: TransformConvex.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
private static boolean checkLinearity(ModelStandardTransform transform) { double lastx = 0; for (int p = 0; p < 2; p++) for (int d = 0; d < 2; d++) for (double i = 0; i < 1.0; i+=0.001) { if(p == 0) transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); else transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); if(d == 0) transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); else transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); double x = transform.transform(i); if(i == 0) lastx = x; else { if(lastx - x > 0.2) return false; lastx = x; } } return true; }
Example 15
Source File: TransformConvex.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
private static boolean checkLinearity(ModelStandardTransform transform) { double lastx = 0; for (int p = 0; p < 2; p++) for (int d = 0; d < 2; d++) for (double i = 0; i < 1.0; i+=0.001) { if(p == 0) transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); else transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); if(d == 0) transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); else transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); double x = transform.transform(i); if(i == 0) lastx = x; else { if(lastx - x > 0.2) return false; lastx = x; } } return true; }
Example 16
Source File: TransformLinear.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { ModelStandardTransform transform = new ModelStandardTransform(); transform.setTransform(ModelStandardTransform.TRANSFORM_LINEAR); assertTrue(checkLinearity(transform)); transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); assertTrue(Math.abs(transform.transform(0.2f) - 0.2f) < 0.0001f); assertTrue(Math.abs(transform.transform(0.8f) - 0.8f) < 0.0001f); transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); assertTrue(Math.abs(transform.transform(0.2f) - 0.8f) < 0.0001f); assertTrue(Math.abs(transform.transform(0.8f) - 0.2f) < 0.0001f); transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); assertTrue(Math.abs(transform.transform(0.2f) - (-0.6f)) < 0.0001f); assertTrue(Math.abs(transform.transform(0.8f) - (0.6f)) < 0.0001f); transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); assertTrue(Math.abs(transform.transform(0.2f) - (0.6f)) < 0.0001f); assertTrue(Math.abs(transform.transform(0.8f) - (-0.6f)) < 0.0001f); }
Example 17
Source File: TransformLinear.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { ModelStandardTransform transform = new ModelStandardTransform(); transform.setTransform(ModelStandardTransform.TRANSFORM_LINEAR); assertTrue(checkLinearity(transform)); transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); assertTrue(Math.abs(transform.transform(0.2f) - 0.2f) < 0.0001f); assertTrue(Math.abs(transform.transform(0.8f) - 0.8f) < 0.0001f); transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); assertTrue(Math.abs(transform.transform(0.2f) - 0.8f) < 0.0001f); assertTrue(Math.abs(transform.transform(0.8f) - 0.2f) < 0.0001f); transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); assertTrue(Math.abs(transform.transform(0.2f) - (-0.6f)) < 0.0001f); assertTrue(Math.abs(transform.transform(0.8f) - (0.6f)) < 0.0001f); transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); assertTrue(Math.abs(transform.transform(0.2f) - (0.6f)) < 0.0001f); assertTrue(Math.abs(transform.transform(0.8f) - (-0.6f)) < 0.0001f); }
Example 18
Source File: TransformConcave.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
private static boolean checkLinearity(ModelStandardTransform transform) { double lastx = 0; for (int p = 0; p < 2; p++) for (int d = 0; d < 2; d++) for (double i = 0; i < 1.0; i+=0.001) { if(p == 0) transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); else transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); if(d == 0) transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); else transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); double x = transform.transform(i); if(i == 0) lastx = x; else { if(lastx - x > 0.2) return false; lastx = x; } } return true; }
Example 19
Source File: TransformAbsolute.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
private static boolean checkLinearity(ModelStandardTransform transform) { double lastx = 0; for (int p = 0; p < 2; p++) for (int d = 0; d < 2; d++) for (double i = 0; i < 1.0; i+=0.001) { if(p == 0) transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); else transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); if(d == 0) transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); else transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); double x = transform.transform(i); if(i == 0) lastx = x; else { if(lastx - x > 0.2) return false; lastx = x; } } return true; }
Example 20
Source File: TransformConcave.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) throws Exception { ModelStandardTransform transform = new ModelStandardTransform(); transform.setTransform(ModelStandardTransform.TRANSFORM_CONCAVE); assertTrue(checkLinearity(transform)); transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); assertTrue(Math.abs(transform.transform(0.0f) - 0.0f) < 0.0001f); assertTrue(transform.transform(0.5f) < 0.5f); assertTrue(Math.abs(transform.transform(1.0f) - 1.0f) < 0.0001f); transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR); assertTrue(Math.abs(transform.transform(1.0f) - 0.0f) < 0.0001f); assertTrue(transform.transform(0.5f) < 0.5f); assertTrue(Math.abs(transform.transform(0.0f) - 1.0f) < 0.0001f); transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX); transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); assertTrue(Math.abs(transform.transform(0.0f) + 1.0f) < 0.0001f); assertTrue(transform.transform(0.25f) > -0.5f); assertTrue(Math.abs(transform.transform(0.5f) - 0.0f) < 0.0001f); assertTrue(transform.transform(0.75f) < 0.5f); assertTrue(Math.abs(transform.transform(1.0f) - 1.0f) < 0.0001f); transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN); transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR); assertTrue(Math.abs(transform.transform(1.0f) + 1.0f) < 0.0001f); assertTrue(transform.transform(0.75f) > -0.5f); assertTrue(Math.abs(transform.transform(0.50f) - 0.0f) < 0.0001f); assertTrue(transform.transform(0.25f) < 0.5f); assertTrue(Math.abs(transform.transform(0.0f) - 1.0f) < 0.0001f); }