Exemple #1
0
 /** @param theValue boolean */
 public void add(final boolean theValue) {
   if (theValue) {
     _myTypetag = OSCBytes.append(_myTypetag, new byte[] {0x54});
   } else {
     _myTypetag = OSCBytes.append(_myTypetag, new byte[] {0x46});
   }
 }
Exemple #2
0
 /**
  * @param channel int
  * @param status int
  * @param value1 int
  * @param value2 int
  */
 public void add(final int channel, final int status, final int value1, final int value2) {
   _myTypetag = OSCBytes.append(_myTypetag, new byte[] {0x6d}); // m
   byte[] theBytes = new byte[4];
   theBytes[0] = (byte) channel;
   theBytes[1] = (byte) status;
   theBytes[2] = (byte) value1;
   theBytes[3] = (byte) value2;
   _myData = OSCBytes.append(_myData, theBytes);
 }
Exemple #3
0
 /**
  * @param b byte[]
  * @return byte[]
  * @invisible
  */
 public static byte[] makeBlob(final byte[] b) {
   int tLength = b.length;
   byte[] b1 = OSCBytes.toBytes(tLength);
   b1 = OSCBytes.append(b1, b);
   int t = tLength % 4;
   if (t != 0) {
     b1 = OSCBytes.append(b1, new byte[4 - t]);
   }
   return b1;
 }
Exemple #4
0
 /**
  * @return byte[]
  * @invisible
  */
 public byte[] getBytes() {
   byte[] myBytes = new byte[0];
   byte[] myTypeTag = OSCBytes.copy(_myTypetag, 0);
   myBytes = OSCBytes.append(myBytes, _myAddrPattern, new byte[align(_myAddrPattern.length)]);
   if (myTypeTag.length == 0) {
     myTypeTag = new byte[] {KOMMA};
   } else if (myTypeTag[0] != KOMMA) {
     myTypeTag = OSCBytes.append(new byte[] {KOMMA}, myTypeTag);
   }
   myBytes = OSCBytes.append(myBytes, myTypeTag, new byte[align(myTypeTag.length)]);
   myBytes = OSCBytes.append(myBytes, _myData, new byte[align(_myData.length) % 4]);
   return myBytes;
 }
Exemple #5
0
 /** @param theArray byte[] */
 public void add(final byte[] theArray) {
   _myTypetag = OSCBytes.append(_myTypetag, new byte[] {0x62});
   _myData = OSCBytes.append(_myData, makeBlob(theArray));
 }
Exemple #6
0
 /** @param theValue char */
 public void add(final char theValue) {
   _myTypetag = OSCBytes.append(_myTypetag, new byte[] {0x63});
   _myData = OSCBytes.append(_myData, OSCBytes.toBytes(theValue));
 }
Exemple #7
0
 /** @param theValue double */
 public void add(final double theValue) {
   _myTypetag = OSCBytes.append(_myTypetag, new byte[] {0x64});
   _myData = OSCBytes.append(_myData, OSCBytes.toBytes(Double.doubleToLongBits(theValue)));
 }
Exemple #8
0
 /** @param theValue float */
 public void add(final float theValue) {
   _myTypetag = OSCBytes.append(_myTypetag, new byte[] {0x66});
   _myData = OSCBytes.append(_myData, OSCBytes.toBytes(Float.floatToIntBits(theValue)));
 }
Exemple #9
0
 /** @param theValue String */
 public void add(final String theValue) {
   _myTypetag = OSCBytes.append(_myTypetag, new byte[] {0x73});
   byte[] myString = theValue.getBytes();
   _myData = OSCBytes.append(_myData, myString, new byte[align(myString.length)]);
 }
Exemple #10
0
 /**
  * add values to an osc message. please check the add documentation for specific information.
  *
  * @example oscMessage
  */
 public void add() {
   _myTypetag = OSCBytes.append(_myTypetag, new byte[] {0x4e});
 }
Exemple #11
0
 /**
  * @return byte[]
  * @invisible
  */
 public byte[] getAddrPatternAsBytes() {
   return OSCBytes.append(_myAddrPattern, new byte[align(_myAddrPattern.length)]);
 }
Exemple #12
0
 /**
  * returns the typetag of the osc message. e.g. the message contains 3 floats then the typetag
  * would be "fff"
  *
  * @return String
  */
 public String typetag() {
   return OSCBytes.getAsString(_myTypetag);
 }
Exemple #13
0
 public String addrPattern() {
   return OSCBytes.getAsString(_myAddrPattern);
 }
Exemple #14
0
 /** @param theAddrPattern int */
 public void setAddrPattern(final int theAddrPattern) {
   _myAddrPattern = OSCBytes.toBytes(theAddrPattern);
 }