Examples of OscMessage


Examples of de.sciss.net.OSCMessage

    msgBufGetN      = new OSCMessage[ numSlices ];
    msgBufOff      = new int[ numSlices ];
   
    for( int i = 0, off = 0; i < numSlices; i++, off += SLICE_SIZE ) {
      msgBufOff[ i ] = off;
      msgBufGetN[ i ] = new OSCMessage( "/b_getn", new Object[] {
          new Integer( bufNum ), new Integer( off ), new Integer( Math.min( SLICE_SIZE, size - off ))});
    }
   
    sliceID        = 0;
  }
View Full Code Here

Examples of de.sciss.net.OSCMessage

    synchronized( sync ) {
      if( isListening ) {
        msgBufGetN   = null// don't query until we've got the buffer specs
        this.bufNum  = bufNum;
        try {
          client.send( new OSCMessage( "/b_query", new Object[] { new Integer( bufNum )}));
        }
        catch( IOException e1 ) {
          System.out.println( e1 );
        }
      } else {
View Full Code Here

Examples of de.sciss.net.OSCMessage

      replyArgs[ 1 ] = stateName;
      replyArgs[ 2 ] = new Integer( e.getKeyCode() );
//      replyArgs[ 3 ] = new Integer( Character.getNumericValue( e.getKeyChar() ));
      replyArgs[ 3 ] = new Integer( e.getKeyChar() );
      replyArgs[ 4 ] = new Integer( e.getModifiers() );
      client.reply( new OSCMessage( getOSCCommand(), replyArgs ));
    }
    catch( IOException ex ) {
      SwingOSC.printException( ex, getOSCCommand() );
    }
  }
View Full Code Here

Examples of de.sciss.net.OSCMessage

      }
      // [ "/key", <componentID>, <state>, <keyCode>, <keyChar>, <modifiers> ]
      replyArgs[ 1 ] = stateName;
      replyArgs[ 2 ] = new Integer( p.x );
      replyArgs[ 3 ] = new Integer( p.y );
      client.reply( new OSCMessage( getOSCCommand(), replyArgs ));
    }
    catch( IOException ex ) {
      SwingOSC.printException( ex, getOSCCommand() );
    }
  }
View Full Code Here

Examples of hermes.postoffice.OscMessage

    testObjects[0] = new Integer(10);
    testObjects[1] = new String("Oh hai");
    testObjects[2] = new Float(1.0);
     
    //don't need a valid address.. just testing the argument retrieval functionality
    OscMessage message = new OscMessage("/DummyAddress", testObjects);
   
    //make sure the number of arguments is correct
    assertEquals(message.getNumberOfRemainingArguments(), 3);
    //Should be an int
    assertEquals(message.getTypeTagOfNextArgument(), "i");
    //check the value
    int intValue = message.getAndRemoveInt();
    assertEquals((Integer)intValue, (Integer)testObjects[0]);
 
    //make sure the number of arguments is correct
    assertEquals(message.getNumberOfRemainingArguments(), 2);
    //Should be a string
    assertEquals(message.getTypeTagOfNextArgument(), "s");
    //check the value
    String stringValue = message.getAndRemoveString();
    assertEquals((String)stringValue, (String)testObjects[1]);
   
    //make sure the number of arguments is correct
    assertEquals(message.getNumberOfRemainingArguments(), 1);
    //Should be a float
    assertEquals(message.getTypeTagOfNextArgument(), "f");
    //check the value
    Float floatValue= message.getAndRemoveFloat();
    assertEquals((Float)floatValue, (Float)testObjects[2]);

    assertEquals(message.getNumberOfRemainingArguments(), 0);
   
  }
View Full Code Here

