本文整理汇总了Java中org.eclipse.smarthome.core.library.types.PlayPauseType.PAUSE属性的典型用法代码示例。如果您正苦于以下问题:Java PlayPauseType.PAUSE属性的具体用法?Java PlayPauseType.PAUSE怎么用?Java PlayPauseType.PAUSE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.smarthome.core.library.types.PlayPauseType
的用法示例。
在下文中一共展示了PlayPauseType.PAUSE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleControlCommand
private void handleControlCommand(Command command) throws SpeakerException {
if (command instanceof PlayPauseType) {
if (command == PlayPauseType.PLAY) {
speaker.resume();
} else if (command == PlayPauseType.PAUSE) {
speaker.pause();
}
} else if (command instanceof NextPreviousType) {
if (command == NextPreviousType.NEXT) {
speaker.next();
} else if (command == NextPreviousType.PREVIOUS) {
speaker.previous();
}
} else if (command instanceof RewindFastforwardType) {
if (command == RewindFastforwardType.FASTFORWARD) {
changeTrackPosition(bindingProperties.getFastForwardSkipTimeInSec() * 1000);
} else if (command == RewindFastforwardType.REWIND) {
changeTrackPosition(-bindingProperties.getRewindSkipTimeInSec() * 1000);
}
} else {
logger.warn("Unknown control command: {}", command);
}
}
示例2: convertNetUsbPlayStatus
private State convertNetUsbPlayStatus(String data) {
State state = UnDefType.UNDEF;
switch (data.charAt(0)) {
case 'P':
state = PlayPauseType.PLAY;
break;
case 'p':
case 'S':
state = PlayPauseType.PAUSE;
break;
case 'F':
state = RewindFastforwardType.FASTFORWARD;
break;
case 'R':
state = RewindFastforwardType.REWIND;
break;
}
return state;
}
示例3: onReceiveCommand
@Override
public void onReceiveCommand(ConnectableDevice device, String channelId, LGWebOSHandler handler, Command command) {
if (device == null) {
return;
}
if (NextPreviousType.NEXT == command) {
if (device.hasCapabilities(PlaylistControl.Next)) {
getPlayListControl(device).next(createDefaultResponseListener());
}
} else if (NextPreviousType.PREVIOUS == command) {
if (device.hasCapabilities(PlaylistControl.Previous)) {
getPlayListControl(device).previous(createDefaultResponseListener());
}
} else if (PlayPauseType.PLAY == command) {
if (device.hasCapabilities(MediaControl.Play)) {
getMediaControl(device).play(createDefaultResponseListener());
}
} else if (PlayPauseType.PAUSE == command) {
if (device.hasCapabilities(MediaControl.Pause)) {
getMediaControl(device).pause(createDefaultResponseListener());
}
} else if (RewindFastforwardType.FASTFORWARD == command) {
if (device.hasCapabilities(MediaControl.FastForward)) {
getMediaControl(device).fastForward(createDefaultResponseListener());
}
} else if (RewindFastforwardType.REWIND == command) {
if (device.hasCapabilities(MediaControl.Rewind)) {
getMediaControl(device).rewind(createDefaultResponseListener());
}
} else {
logger.warn("Only accept NextPreviousType, PlayPauseType, RewindFastforwardType. Type was {}.",
command.getClass());
}
}