Package org.teleal.cling.model.state

Examples of org.teleal.cling.model.state.StateVariableValue


  }


  public String getCurrentVolume(){
    if(stateMap != null && isConfigured()) {
      StateVariableValue status = stateMap.get("VolumeMaster");
      return status.getValue().toString();
    } else {
      return null;
    }   
  }
View Full Code Here


        // find all the CommandTypes that are defined for each
        // StateVariable
        List<SonosCommandType> supportedCommands = SonosCommandType
            .getCommandByVariable(stateVariable);

        StateVariableValue status = values.get(stateVariable);

        for (SonosCommandType sonosCommandType : supportedCommands) {

          // create a new State based on the type of Sonos Command and
          // the status value in the map
          Type newState = null;
          try {
            newState = createStateForType((Class<? extends State>) sonosCommandType.getTypeClass(), status
                .getValue().toString());
          } catch (BindingConfigParseException e) {
            logger.error(
                "Error parsing a value {} to a state variable of type {}",
                status.toString(), sonosCommandType
                .getTypeClass().toString());
          }

          for (SonosBindingProvider provider : providers) {
            List<String> qualifiedItems = provider.getItemNames(sonosZonePlayerCache.getByDevice(device).getId(), sonosCommandType.getSonosCommand());
View Full Code Here

  }


  protected boolean isUpdatedValue(String valueName,StateVariableValue newValue) {
    if(newValue != null && valueName != null) {
      StateVariableValue oldValue = stateMap.get(valueName);

      if(newValue.getValue()== null) {
        // we will *not* store an empty value, thank you.
        return false;
      } else {
        if(oldValue == null) {
          // there was nothing stored before
          return true;
        } else {
          if (oldValue.getValue() == null) {
            // something was defined, but no value present
            return true;
          } else {
            if(newValue.getValue().equals(oldValue.getValue())) {
              return false;
            } else {
              return true;
            }
          }
View Full Code Here

        SonosZonePlayer coordinator = sonosBinding.getCoordinatorForZonePlayer(this);
        //coordinator.setCurrentURI(theEntry);
        coordinator.addURIToQueue(theEntry);

        if(stateMap != null && isConfigured()) {
          StateVariableValue firstTrackNumberEnqueued = stateMap.get("FirstTrackNumberEnqueued");
          if(firstTrackNumberEnqueued!=null) {
            coordinator.seek("TRACK_NR", firstTrackNumberEnqueued.getValue().toString());
          }
        }

        coordinator.play();
View Full Code Here

    }
  }

  public String getZoneName() {
    if(stateMap != null && isConfigured()) {
      StateVariableValue value = stateMap.get("ZoneName");
      if(value != null) {
        return value.getValue().toString();
      }
    }
    return null;

  }
View Full Code Here

  }

  public String getZoneGroupID() {
    if(stateMap != null && isConfigured()) {
      StateVariableValue value = stateMap.get("LocalGroupUUID");
      if(value != null) {
        return value.getValue().toString();
      }
    }
    return null;

  }
View Full Code Here

  }

  public boolean isGroupCoordinator() {
    if(stateMap != null && isConfigured()) {
      StateVariableValue value = stateMap.get("GroupCoordinatorIsLocal");
      if(value != null) {
        return (Boolean) value.getValue();
      }
    }

    return false;
View Full Code Here

    }
  }

  public String getMute(){
    if(stateMap != null && isConfigured()) {
      StateVariableValue value = stateMap.get("MuteMaster");
      if(value != null) {
        return value.getValue().toString();
      }
    }

    return null;
View Full Code Here

    }
  }

  public String getVolume() {
    if(stateMap != null && isConfigured()) {
      StateVariableValue value = stateMap.get("VolumeMaster");
      if(value != null) {
        return value.getValue().toString();
      }
    }

    return null;
View Full Code Here

  public String getTime() {
    if(isConfigured()) {
      updateTime();
      if(stateMap != null) {
        StateVariableValue value = stateMap.get("CurrentLocalTime");
        if(value != null) {
          return value.getValue().toString();
        }

      }
    }
    return null;
View Full Code Here

TOP

Related Classes of org.teleal.cling.model.state.StateVariableValue

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.