public void flick(Coordinates where, int xOffset, int yOffset, int speed) { Map<String, Object> flickParams = CoordinatesUtils.paramsFromCoordinates(where); flickParams.put("xoffset", xOffset); flickParams.put("yoffset", yOffset); flickParams.put("speed", speed); executeMethod.execute(DriverCommand.TOUCH_FLICK, flickParams); }
@Override public double getVolume() { return ((Number) driverExecuteMethod.execute( QtWebKitDriverCommand.GET_PLAYER_VOLUME, ImmutableMap.of("id", id))) .doubleValue(); }
@Override public double getCurrentPlayingPosition() { return ((Number) driverExecuteMethod.execute( QtWebKitDriverCommand.GET_CURRENT_PLAYING_POSITION, ImmutableMap.of("id", id))) .doubleValue(); }
@Override public double getSpeed() { return ((Number) driverExecuteMethod.execute( QtWebKitDriverCommand.GET_PLAYBACK_SPEED, ImmutableMap.of("id", id))) .doubleValue(); }
@Override public void setVolume(double volume) throws IllegalArgumentException { if (volume > 1 || volume < 0) { throw new IllegalArgumentException("Volume should be between 1 and 0"); } driverExecuteMethod.execute( QtWebKitDriverCommand.SET_PLAYER_VOLUME, ImmutableMap.of("id", id, "volume", volume)); }
@Override public PlayerState getState() { Number response = (Number) driverExecuteMethod.execute( QtWebKitDriverCommand.GET_PLAYER_STATE, ImmutableMap.of("id", id)); PlayerState state = PlayerState.values()[response.intValue()]; return state; }
public void scroll(int xOffset, int yOffset) { Map<String, Object> scrollParams = new HashMap<String, Object>(); scrollParams.put("xoffset", xOffset); scrollParams.put("yoffset", yOffset); executeMethod.execute(DriverCommand.TOUCH_SCROLL, scrollParams); }
public void longPress(Coordinates where) { Map<String, Object> longPressParams = CoordinatesUtils.paramsFromCoordinates(where); executeMethod.execute(DriverCommand.TOUCH_LONG_PRESS, longPressParams); }
public void doubleTap(Coordinates where) { Map<String, Object> doubleTapParams = CoordinatesUtils.paramsFromCoordinates(where); executeMethod.execute(DriverCommand.TOUCH_DOUBLE_TAP, doubleTapParams); }
public void scroll(Coordinates where, int xOffset, int yOffset) { Map<String, Object> scrollParams = CoordinatesUtils.paramsFromCoordinates(where); scrollParams.put("xoffset", xOffset); scrollParams.put("yoffset", yOffset); executeMethod.execute(DriverCommand.TOUCH_SCROLL, scrollParams); }
public void move(int x, int y) { Map<String, Object> moveParams = new HashMap<String, Object>(); moveParams.put("x", x); moveParams.put("y", y); executeMethod.execute(DriverCommand.TOUCH_MOVE, moveParams); }
public void up(int x, int y) { Map<String, Object> upParams = new HashMap<String, Object>(); upParams.put("x", x); upParams.put("y", y); executeMethod.execute(DriverCommand.TOUCH_UP, upParams); }
@Override public void setMute(boolean mute) { driverExecuteMethod.execute( QtWebKitDriverCommand.SET_PLAYER_MUTE, ImmutableMap.of("id", id, "mute", mute)); }
@Override public void seek(double position) { driverExecuteMethod.execute( QtWebKitDriverCommand.SET_CURRENT_PLAYING_POSITION, ImmutableMap.of("id", id, "position", position)); }
@Override public void setSpeed(double speed) { driverExecuteMethod.execute( QtWebKitDriverCommand.SET_PLAYBACK_SPEED, ImmutableMap.of("id", id, "speed", speed)); }
public void flick(int xSpeed, int ySpeed) { Map<String, Object> flickParams = new HashMap<String, Object>(); flickParams.put("xspeed", xSpeed); flickParams.put("yspeed", ySpeed); executeMethod.execute(DriverCommand.TOUCH_FLICK, flickParams); }
public void down(int x, int y) { Map<String, Object> downParams = new HashMap<String, Object>(); downParams.put("x", x); downParams.put("y", y); executeMethod.execute(DriverCommand.TOUCH_DOWN, downParams); }
@Override public void setState(PlayerState state) { driverExecuteMethod.execute( QtWebKitDriverCommand.SET_PLAYER_STATE, ImmutableMap.of("id", id, "state", state.ordinal())); }
@Override public boolean isMuted() { return (Boolean) driverExecuteMethod.execute( QtWebKitDriverCommand.GET_PLAYER_MUTE, ImmutableMap.of("id", id)); }