Package com.sun.media.sound

Examples of com.sun.media.sound.ModelStandardTransform


    if(!value)
      throw new RuntimeException("assertTrue fails!");
  }
   
  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);
  }
View Full Code Here


      throw new RuntimeException("assertTrue fails!");
   
  }
 
  public static void main(String[] args) throws Exception {
    ModelStandardTransform transform = new ModelStandardTransform();
    transform.setTransform(ModelStandardTransform.TRANSFORM_ABSOLUTE)
    assertTrue(Math.abs(transform.transform(0.2f) - 0.2f) < 0.0001f);
    assertTrue(Math.abs(transform.transform(-0.8f) - 0.8f) < 0.0001f);
    assertTrue(checkLinearity(transform));
  }
View Full Code Here

    if(!value)
      throw new RuntimeException("assertTrue fails!");
  }
 
  public static void main(String[] args) throws Exception {
    ModelStandardTransform transform = new ModelStandardTransform();
    transform.setTransform(ModelStandardTransform.TRANSFORM_CONVEX);
    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);
  }
View Full Code Here

    if(!value)
      throw new RuntimeException("assertTrue fails!");
  }
 
  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);
  }
View Full Code Here

    if(!value)
      throw new RuntimeException("assertTrue fails!");
  }

  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);
  }
View Full Code Here

TOP

Related Classes of com.sun.media.sound.ModelStandardTransform

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.