当前位置: 首页>>代码示例>>Java>>正文


Java PlayPauseType.PAUSE属性代码示例

本文整理汇总了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);
    }
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:23,代码来源:AllPlayHandler.java

示例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;
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:20,代码来源:OnkyoHandler.java

示例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());
    }
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:34,代码来源:MediaControlPlayer.java


注:本文中的org.eclipse.smarthome.core.library.types.PlayPauseType.PAUSE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。