本文整理汇总了Java中org.fourthline.cling.support.renderingcontrol.lastchange.RenderingControlVariable类的典型用法代码示例。如果您正苦于以下问题:Java RenderingControlVariable类的具体用法?Java RenderingControlVariable怎么用?Java RenderingControlVariable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RenderingControlVariable类属于org.fourthline.cling.support.renderingcontrol.lastchange包,在下文中一共展示了RenderingControlVariable类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setMute
import org.fourthline.cling.support.renderingcontrol.lastchange.RenderingControlVariable; //导入依赖的package包/类
@Override
@UpnpAction
public void setMute(
@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes arg0,
@UpnpInputArgument(name = "Channel") String arg1,
@UpnpInputArgument(name = "DesiredMute", stateVariable = "Mute") boolean arg2)
throws RenderingControlException {
// TODO Auto-generated method stub
Log.e(LOG_TAG, "Start to set mute");
mAudioManager.setStreamMute(AudioManager.STREAM_MUSIC, arg2);
getLastChange().setEventedValue(
getDefaultInstanceID(),
new RenderingControlVariable.Mute(new ChannelMute(
Channel.Master, arg2)));
getLastChange().fire(getPropertyChangeSupport());
}
示例2: setVolume
import org.fourthline.cling.support.renderingcontrol.lastchange.RenderingControlVariable; //导入依赖的package包/类
synchronized public void setVolume(double volume) {
Log.i(TAG,"setVolume " + volume);
storedVolume = getVolume();
Intent intent = new Intent();
intent.setAction(Action.DMR);
intent.putExtra("helpAction", Action.SET_VOLUME);
intent.putExtra("volume", volume);
mContext.sendBroadcast(intent);
ChannelMute switchedMute =
(storedVolume == 0 && volume > 0) || (storedVolume > 0 && volume == 0)
? new ChannelMute(Channel.Master, storedVolume > 0 && volume == 0)
: null;
getRenderingControlLastChange().setEventedValue(
getInstanceId(),
new RenderingControlVariable.Volume(
new ChannelVolume(Channel.Master, (int) (volume * 100))
),
switchedMute != null
? new RenderingControlVariable.Mute(switchedMute)
: null
);
}
示例3: setVolume
import org.fourthline.cling.support.renderingcontrol.lastchange.RenderingControlVariable; //导入依赖的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: appendCurrentState
import org.fourthline.cling.support.renderingcontrol.lastchange.RenderingControlVariable; //导入依赖的package包/类
@Override
public void appendCurrentState(LastChange lc, UnsignedIntegerFourBytes instanceId) throws Exception {
for (Channel channel : getCurrentChannels()) {
String channelString = channel.name();
lc.setEventedValue(
instanceId,
new RenderingControlVariable.Mute(new ChannelMute(channel, getMute(instanceId, channelString))),
new RenderingControlVariable.Loudness(new ChannelLoudness(channel, getLoudness(instanceId, channelString))),
new RenderingControlVariable.Volume(new ChannelVolume(channel, getVolume(instanceId, channelString).getValue().intValue())),
new RenderingControlVariable.VolumeDB(new ChannelVolumeDB(channel, getVolumeDB(instanceId, channelString))),
new RenderingControlVariable.PresetNameList(PresetName.FactoryDefaults.name())
);
}
}