SDL_Android/SmartDeviceLinkAndroidProxy - added the correct version of the proxy
[profile/ivi/smartdevicelink.git] / SDL_Android / SmartDeviceLinkProxyAndroid / src / com / smartdevicelink / proxy / rpc / Speak.java
index 9c5ed4a..3a099ee 100755 (executable)
-//
-// Copyright (c) 2013 Ford Motor Company
-//
-package com.smartdevicelink.proxy.rpc;
-
-import java.util.Hashtable;
-import java.util.Vector;
-
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.constants.Names;
-
-public class Speak extends RPCRequest {
-
-    public Speak() {
-        super("Speak");
-    }
-    public Speak(Hashtable hash) {
-        super(hash);
-    }
-    public Vector<TTSChunk> getTtsChunks() {
-       if (parameters.get(Names.ttsChunks) instanceof Vector<?>) {
-               Vector<?> list = (Vector<?>)parameters.get(Names.ttsChunks);
-               if (list != null && list.size() > 0) {
-                   Object obj = list.get(0);
-                   if (obj instanceof TTSChunk) {
-                       return (Vector<TTSChunk>) list;
-                   } else if (obj instanceof Hashtable) {
-                       Vector<TTSChunk> newList = new Vector<TTSChunk>();
-                       for (Object hashObj : list) {
-                           newList.add(new TTSChunk((Hashtable)hashObj));
-                       }
-                       return newList;
-                   }
-               }
-       }
-        return null;
-    }
-    public void setTtsChunks( Vector<TTSChunk> ttsChunks ) {
-        if (ttsChunks != null) {
-            parameters.put(Names.ttsChunks, ttsChunks );
-        }
-    }
-}
+package com.smartdevicelink.proxy.rpc;\r
+\r
+import java.util.Hashtable;\r
+import java.util.Vector;\r
+\r
+import com.smartdevicelink.proxy.RPCRequest;\r
+import com.smartdevicelink.proxy.constants.Names;\r
+\r
+/**\r
+ * Speaks a phrase over the vehicle audio system using SMARTDEVICELINK's TTS\r
+ * (text-to-speech) engine. The provided text to be spoken can be simply a text\r
+ * phrase, or it can consist of phoneme specifications to direct SMARTDEVICELINK's TTS\r
+ * engine to speak a "speech-sculpted" phrase\r
+ * <p>\r
+ * Receipt of the Response indicates the completion of the Speak operation,\r
+ * regardless of how the Speak operation may have completed (i.e. successfully,\r
+ * interrupted, terminated, etc.)\r
+ * <p>\r
+ * Requesting a new Speak operation while the application has another Speak\r
+ * operation already in progress (i.e. no corresponding Response for that\r
+ * in-progress Speak operation has been received yet) will terminate the\r
+ * in-progress Speak operation (causing its corresponding Response to be sent by\r
+ * SMARTDEVICELINK) and begin the requested Speak operation\r
+ * <p>\r
+ * Requesting a new Speak operation while the application has an <i>\r
+ * {@linkplain Alert}</i> operation already in progress (i.e. no corresponding\r
+ * Response for that in-progress <i>{@linkplain Alert}</i> operation has been\r
+ * received yet) will result in the Speak operation request being rejected\r
+ * (indicated in the Response to the Request)\r
+ * <p>\r
+ * Requesting a new <i>{@linkplain Alert}</i> operation while the application\r
+ * has a Speak operation already in progress (i.e. no corresponding Response for\r
+ * that in-progress Speak operation has been received yet) will terminate the\r
+ * in-progress Speak operation (causing its corresponding Response to be sent by\r
+ * SMARTDEVICELINK) and begin the requested <i>{@linkplain Alert}</i> operation\r
+ * <p>\r
+ * Requesting a new Speak operation while the application has a <i>\r
+ * {@linkplain PerformInteraction}</i> operation already in progress (i.e. no\r
+ * corresponding Response for that in-progress <i>\r
+ * {@linkplain PerformInteraction}</i> operation has been received yet) will\r
+ * result in the Speak operation request being rejected (indicated in the\r
+ * Response to the Request)\r
+ * <p>\r
+ * Requesting a <i> {@linkplain PerformInteraction}</i> operation while the\r
+ * application has a Speak operation already in progress (i.e. no corresponding\r
+ * Response for that in-progress Speak operation has been received yet) will\r
+ * terminate the in-progress Speak operation (causing its corresponding Response\r
+ * to be sent by SMARTDEVICELINK) and begin the requested <i>\r
+ * {@linkplain PerformInteraction}</i> operation\r
+ * <p>\r
+ * \r
+ * <b>HMI Status Requirements:</b><br/>\r
+ * HMILevel: FULL, Limited<br/>\r
+ * AudioStreamingState: Any<br/>\r
+ * SystemContext: MAIN, MENU, VR\r
+ * </p>\r
+ * <b>Notes: </b>\r
+ * <ul>\r
+ * <li>When <i>{@linkplain Alert}</i> is issued with MENU in effect, <i>\r
+ * {@linkplain Alert}</i> is queued and "played" when MENU interaction is\r
+ * completed (i.e. SystemContext reverts to MAIN). When <i>{@linkplain Alert}\r
+ * </i> is issued with VR in effect, <i>{@linkplain Alert}</i> is queued and\r
+ * "played" when VR interaction is completed (i.e. SystemContext reverts to\r
+ * MAIN)</li>\r
+ * <li>When both <i>{@linkplain Alert}</i> and Speak are queued during MENU or\r
+ * VR, they are "played" back in the order in which they were queued, with all\r
+ * existing rules for "collisions" still in effect</li>\r
+ * </ul>\r
+ * <p>\r
+ * \r
+ * @since SmartDeviceLink 1.0\r
+ * @see Alert\r
+ */\r
+public class Speak extends RPCRequest {\r
+\r
+       /**\r
+        * Constructs a new Speak object\r
+        */    \r
+       public Speak() {\r
+        super("Speak");\r
+    }\r
+       /**\r
+        * Constructs a new Speak object indicated by the Hashtable parameter\r
+        * <p>\r
+        * \r
+        * @param hash\r
+        *            The Hashtable to use\r
+        */     \r
+    public Speak(Hashtable hash) {\r
+        super(hash);\r
+    }\r
+       /**\r
+        * Gets a Vector<TTSChunk> representing an array of 1-100 TTSChunk structs\r
+        * which, taken together, specify the phrase to be spoken\r
+        * \r
+        * @return Vector<TTSChunk> -an Array of 1-100 TTSChunk specify the phrase to be spoken\r
+        */    \r
+    public Vector<TTSChunk> getTtsChunks() {\r
+       if (parameters.get(Names.ttsChunks) instanceof Vector<?>) {\r
+               Vector<?> list = (Vector<?>)parameters.get(Names.ttsChunks);\r
+               if (list != null && list.size() > 0) {\r
+                   Object obj = list.get(0);\r
+                   if (obj instanceof TTSChunk) {\r
+                       return (Vector<TTSChunk>) list;\r
+                   } else if (obj instanceof Hashtable) {\r
+                       Vector<TTSChunk> newList = new Vector<TTSChunk>();\r
+                       for (Object hashObj : list) {\r
+                           newList.add(new TTSChunk((Hashtable)hashObj));\r
+                       }\r
+                       return newList;\r
+                   }\r
+               }\r
+       }\r
+        return null;\r
+    }\r
+       /**\r
+        * Sets a Vector<TTSChunk> representing an array of 1-100 TTSChunk structs\r
+        * which, taken together, specify the phrase to be spoken\r
+        * \r
+        * @param ttsChunks\r
+        *            a Vector<TTSChunk> value representing an array of 1-100 TTSChunk structs\r
+        * which specify the phrase to be spoken\r
+        *            <p>\r
+        *            <ul>\r
+        *            <li>The array must have 1-100 elements</li>\r
+        *            <li>The total length of the phrase composed from the ttsChunks\r
+        *            provided must be less than 500 characters or the request will\r
+        *            be rejected</li>\r
+        *            <li>Each chunk can be no more than 500 characters</li>\r
+        *            </ul>\r
+        */    \r
+    public void setTtsChunks( Vector<TTSChunk> ttsChunks ) {\r
+        if (ttsChunks != null) {\r
+            parameters.put(Names.ttsChunks, ttsChunks );\r
+        }\r
+    }\r
+}\r