Sophie

Sophie

distrib > Fedora > 17 > i386 > by-pkgid > 530a9ab1a0e6101c31203dc116b2127b > files > 37

portmidi-devel-217-6.fc17.i686.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"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>PortMidi: Input/Output Devices Handling</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">PortMidi
   &#160;<span id="projectnumber">2.2.x</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.8.0 -->
  <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>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('group__grp__device.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Input/Output Devices Handling</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga2ff3676bcff6077e64ef6f3eb57fb37e"><td class="memItemLeft" align="right" valign="top">PMEXPORT const <a class="el" href="structPmDeviceInfo.html">PmDeviceInfo</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__grp__device.html#ga2ff3676bcff6077e64ef6f3eb57fb37e">Pm_GetDeviceInfo</a> (PmDeviceID id)</td></tr>
<tr class="memdesc:ga2ff3676bcff6077e64ef6f3eb57fb37e"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="group__grp__device.html#ga2ff3676bcff6077e64ef6f3eb57fb37e" title="Pm_GetDeviceInfo() returns a pointer to a PmDeviceInfo structure referring to the device specified by...">Pm_GetDeviceInfo()</a> returns a pointer to a <a class="el" href="structPmDeviceInfo.html">PmDeviceInfo</a> structure referring to the device specified by id.  <a href="#ga2ff3676bcff6077e64ef6f3eb57fb37e"></a><br/></td></tr>
<tr class="memitem:gabd50a31baaa494ad8b405f9ad54c966e"><td class="memItemLeft" align="right" valign="top">PMEXPORT PmError&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__grp__device.html#gabd50a31baaa494ad8b405f9ad54c966e">Pm_OpenInput</a> (PortMidiStream **stream, PmDeviceID inputDevice, void *inputDriverInfo, int32_t bufferSize, PmTimeProcPtr time_proc, void *time_info)</td></tr>
<tr class="memdesc:gabd50a31baaa494ad8b405f9ad54c966e"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="group__grp__device.html#gabd50a31baaa494ad8b405f9ad54c966e" title="Pm_OpenInput() and Pm_OpenOutput() open devices.">Pm_OpenInput()</a> and Pm_OpenOutput() open devices.  <a href="#gabd50a31baaa494ad8b405f9ad54c966e"></a><br/></td></tr>
<tr class="memitem:ga134924cfa8badeecff3c5e1f22aee178"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga134924cfa8badeecff3c5e1f22aee178"></a>
PMEXPORT PmError&#160;</td><td class="memItemRight" valign="bottom"><b>Pm_OpenOutput</b> (PortMidiStream **stream, PmDeviceID outputDevice, void *outputDriverInfo, int32_t bufferSize, PmTimeProcPtr time_proc, void *time_info, int32_t latency)</td></tr>
</table>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga2ff3676bcff6077e64ef6f3eb57fb37e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">PMEXPORT const <a class="el" href="structPmDeviceInfo.html">PmDeviceInfo</a>* <a class="el" href="group__grp__device.html#ga2ff3676bcff6077e64ef6f3eb57fb37e">Pm_GetDeviceInfo</a> </td>
          <td>(</td>
          <td class="paramtype">PmDeviceID&#160;</td>
          <td class="paramname"><em>id</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p><a class="el" href="group__grp__device.html#ga2ff3676bcff6077e64ef6f3eb57fb37e" title="Pm_GetDeviceInfo() returns a pointer to a PmDeviceInfo structure referring to the device specified by...">Pm_GetDeviceInfo()</a> returns a pointer to a <a class="el" href="structPmDeviceInfo.html">PmDeviceInfo</a> structure referring to the device specified by id. </p>
<p>If id is out of range the function returns NULL.</p>
<p>The returned structure is owned by the PortMidi implementation and must not be manipulated or freed. The pointer is guaranteed to be valid between calls to Pm_Initialize() and Pm_Terminate(). </p>

<p>Definition at line <a class="el" href="portmidi_8c_source.html#l00183">183</a> of file <a class="el" href="portmidi_8c_source.html">portmidi.c</a>.</p>

</div>
</div>
<a class="anchor" id="gabd50a31baaa494ad8b405f9ad54c966e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">PMEXPORT PmError <a class="el" href="group__grp__device.html#gabd50a31baaa494ad8b405f9ad54c966e">Pm_OpenInput</a> </td>
          <td>(</td>
          <td class="paramtype">PortMidiStream **&#160;</td>
          <td class="paramname"><em>stream</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">PmDeviceID&#160;</td>
          <td class="paramname"><em>inputDevice</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>inputDriverInfo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32_t&#160;</td>
          <td class="paramname"><em>bufferSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">PmTimeProcPtr&#160;</td>
          <td class="paramname"><em>time_proc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>time_info</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p><a class="el" href="group__grp__device.html#gabd50a31baaa494ad8b405f9ad54c966e" title="Pm_OpenInput() and Pm_OpenOutput() open devices.">Pm_OpenInput()</a> and Pm_OpenOutput() open devices. </p>
<p>stream is the address of a PortMidiStream pointer which will receive a pointer to the newly opened stream.</p>
<p>inputDevice is the id of the device used for input (see PmDeviceID above).</p>
<p>inputDriverInfo is a pointer to an optional driver specific data structure containing additional information for device setup or handle processing. inputDriverInfo is never required for correct operation. If not used inputDriverInfo should be NULL.</p>
<p>outputDevice is the id of the device used for output (see PmDeviceID above.)</p>
<p>outputDriverInfo is a pointer to an optional driver specific data structure containing additional information for device setup or handle processing. outputDriverInfo is never required for correct operation. If not used outputDriverInfo should be NULL.</p>
<p>For input, the buffersize specifies the number of input events to be buffered waiting to be read using <a class="el" href="group__grp__io.html#ga3d59225bc890ede974f245ada3de6456" title="Pm_Read() retrieves midi data into a buffer, and returns the number of events read.">Pm_Read()</a>. For output, buffersize specifies the number of output events to be buffered waiting for output. (In some cases -- see below -- PortMidi does not buffer output at all and merely passes data to a lower-level API, in which case buffersize is ignored.)</p>
<p>latency is the delay in milliseconds applied to timestamps to determine when the output should actually occur. (If latency is &lt; 0, 0 is assumed.) If latency is zero, timestamps are ignored and all output is delivered immediately. If latency is greater than zero, output is delayed until the message timestamp plus the latency. (NOTE: the time is measured relative to the time source indicated by time_proc. Timestamps are absolute, not relative delays or offsets.) In some cases, PortMidi can obtain better timing than your application by passing timestamps along to the device driver or hardware. Latency may also help you to synchronize midi data to audio data by matching midi latency to the audio buffer latency.</p>
<p>time_proc is a pointer to a procedure that returns time in milliseconds. It may be NULL, in which case a default millisecond timebase (PortTime) is used. If the application wants to use PortTime, it should start the timer (call Pt_Start) before calling Pm_OpenInput or Pm_OpenOutput. If the application tries to start the timer <em>after</em> Pm_OpenInput or Pm_OpenOutput, it may get a ptAlreadyStarted error from Pt_Start, and the application's preferred time resolution and callback function will be ignored. time_proc result values are appended to incoming MIDI data, and time_proc times are used to schedule outgoing MIDI data (when latency is non-zero).</p>
<p>time_info is a pointer passed to time_proc.</p>
<p>Example: If I provide a timestamp of 5000, latency is 1, and time_proc returns 4990, then the desired output time will be when time_proc returns timestamp+latency = 5001. This will be 5001-4990 = 11ms from now.</p>
<p>return value: Upon success Pm_Open() returns PmNoError and places a pointer to a valid PortMidiStream in the stream argument. If a call to Pm_Open() fails a nonzero error code is returned (see PMError above) and the value of port is invalid.</p>
<p>Any stream that is successfully opened should eventually be closed by calling <a class="el" href="group__grp__events__filters.html#ga6b26be2fbcf092c9625ade5303edd0ac" title="Pm_Close() closes a midi stream, flushing any pending buffers.">Pm_Close()</a>. </p>

<p>Definition at line <a class="el" href="portmidi_8c_source.html#l00669">669</a> of file <a class="el" href="portmidi_8c_source.html">portmidi.c</a>.</p>

<p>References <a class="el" href="portmidi_8h_source.html#l00389">PM_FILT_ACTIVE</a>.</p>

</div>
</div>
</div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
<hr size="1"><address style="text-align: right;"><small>
Generated for PortMidi by <a href="http://www.doxygen.org/
index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a>
1.8.0</small></address>
</body>
</html>