[RADIO][TNEF-1685] Add Restrction call api on callback function
authorSangjin Sim <sangjin0924.sim@samsung.com>
Thu, 17 Sep 2015 12:40:26 +0000 (21:40 +0900)
committerSangjin Sim <sangjin0924.sim@samsung.com>
Thu, 17 Sep 2015 12:40:45 +0000 (21:40 +0900)
Signed-off-by: Sangjin Sim <sangjin0924.sim@samsung.com>
Change-Id: Ia955cbad089d7dccda85990ba10e67c976b03e04

org.tizen.tutorials/html/native/multimedia/radio_tutorial_n.htm

index bf96c0e..64cfc6b 100644 (file)
@@ -27,7 +27,7 @@
                        <li><a href="#scan">Scanning for All Available Radio Frequencies</a></li>
                        <li><a href="#tune">Tuning the Radio and Beginning Listening</a></li>
                        <li><a href="#seek">Seeking for a Nearby Channel</a></li>
-               </ul> 
+               </ul>
         <p class="toc-title">Related Info</p>
         <ul class="toc">
             <li><a href="../../../../org.tizen.guides/html/native/multimedia/radio_n.htm">Radio Guide</a></li>
@@ -40,7 +40,7 @@
 <div id="container"><div id="contents"><div class="content">
 <h1>Radio: Accessing the Radio</h1>
 
-  
+
 <p>This tutorial demonstrates how you can access and tune a radio.</p>
 
 <h2>Warm-up</h2>
@@ -99,19 +99,19 @@ if (ret != RADIO_ERROR_NONE)
 <p>Implement the callback function:</p>
 
 <pre class="prettyprint">
-static void 
+static void
 on_radio_interrupted(radio_interrupted_code_e code, void* userdata)
 {
 &nbsp;&nbsp;&nbsp;// Search the radio handle from userdata
 &nbsp;&nbsp;&nbsp;mRadioInfo* mRadio = (mRadioInfo *)userdata;
+
 &nbsp;&nbsp;&nbsp;switch (code)
 &nbsp;&nbsp;&nbsp;{
 &nbsp;&nbsp;&nbsp;case RADIO_INTERRUPTED_COMPLETED:
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// The application, which was the source of conflict, is closed now
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Restart the radio playback here
 &nbsp;&nbsp;&nbsp;break;
+
 &nbsp;&nbsp;&nbsp;default:
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Your radio listening is interrupted
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Release the application resources or save the current state here
@@ -135,18 +135,18 @@ if (ret != RADIO_ERROR_NONE)
 <li>
 <p>Implement the callback function:</p>
 
-<pre class="prettyprint">void 
+<pre class="prettyprint">void
 on_scan_finished(void* userdata)
 {
 &nbsp;&nbsp;&nbsp;// Frequency scanning is done. Tune into one of the scanned frequencies
-&nbsp;&nbsp;&nbsp;// and start listening 
+&nbsp;&nbsp;&nbsp;// and start listening
 }
 </pre>
 
 <p>The callback function returns the available frequencies:</p>
 
 <pre class="prettyprint">
-void 
+void
 on_scan_updated(int frequency, void* userdata)
 {
 &nbsp;&nbsp;&nbsp;mRadioInfo* mRadio = (mRadioInfo *)userdata;
@@ -159,7 +159,11 @@ on_scan_updated(int frequency, void* userdata)
 <p>Start scanning</p>
 <pre class="prettyprint">radio_scan_start(mRadio.radio, on_scan_updated, &amp;mRadio);</pre>
 
-<p>The scanning time depends on your environment (the strength of the radio signal). Cancel the current scan using the <span style="font-family: Courier New,Courier,monospace">radio_scan_stop()</span> function.</p></li></ol>
+<p>The scanning time depends on your environment (the strength of the radio signal). Cancel the current scan using the <span style="font-family: Courier New,Courier,monospace">radio_scan_stop()</span> function.</p></li>
+<li>
+<p>Restriction</p>
+<p>You must not call radio api (ex. <span style="font-family: Courier New,Courier,monospace">radio_set_frequency, radio_start ...</span>) in callback function.  </p></li>
+</ol>
 
  <h2 id="tune" name="tune">Tuning the Radio and Beginning Listening</h2>
 
@@ -171,7 +175,7 @@ ret = radio_set_frequency(mRadio.radio, mRadio.frequencies[mRadio.selected_chann
 if (ret != RADIO_ERROR_NONE)
 {
 &nbsp;&nbsp;&nbsp;return false;
-} 
+}
 </pre>
 </li>
 <li>
@@ -199,7 +203,7 @@ ret = radio_seek_down(mRadio.radio, on_seek_completed, &amp;mRadio);
 if (ret != RADIO_ERROR_NONE)
 {
 &nbsp;&nbsp;&nbsp;return false;
-} 
+}
 </pre>
 
 <p>To seek down, use the <span style="font-family: Courier New,Courier,monospace">radio_seek_up()</span> function in a similar fashion.</p>
@@ -211,10 +215,10 @@ void on_seek_completed(int frequency, void* userdata)
 {
 &nbsp;&nbsp;&nbsp;mRadioInfo *mRadio = (mRadioInfo *)userdata;
 &nbsp;&nbsp;&nbsp;int new_frequency = 0;
+
 &nbsp;&nbsp;&nbsp;// The seek is done. The radio is tuned into the newly found frequency
 &nbsp;&nbsp;&nbsp;// The application sets the new frequency and updates the user interface
-&nbsp;&nbsp;&nbsp;radio_get_frequency(mRadio-&gt;radio, &amp;new_frequency);   
+&nbsp;&nbsp;&nbsp;radio_get_frequency(mRadio-&gt;radio, &amp;new_frequency);
 }
 </pre>
 </li></ol>