public void forwardMessage(OSCMessage message) { try { oscPortOut.send(message); } catch (Exception e) { e.printStackTrace(); } }
public void forwardBundle(OSCBundle bundle) { // for (OSCPacket packet : bundle.getPackets()) // { // System.out.println(packet.toString()); // } try { oscPortOut.send(bundle); } catch (Exception e) { e.printStackTrace(); } }
@Override public void send(OSCBundle bundle) { try { oscPortOut.send(bundle); } catch (IOException e) { logger.log(Level.WARNING, "failed to send OSC bundle", e); } }
@Override public void send(OSCBundle bundle) { try { oscPortOut.send(bundle); } catch (IOException e) { logger.log(Level.WARNING, "failed to send OSC bundle", e); } }
protected void oscSend(String command, int timestamp, String...data) { if (sender != null) { List<Object> args = new ArrayList<Object>(6); args.add(timestamp); for (int i = 0; i < data.length; i++) { args.add(data[i]); } OSCMessage msg = new OSCMessage("/" + command, args); try { sender.send(msg); } catch (Exception ex) { Log.error("Error sending OSC message", ex); } } }
protected void oscSend(String command, int timestamp, float...data) { if (sender != null) { List<Object> args = new ArrayList<Object>(6); args.add(timestamp); for (int i = 0; i < data.length; i++) { args.add(data[i]); } OSCMessage msg = new OSCMessage("/" + command, args); try { sender.send(msg); } catch (Exception ex) { Log.error("Error sending OSC message", ex); } } }
protected void oscSend(String command, int timestamp, int...data) { if (sender != null) { List<Object> args = new ArrayList<Object>(6); args.add(timestamp); for (int i = 0; i < data.length; i++) { args.add(data[i]); } OSCMessage msg = new OSCMessage("/" + command, args); try { sender.send(msg); } catch (Exception ex) { Log.error("Error sending OSC message", ex); } } }
public void doSendOn(float freq, int node) { // if "Set Address" has not been performed then give the message to set // it first if (null == oscPort) { showError("Please set an address first"); } // send an OSC message to start the synth "pink" on node 1000. List<Object> args = new ArrayList<Object>(6); args.add("javaosc-example"); args.add(new Integer(node)); args.add(new Integer(1)); args.add(new Integer(0)); args.add("freq"); args.add(new Float(freq)); // a comma is placed after /s_new in the code OSCMessage msg = new OSCMessage("/s_new", args); // Object[] args2 = {new Symbol("amp"), new Float(0.5)}; // OscMessage msg2 = new OscMessage("/n_set", args2); //oscPort.send(msg); // try to use the send method of oscPort using the msg in nodeWidget // send an error message if this doesn't happen try { oscPort.send(msg); } catch (Exception ex) { showError("Couldn't send"); } }
public void doSendSlider(float freq, int node) { // if "Set Address" has not been performed then give the message to set // it first if (null == oscPort) { showError("Please set an address first"); } // send an OSC message to set the node 1000 List<Object> args = new ArrayList<Object>(3); args.add(new Integer(node)); args.add("freq"); args.add(new Float(freq)); OSCMessage msg = new OSCMessage("/n_set", args); // try to use the send method of oscPort using the msg in nodeWidget // send an error message if this doesn't happen try { oscPort.send(msg); } catch (Exception e) { showError("Couldn't send"); } }
public void doSendOff(int node) { // if "Set Address" has not been performed then give the message to set // it first if (null == oscPort) { showError("Please set an address first"); } // send an OSC message to free the node 1000 List<Object> args = new ArrayList<Object>(1); args.add(new Integer(node)); OSCMessage msg = new OSCMessage("/n_free", args); // try to use the send method of oscPort using the msg in nodeWidget // send an error message if this doesn't happen try { oscPort.send(msg); } catch (Exception e) { showError("Couldn't send"); } }
public void doSendGlobalOff(int node1, int node2, int node3) { if (null == oscPort) { showError("Please set an address first"); } List<Object> args1 = new ArrayList<Object>(1); args1.add(new Integer(node1)); OSCMessage msg1 = new OSCMessage("/n_free", args1); List<Object> args2 = new ArrayList<Object>(1); args2.add(new Integer(node2)); OSCMessage msg2 = new OSCMessage("/n_free", args2); List<Object> args3 = new ArrayList<Object>(1); args3.add(new Integer(node3)); OSCMessage msg3 = new OSCMessage("/n_free", args3); // create a timeStamped bundle of the messages List<OSCPacket> packets = new ArrayList<OSCPacket>(3); packets.add(msg1); packets.add(msg2); packets.add(msg3); Date newDate = new Date(); long time = newDate.getTime(); Integer delayTime = Integer.valueOf(textBox4.getText()); time = time + delayTime.longValue(); newDate.setTime(time); OSCBundle bundle = new OSCBundle(packets, newDate); try { oscPort.send(bundle); } catch (Exception e) { showError("Couldn't send"); } }