Android Open Source - Sensors2OSC Osc Configuration






From Project

Back to project page Sensors2OSC.

License

The source code is released under:

Author: Thomas Mayer <thomas@residuum.org> Antonio Deusany de Carvalho Junior Copyright (c) 2014 Thomas Mayer, Antonio Deusany de Carvalho Junior Permission is hereby granted, free of charge, to any...

If you think the Android project Sensors2OSC listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.sensors2.osc.communication;
/*from   w  w  w .j  a va 2  s.com*/
/**
 * Created by thomas on 10.11.14.
 */

import com.illposed.osc.OSCPortOut;

import java.net.InetAddress;

public class OscConfiguration {
  private static OscConfiguration instance;
  private OSCPortOut oscPort;
  private String host;
  private int port;

  private OscConfiguration() {
    this.oscPort = null;
    this.host = null;
    this.port = 0;
  }

  public static OscConfiguration getInstance() {
    if (instance == null) {
      instance = new OscConfiguration();
    }
    return instance;
  }

  public void setHost(String host) {
    this.host = host;
    this.oscPort = null;
  }

  public void setPort(int port) {
    this.port = port;
    this.oscPort = null;
  }

  public OSCPortOut getOscPort() {
    if (this.oscPort == null) {
      try {
        InetAddress address = InetAddress.getByName(this.host);
        this.oscPort = new OSCPortOut(address, this.port);
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
    return this.oscPort;
  }
}




Java Source Code List

org.sensors2.osc.ApplicationTest.java
org.sensors2.osc.activities.AboutActivity.java
org.sensors2.osc.activities.SettingsActivity.java
org.sensors2.osc.activities.StartUpActivity.java
org.sensors2.osc.communication.OscCommunication.java
org.sensors2.osc.communication.OscConfiguration.java
org.sensors2.osc.communication.OscDispatcher.java
org.sensors2.osc.communication.SensorConfiguration.java
org.sensors2.osc.fragments.SensorFragment.java
org.sensors2.osc.fragments.SensorGroupFragment.java
org.sensors2.osc.sensors.Parameters.java
org.sensors2.osc.sensors.Settings.java