Examples of hermes.postoffice.OscMessage

    testObjects[0] = new Integer(10);
    testObjects[1] = new String("Oh hai");
    testObjects[2] = new Float(1.0);
     
    //don't need a valid address.. just testing the argument retrieval functionality
    OscMessage message = new OscMessage("/DummyAddress", testObjects);
   
    try {
      message.getAndRemoveFloat();
        fail( "Should throw AssertionError" );
    } catch (AssertionError expectedException) {
    }
   
    try {
      message.getAndRemoveString();
        fail( "Should throw AssertionError" );
    } catch (AssertionError expectedException) {
    }
   
    //remove the element to check Int
    message.getAndRemoveInt();

    try {
      message.getAndRemoveInt();
        fail( "Should throw AssertionError" );
    } catch (AssertionError expectedException) {
    }
   
    //empty the OSCMessage and then check errors..
    message.getAndRemoveString();
    message.getAndRemoveFloat();

   
    try {
      message.getAndRemoveInt();
        fail( "Should throw AssertionError because the OSCMessage is empty" );
    } catch (AssertionError expectedException) {
      }
   
    try {
      message.getAndRemoveFloat();
        fail( "Should throw AssertionError because the OSCMessage is empty" );
    } catch (AssertionError expectedException) {
      }
   
   
    try {
      message.getAndRemoveString();
        fail( "Should throw AssertionError because the OSCMessage is empty" );
    } catch (AssertionError expectedException) {
      }
   
    try {
      message.getTypeTagOfNextArgument();
        fail( "Should throw AssertionError because the OSCMessage is empty" );
    } catch (AssertionError expectedException) {
      }
   
    //Lastly, check nonexistent typetag
     class Impossible {
    }
    //make a message that contains an 'Impossible'
    testObjects = new Object[1];
    testObjects[0] = new Impossible();
    message = new OscMessage("/DummyAddress", testObjects);
   
    try {
      message.getTypeTagOfNextArgument();
        fail( "Should throw AssertionError because the tag does not exist" );
    } catch (AssertionError expectedException) {
      }
   
  }
View Full Code Here

Examples of oscP5.OscMessage

      // y se prepare para recibir al visitante
      // El mismo mensaje lo mando a la terminal   

      logger.info("SENDING AKG TO VISUAL + TERMINAL");

      OscMessage myMessage = new OscMessage("/visitorReady")

      myMessage.add(v.getName1());
      myMessage.add(v.getName2());
      oscGateway.send(myMessage, oscVisualLocation);
      oscGateway.send(myMessage, oscTerminalLocation);

    }else{

      logger.info("VISITOR DOESNT EXISTS");

      // el codigo ingresado es incorrecto
      // responde negativo solo a la terminal
      OscMessage myMessage = new OscMessage("/visitorError")
      oscGateway.send(myMessage, oscTerminalLocation);

    }
  }
View Full Code Here

Examples of oscP5.OscMessage

      // y se prepare para recibir al visitante
      // El mismo mensaje lo mando a la terminal   

      logger.info("SENDING AKG TO VISUAL + TERMINAL");

      OscMessage myMessage = new OscMessage("/visitorReady")

      myMessage.add( checkName(v.getName1()));
      myMessage.add( checkName(v.getName2()));
      oscGateway.send(myMessage, oscVisualLocation);
      oscGateway.send(myMessage, oscTerminalLocation);

    }else{

      logger.info("VISITOR DOESNT EXISTS");

      // el codigo ingresado es incorrecto
      // responde negativo solo a la terminal
      OscMessage myMessage = new OscMessage("/visitorError")
      oscGateway.send(myMessage, oscTerminalLocation);

    }
  }
View Full Code Here

Examples of oscP5.OscMessage

 

 
  private void visualStatus(){
   
    OscMessage myMessage = new OscMessage("/pingVisual")
   
  //  oscTerminalLocation = new NetAddress("127.0.0.1",  oscTerminalPort);
   
    oscGateway.send(myMessage, oscTerminalLocation);
   
View Full Code Here

Examples of oscP5.OscMessage

  }

 
  public void sendOSCMessage(String message, NetAddress dest){
   
    OscMessage myMessage = new OscMessage(message);     
    oscGateway.send(myMessage, oscCoreLocation);
 
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.