Sophie

Sophie

distrib > Mandriva > 10.2 > i586 > media > contrib > by-pkgid > cd2667db9dd0e54dd9cc3719d6459ef1 > files > 43

libalsaplayer0-devel-0.99.76-5mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>AlsaPlayer: scope_plugin.h File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.9.1 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<div class="nav">
<a class="el" href="dir_000000.html">alsaplayer</a></div>
<h1>scope_plugin.h File Reference</h1>
<p>
<a href="scope__plugin_8h-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Data Structures</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct__scope__plugin.html">_scope_plugin</a></td></tr>

<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="scope__plugin_8h.html#a0">SCOPE_PLUGIN_BASE_VERSION</a>&nbsp;&nbsp;&nbsp;0x1000</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="scope__plugin_8h.html#a1">SCOPE_PLUGIN_VERSION</a>&nbsp;&nbsp;&nbsp;(SCOPE_PLUGIN_BASE_VERSION + 7)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="scope__plugin_8h.html#a2">SCOPE_NICE</a>&nbsp;&nbsp;&nbsp;10</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="scope__plugin_8h.html#a3">SCOPE_SLEEP</a>&nbsp;&nbsp;&nbsp;20000</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="scope__plugin_8h.html#a4">SCOPE_BG_RED</a>&nbsp;&nbsp;&nbsp;0</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="scope__plugin_8h.html#a5">SCOPE_BG_GREEN</a>&nbsp;&nbsp;&nbsp;0</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="scope__plugin_8h.html#a6">SCOPE_BG_BLUE</a>&nbsp;&nbsp;&nbsp;0</td></tr>

<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="scope__plugin_8h.html#a7">scope_version_type</a></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef int(*&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="scope__plugin_8h.html#a8">scope_init_type</a> )(void *arg)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef void(*&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="scope__plugin_8h.html#a9">scope_start_type</a> )(void)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef int(*&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="scope__plugin_8h.html#a10">scope_running_type</a> )(void)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef void(*&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="scope__plugin_8h.html#a11">scope_stop_type</a> )(void)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef void(*&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="scope__plugin_8h.html#a12">scope_shutdown_type</a> )(void)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef void(*&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="scope__plugin_8h.html#a13">scope_set_data_type</a> )(void *buffer, int count)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef void(*&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="scope__plugin_8h.html#a14">scope_set_fft_type</a> )(void *buffer, int samples, int channels)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef <a class="el" href="struct__scope__plugin.html">_scope_plugin</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="scope__plugin_8h.html#a15">scope_plugin</a></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef <a class="el" href="struct__scope__plugin.html">scope_plugin</a> *(*&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="scope__plugin_8h.html#a16">scope_plugin_info_type</a> )(void)</td></tr>

</table>
<hr><h2>Define Documentation</h2>
<a class="anchor" name="a6" doxytag="scope_plugin.h::SCOPE_BG_BLUE"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define SCOPE_BG_BLUE&nbsp;&nbsp;&nbsp;0          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The value of the BLUE component of the default background color for scope windows. Value should be from 0-255     </td>
  </tr>
</table>
<a class="anchor" name="a5" doxytag="scope_plugin.h::SCOPE_BG_GREEN"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define SCOPE_BG_GREEN&nbsp;&nbsp;&nbsp;0          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The value of the GREEN component of the default background color for scope windows. Value should be from 0-255     </td>
  </tr>
</table>
<a class="anchor" name="a4" doxytag="scope_plugin.h::SCOPE_BG_RED"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define SCOPE_BG_RED&nbsp;&nbsp;&nbsp;0          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The value of the RED component of the default background color for scope windows. Value should be from 0-255     </td>
  </tr>
</table>
<a class="anchor" name="a2" doxytag="scope_plugin.h::SCOPE_NICE"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define SCOPE_NICE&nbsp;&nbsp;&nbsp;10          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The default nice level scope plugins should be set at. Most scope plugins are just eye candy and as such should not interfere with other processes on your system. They should only use CPU cycles that would otherwise be wasted. Setting the scopes to a nice level of 10 or higher pretty much insures this. If you don't like this policy you can lower the value. Keep in mind that negative values will only work if you run the HOST as root     </td>
  </tr>
</table>
<a class="anchor" name="a0" doxytag="scope_plugin.h::SCOPE_PLUGIN_BASE_VERSION"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define SCOPE_PLUGIN_BASE_VERSION&nbsp;&nbsp;&nbsp;0x1000          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The base version number of the scope plugin. Set at 0x1000     </td>
  </tr>
</table>
<a class="anchor" name="a1" doxytag="scope_plugin.h::SCOPE_PLUGIN_VERSION"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define SCOPE_PLUGIN_VERSION&nbsp;&nbsp;&nbsp;(SCOPE_PLUGIN_BASE_VERSION + 7)          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The version of the scope plugin API. This should be increased whenever structural changes are made to the API. This value should only be changed by the maintainers.     </td>
  </tr>
