Sophie

Sophie

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

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: portmidi.h Source File</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 class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</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('portmidi_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">portmidi.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef PORT_MIDI_H</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define PORT_MIDI_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span><span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00004"></a>00004 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {
<a name="l00005"></a>00005 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span>
<a name="l00006"></a>00006 
<a name="l00007"></a>00007 <span class="comment">/*</span>
<a name="l00008"></a>00008 <span class="comment"> * PortMidi Portable Real-Time MIDI Library</span>
<a name="l00009"></a>00009 <span class="comment"> * PortMidi API Header File</span>
<a name="l00010"></a>00010 <span class="comment"> * Latest version available at: http://sourceforge.net/projects/portmedia</span>
<a name="l00011"></a>00011 <span class="comment"> *</span>
<a name="l00012"></a>00012 <span class="comment"> * Copyright (c) 1999-2000 Ross Bencina and Phil Burk</span>
<a name="l00013"></a>00013 <span class="comment"> * Copyright (c) 2001-2006 Roger B. Dannenberg</span>
<a name="l00014"></a>00014 <span class="comment"> *</span>
<a name="l00015"></a>00015 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining</span>
<a name="l00016"></a>00016 <span class="comment"> * a copy of this software and associated documentation files</span>
<a name="l00017"></a>00017 <span class="comment"> * (the &quot;Software&quot;), to deal in the Software without restriction,</span>
<a name="l00018"></a>00018 <span class="comment"> * including without limitation the rights to use, copy, modify, merge,</span>
<a name="l00019"></a>00019 <span class="comment"> * publish, distribute, sublicense, and/or sell copies of the Software,</span>
<a name="l00020"></a>00020 <span class="comment"> * and to permit persons to whom the Software is furnished to do so,</span>
<a name="l00021"></a>00021 <span class="comment"> * subject to the following conditions:</span>
<a name="l00022"></a>00022 <span class="comment"> *</span>
<a name="l00023"></a>00023 <span class="comment"> * The above copyright notice and this permission notice shall be</span>
<a name="l00024"></a>00024 <span class="comment"> * included in all copies or substantial portions of the Software.</span>
<a name="l00025"></a>00025 <span class="comment"> *</span>
<a name="l00026"></a>00026 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,</span>
<a name="l00027"></a>00027 <span class="comment"> * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF</span>
<a name="l00028"></a>00028 <span class="comment"> * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.</span>
<a name="l00029"></a>00029 <span class="comment"> * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR</span>
<a name="l00030"></a>00030 <span class="comment"> * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF</span>
<a name="l00031"></a>00031 <span class="comment"> * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION</span>
<a name="l00032"></a>00032 <span class="comment"> * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</span>
<a name="l00033"></a>00033 <span class="comment"> */</span>
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 <span class="comment">/*</span>
<a name="l00036"></a>00036 <span class="comment"> * The text above constitutes the entire PortMidi license; however, </span>
<a name="l00037"></a>00037 <span class="comment"> * the PortMusic community also makes the following non-binding requests:</span>
<a name="l00038"></a>00038 <span class="comment"> *</span>
<a name="l00039"></a>00039 <span class="comment"> * Any person wishing to distribute modifications to the Software is</span>
<a name="l00040"></a>00040 <span class="comment"> * requested to send the modifications to the original developer so that</span>
<a name="l00041"></a>00041 <span class="comment"> * they can be incorporated into the canonical version. It is also</span>
<a name="l00042"></a>00042 <span class="comment"> * requested that these non-binding requests be included along with the </span>
<a name="l00043"></a>00043 <span class="comment"> * license above.</span>
<a name="l00044"></a>00044 <span class="comment"> */</span>
<a name="l00045"></a>00045 
<a name="l00046"></a>00046 <span class="comment">/* CHANGELOG FOR PORTMIDI</span>
<a name="l00047"></a>00047 <span class="comment"> *     (see ../CHANGELOG.txt)</span>
<a name="l00048"></a>00048 <span class="comment"> *</span>
<a name="l00049"></a>00049 <span class="comment"> * NOTES ON HOST ERROR REPORTING: </span>
<a name="l00050"></a>00050 <span class="comment"> *</span>
<a name="l00051"></a>00051 <span class="comment"> *    PortMidi errors (of type PmError) are generic, system-independent errors.</span>
<a name="l00052"></a>00052 <span class="comment"> *    When an error does not map to one of the more specific PmErrors, the</span>
<a name="l00053"></a>00053 <span class="comment"> *    catch-all code pmHostError is returned. This means that PortMidi has</span>
<a name="l00054"></a>00054 <span class="comment"> *    retained a more specific system-dependent error code. The caller can</span>
<a name="l00055"></a>00055 <span class="comment"> *    get more information by calling Pm_HasHostError() to test if there is</span>
<a name="l00056"></a>00056 <span class="comment"> *    a pending host error, and Pm_GetHostErrorText() to get a text string</span>
<a name="l00057"></a>00057 <span class="comment"> *    describing the error. Host errors are reported on a per-device basis </span>
<a name="l00058"></a>00058 <span class="comment"> *    because only after you open a device does PortMidi have a place to </span>
<a name="l00059"></a>00059 <span class="comment"> *    record the host error code. I.e. only </span>
<a name="l00060"></a>00060 <span class="comment"> *    those routines that receive a (PortMidiStream *) argument check and </span>
<a name="l00061"></a>00061 <span class="comment"> *    report errors. One exception to this is that Pm_OpenInput() and </span>
<a name="l00062"></a>00062 <span class="comment"> *    Pm_OpenOutput() can report errors even though when an error occurs,</span>
<a name="l00063"></a>00063 <span class="comment"> *    there is no PortMidiStream* to hold the error. Fortunately, both</span>
<a name="l00064"></a>00064 <span class="comment"> *    of these functions return any error immediately, so we do not really</span>
<a name="l00065"></a>00065 <span class="comment"> *    need per-device error memory. Instead, any host error code is stored</span>
<a name="l00066"></a>00066 <span class="comment"> *    in a global, pmHostError is returned, and the user can call </span>
<a name="l00067"></a>00067 <span class="comment"> *    Pm_GetHostErrorText() to get the error message (and the invalid stream</span>
<a name="l00068"></a>00068 <span class="comment"> *    parameter will be ignored.) The functions </span>
<a name="l00069"></a>00069 <span class="comment"> *    pm_init and pm_term do not fail or raise</span>
<a name="l00070"></a>00070 <span class="comment"> *    errors. The job of pm_init is to locate all available devices so that</span>
<a name="l00071"></a>00071 <span class="comment"> *    the caller can get information via PmDeviceInfo(). If an error occurs,</span>
<a name="l00072"></a>00072 <span class="comment"> *    the device is simply not listed as available.</span>
<a name="l00073"></a>00073 <span class="comment"> *</span>
<a name="l00074"></a>00074 <span class="comment"> *    Host errors come in two flavors:</span>
<a name="l00075"></a>00075 <span class="comment"> *      a) host error </span>
<a name="l00076"></a>00076 <span class="comment"> *      b) host error during callback</span>
<a name="l00077"></a>00077 <span class="comment"> *    These can occur w/midi input or output devices. (b) can only happen </span>
<a name="l00078"></a>00078 <span class="comment"> *    asynchronously (during callback routines), whereas (a) only occurs while</span>
<a name="l00079"></a>00079 <span class="comment"> *    synchronously running PortMidi and any resulting system dependent calls.</span>
<a name="l00080"></a>00080 <span class="comment"> *    Both (a) and (b) are reported by the next read or write call. You can</span>
<a name="l00081"></a>00081 <span class="comment"> *    also query for asynchronous errors (b) at any time by calling</span>
<a name="l00082"></a>00082 <span class="comment"> *    Pm_HasHostError().</span>
<a name="l00083"></a>00083 <span class="comment"> *</span>
<a name="l00084"></a>00084 <span class="comment"> * NOTES ON COMPILE-TIME SWITCHES</span>
<a name="l00085"></a>00085 <span class="comment"> *</span>
<a name="l00086"></a>00086 <span class="comment"> *    DEBUG assumes stdio and a console. Use this if you want automatic, simple</span>
<a name="l00087"></a>00087 <span class="comment"> *        error reporting, e.g. for prototyping. If you are using MFC or some </span>
<a name="l00088"></a>00088 <span class="comment"> *        other graphical interface with no console, DEBUG probably should be</span>
<a name="l00089"></a>00089 <span class="comment"> *        undefined.</span>
<a name="l00090"></a>00090 <span class="comment"> *    PM_CHECK_ERRORS more-or-less takes over error checking for return values,</span>
<a name="l00091"></a>00091 <span class="comment"> *        stopping your program and printing error messages when an error</span>
<a name="l00092"></a>00092 <span class="comment"> *        occurs. This also uses stdio for console text I/O.</span>
<a name="l00093"></a>00093 <span class="comment"> */</span>
<a name="l00094"></a>00094 
<a name="l00095"></a>00095 <span class="preprocessor">#ifndef WIN32</span>
<a name="l00096"></a>00096 <span class="preprocessor"></span><span class="comment">// Linux and OS X have stdint.h</span>
<a name="l00097"></a>00097 <span class="preprocessor">#include &lt;stdint.h&gt;</span>
<a name="l00098"></a>00098 <span class="preprocessor">#else</span>
<a name="l00099"></a>00099 <span class="preprocessor"></span><span class="preprocessor">#ifndef INT32_DEFINED</span>
<a name="l00100"></a>00100 <span class="preprocessor"></span><span class="comment">// rather than having users install a special .h file for windows, </span>
<a name="l00101"></a>00101 <span class="comment">// just put the required definitions inline here. porttime.h uses</span>
<a name="l00102"></a>00102 <span class="comment">// these too, so the definitions are (unfortunately) duplicated there</span>
<a name="l00103"></a>00103 <span class="keyword">typedef</span> <span class="keywordtype">int</span> int32_t;
<a name="l00104"></a>00104 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> uint32_t;
<a name="l00105"></a>00105 <span class="preprocessor">#define INT32_DEFINED</span>
<a name="l00106"></a>00106 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00107"></a>00107 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00108"></a>00108 <span class="preprocessor"></span>
<a name="l00109"></a>00109 <span class="preprocessor">#ifdef _WINDLL</span>
<a name="l00110"></a>00110 <span class="preprocessor"></span><span class="preprocessor">#define PMEXPORT __declspec(dllexport)</span>
<a name="l00111"></a>00111 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00112"></a>00112 <span class="preprocessor"></span><span class="preprocessor">#define PMEXPORT </span>
<a name="l00113"></a>00113 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00114"></a>00114 <span class="preprocessor"></span>
<a name="l00115"></a>00115 <span class="preprocessor">#ifndef FALSE</span>
<a name="l00116"></a>00116 <span class="preprocessor"></span><span class="preprocessor">    #define FALSE 0</span>
<a name="l00117"></a>00117 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00118"></a>00118 <span class="preprocessor"></span><span class="preprocessor">#ifndef TRUE</span>
<a name="l00119"></a>00119 <span class="preprocessor"></span><span class="preprocessor">    #define TRUE 1</span>
<a name="l00120"></a>00120 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00121"></a>00121 <span class="preprocessor"></span>
<a name="l00122"></a>00122 <span class="comment">/* default size of buffers for sysex transmission: */</span>
<a name="l00123"></a>00123 <span class="preprocessor">#define PM_DEFAULT_SYSEX_BUFFER_SIZE 1024</span>
<a name="l00124"></a>00124 <span class="preprocessor"></span>
<a name="l00126"></a>00126 <span class="keyword">typedef</span> <span class="keyword">enum</span> {
<a name="l00127"></a>00127     pmNoError = 0,
<a name="l00128"></a>00128     pmNoData = 0, 
<a name="l00129"></a>00129     pmGotData = 1, 
<a name="l00130"></a>00130     pmHostError = -10000,
<a name="l00131"></a>00131     pmInvalidDeviceId, 
<a name="l00136"></a>00136     pmInsufficientMemory,
<a name="l00137"></a>00137     pmBufferTooSmall,
<a name="l00138"></a>00138     pmBufferOverflow,
<a name="l00139"></a>00139     pmBadPtr, <span class="comment">/* PortMidiStream parameter is NULL or</span>
<a name="l00140"></a>00140 <span class="comment">               * stream is not opened or</span>
<a name="l00141"></a>00141 <span class="comment">               * stream is output when input is required or</span>
<a name="l00142"></a>00142 <span class="comment">               * stream is input when output is required */</span>
<a name="l00143"></a>00143     pmBadData, 
<a name="l00144"></a>00144     pmInternalError,
<a name="l00145"></a>00145     pmBufferMaxSize 
<a name="l00146"></a>00146     <span class="comment">/* NOTE: If you add a new error type, be sure to update Pm_GetErrorText() */</span>
<a name="l00147"></a>00147 } PmError;
<a name="l00148"></a>00148 
<a name="l00153"></a>00153 PMEXPORT PmError Pm_Initialize( <span class="keywordtype">void</span> );
<a name="l00154"></a>00154 
<a name="l00159"></a>00159 PMEXPORT PmError Pm_Terminate( <span class="keywordtype">void</span> );
<a name="l00160"></a>00160 
<a name="l00163"></a>00163 <span class="keyword">typedef</span> <span class="keywordtype">void</span> PortMidiStream;
<a name="l00164"></a>00164 <span class="preprocessor">#define PmStream PortMidiStream</span>
<a name="l00165"></a>00165 <span class="preprocessor"></span>
<a name="l00180"></a>00180 PMEXPORT <span class="keywordtype">int</span> Pm_HasHostError( PortMidiStream * stream );
<a name="l00181"></a>00181 
<a name="l00182"></a>00182 
<a name="l00187"></a>00187 PMEXPORT <span class="keyword">const</span> <span class="keywordtype">char</span> *Pm_GetErrorText( PmError errnum );
<a name="l00188"></a>00188 
<a name="l00193"></a>00193 PMEXPORT <span class="keywordtype">void</span> Pm_GetHostErrorText(<span class="keywordtype">char</span> * msg, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> len);
<a name="l00194"></a>00194 
<a name="l00195"></a>00195 <span class="preprocessor">#define HDRLENGTH 50</span>
<a name="l00196"></a>00196 <span class="preprocessor"></span><span class="preprocessor">#define PM_HOST_ERROR_MSG_LEN 256u </span><span class="comment">/* any host error msg will occupy less </span>
<a name="l00197"></a>00197 <span class="comment">                                      than this number of characters */</span>
<a name="l00198"></a>00198 
<a name="l00205"></a>00205 <span class="keyword">typedef</span> <span class="keywordtype">int</span> PmDeviceID;
<a name="l00206"></a><a class="code" href="structPmDeviceInfo.html">00206</a> <span class="preprocessor">#define pmNoDevice -1</span>
<a name="l00207"></a><a class="code" href="structPmDeviceInfo.html#ab2b405d77d62c45105703d8b25177665">00207</a> <span class="preprocessor"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>{
<a name="l00208"></a><a class="code" href="structPmDeviceInfo.html#a8c83e0e882db5a980a007437a806363b">00208</a>     <span class="keywordtype">int</span> structVersion; 
<a name="l00209"></a><a class="code" href="structPmDeviceInfo.html#a5f708c92e58b1c77454bffeee1d7c61c">00209</a>     <span class="keyword">const</span> <span class="keywordtype">char</span> *interf; 
<a name="l00210"></a><a class="code" href="structPmDeviceInfo.html#a9447230099afd8efc3f57906a02f6eba">00210</a>     <span class="keyword">const</span> <span class="keywordtype">char</span> *name;   
<a name="l00211"></a><a class="code" href="structPmDeviceInfo.html#a0e395068e4eee637cc576541884d7e69">00211</a>     <span class="keywordtype">int</span> input; 
<a name="l00212"></a><a class="code" href="structPmDeviceInfo.html#ab4d3d62344b0c525d444bd844e7d70eb">00212</a>     <span class="keywordtype">int</span> output; 
<a name="l00213"></a>00213     <span class="keywordtype">int</span> opened; 
<a name="l00215"></a>00215 } <a class="code" href="structPmDeviceInfo.html">PmDeviceInfo</a>;
<a name="l00216"></a>00216 
<a name="l00218"></a>00218 PMEXPORT <span class="keywordtype">int</span> Pm_CountDevices( <span class="keywordtype">void</span> );
<a name="l00261"></a>00261 PMEXPORT PmDeviceID Pm_GetDefaultInputDeviceID( <span class="keywordtype">void</span> );
<a name="l00263"></a>00263 PMEXPORT PmDeviceID Pm_GetDefaultOutputDeviceID( <span class="keywordtype">void</span> );
<a name="l00264"></a>00264 
<a name="l00269"></a>00269 <span class="keyword">typedef</span> int32_t PmTimestamp;
<a name="l00270"></a>00270 <span class="keyword">typedef</span> PmTimestamp (*PmTimeProcPtr)(<span class="keywordtype">void</span> *time_info);
<a name="l00271"></a>00271 
<a name="l00273"></a>00273 <span class="preprocessor">#define PmBefore(t1,t2) ((t1-t2) &lt; 0)</span>
<a name="l00274"></a>00274 <span class="preprocessor"></span>
<a name="l00287"></a>00287 PMEXPORT <span class="keyword">const</span> <a class="code" href="structPmDeviceInfo.html">PmDeviceInfo</a>* <a class="code" 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>( PmDeviceID <span class="keywordtype">id</span> );
<a name="l00288"></a>00288 
<a name="l00353"></a>00353 PMEXPORT PmError <a class="code" href="group__grp__device.html#gabd50a31baaa494ad8b405f9ad54c966e" title="Pm_OpenInput() and Pm_OpenOutput() open devices.">Pm_OpenInput</a>( PortMidiStream** stream,
<a name="l00354"></a>00354                 PmDeviceID inputDevice,
<a name="l00355"></a>00355                 <span class="keywordtype">void</span> *inputDriverInfo,
<a name="l00356"></a>00356                 int32_t bufferSize,
<a name="l00357"></a>00357                 PmTimeProcPtr time_proc,
<a name="l00358"></a>00358                 <span class="keywordtype">void</span> *time_info );
<a name="l00359"></a>00359 
<a name="l00360"></a>00360 PMEXPORT PmError Pm_OpenOutput( PortMidiStream** stream,
<a name="l00361"></a>00361                 PmDeviceID outputDevice,
<a name="l00362"></a>00362                 <span class="keywordtype">void</span> *outputDriverInfo,
<a name="l00363"></a>00363                 int32_t bufferSize,
<a name="l00364"></a>00364                 PmTimeProcPtr time_proc,
<a name="l00365"></a>00365                 <span class="keywordtype">void</span> *time_info,
<a name="l00366"></a>00366                 int32_t latency );
<a name="l00374"></a>00374 <span class="comment">/*  \function PmError Pm_SetFilter( PortMidiStream* stream, int32_t filters )</span>
<a name="l00375"></a>00375 <span class="comment">    Pm_SetFilter() sets filters on an open input stream to drop selected</span>
<a name="l00376"></a>00376 <span class="comment">    input types. By default, only active sensing messages are filtered.</span>
<a name="l00377"></a>00377 <span class="comment">    To prohibit, say, active sensing and sysex messages, call</span>
<a name="l00378"></a>00378 <span class="comment">    Pm_SetFilter(stream, PM_FILT_ACTIVE | PM_FILT_SYSEX);</span>
<a name="l00379"></a>00379 <span class="comment"></span>
<a name="l00380"></a>00380 <span class="comment">    Filtering is useful when midi routing or midi thru functionality is being</span>
<a name="l00381"></a>00381 <span class="comment">    provided by the user application.</span>
<a name="l00382"></a>00382 <span class="comment">    For example, you may want to exclude timing messages (clock, MTC, start/stop/continue),</span>
<a name="l00383"></a>00383 <span class="comment">    while allowing note-related messages to pass.</span>
<a name="l00384"></a>00384 <span class="comment">    Or you may be using a sequencer or drum-machine for MIDI clock information but want to</span>
<a name="l00385"></a>00385 <span class="comment">    exclude any notes it may play.</span>
<a name="l00386"></a>00386 <span class="comment"> */</span>
<a name="l00387"></a>00387     
<a name="l00388"></a>00388 <span class="comment">/* Filter bit-mask definitions */</span>
<a name="l00390"></a>00390 <span class="preprocessor">#define PM_FILT_ACTIVE (1 &lt;&lt; 0x0E)</span>
<a name="l00391"></a><a class="code" href="group__grp__events__filters.html#ga3ef53d51914740bb7746e017b5a44402">00391</a> <span class="preprocessor"></span>
<a name="l00392"></a>00392 <span class="preprocessor">#define PM_FILT_SYSEX (1 &lt;&lt; 0x00)</span>
<a name="l00393"></a><a class="code" href="group__grp__events__filters.html#gaf6d54a9ff867bab06ee18bc637887834">00393</a> <span class="preprocessor"></span>
<a name="l00394"></a>00394 <span class="preprocessor">#define PM_FILT_CLOCK (1 &lt;&lt; 0x08)</span>
<a name="l00395"></a><a class="code" href="group__grp__events__filters.html#gae8733c7af01f94015043c8926076557a">00395</a> <span class="preprocessor"></span>
<a name="l00396"></a>00396 <span class="preprocessor">#define PM_FILT_PLAY ((1 &lt;&lt; 0x0A) | (1 &lt;&lt; 0x0C) | (1 &lt;&lt; 0x0B))</span>
<a name="l00397"></a><a class="code" href="group__grp__events__filters.html#gaa4de938a93a84d9d06cc5173f4277595">00397</a> <span class="preprocessor"></span>
<a name="l00398"></a>00398 <span class="preprocessor">#define PM_FILT_TICK (1 &lt;&lt; 0x09)</span>
<a name="l00399"></a><a class="code" href="group__grp__events__filters.html#gaea41a2172d5c7382f6b9d7df85c62a7c">00399</a> <span class="preprocessor"></span>
<a name="l00400"></a>00400 <span class="preprocessor">#define PM_FILT_FD (1 &lt;&lt; 0x0D)</span>
<a name="l00401"></a><a class="code" href="group__grp__events__filters.html#ga4ee575e9f8ba7bf24e53919cfe81edab">00401</a> <span class="preprocessor"></span>
<a name="l00402"></a>00402 <span class="preprocessor">#define PM_FILT_UNDEFINED PM_FILT_FD</span>
<a name="l00403"></a><a class="code" href="group__grp__events__filters.html#gaf398203a8c838897bd07dc356cd9ed54">00403</a> <span class="preprocessor"></span>
<a name="l00404"></a>00404 <span class="preprocessor">#define PM_FILT_RESET (1 &lt;&lt; 0x0F)</span>
<a name="l00405"></a><a class="code" href="group__grp__events__filters.html#ga20f84601b1fc10c18339cf85bf9b91e9">00405</a> <span class="preprocessor"></span>
<a name="l00406"></a>00406 <span class="preprocessor">#define PM_FILT_REALTIME (PM_FILT_ACTIVE | PM_FILT_SYSEX | PM_FILT_CLOCK | \</span>
<a name="l00407"></a>00407 <span class="preprocessor">    PM_FILT_PLAY | PM_FILT_UNDEFINED | PM_FILT_RESET | PM_FILT_TICK)</span>
<a name="l00408"></a><a class="code" href="group__grp__events__filters.html#ga27d37f62f7ab2674c5c6626a15630b48">00408</a> <span class="preprocessor"></span>
<a name="l00409"></a>00409 <span class="preprocessor">#define PM_FILT_NOTE ((1 &lt;&lt; 0x19) | (1 &lt;&lt; 0x18))</span>
<a name="l00410"></a><a class="code" href="group__grp__events__filters.html#gaf26195f93ad34640136d893fd4729a31">00410</a> <span class="preprocessor"></span>
<a name="l00411"></a>00411 <span class="preprocessor">#define PM_FILT_CHANNEL_AFTERTOUCH (1 &lt;&lt; 0x1D)</span>
<a name="l00412"></a><a class="code" href="group__grp__events__filters.html#ga1b300264b36000d2f1aceb990a1aeb1d">00412</a> <span class="preprocessor"></span>
<a name="l00413"></a>00413 <span class="preprocessor">#define PM_FILT_POLY_AFTERTOUCH (1 &lt;&lt; 0x1A)</span>
<a name="l00414"></a><a class="code" href="group__grp__events__filters.html#ga4f2cf0d7c7de4318c0750b80098031da">00414</a> <span class="preprocessor"></span>
<a name="l00415"></a>00415 <span class="preprocessor">#define PM_FILT_AFTERTOUCH (PM_FILT_CHANNEL_AFTERTOUCH | PM_FILT_POLY_AFTERTOUCH)</span>
<a name="l00416"></a><a class="code" href="group__grp__events__filters.html#gade6cc12acc0eed1bbff2ead41cdc1ba4">00416</a> <span class="preprocessor"></span>
<a name="l00417"></a>00417 <span class="preprocessor">#define PM_FILT_PROGRAM (1 &lt;&lt; 0x1C)</span>
<a name="l00418"></a><a class="code" href="group__grp__events__filters.html#gab37c64bd527f54ec37fb312dabda16b1">00418</a> <span class="preprocessor"></span>
<a name="l00419"></a>00419 <span class="preprocessor">#define PM_FILT_CONTROL (1 &lt;&lt; 0x1B)</span>
<a name="l00420"></a><a class="code" href="group__grp__events__filters.html#gae6615da402e1a1a82b7833c7a30415e4">00420</a> <span class="preprocessor"></span>
<a name="l00421"></a>00421 <span class="preprocessor">#define PM_FILT_PITCHBEND (1 &lt;&lt; 0x1E)</span>
<a name="l00422"></a><a class="code" href="group__grp__events__filters.html#ga9209ea350d58f2d1bc404bc1deecce0f">00422</a> <span class="preprocessor"></span>
<a name="l00423"></a>00423 <span class="preprocessor">#define PM_FILT_MTC (1 &lt;&lt; 0x01)</span>
<a name="l00424"></a><a class="code" href="group__grp__events__filters.html#ga830ecd4a62070c6e76352eea4524f537">00424</a> <span class="preprocessor"></span>
<a name="l00425"></a>00425 <span class="preprocessor">#define PM_FILT_SONG_POSITION (1 &lt;&lt; 0x02)</span>
<a name="l00426"></a><a class="code" href="group__grp__events__filters.html#ga45af83115b0e12767e99f619801f49b5">00426</a> <span class="preprocessor"></span>
<a name="l00427"></a>00427 <span class="preprocessor">#define PM_FILT_SONG_SELECT (1 &lt;&lt; 0x03)</span>
<a name="l00428"></a><a class="code" href="group__grp__events__filters.html#ga96a486160895ec39c1f74611149e6bdd">00428</a> <span class="preprocessor"></span>
<a name="l00429"></a>00429 <span class="preprocessor">#define PM_FILT_TUNE (1 &lt;&lt; 0x06)</span>
<a name="l00430"></a><a class="code" href="group__grp__events__filters.html#ga9f87e719897a7be9e0c17ea2c60c0171">00430</a> <span class="preprocessor"></span>
<a name="l00431"></a>00431 <span class="preprocessor">#define PM_FILT_SYSTEMCOMMON (PM_FILT_MTC | PM_FILT_SONG_POSITION | PM_FILT_SONG_SELECT | PM_FILT_TUNE)</span>
<a name="l00432"></a>00432 <span class="preprocessor"></span>
<a name="l00433"></a>00433 
<a name="l00434"></a>00434 PMEXPORT PmError Pm_SetFilter( PortMidiStream* stream, int32_t filters );
<a name="l00435"></a>00435 
<a name="l00436"></a>00436 <span class="preprocessor">#define Pm_Channel(channel) (1&lt;&lt;(channel))</span>
<a name="l00437"></a>00437 <span class="preprocessor"></span>
<a name="l00452"></a>00452 PMEXPORT PmError <a class="code" href="group__grp__events__filters.html#ga87f9bc67a21a8b058a3f915a2f98746a" title="Pm_SetChannelMask() filters incoming messages based on channel.">Pm_SetChannelMask</a>(PortMidiStream *stream, <span class="keywordtype">int</span> mask);
<a name="l00453"></a>00453 
<a name="l00462"></a>00462 PMEXPORT PmError <a class="code" href="group__grp__events__filters.html#ga8934ac3b02359b60177a06580c66a20e" title="Pm_Abort() terminates outgoing messages immediately The caller should immediately close the output po...">Pm_Abort</a>( PortMidiStream* stream );
<a name="l00463"></a>00463      
<a name="l00469"></a>00469 PMEXPORT PmError <a class="code" href="group__grp__events__filters.html#ga6b26be2fbcf092c9625ade5303edd0ac" title="Pm_Close() closes a midi stream, flushing any pending buffers.">Pm_Close</a>( PortMidiStream* stream );
<a name="l00470"></a>00470 
<a name="l00494"></a>00494 PmError <a class="code" href="group__grp__events__filters.html#gada0edc37a3424b086b14b151be3aea1a" title="Pm_Synchronize() instructs PortMidi to (re)synchronize to the time_proc passed when the stream was op...">Pm_Synchronize</a>( PortMidiStream* stream );
<a name="l00495"></a>00495 
<a name="l00496"></a>00496 
<a name="l00504"></a>00504 <span class="preprocessor">#define Pm_Message(status, data1, data2) \</span>
<a name="l00505"></a>00505 <span class="preprocessor">         ((((data2) &lt;&lt; 16) &amp; 0xFF0000) | \</span>
<a name="l00506"></a>00506 <span class="preprocessor">          (((data1) &lt;&lt; 8) &amp; 0xFF00) | \</span>
<a name="l00507"></a>00507 <span class="preprocessor">          ((status) &amp; 0xFF))</span>
<a name="l00508"></a>00508 <span class="preprocessor"></span><span class="preprocessor">#define Pm_MessageStatus(msg) ((msg) &amp; 0xFF)</span>
<a name="l00509"></a>00509 <span class="preprocessor"></span><span class="preprocessor">#define Pm_MessageData1(msg) (((msg) &gt;&gt; 8) &amp; 0xFF)</span>
<a name="l00510"></a>00510 <span class="preprocessor"></span><span class="preprocessor">#define Pm_MessageData2(msg) (((msg) &gt;&gt; 16) &amp; 0xFF)</span>
<a name="l00511"></a><a class="code" href="group__grp__events__filters.html#gad8455e4afe978a74c68e345bef99761d">00511</a> <span class="preprocessor"></span>
<a name="l00512"></a>00512 <span class="keyword">typedef</span> int32_t <a class="code" href="group__grp__events__filters.html#gad8455e4afe978a74c68e345bef99761d" title="see PmEvent">PmMessage</a>; 
<a name="l00578"></a>00578 <span class="keyword">typedef</span> <span class="keyword">struct </span>{
<a name="l00579"></a>00579     PmMessage      message;
<a name="l00580"></a>00580     PmTimestamp    timestamp;
<a name="l00581"></a>00581 } <a class="code" href="structPmEvent.html" title="All midi data comes in the form of PmEvent structures.">PmEvent</a>;
<a name="l00582"></a>00582 
<a name="l00613"></a>00613 PMEXPORT <span class="keywordtype">int</span> <a class="code" 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>( PortMidiStream *stream, <a class="code" href="structPmEvent.html" title="All midi data comes in the form of PmEvent structures.">PmEvent</a> *buffer, int32_t length );
<a name="l00614"></a>00614 
<a name="l00619"></a>00619 PMEXPORT PmError <a class="code" href="group__grp__io.html#ga54198ca9dc1af9d82ec5f44f661faeea" title="Pm_Poll() tests whether input is available, returning TRUE, FALSE, or an error value.">Pm_Poll</a>( PortMidiStream *stream);
<a name="l00620"></a>00620 
<a name="l00634"></a>00634 PMEXPORT PmError <a class="code" href="group__grp__io.html#ga82950117f003d28f9ca6536c00af985a" title="Pm_Write() writes midi data from a buffer.">Pm_Write</a>( PortMidiStream *stream, <a class="code" href="structPmEvent.html" title="All midi data comes in the form of PmEvent structures.">PmEvent</a> *buffer, int32_t length );
<a name="l00635"></a>00635 
<a name="l00642"></a>00642 PMEXPORT PmError <a class="code" href="group__grp__io.html#ga4a8cdd77e5b2ad4c16338eed475dfc6b" title="Pm_WriteShort() writes a timestamped non-system-exclusive midi message.">Pm_WriteShort</a>( PortMidiStream *stream, PmTimestamp when, int32_t msg);
<a name="l00643"></a>00643 
<a name="l00647"></a>00647 PMEXPORT PmError <a class="code" href="group__grp__io.html#ga4bd5753bdfb53a1611bcdf5ba159fc87" title="Pm_WriteSysEx() writes a timestamped system-exclusive midi message.">Pm_WriteSysEx</a>( PortMidiStream *stream, PmTimestamp when, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *msg);
<a name="l00648"></a>00648 
<a name="l00651"></a>00651 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00652"></a>00652 <span class="preprocessor"></span>}
<a name="l00653"></a>00653 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span>
<a name="l00654"></a>00654 <span class="preprocessor">#endif </span><span class="comment">/* PORT_MIDI_H */</span>
</pre></div></div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><b>portmidi.h</b>      </li>
<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>