1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xmlns="http://www.w3.org/1999/xhtml"> 3<head> 4<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> 5<meta http-equiv="X-UA-Compatible" content="IE=9"/> 6<meta name="generator" content="Doxygen 1.8.15"/> 7<meta name="viewport" content="width=device-width, initial-scale=1"/> 8<title>Oboe: oboe::AudioStreamErrorCallback Class Reference</title> 9<link href="tabs.css" rel="stylesheet" type="text/css"/> 10<script type="text/javascript" src="jquery.js"></script> 11<script type="text/javascript" src="dynsections.js"></script> 12<link href="search/search.css" rel="stylesheet" type="text/css"/> 13<script type="text/javascript" src="search/searchdata.js"></script> 14<script type="text/javascript" src="search/search.js"></script> 15<link href="doxygen.css" rel="stylesheet" type="text/css" /> 16</head> 17<body> 18<div id="top"><!-- do not remove this div, it is closed by doxygen! --> 19<div id="titlearea"> 20<table cellspacing="0" cellpadding="0"> 21 <tbody> 22 <tr style="height: 56px;"> 23 <td id="projectalign" style="padding-left: 0.5em;"> 24 <div id="projectname">Oboe 25  <span id="projectnumber">1.5</span> 26 </div> 27 <div id="projectbrief">A library for creating real-time audio apps on Android</div> 28 </td> 29 </tr> 30 </tbody> 31</table> 32</div> 33<!-- end header part --> 34<!-- Generated by Doxygen 1.8.15 --> 35<script type="text/javascript"> 36/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ 37var searchBox = new SearchBox("searchBox", "search",false,'Search'); 38/* @license-end */ 39</script> 40<script type="text/javascript" src="menudata.js"></script> 41<script type="text/javascript" src="menu.js"></script> 42<script type="text/javascript"> 43/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ 44$(function() { 45 initMenu('',true,false,'search.php','Search'); 46 $(document).ready(function() { init_search(); }); 47}); 48/* @license-end */</script> 49<div id="main-nav"></div> 50<!-- window showing the filter options --> 51<div id="MSearchSelectWindow" 52 onmouseover="return searchBox.OnSearchSelectShow()" 53 onmouseout="return searchBox.OnSearchSelectHide()" 54 onkeydown="return searchBox.OnSearchSelectKey(event)"> 55</div> 56 57<!-- iframe showing the search results (closed by default) --> 58<div id="MSearchResultsWindow"> 59<iframe src="javascript:void(0)" frameborder="0" 60 name="MSearchResults" id="MSearchResults"> 61</iframe> 62</div> 63 64<div id="nav-path" class="navpath"> 65 <ul> 66<li class="navelem"><a class="el" href="namespaceoboe.html">oboe</a></li><li class="navelem"><a class="el" href="classoboe_1_1_audio_stream_error_callback.html">AudioStreamErrorCallback</a></li> </ul> 67</div> 68</div><!-- top --> 69<div class="header"> 70 <div class="summary"> 71<a href="#pub-methods">Public Member Functions</a> | 72<a href="classoboe_1_1_audio_stream_error_callback-members.html">List of all members</a> </div> 73 <div class="headertitle"> 74<div class="title">oboe::AudioStreamErrorCallback Class Reference</div> </div> 75</div><!--header--> 76<div class="contents"> 77 78<p><code>#include <<a class="el" href="_audio_stream_callback_8h_source.html">AudioStreamCallback.h</a>></code></p> 79<div class="dynheader"> 80Inheritance diagram for oboe::AudioStreamErrorCallback:</div> 81<div class="dyncontent"> 82 <div class="center"> 83 <img src="classoboe_1_1_audio_stream_error_callback.png" usemap="#oboe::AudioStreamErrorCallback_map" alt=""/> 84 <map id="oboe::AudioStreamErrorCallback_map" name="oboe::AudioStreamErrorCallback_map"> 85<area href="classoboe_1_1_audio_stream_callback.html" alt="oboe::AudioStreamCallback" shape="rect" coords="0,56,197,80"/> 86<area href="classoboe_1_1_stabilized_callback.html" alt="oboe::StabilizedCallback" shape="rect" coords="0,112,197,136"/> 87 </map> 88</div></div> 89<table class="memberdecls"> 90<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> 91Public Member Functions</h2></td></tr> 92<tr class="memitem:a5ad4b8936746ecbb2160a9389b117fc3"><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classoboe_1_1_audio_stream_error_callback.html#a5ad4b8936746ecbb2160a9389b117fc3">onError</a> (<a class="el" href="classoboe_1_1_audio_stream.html">AudioStream</a> *, <a class="el" href="namespaceoboe.html#a486512e787b609c80ba4436f23929af1">Result</a>)</td></tr> 93<tr class="separator:a5ad4b8936746ecbb2160a9389b117fc3"><td class="memSeparator" colspan="2"> </td></tr> 94<tr class="memitem:a4eb1e4916b71d8231e97b19898bc9bf0"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classoboe_1_1_audio_stream_error_callback.html#a4eb1e4916b71d8231e97b19898bc9bf0">onErrorBeforeClose</a> (<a class="el" href="classoboe_1_1_audio_stream.html">AudioStream</a> *, <a class="el" href="namespaceoboe.html#a486512e787b609c80ba4436f23929af1">Result</a>)</td></tr> 95<tr class="separator:a4eb1e4916b71d8231e97b19898bc9bf0"><td class="memSeparator" colspan="2"> </td></tr> 96<tr class="memitem:a76bd3ef3e00396e10c21812003654cfe"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classoboe_1_1_audio_stream_error_callback.html#a76bd3ef3e00396e10c21812003654cfe">onErrorAfterClose</a> (<a class="el" href="classoboe_1_1_audio_stream.html">AudioStream</a> *, <a class="el" href="namespaceoboe.html#a486512e787b609c80ba4436f23929af1">Result</a>)</td></tr> 97<tr class="separator:a76bd3ef3e00396e10c21812003654cfe"><td class="memSeparator" colspan="2"> </td></tr> 98</table> 99<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> 100<div class="textblock"><p><a class="el" href="classoboe_1_1_audio_stream_error_callback.html">AudioStreamErrorCallback</a> defines a callback interface for being alerted when a stream has an error or is disconnected using <code>onError*</code> methods.</p> 101<p>It is used with <a class="el" href="classoboe_1_1_audio_stream_builder.html#aacb66f530bfc6f545911b5e169774567">AudioStreamBuilder::setErrorCallback()</a>. </p> 102</div><h2 class="groupheader">Member Function Documentation</h2> 103<a id="a5ad4b8936746ecbb2160a9389b117fc3"></a> 104<h2 class="memtitle"><span class="permalink"><a href="#a5ad4b8936746ecbb2160a9389b117fc3">◆ </a></span>onError()</h2> 105 106<div class="memitem"> 107<div class="memproto"> 108<table class="mlabels"> 109 <tr> 110 <td class="mlabels-left"> 111 <table class="memname"> 112 <tr> 113 <td class="memname">virtual bool oboe::AudioStreamErrorCallback::onError </td> 114 <td>(</td> 115 <td class="paramtype"><a class="el" href="classoboe_1_1_audio_stream.html">AudioStream</a> * </td> 116 <td class="paramname">, </td> 117 </tr> 118 <tr> 119 <td class="paramkey"></td> 120 <td></td> 121 <td class="paramtype"><a class="el" href="namespaceoboe.html#a486512e787b609c80ba4436f23929af1">Result</a> </td> 122 <td class="paramname"> </td> 123 </tr> 124 <tr> 125 <td></td> 126 <td>)</td> 127 <td></td><td></td> 128 </tr> 129 </table> 130 </td> 131 <td class="mlabels-right"> 132<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td> 133 </tr> 134</table> 135</div><div class="memdoc"> 136<p>This will be called before other <code>onError</code> methods when an error occurs on a stream, such as when the stream is disconnected.</p> 137<p>It can be used to override and customize the normal error processing. Use of this method is considered an advanced technique. It might, for example, be used if an app want to use a high level lock when closing and reopening a stream. Or it might be used when an app want to signal a management thread that handles all of the stream state.</p> 138<p>If this method returns false it indicates that the stream has *not been stopped and closed by the application. In this case it will be stopped by Oboe in the following way: <a class="el" href="classoboe_1_1_audio_stream_error_callback.html#a4eb1e4916b71d8231e97b19898bc9bf0">onErrorBeforeClose()</a> will be called, then the stream will be closed and <a class="el" href="classoboe_1_1_audio_stream_error_callback.html#a76bd3ef3e00396e10c21812003654cfe">onErrorAfterClose()</a> will be closed.</p> 139<p>If this method returns true it indicates that the stream <em>has</em> been stopped and closed by the application and Oboe will not do this. In that case, the app MUST stop() and close() the stream.</p> 140<p>This method will be called on a thread created by Oboe.</p> 141<dl class="params"><dt>Parameters</dt><dd> 142 <table class="params"> 143 <tr><td class="paramname">audioStream</td><td>pointer to the associated stream </td></tr> 144 <tr><td class="paramname">error</td><td></td></tr> 145 </table> 146 </dd> 147</dl> 148<dl class="section return"><dt>Returns</dt><dd>true if the stream has been stopped and closed, false if not </dd></dl> 149 150</div> 151</div> 152<a id="a76bd3ef3e00396e10c21812003654cfe"></a> 153<h2 class="memtitle"><span class="permalink"><a href="#a76bd3ef3e00396e10c21812003654cfe">◆ </a></span>onErrorAfterClose()</h2> 154 155<div class="memitem"> 156<div class="memproto"> 157<table class="mlabels"> 158 <tr> 159 <td class="mlabels-left"> 160 <table class="memname"> 161 <tr> 162 <td class="memname">virtual void oboe::AudioStreamErrorCallback::onErrorAfterClose </td> 163 <td>(</td> 164 <td class="paramtype"><a class="el" href="classoboe_1_1_audio_stream.html">AudioStream</a> * </td> 165 <td class="paramname">, </td> 166 </tr> 167 <tr> 168 <td class="paramkey"></td> 169 <td></td> 170 <td class="paramtype"><a class="el" href="namespaceoboe.html#a486512e787b609c80ba4436f23929af1">Result</a> </td> 171 <td class="paramname"> </td> 172 </tr> 173 <tr> 174 <td></td> 175 <td>)</td> 176 <td></td><td></td> 177 </tr> 178 </table> 179 </td> 180 <td class="mlabels-right"> 181<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td> 182 </tr> 183</table> 184</div><div class="memdoc"> 185<p>This will be called when an error occurs on a stream, such as when the stream is disconnected, and if <a class="el" href="classoboe_1_1_audio_stream_error_callback.html#a5ad4b8936746ecbb2160a9389b117fc3">onError()</a> returns false (indicating that the error has not already been handled).</p> 186<p>The underlying AAudio or OpenSL ES stream will already be stopped AND closed by Oboe. So the underlying stream cannot be referenced. But you can still query most parameters.</p> 187<p>This callback could be used to reopen a new stream on another device.</p> 188<dl class="params"><dt>Parameters</dt><dd> 189 <table class="params"> 190 <tr><td class="paramname">audioStream</td><td>pointer to the associated stream </td></tr> 191 <tr><td class="paramname">error</td><td></td></tr> 192 </table> 193 </dd> 194</dl> 195 196<p>Reimplemented in <a class="el" href="classoboe_1_1_stabilized_callback.html#af7521da42c4b08a71e6102994f6f41f4">oboe::StabilizedCallback</a>.</p> 197 198</div> 199</div> 200<a id="a4eb1e4916b71d8231e97b19898bc9bf0"></a> 201<h2 class="memtitle"><span class="permalink"><a href="#a4eb1e4916b71d8231e97b19898bc9bf0">◆ </a></span>onErrorBeforeClose()</h2> 202 203<div class="memitem"> 204<div class="memproto"> 205<table class="mlabels"> 206 <tr> 207 <td class="mlabels-left"> 208 <table class="memname"> 209 <tr> 210 <td class="memname">virtual void oboe::AudioStreamErrorCallback::onErrorBeforeClose </td> 211 <td>(</td> 212 <td class="paramtype"><a class="el" href="classoboe_1_1_audio_stream.html">AudioStream</a> * </td> 213 <td class="paramname">, </td> 214 </tr> 215 <tr> 216 <td class="paramkey"></td> 217 <td></td> 218 <td class="paramtype"><a class="el" href="namespaceoboe.html#a486512e787b609c80ba4436f23929af1">Result</a> </td> 219 <td class="paramname"> </td> 220 </tr> 221 <tr> 222 <td></td> 223 <td>)</td> 224 <td></td><td></td> 225 </tr> 226 </table> 227 </td> 228 <td class="mlabels-right"> 229<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td> 230 </tr> 231</table> 232</div><div class="memdoc"> 233<p>This will be called when an error occurs on a stream, such as when the stream is disconnected, and if <a class="el" href="classoboe_1_1_audio_stream_error_callback.html#a5ad4b8936746ecbb2160a9389b117fc3">onError()</a> returns false (indicating that the error has not already been handled).</p> 234<p>Note that this will be called on a thread created by Oboe.</p> 235<p>The underlying stream will already be stopped by Oboe but not yet closed. So the stream can be queried.</p> 236<p>Do not close or delete the stream in this method because it will be closed after this method returns.</p> 237<dl class="params"><dt>Parameters</dt><dd> 238 <table class="params"> 239 <tr><td class="paramname">audioStream</td><td>pointer to the associated stream </td></tr> 240 <tr><td class="paramname">error</td><td></td></tr> 241 </table> 242 </dd> 243</dl> 244 245<p>Reimplemented in <a class="el" href="classoboe_1_1_stabilized_callback.html#a7ec0e9fca3181962ab78716bcda83e10">oboe::StabilizedCallback</a>.</p> 246 247</div> 248</div> 249<hr/>The documentation for this class was generated from the following file:<ul> 250<li>include/oboe/<a class="el" href="_audio_stream_callback_8h_source.html">AudioStreamCallback.h</a></li> 251</ul> 252</div><!-- contents --> 253<!-- start footer part --> 254<hr class="footer"/><address class="footer"><small> 255Generated by  <a href="http://www.doxygen.org/index.html"> 256<img class="footer" src="doxygen.png" alt="doxygen"/> 257</a> 1.8.15 258</small></address> 259</body> 260</html> 261