</table>
<a class="anchor" name="a3" doxytag="scope_plugin.h::SCOPE_SLEEP"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">#define SCOPE_SLEEP&nbsp;&nbsp;&nbsp;20000          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The default sleep time in microseconds for scopes. After every render iteration a scope should sleep for this amount of time. You should use the dosleep() call i.e. dosleep(SCOPE_SLEEP). A value of 20000 will let scopes run at 100000/20000 = 50 frames per second. If the scopes are consuming too much CPU consider raising this value.     </td>
  </tr>
</table>
<hr><h2>Typedef Documentation</h2>
<a class="anchor" name="a8" doxytag="scope_plugin.h::scope_init_type"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">typedef int(* <a class="el" href="scope__plugin_8h.html#a8">scope_init_type</a>)(void *arg)          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The init function of a scope plugin. This function should initialize all data structures needed for the scope plugin. Return value should be 1 on success, 0 if initialization fails.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>Set</em>&nbsp;</td><td>to NULL. This currently used for internal plugins only </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="a15" doxytag="scope_plugin.h::scope_plugin"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">typedef struct <a class="el" href="struct__scope__plugin.html">_scope_plugin</a>  <a class="el" href="struct__scope__plugin.html">scope_plugin</a>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
You should declare a scope_plugin variable and populate it with pointers of the specific functions implemented by your scope     </td>
  </tr>
</table>
<a class="anchor" name="a16" doxytag="scope_plugin.h::scope_plugin_info_type"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">typedef <a class="el" href="struct__scope__plugin.html">scope_plugin</a>*(* <a class="el" href="scope__plugin_8h.html#a16">scope_plugin_info_type</a>)(void)          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Every scope plugin should have a scope_plugin_info() function that returns a pointer to a scope_plugin structure that is filled with pointers to your function implementations.     </td>
  </tr>
</table>
<a class="anchor" name="a10" doxytag="scope_plugin.h::scope_running_type"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">typedef int(* <a class="el" href="scope__plugin_8h.html#a10">scope_running_type</a>)(void)          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
This function should tell the HOST if the scope is running i.e. on-screen and rendering. A value of 1 should be returned if this is the case, 0 if the scope is not active.     </td>
  </tr>
</table>
<a class="anchor" name="a13" doxytag="scope_plugin.h::scope_set_data_type"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">typedef void(* <a class="el" href="scope__plugin_8h.html#a13">scope_set_data_type</a>)(void *buffer, int count)          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>buffer</em>&nbsp;</td><td>pointer to buffer data </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>count</em>&nbsp;</td><td>number of short (int16) samples in buffer</td></tr>
  </table>
</dl>
The set_data function should be defined if your scope wants to get it hands on PCM data. The format of the buffer is short (int16) interleaved stereo data. A count value of 1024 means there are 2048 short samples in the buffer. These samples are interleaved, so even sample positions are from the left channel, uneven sample positions from the right channel. The API will be changed to accommodate variable channels in the not too distant future.     </td>
  </tr>
</table>
<a class="anchor" name="a14" doxytag="scope_plugin.h::scope_set_fft_type"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">typedef void(* <a class="el" href="scope__plugin_8h.html#a14">scope_set_fft_type</a>)(void *buffer, int samples, int channels)          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>buffer</em>&nbsp;</td><td>buffer with FFT values </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>samples</em>&nbsp;</td><td>number of FFT values per channel </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>channels</em>&nbsp;</td><td>number of channels</td></tr>
  </table>
</dl>
This function should be defined if your scope wants to get FFT data. The HOST typically calculates 256 FFT values per channel (going from low frequency range to high). The value is betwee 0-256. The buffer format is NON-interleaved int (int32). So if samples = 256 and channels = 2 then there are 2 * 256 number of samples in the buffer. The first 256 are for channel 1, the other 256 for channel 2.     </td>
  </tr>
</table>
<a class="anchor" name="a12" doxytag="scope_plugin.h::scope_shutdown_type"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">typedef void(* <a class="el" href="scope__plugin_8h.html#a12">scope_shutdown_type</a>)(void)          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The shutdown function is called just before the plugin is unloaded or just before the HOST decides to exit. All data structures allocated in the init routine should be freed here.     </td>
  </tr>
</table>
<a class="anchor" name="a9" doxytag="scope_plugin.h::scope_start_type"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">typedef void(* <a class="el" href="scope__plugin_8h.html#a9">scope_start_type</a>)(void)          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
This function will be called when the HOST wants to activate the scope. It should pop up the scope window and start rendering the PCM or FFT data     </td>
  </tr>
</table>
<a class="anchor" name="a11" doxytag="scope_plugin.h::scope_stop_type"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">typedef void(* <a class="el" href="scope__plugin_8h.html#a11">scope_stop_type</a>)(void)          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
This function should stop and close the scope window if it was running. It should just return if the scope is not running.     </td>
  </tr>
</table>
<a class="anchor" name="a7" doxytag="scope_plugin.h::scope_version_type"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">typedef int <a class="el" href="scope__plugin_8h.html#a7">scope_version_type</a>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The API this scope was compiled against. It should always be set to SCOPE_PLUGIN_VERSION. Failing to set this will most likely result in a scope plugin that won't load.     </td>
  </tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Thu Mar 31 10:58:47 2005 for AlsaPlayer by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address>
</body>
</html>