Package javax.sound.sampled

Examples of javax.sound.sampled.BooleanControl$Type


      System.out.println();

      ExprManager em = new ExprManager();
      SmtEngine smt = new SmtEngine(em);

      Type t = em.booleanType();
      Expr a = em.mkVar("a", em.booleanType());
      Expr b = em.mkVar("b", em.booleanType());
      Expr e = new Expr(em.mkExpr(Kind.AND, a, b, new Expr(a).notExpr()));
      System.out.println("==> " + e);
View Full Code Here


public class BooleanControlTest extends TestCase {

    public void testEnumControl() {

        BooleanControl control = new MyControl(BooleanControl.Type.MUTE, true,
                "ON", "OFF");
        assertTrue(control.getValue());
        control.setValue(false);
        assertFalse(control.getValue());
        assertEquals("ON", control.getStateLabel(true));
        assertEquals("OFF", control.getStateLabel(false));
        assertEquals("Mute Control with current value: OFF", control
                .toString());

        control = new MyControl(BooleanControl.Type.APPLY_REVERB, false);
        assertFalse(control.getValue());
        control.setValue(true);
        assertTrue(control.getValue());
        assertEquals("true", control.getStateLabel(true));
        assertEquals("false", control.getStateLabel(false));
        assertEquals("Apply Reverb Control with current value: true", control
                .toString());
    }
View Full Code Here

    portLine.close();
  }

  public static void printControl(Control memberControl) {
    if (memberControl instanceof BooleanControl) {
      BooleanControl bc = (BooleanControl) memberControl;
      System.out.println(bc + ": " + bc.getValue());
    } else if (memberControl instanceof FloatControl) {
      FloatControl fc = (FloatControl) memberControl;
      System.out.println(fc + ": " + fc.getValue());

    } else if (memberControl instanceof EnumControl) {
View Full Code Here

  public synchronized void stopTestOutput() {
    myClip.stop();
  }

  public void toggleMute() {
    BooleanControl bc = (BooleanControl) outputLine.getControl(BooleanControl.Type.MUTE);
    if (bc != null) {
      bc.setValue(!bc.getValue());
    }
  }
View Full Code Here

      bc.setValue(!bc.getValue());
    }
  }

  public void setMute(boolean state) {
    BooleanControl bc = (BooleanControl) outputLine.getControl(BooleanControl.Type.MUTE);
    if (bc != null) {
      bc.setValue(state);
    }
  }
View Full Code Here

            // now calculate the parameters
            int offset = 1;
            for (Class<?> aClass : delegatedMethod.getParameterTypes())
            {
                final Type type = Type.getType(aClass);
                mv.visitVarInsn(type.getOpcode(Opcodes.ILOAD), offset);
                offset += type.getSize();
            }

            // and finally invoke the target method on the provided Contextual Instance
            final Type declaringClass = Type.getType(delegatedMethod.getDeclaringClass());
            boolean interfaceMethod = Modifier.isInterface(delegatedMethod.getDeclaringClass().getModifiers());
            mv.visitMethodInsn(interfaceMethod ? Opcodes.INVOKEINTERFACE : Opcodes.INVOKEVIRTUAL,
                               declaringClass.getInternalName(), delegatedMethod.getName(), methodDescriptor);

            generateReturn(mv, delegatedMethod);

            mv.visitMaxs(-1, -1);
View Full Code Here

            mv.visitFieldInsn(Opcodes.GETFIELD, proxyClassFileName, FIELD_PROXIED_INSTANCE, Type.getDescriptor(classToProxy));

            int offset = 1;
            for (Class<?> aClass : delegatedMethod.getParameterTypes())
            {
                final Type type = Type.getType(aClass);
                mv.visitVarInsn(type.getOpcode(Opcodes.ILOAD), offset);
                offset += type.getSize();
            }

            final Type declaringClass = Type.getType(delegatedMethod.getDeclaringClass());
            mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, declaringClass.getInternalName(), delegatedMethod.getName(), methodDescriptor);

            generateReturn(mv, delegatedMethod);

            mv.visitMaxs(-1, -1);
View Full Code Here

            // now calculate the parameters
            int offset = 1;
            for (Class<?> aClass : delegatedMethod.getParameterTypes())
            {
                final Type type = Type.getType(aClass);
                mv.visitVarInsn(type.getOpcode(Opcodes.ILOAD), offset);
                offset += type.getSize();
            }

            // and finally invoke the target method on the provided Contextual Instance
            final Type declaringClass = Type.getType(delegatedMethod.getDeclaringClass());
            if (abstractMethod)
            {
                // generate an empty return block
            }
            else
            {
                // invoke the method on the super class;
                mv.visitMethodInsn(Opcodes.INVOKESPECIAL, declaringClass.getInternalName(), delegatedMethod.getName(), methodDescriptor);
            }

            generateReturn(mv, delegatedMethod);

            mv.visitMaxs(-1, -1);
View Full Code Here

    @Override
    public void visit(final String name, final Object value) {
        if ("value".equals(name)) {
            if (value instanceof Type) {
                final Type type = (Type) value;
                final int sort = type.getSort();
                switch (sort) {
                    case Type.OBJECT:
                        if (type.getClassName().equals(ValidationRunner.class.getName())) {
                            classInfos.add(current);
                        }
                        break;
                }
            } else {
View Full Code Here

    public String getRelatedName() {
        return relatedName;
    }

    public String getDescriptor() {
        Type collectionType = cmrStyle.getCollectionType();
        if (collectionType == null) {
            return type.getDescriptor();
        }
        return collectionType.getDescriptor();
    }
View Full Code Here

TOP

Related Classes of javax.sound.sampled.BooleanControl$Type

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.