1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.fourthline.cling.support.renderingcontrol.callback;
17
18 import org.fourthline.cling.controlpoint.ActionCallback;
19 import org.fourthline.cling.model.action.ActionInvocation;
20 import org.fourthline.cling.model.meta.Service;
21 import org.fourthline.cling.model.types.UnsignedIntegerFourBytes;
22 import org.fourthline.cling.model.types.UnsignedIntegerTwoBytes;
23 import org.fourthline.cling.support.model.Channel;
24
25 import java.util.logging.Logger;
26
27
28
29
30
31 public abstract class SetVolume extends ActionCallback {
32
33 private static Logger log = Logger.getLogger(SetVolume.class.getName());
34
35 public SetVolume(Service service, long newVolume) {
36 this(new UnsignedIntegerFourBytes(0), service, newVolume);
37 }
38
39 public SetVolume(UnsignedIntegerFourBytes instanceId, Service service, long newVolume) {
40 super(new ActionInvocation(service.getAction("SetVolume")));
41 getActionInvocation().setInput("InstanceID", instanceId);
42 getActionInvocation().setInput("Channel", Channel.Master.toString());
43 getActionInvocation().setInput("DesiredVolume", new UnsignedIntegerTwoBytes(newVolume));
44 }
45
46 @Override
47 public void success(ActionInvocation invocation) {
48 log.fine("Executed successfully");
49
50 }
51 }