Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
8.6KB

  1. <HTML>
  2. <HEAD>
  3. <TITLE>The RtAudio Home Page</TITLE>
  4. <LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
  5. <LINK REL="SHORTCUT ICON" HREF="http://www.music.mcgill.ca/~gary/favicon.ico">
  6. </HEAD>
  7. <BODY BGCOLOR="#FFFFFF">
  8. <CENTER>
  9. <a class="qindex" href="index.html">Home</a> &nbsp; <a class="qindex" href="annotated.html">Class/Enum List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </CENTER>
  10. <HR>
  11. <!-- Generated by Doxygen 1.5.8 -->
  12. <h1>RtError.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/************************************************************************/</span>
  13. <a name="l00010"></a>00010 <span class="comment">/************************************************************************/</span>
  14. <a name="l00011"></a>00011
  15. <a name="l00012"></a>00012 <span class="preprocessor">#ifndef RTERROR_H</span>
  16. <a name="l00013"></a>00013 <span class="preprocessor"></span><span class="preprocessor">#define RTERROR_H</span>
  17. <a name="l00014"></a>00014 <span class="preprocessor"></span>
  18. <a name="l00015"></a>00015 <span class="preprocessor">#include &lt;exception&gt;</span>
  19. <a name="l00016"></a>00016 <span class="preprocessor">#include &lt;iostream&gt;</span>
  20. <a name="l00017"></a>00017 <span class="preprocessor">#include &lt;string&gt;</span>
  21. <a name="l00018"></a>00018
  22. <a name="l00019"></a><a class="code" href="classRtError.html">00019</a> <span class="keyword">class </span><a class="code" href="classRtError.html" title="Exception handling class for RtAudio &amp;amp; RtMidi.">RtError</a> : <span class="keyword">public</span> std::exception
  23. <a name="l00020"></a>00020 {
  24. <a name="l00021"></a>00021 <span class="keyword">public</span>:
  25. <a name="l00023"></a><a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac">00023</a> <span class="keyword">enum</span> <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac" title="Defined RtError types.">Type</a> {
  26. <a name="l00024"></a><a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac3a1603c24a56cbdaf5f8ae4ddcb86398">00024</a> <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac3a1603c24a56cbdaf5f8ae4ddcb86398">WARNING</a>,
  27. <a name="l00025"></a><a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac20e5a369394d19b704ace17002007eba">00025</a> <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac20e5a369394d19b704ace17002007eba">DEBUG_WARNING</a>,
  28. <a name="l00026"></a><a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac444efd3ccf774b2ba9f9bde70ec71cd6">00026</a> <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac444efd3ccf774b2ba9f9bde70ec71cd6">UNSPECIFIED</a>,
  29. <a name="l00027"></a><a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903acf267eb2d710f33d649ba840eeab6ff82">00027</a> <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903acf267eb2d710f33d649ba840eeab6ff82">NO_DEVICES_FOUND</a>,
  30. <a name="l00028"></a><a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903acd6064062066fffdba258237a7c2159b1">00028</a> <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903acd6064062066fffdba258237a7c2159b1">INVALID_DEVICE</a>,
  31. <a name="l00029"></a><a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903acb4f813e5a36905c89d4081a59497432e">00029</a> <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903acb4f813e5a36905c89d4081a59497432e">MEMORY_ERROR</a>,
  32. <a name="l00030"></a><a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903aca3eabf0f71120beaba94148a1b78fed6">00030</a> <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903aca3eabf0f71120beaba94148a1b78fed6">INVALID_PARAMETER</a>,
  33. <a name="l00031"></a><a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac8e65f51a3fbdc1a4a1552b3260df36bc">00031</a> <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac8e65f51a3fbdc1a4a1552b3260df36bc">INVALID_USE</a>,
  34. <a name="l00032"></a><a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac995e97ecf6beeedaba525022a63aec6b">00032</a> <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac995e97ecf6beeedaba525022a63aec6b">DRIVER_ERROR</a>,
  35. <a name="l00033"></a><a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac8947d0a2e2a84ecf3646271844e06a6b">00033</a> <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac8947d0a2e2a84ecf3646271844e06a6b">SYSTEM_ERROR</a>,
  36. <a name="l00034"></a><a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903aceb6282f991e2d93ab294a4272fc3f6c6">00034</a> <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903aceb6282f991e2d93ab294a4272fc3f6c6">THREAD_ERROR</a>
  37. <a name="l00035"></a>00035 };
  38. <a name="l00036"></a>00036
  39. <a name="l00038"></a><a class="code" href="classRtError.html#a479a305ccbe56be0fd9137b9b405a37">00038</a> <a class="code" href="classRtError.html#a479a305ccbe56be0fd9137b9b405a37" title="The constructor.">RtError</a>( <span class="keyword">const</span> std::string&amp; message, <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac" title="Defined RtError types.">Type</a> type = <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac444efd3ccf774b2ba9f9bde70ec71cd6">RtError::UNSPECIFIED</a> ) throw() : message_(message), type_(type) {}
  40. <a name="l00039"></a>00039
  41. <a name="l00041"></a><a class="code" href="classRtError.html#6793e03386e7e69ffafb65a296dfa48c">00041</a> <span class="keyword">virtual</span> <a class="code" href="classRtError.html#6793e03386e7e69ffafb65a296dfa48c" title="The destructor.">~RtError</a>( <span class="keywordtype">void</span> ) throw() {}
  42. <a name="l00042"></a>00042
  43. <a name="l00044"></a><a class="code" href="classRtError.html#da41f7472122f45bc5b4677f066e0943">00044</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classRtError.html#da41f7472122f45bc5b4677f066e0943" title="Prints thrown error message to stderr.">printMessage</a>( <span class="keywordtype">void</span> ) throw() { std::cerr &lt;&lt; <span class="charliteral">'\n'</span> &lt;&lt; message_ &lt;&lt; <span class="stringliteral">"\n\n"</span>; }
  44. <a name="l00045"></a>00045
  45. <a name="l00047"></a><a class="code" href="classRtError.html#4ee7df9728d73f533afbaddcd9ca4d9c">00047</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac" title="Defined RtError types.">Type</a>&amp; <a class="code" href="classRtError.html#4ee7df9728d73f533afbaddcd9ca4d9c" title="Returns the thrown error message type.">getType</a>(<span class="keywordtype">void</span>) throw() { <span class="keywordflow">return</span> type_; }
  46. <a name="l00048"></a>00048
  47. <a name="l00050"></a><a class="code" href="classRtError.html#c7f467788e29d246333d7af050801164">00050</a> <span class="keyword">virtual</span> <span class="keyword">const</span> std::string&amp; <a class="code" href="classRtError.html#c7f467788e29d246333d7af050801164" title="Returns the thrown error message string.">getMessage</a>(<span class="keywordtype">void</span>) throw() { <span class="keywordflow">return</span> message_; }
  48. <a name="l00051"></a>00051
  49. <a name="l00053"></a><a class="code" href="classRtError.html#eb843b7a7785d66061c61ebfc29e7e9d">00053</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classRtError.html#eb843b7a7785d66061c61ebfc29e7e9d" title="Returns the thrown error message as a c-style string.">what</a>( <span class="keywordtype">void</span> ) <span class="keyword">const</span> throw() { <span class="keywordflow">return</span> message_.c_str(); }
  50. <a name="l00054"></a>00054
  51. <a name="l00055"></a>00055 <span class="keyword">protected</span>:
  52. <a name="l00056"></a>00056 std::string message_;
  53. <a name="l00057"></a>00057 <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac" title="Defined RtError types.">Type</a> type_;
  54. <a name="l00058"></a>00058 };
  55. <a name="l00059"></a>00059
  56. <a name="l00060"></a>00060 <span class="preprocessor">#endif</span>
  57. </pre></div></div>
  58. <HR>
  59. <table><tr><td><img src="../images/mcgill.gif" width=165></td>
  60. <td>&copy;2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.<br>Maintained by <a href="http://www.music.mcgill.ca/~gary/">Gary P. Scavone</a>.</td></tr>
  61. </table>
  62. </BODY>
  63. </HTML>