Android Open Source - SensOSC Osc Configuration






From Project

Back to project page SensOSC.

License

The source code is released under:

Author: Thomas Mayer <thomas@residuum.org> Copyright (c) 2014 Thomas Mayer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation ...

If you think the Android project SensOSC 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.residuum.sensosc;
//from   w  w  w .j  a  v a 2s  .com
import com.illposed.osc.OSCPortOut;

import java.net.InetAddress;

/**
 * Created by thomas on 20.09.14.
 */
public class OscConfiguration {
  private static OscConfiguration instance;

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

  private OSCPortOut oscPort;
  private String host;
  private int port;

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

  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.residuum.sensosc.AboutActivity.java
org.residuum.sensosc.ApplicationTest.java
org.residuum.sensosc.ExtendedEditTextPreference.java
org.residuum.sensosc.OscCommunication.java
org.residuum.sensosc.OscConfiguration.java
org.residuum.sensosc.SensorFragment.java
org.residuum.sensosc.SensorGroupFragment.java
org.residuum.sensosc.Sensor.java
org.residuum.sensosc.SettingsActivity.java
org.residuum.sensosc.StartupActivity.java