Package org.teleal.cling.model.action

Examples of org.teleal.cling.model.action.ActionInvocation


  public boolean play() {
    if(isConfigured()) {
      Service service = device.findService(new UDAServiceId("AVTransport"));
      Action action = service.getAction("Play");
      ActionInvocation invocation = new ActionInvocation(action);

      invocation.setInput("Speed", "1");

      executeActionInvocation(invocation);

      return true;
    } else {
View Full Code Here


  public boolean stop() {
    if(isConfigured()) {
      Service service = device.findService(new UDAServiceId("AVTransport"));
      Action action = service.getAction("Stop");
      ActionInvocation invocation = new ActionInvocation(action);

      executeActionInvocation(invocation);

      return true;
    } else {
View Full Code Here

  public boolean pause() {
    if(isConfigured()) {
      Service service = device.findService(new UDAServiceId("AVTransport"));
      Action action = service.getAction("Pause");
      ActionInvocation invocation = new ActionInvocation(action);

      executeActionInvocation(invocation);

      return true;
    } else {
View Full Code Here

  public boolean next() {
    if(isConfigured()) {
      Service service = device.findService(new UDAServiceId("AVTransport"));
      Action action = service.getAction("Next");
      ActionInvocation invocation = new ActionInvocation(action);

      executeActionInvocation(invocation);

      return true;
    } else {
View Full Code Here

  public boolean previous() {
    if(isConfigured()) {
      Service service = device.findService(new UDAServiceId("AVTransport"));
      Action action = service.getAction("Previous");
      ActionInvocation invocation = new ActionInvocation(action);

      executeActionInvocation(invocation);

      return true;
    } else {
View Full Code Here

    if(isConfigured()) {

      Service service = device.findService(new UDAServiceId("AVTransport"));
      Action action = service.getAction("BecomeCoordinatorOfStandaloneGroup");
      ActionInvocation invocation = new ActionInvocation(action);

      executeActionInvocation(invocation);

      return true;
    } else {
View Full Code Here

  public boolean setMute(String string) {
    if(string != null && isConfigured()) {

      Service service = device.findService(new UDAServiceId("RenderingControl"));
      Action action = service.getAction("SetMute");
      ActionInvocation invocation = new ActionInvocation(action);

      try {
        invocation.setInput("Channel", "Master");

        if(string.equals("ON") || string.equals("OPEN") || string.equals("UP") ) {
          invocation.setInput("DesiredMute", "True");             
        } else

          if(string.equals("OFF") || string.equals("CLOSED") || string.equals("DOWN") ) {
            invocation.setInput("DesiredMute", "False");             
          } else {
            return false;
          }
      } catch (InvalidValueException ex) {
        logger.error("Action Invalid Value Exception {}",ex.getMessage());
View Full Code Here

  public boolean setVolume(String value) {
    if(value != null && isConfigured()) {

      Service service = device.findService(new UDAServiceId("RenderingControl"));
      Action action = service.getAction("SetVolume");
      ActionInvocation invocation = new ActionInvocation(action);

      try {
        String newValue = value;
        if(value.equals("INCREASE")) {
          int i = Integer.valueOf(this.getVolume());
          newValue = String.valueOf(Math.min(100, i+1));
        } else if (value.equals("DECREASE")) {
          int i = Integer.valueOf(this.getVolume());
          newValue = String.valueOf(Math.max(0, i-1));         
        } else if (value.equals("ON")) {
          newValue = "100";
        } else if (value.equals("OFF")) {
          newValue = "0";
        } else {
          newValue = value;
        }
        invocation.setInput("Channel", "Master");
        invocation.setInput("DesiredVolume",newValue);
      } catch (InvalidValueException ex) {
        logger.error("Action Invalid Value Exception {}",ex.getMessage());
      } catch (NumberFormatException ex) {
        logger.error("Action Invalid Value Format Exception {}",ex.getMessage())
      }
View Full Code Here

    if(isConfigured()) {

      Service service = device.findService(new UDAServiceId("AlarmClock"));
      Action action = service.getAction("GetTimeNow");
      ActionInvocation invocation = new ActionInvocation(action);

      executeActionInvocation(invocation);

      return true;
    } else {
View Full Code Here

    if(stateMap != null && isConfigured()) {

      Service service = device.findService(new UDAServiceId("AVTransport"));
      Action action = service.getAction("GetRunningAlarmProperties");
      ActionInvocation invocation = new ActionInvocation(action);

      executeActionInvocation(invocation);

      // for this property we would like to "compile" a more friendly variable.
      // this newly created "variable" is also store in the stateMap
View Full Code Here

TOP

Related Classes of org.teleal.cling.model.action.ActionInvocation

Copyright © 2018 www.massapicom. 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.