1 package com.smartdevicelink.proxy.rpc;
\r
3 import java.util.Hashtable;
\r
5 import com.smartdevicelink.proxy.RPCRequest;
\r
6 import com.smartdevicelink.proxy.constants.Names;
\r
7 import com.smartdevicelink.proxy.rpc.enums.UpdateMode;
\r
8 import com.smartdevicelink.util.DebugTool;
\r
10 * Sets the media clock/timer value and the update method (e.g.count-up,
\r
13 * Function Group: Base <p>
\r
14 * <b>HMILevel needs to be FULL, LIMITIED or BACKGROUND</b>
\r
17 * @since SmartDeviceLink 1.0
\r
19 public class SetMediaClockTimer extends RPCRequest {
\r
21 * Constructs a new SetMediaClockTimer object
\r
23 public SetMediaClockTimer() {
\r
24 super("SetMediaClockTimer");
\r
27 * Constructs a new SetMediaClockTimer object indicated by the Hashtable
\r
32 * The Hashtable to use
\r
34 public SetMediaClockTimer(Hashtable hash) {
\r
38 * Gets the Start Time which media clock timer is set
\r
40 * @return StartTime -a StartTime object specifying hour, minute, second
\r
43 public StartTime getStartTime() {
\r
44 Object obj = parameters.get(Names.startTime);
\r
45 if (obj instanceof StartTime) {
\r
46 return (StartTime)obj;
\r
47 } else if (obj instanceof Hashtable) {
\r
48 return new StartTime((Hashtable)obj);
\r
53 * Sets a Start Time with specifying hour, minute, second values
\r
56 * a startTime object with specifying hour, minute, second values
\r
60 * <li>If "updateMode" is COUNTUP or COUNTDOWN, this parameter
\r
61 * must be provided</li>
\r
62 * <li>Will be ignored for PAUSE/RESUME and CLEAR</li>
\r
65 public void setStartTime( StartTime startTime ) {
\r
66 if (startTime != null) {
\r
67 parameters.put(Names.startTime, startTime );
\r
71 * Gets the media clock/timer update mode (COUNTUP/COUNTDOWN/PAUSE/RESUME)
\r
73 * @return UpdateMode -a Enumeration value (COUNTUP/COUNTDOWN/PAUSE/RESUME)
\r
75 public UpdateMode getUpdateMode() {
\r
76 Object obj = parameters.get(Names.updateMode);
\r
77 if (obj instanceof UpdateMode) {
\r
78 return (UpdateMode) obj;
\r
79 } else if (obj instanceof String) {
\r
80 UpdateMode theCode = null;
\r
82 theCode = UpdateMode.valueForString((String) obj);
\r
83 } catch (Exception e) {
\r
84 DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.updateMode, e);
\r
91 * Sets the media clock/timer update mode (COUNTUP/COUNTDOWN/PAUSE/RESUME)
\r
94 * a Enumeration value (COUNTUP/COUNTDOWN/PAUSE/RESUME)
\r
98 * <li>When updateMode is PAUSE, RESUME or CLEAR, the start time value
\r
100 * <li>When updateMode is RESUME, the timer resumes counting from
\r
101 * the timer's value when it was paused</li>
\r
104 public void setUpdateMode( UpdateMode updateMode ) {
\r
105 if (updateMode != null) {
\r
106 parameters.put(Names.updateMode, updateMode );
\r