use of org.teleal.cling.model.types.UDAServiceId in project openhab1-addons by openhab.
the class SonosZonePlayer method saveQueue.
public boolean saveQueue(String name, String queueID) {
if (name != null && queueID != null && isConfigured()) {
Service service = device.findService(new UDAServiceId("AVTransport"));
Action action = service.getAction("SaveQueue");
ActionInvocation invocation = new ActionInvocation(action);
try {
invocation.setInput("Title", name);
invocation.setInput("ObjectID", queueID);
} catch (InvalidValueException ex) {
logger.error("Action Invalid Value Exception {}", ex.getMessage());
} catch (NumberFormatException ex) {
logger.error("Action Invalid Value Format Exception {}", ex.getMessage());
}
executeActionInvocation(invocation);
return true;
} else {
return false;
}
}
use of org.teleal.cling.model.types.UDAServiceId in project openhab1-addons by openhab.
the class SonosZonePlayer method addURIToQueue.
public boolean addURIToQueue(String URI, String meta, int desiredFirstTrack, boolean enqueueAsNext) {
if (isConfigured() && URI != null && meta != null) {
Service service = device.findService(new UDAServiceId("AVTransport"));
Action action = service.getAction("AddURIToQueue");
ActionInvocation invocation = new ActionInvocation(action);
try {
invocation.setInput("InstanceID", "0");
invocation.setInput("EnqueuedURI", URI);
invocation.setInput("EnqueuedURIMetaData", meta);
invocation.setInput("DesiredFirstTrackNumberEnqueued", new UnsignedIntegerFourBytes(desiredFirstTrack));
invocation.setInput("EnqueueAsNext", enqueueAsNext);
} catch (InvalidValueException ex) {
logger.error("Action Invalid Value Exception {}", ex.getMessage());
} catch (NumberFormatException ex) {
logger.error("Action Invalid Value Format Exception {}", ex.getMessage());
}
executeActionInvocation(invocation);
return true;
}
return false;
}
Aggregations