本文整理汇总了Java中org.fourthline.cling.model.types.UnsignedIntegerTwoBytes类的典型用法代码示例。如果您正苦于以下问题:Java UnsignedIntegerTwoBytes类的具体用法?Java UnsignedIntegerTwoBytes怎么用?Java UnsignedIntegerTwoBytes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UnsignedIntegerTwoBytes类属于org.fourthline.cling.model.types包,在下文中一共展示了UnsignedIntegerTwoBytes类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getVolume
import org.fourthline.cling.model.types.UnsignedIntegerTwoBytes; //导入依赖的package包/类
@Override
public UnsignedIntegerTwoBytes getVolume(UnsignedIntegerFourBytes instanceId,
String channelName) throws RenderingControlException {
Log.d(getClass().getName(), "getVolume() ");
return new UnsignedIntegerTwoBytes(upnpClient.getVolume());
}
示例2: getVolume
import org.fourthline.cling.model.types.UnsignedIntegerTwoBytes; //导入依赖的package包/类
@Override
@UpnpAction(out = @UpnpOutputArgument(name = "CurrentVolume", stateVariable = "Volume"))
public UnsignedIntegerTwoBytes getVolume(
@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes arg0,
@UpnpInputArgument(name = "Channel") String arg1)
throws RenderingControlException {
// TODO Auto-generated method stub
return new UnsignedIntegerTwoBytes(
mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC));
}
示例3: setVolume
import org.fourthline.cling.model.types.UnsignedIntegerTwoBytes; //导入依赖的package包/类
@Override
@UpnpAction
public void setVolume(
@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes arg0,
@UpnpInputArgument(name = "Channel") String arg1,
@UpnpInputArgument(name = "DesiredVolume", stateVariable = "Volume") UnsignedIntegerTwoBytes arg2)
throws RenderingControlException {
// TODO Auto-generated method stub
int volume = arg2.getValue().intValue();
int maxVolume = mAudioManager
.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
Log.e(LOG_TAG, "MaxVolume:" + maxVolume + "currentVolume" + volume);
if (volume >= 0 && volume <= maxVolume) {
mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, volume,
AudioManager.FLAG_PLAY_SOUND | AudioManager.FLAG_SHOW_UI);
if (volume > 0)
mAudioManager.setStreamMute(AudioManager.STREAM_MUSIC, false);
boolean isMute = volume == 0 ? true : false;
getLastChange().setEventedValue(
getDefaultInstanceID(),
new RenderingControlVariable.Volume(new ChannelVolume(
Channel.Master, volume)),
new RenderingControlVariable.Mute(new ChannelMute(
Channel.Master, isMute)));
getLastChange().fire(getPropertyChangeSupport());
} else
throw new RenderingControlException(ErrorCode.INVALID_ARGS,
"The volume is invalid.");
}
示例4: PortMapping
import org.fourthline.cling.model.types.UnsignedIntegerTwoBytes; //导入依赖的package包/类
public PortMapping(Map<String, ActionArgumentValue<Service>> map) {
this(
(Boolean) map.get("NewEnabled").getValue(),
(UnsignedIntegerFourBytes) map.get("NewLeaseDuration").getValue(),
(String) map.get("NewRemoteHost").getValue(),
(UnsignedIntegerTwoBytes) map.get("NewExternalPort").getValue(),
(UnsignedIntegerTwoBytes) map.get("NewInternalPort").getValue(),
(String) map.get("NewInternalClient").getValue(),
Protocol.valueOf(map.get("NewProtocol").toString()),
(String) map.get("NewPortMappingDescription").getValue()
);
}
示例5: getAttributes
import org.fourthline.cling.model.types.UnsignedIntegerTwoBytes; //导入依赖的package包/类
@Override
public Map.Entry<String, String>[] getAttributes() {
return new Map.Entry[]{
new AbstractMap.SimpleEntry<String, String>(
"val",
new UnsignedIntegerTwoBytesDatatype().getString(
new UnsignedIntegerTwoBytes(getValue().getVolumeDB())
)
),
new AbstractMap.SimpleEntry<String, String>(
"channel",
getValue().getChannel().name()
)
};
}
示例6: getAttributes
import org.fourthline.cling.model.types.UnsignedIntegerTwoBytes; //导入依赖的package包/类
@Override
public Map.Entry<String, String>[] getAttributes() {
return new Map.Entry[]{
new AbstractMap.SimpleEntry<String, String>(
"val",
new UnsignedIntegerTwoBytesDatatype().getString(
new UnsignedIntegerTwoBytes(getValue().getVolume())
)
),
new AbstractMap.SimpleEntry<String, String>(
"channel",
getValue().getChannel().name()
)
};
}
示例7: getVolume
import org.fourthline.cling.model.types.UnsignedIntegerTwoBytes; //导入依赖的package包/类
@Override
public UnsignedIntegerTwoBytes getVolume(UnsignedIntegerFourBytes instanceId, String channelName) throws RenderingControlException {
checkChannel(channelName);
int vol = (int) (getInstance(instanceId).getVolume() * 100);
log.fine("Getting backend volume: " + vol);
return new UnsignedIntegerTwoBytes(vol);
}
示例8: setVolume
import org.fourthline.cling.model.types.UnsignedIntegerTwoBytes; //导入依赖的package包/类
@Override
public void setVolume(UnsignedIntegerFourBytes instanceId, String channelName, UnsignedIntegerTwoBytes desiredVolume) throws RenderingControlException {
checkChannel(channelName);
double vol = desiredVolume.getValue() / 100d;
log.fine("Setting backend volume to: " + vol);
getInstance(instanceId).setVolume(vol);
}
示例9: setVolume
import org.fourthline.cling.model.types.UnsignedIntegerTwoBytes; //导入依赖的package包/类
@Override
public void setVolume(UnsignedIntegerFourBytes instanceId, String channelName,
UnsignedIntegerTwoBytes desiredVolume) throws RenderingControlException {
Log.d(getClass().getName(), "setVolume() ");
upnpClient.setVolume(desiredVolume.getValue().intValue());
}
示例10: getVolume
import org.fourthline.cling.model.types.UnsignedIntegerTwoBytes; //导入依赖的package包/类
@Override
public UnsignedIntegerTwoBytes getVolume(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes unsignedIntegerFourBytes, @UpnpInputArgument(name = "Channel") String s) throws RenderingControlException {
return null;
}
示例11: getExternalPort
import org.fourthline.cling.model.types.UnsignedIntegerTwoBytes; //导入依赖的package包/类
public UnsignedIntegerTwoBytes getExternalPort() {
return externalPort;
}
示例12: setExternalPort
import org.fourthline.cling.model.types.UnsignedIntegerTwoBytes; //导入依赖的package包/类
public void setExternalPort(UnsignedIntegerTwoBytes externalPort) {
this.externalPort = externalPort;
}
示例13: getInternalPort
import org.fourthline.cling.model.types.UnsignedIntegerTwoBytes; //导入依赖的package包/类
public UnsignedIntegerTwoBytes getInternalPort() {
return internalPort;
}
示例14: setInternalPort
import org.fourthline.cling.model.types.UnsignedIntegerTwoBytes; //导入依赖的package包/类
public void setInternalPort(UnsignedIntegerTwoBytes internalPort) {
this.internalPort = internalPort;
}
示例15: getVolume
import org.fourthline.cling.model.types.UnsignedIntegerTwoBytes; //导入依赖的package包/类
@UpnpAction(out = @UpnpOutputArgument(name = "CurrentVolume", stateVariable = "Volume"))
public abstract UnsignedIntegerTwoBytes getVolume(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId,
@UpnpInputArgument(name = "Channel") String channelName) throws RenderingControlException;