Sophie

Sophie

distrib > * > cooker > x86_64 > by-pkgid > 12036146830596fff8a6e80859ec761e > files > 26

lib64njb-devel-2.2.6-9.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>libnjb: dumpeax.c</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.3 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">libnjb&#160;<span id="projectnumber">2.2.6</span></div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<h1>dumpeax.c</h1>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><span class="preprocessor">#include &quot;common.h&quot;</span>

<span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> **argv)
{
  <a name="_a0"></a><a class="code" href="structnjb__struct.html">njb_t</a> njbs[<a name="a1"></a><a class="code" href="libnjb_8h.html#a46e41076f44166b6446e3fdae6db62a9">NJB_MAX_DEVICES</a>], *njb;
  <span class="keyword">extern</span> <span class="keywordtype">char</span> *optarg;
  <span class="keywordtype">int</span> opt;
  <span class="keywordtype">int</span> i, n, debug;
  <a name="_a2"></a><a class="code" href="structnjb__eax__struct.html">njb_eax_t</a> *eax;
  
  debug = 0;
  <span class="keywordflow">while</span> ((opt = getopt(argc, argv, <span class="stringliteral">&quot;D:&quot;</span>)) != -1) {
    <span class="keywordflow">switch</span> (opt) {
    <span class="keywordflow">case</span> <span class="charliteral">&#39;D&#39;</span>:
      debug = atoi(optarg);
      <span class="keywordflow">break</span>;
    <span class="keywordflow">default</span>:
      fprintf(stderr, <span class="stringliteral">&quot;usage: dumpeax [ -D debuglvl ]\n&quot;</span>);
      <span class="keywordflow">return</span> 1;
    }
  }
  
  <span class="keywordflow">if</span> (debug)
    <a name="a3"></a><a class="code" href="group__internals.html#gaa5ff48cc89e320bc1c1d89efd2613d77">NJB_Set_Debug</a>(debug);
  
  <span class="keywordflow">if</span> (<a name="a4"></a><a class="code" href="group__basic.html#ga199efd7711a70ae5d63f4052c2e492d3">NJB_Discover</a>(njbs, 0, &amp;n) == -1) {
    fprintf(stderr, <span class="stringliteral">&quot;could not locate any jukeboxes\n&quot;</span>);
    exit(1);
  }
  
  <span class="keywordflow">if</span> (n == 0) {
    fprintf(stderr, <span class="stringliteral">&quot;no NJB devices found\n&quot;</span>);
    <span class="keywordflow">return</span> 0;
  }
  
  njb = njbs;
  
  <span class="keywordflow">if</span> (<a name="a5"></a><a class="code" href="group__basic.html#gaa631536b597d8f8cb73eeb47eff6640a">NJB_Open</a>(njb) == -1) {
    <a name="a6"></a><a class="code" href="group__internals.html#gae9b849a9a883fe1fd697278bd8d49585">NJB_Error_Dump</a>(njb, stderr);
    <span class="keywordflow">return</span> 1;
  }
  
  <span class="keywordflow">if</span> (<a name="a7"></a><a class="code" href="group__basic.html#ga023eb258743b5961ec1b85cbd62a55cb">NJB_Capture</a>(njb) == -1) {
    <a class="code" href="group__internals.html#gae9b849a9a883fe1fd697278bd8d49585">NJB_Error_Dump</a>(njb, stderr);
    <span class="keywordflow">return</span> 1;
  }
  
  <a name="a8"></a><a class="code" href="group__eaxapi.html#ga4d59282ecca52bb7bfcd78c5f21c4a47">NJB_Reset_Get_EAX_Type</a> (njb);
  
  <span class="keywordflow">while</span> ((eax = <a name="a9"></a><a class="code" href="group__eaxapi.html#gaa9146994b5fdcf249d094067f5059431">NJB_Get_EAX_Type</a> (njb)) != NULL) {
    printf(<span class="stringliteral">&quot;------------------------------------------\n&quot;</span>);
    printf(<span class="stringliteral">&quot;Effect number: %04X\n&quot;</span>, eax-&gt;<a name="a10"></a><a class="code" href="structnjb__eax__struct.html#ac5e49d1efecf648a4e066d6a27e6b470">number</a>);
    printf(<span class="stringliteral">&quot;Effect name: %s\n&quot;</span>, eax-&gt;<a name="a11"></a><a class="code" href="structnjb__eax__struct.html#abdb3bc8dbe965974e31dfe8a60de6125">name</a>);
    printf(<span class="stringliteral">&quot;Effect group %d\n&quot;</span>, eax-&gt;<a name="a12"></a><a class="code" href="structnjb__eax__struct.html#aa8c7d20648860165ae69bd6c4ab3a450">group</a>);
    <span class="keywordflow">if</span> (eax-&gt;<a name="a13"></a><a class="code" href="structnjb__eax__struct.html#a52136d50f154229d9df24ea389478687">exclusive</a> != 0x00) {
      printf(<span class="stringliteral">&quot;Effect is exclusive\n&quot;</span>);
    }
    <span class="keywordflow">if</span> (eax-&gt;<a name="a14"></a><a class="code" href="structnjb__eax__struct.html#a920778f9df1f740be70efca4340197f2">type</a> == NJB_EAX_FIXED_OPTION_CONTROL) {
      printf(<span class="stringliteral">&quot;Effect has fixed options:\n&quot;</span>);
      printf(<span class="stringliteral">&quot;    Current selection: %d\n&quot;</span>, eax-&gt;<a name="a15"></a><a class="code" href="structnjb__eax__struct.html#a4133ff6ae8d2d821fdda1a40e9e6c9b6">current_value</a>);
      <span class="keywordflow">for</span>(i = 0; i &lt; eax-&gt;<a name="a16"></a><a class="code" href="structnjb__eax__struct.html#ae605e5c3487bef32a97186fae24e6b8e">max_value</a> - eax-&gt;<a name="a17"></a><a class="code" href="structnjb__eax__struct.html#a1500b0227c7537a7644bb5a638257998">min_value</a> + 1; i++) {
        printf(<span class="stringliteral">&quot;    %d. %s\n&quot;</span>, eax-&gt;<a class="code" href="structnjb__eax__struct.html#a1500b0227c7537a7644bb5a638257998">min_value</a>+i, eax-&gt;<a name="a18"></a><a class="code" href="structnjb__eax__struct.html#a827b00e65663f69ac950247913fba496">option_names</a>[i]);
      }
    }
    <span class="keywordflow">if</span> (eax-&gt;<a class="code" href="structnjb__eax__struct.html#a920778f9df1f740be70efca4340197f2">type</a> == NJB_EAX_SLIDER_CONTROL) {
      printf(<span class="stringliteral">&quot;Effect is a slider:\n&quot;</span>);
      printf(<span class="stringliteral">&quot;    Current value: %d\n&quot;</span>, eax-&gt;<a class="code" href="structnjb__eax__struct.html#a4133ff6ae8d2d821fdda1a40e9e6c9b6">current_value</a>);
      printf(<span class="stringliteral">&quot;    Min value: %d\n&quot;</span>, eax-&gt;<a class="code" href="structnjb__eax__struct.html#a1500b0227c7537a7644bb5a638257998">min_value</a>);
      printf(<span class="stringliteral">&quot;    Max value %d\n&quot;</span>, eax-&gt;<a class="code" href="structnjb__eax__struct.html#ae605e5c3487bef32a97186fae24e6b8e">max_value</a>);
    }     
    <a name="a19"></a><a class="code" href="group__eaxapi.html#ga9690bd523ae9729ae9a6d5e21bb87d88">NJB_Destroy_EAX_Type</a> (eax);
  }
  
  <span class="comment">/* Dump any pending errors */</span>
  <a class="code" href="group__internals.html#gae9b849a9a883fe1fd697278bd8d49585">NJB_Error_Dump</a>(njb, stderr);
  
  <a name="a20"></a><a class="code" href="group__basic.html#ga69d4034384f1bd033ed2c9ba7a9b32d4">NJB_Release</a>(njb);
  
  <a name="a21"></a><a class="code" href="group__basic.html#ga13a9c926c430f38f3a6535ecaaf3e9b9">NJB_Close</a>(njb);
  <span class="keywordflow">return</span> 0;
}
</pre></div> </div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Mon May 2 2011 06:05:24 for libnjb by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address>
</body>
</html>