File: classRtMidiOut.html

package info (click to toggle)
stk 4.4.4-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 24,856 kB
  • sloc: cpp: 33,976; tcl: 2,375; sh: 2,319; ansic: 163; perl: 114; makefile: 37
file content (215 lines) | stat: -rw-r--r-- 14,028 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<HTML>
<HEAD>
<TITLE>The Synthesis ToolKit in C++ (STK)</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<img src="princeton.gif"> &nbsp; <img src="ccrma.gif"> &nbsp; <img src="mcgill.gif"><P>
<a class="qindex" href="index.html">Home</a> &nbsp; <a class="qindex" href="information.html">Information</a> &nbsp; <a class="qindex" href="classes.html">Classes</a> &nbsp; <a class="qindex" href="download.html">Download</a> &nbsp; <a class="qindex" href="usage.html">Usage</a> &nbsp; <a class="qindex" href="maillist.html">Mail List</a> &nbsp; <a class="qindex" href="system.html">Requirements</a> &nbsp; <a class="qindex" href="links.html">Links</a> &nbsp; <a class="qindex" href="faq.html">FAQ</a> &nbsp; <a class="qindex" href="tutorial.html">Tutorial</a></CENTER>
<HR>
<!-- Generated by Doxygen 1.6.2 -->
<div class="contents">
<h1>RtMidiOut Class Reference</h1><!-- doxytag: class="RtMidiOut" --><!-- doxytag: inherits="RtMidi" -->
<p>A realtime MIDI output class.  
<a href="#_details">More...</a></p>

<p><code>#include &lt;<a class="el" href="RtMidi_8h_source.html">RtMidi.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for RtMidiOut:</div>
<div class="dynsection">
 <div class="center">
  <img src="classRtMidiOut.png" usemap="#RtMidiOut_map" alt=""/>
  <map id="RtMidiOut_map" name="RtMidiOut_map">
<area href="classRtMidi.html" alt="RtMidi" shape="rect" coords="0,0,67,24"/>
</map>
 </div>
</div>

<p><a href="classRtMidiOut-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtMidiOut.html#a2940966e36b5479fbbf82c07424318cc">RtMidiOut</a> (<a class="el" href="classRtMidi.html#aac66af04a85fe5c5f07c360574a19406">RtMidi::Api</a> api=UNSPECIFIED, const std::string clientName=std::string(&quot;RtMidi Output Client&quot;))</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Default constructor that allows an optional client name.  <a href="#a2940966e36b5479fbbf82c07424318cc"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afdc37ccd60d7a31b3970da7a1d423881"></a><!-- doxytag: member="RtMidiOut::~RtMidiOut" ref="afdc37ccd60d7a31b3970da7a1d423881" args="(void)" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtMidiOut.html#afdc37ccd60d7a31b3970da7a1d423881">~RtMidiOut</a> (void)  throw ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The destructor closes any open MIDI connections. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a532b5712e305bd8afb65a3ad14138e0f"></a><!-- doxytag: member="RtMidiOut::getCurrentApi" ref="a532b5712e305bd8afb65a3ad14138e0f" args="(void)" -->
<a class="el" href="classRtMidi.html#aac66af04a85fe5c5f07c360574a19406">RtMidi::Api</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtMidiOut.html#a532b5712e305bd8afb65a3ad14138e0f">getCurrentApi</a> (void)  throw ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the MIDI API specifier for the current instance of <a class="el" href="classRtMidiOut.html" title="A realtime MIDI output class.">RtMidiOut</a>. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtMidiOut.html#a1b280d67317cd473a8816aeb2fe6c186">openPort</a> (unsigned int portNumber=0, const std::string portName=std::string(&quot;RtMidi Output&quot;))</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Open a MIDI output connection.  <a href="#a1b280d67317cd473a8816aeb2fe6c186"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5a28d1ba9e002fd07a317d3a257d87e8"></a><!-- doxytag: member="RtMidiOut::closePort" ref="a5a28d1ba9e002fd07a317d3a257d87e8" args="(void)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtMidiOut.html#a5a28d1ba9e002fd07a317d3a257d87e8">closePort</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Close an open MIDI connection (if one exists). <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtMidiOut.html#a47068e1c076d91fd89587c0ccdeddc7a">openVirtualPort</a> (const std::string portName=std::string(&quot;RtMidi Output&quot;))</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a virtual output port, with optional name, to allow software connections (OS X and ALSA only).  <a href="#a47068e1c076d91fd89587c0ccdeddc7a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0c4d662e1c398ddf35a2dbaf66f50976"></a><!-- doxytag: member="RtMidiOut::getPortCount" ref="a0c4d662e1c398ddf35a2dbaf66f50976" args="(void)" -->
unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtMidiOut.html#a0c4d662e1c398ddf35a2dbaf66f50976">getPortCount</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the number of available MIDI output ports. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">std::string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtMidiOut.html#acc4ae0ab71a49ae7629075d5a9cd837c">getPortName</a> (unsigned int portNumber=0)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return a string identifier for the specified MIDI port type and number.  <a href="#acc4ae0ab71a49ae7629075d5a9cd837c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtMidiOut.html#a0bd8972ef8ac4e8d37ccc4b5d51c2eb3">sendMessage</a> (std::vector&lt; unsigned char &gt; *message)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Immediately send a single message out an open MIDI output port.  <a href="#a0bd8972ef8ac4e8d37ccc4b5d51c2eb3"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>A realtime MIDI output class. </p>
<p>This class provides a common, platform-independent API for MIDI output. It allows one to probe available MIDI output ports, to connect to one such port, and to send MIDI bytes immediately over the connection. Create multiple instances of this class to connect to more than one MIDI device at the same time. With the OS-X and Linux ALSA MIDI APIs, it is also possible to open a virtual port to which other MIDI software clients can connect.</p>
<p>by Gary P. Scavone, 2003-2012. </p>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a2940966e36b5479fbbf82c07424318cc"></a><!-- doxytag: member="RtMidiOut::RtMidiOut" ref="a2940966e36b5479fbbf82c07424318cc" args="(RtMidi::Api api=UNSPECIFIED, const std::string clientName=std::string(&quot;RtMidi Output Client&quot;))" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">RtMidiOut::RtMidiOut </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classRtMidi.html#aac66af04a85fe5c5f07c360574a19406">RtMidi::Api</a>&nbsp;</td>
          <td class="paramname"> <em>api</em> = <code>UNSPECIFIED</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string&nbsp;</td>
          <td class="paramname"> <em>clientName</em> = <code>std::string(&quot;RtMidi&nbsp;Output&nbsp;Client&quot;)</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Default constructor that allows an optional client name. </p>
<p>An exception will be thrown if a MIDI system initialization error occurs.</p>
<p>If no API argument is specified and multiple API support has been compiled, the default order of use is JACK, ALSA (Linux) and CORE, Jack (OS-X). </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a1b280d67317cd473a8816aeb2fe6c186"></a><!-- doxytag: member="RtMidiOut::openPort" ref="a1b280d67317cd473a8816aeb2fe6c186" args="(unsigned int portNumber=0, const std::string portName=std::string(&quot;RtMidi Output&quot;))" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RtMidiOut::openPort </td>
          <td>(</td>
          <td class="paramtype">unsigned int&nbsp;</td>
          <td class="paramname"> <em>portNumber</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string&nbsp;</td>
          <td class="paramname"> <em>portName</em> = <code>std::string(&nbsp;&quot;RtMidi&nbsp;Output&quot;&nbsp;)</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Open a MIDI output connection. </p>
<p>An optional port number greater than 0 can be specified. Otherwise, the default or first port found is opened. An exception is thrown if an error occurs while attempting to make the port connection. </p>

<p>Implements <a class="el" href="classRtMidi.html#ad9e30a89638f93193cb40edebaa536f5">RtMidi</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00438"></a>00438 { <span class="keywordflow">return</span> rtapi_-&gt;openPort( portNumber, portName ); }
</pre></div></p>

</div>
</div>
<a class="anchor" id="a47068e1c076d91fd89587c0ccdeddc7a"></a><!-- doxytag: member="RtMidiOut::openVirtualPort" ref="a47068e1c076d91fd89587c0ccdeddc7a" args="(const std::string portName=std::string(&quot;RtMidi Output&quot;))" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RtMidiOut::openVirtualPort </td>
          <td>(</td>
          <td class="paramtype">const std::string&nbsp;</td>
          <td class="paramname"> <em>portName</em> = <code>std::string(&nbsp;&quot;RtMidi&nbsp;Output&quot;&nbsp;)</code></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Create a virtual output port, with optional name, to allow software connections (OS X and ALSA only). </p>
<p>This function creates a virtual MIDI output port to which other software applications can connect. This type of functionality is currently only supported by the Macintosh OS-X and Linux ALSA APIs (the function does nothing with the other APIs). An exception is thrown if an error occurs while attempting to create the virtual port. </p>

<p>Implements <a class="el" href="classRtMidi.html#a9200cde4f5337c0bc421d20bd4fcf654">RtMidi</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00439"></a>00439 { <span class="keywordflow">return</span> rtapi_-&gt;openVirtualPort( portName ); }
</pre></div></p>

</div>
</div>
<a class="anchor" id="acc4ae0ab71a49ae7629075d5a9cd837c"></a><!-- doxytag: member="RtMidiOut::getPortName" ref="acc4ae0ab71a49ae7629075d5a9cd837c" args="(unsigned int portNumber=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string RtMidiOut::getPortName </td>
          <td>(</td>
          <td class="paramtype">unsigned int&nbsp;</td>
          <td class="paramname"> <em>portNumber</em> = <code>0</code></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return a string identifier for the specified MIDI port type and number. </p>
<p>An empty string is returned if an invalid port specifier is provided. </p>

<p>Implements <a class="el" href="classRtMidi.html#a799e2b9f4df39b298518f2b394db3391">RtMidi</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00442"></a>00442 { <span class="keywordflow">return</span> rtapi_-&gt;getPortName( portNumber ); }
</pre></div></p>

</div>
</div>
<a class="anchor" id="a0bd8972ef8ac4e8d37ccc4b5d51c2eb3"></a><!-- doxytag: member="RtMidiOut::sendMessage" ref="a0bd8972ef8ac4e8d37ccc4b5d51c2eb3" args="(std::vector&lt; unsigned char &gt; *message)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RtMidiOut::sendMessage </td>
          <td>(</td>
          <td class="paramtype">std::vector&lt; unsigned char &gt; *&nbsp;</td>
          <td class="paramname"> <em>message</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Immediately send a single message out an open MIDI output port. </p>
<p>An exception is thrown if an error occurs during output or an output connection was not previously established. </p>

<p><div class="fragment"><pre class="fragment"><a name="l00443"></a>00443 { <span class="keywordflow">return</span> rtapi_-&gt;sendMessage( message ); }
</pre></div></p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="RtMidi_8h_source.html">RtMidi.h</a></li>
</ul>
</div>
<HR>

<table>
  <tr><td><A HREF="http://ccrma.stanford.edu/software/stk/"><I>The Synthesis ToolKit in C++ (STK)</I></A></td></tr>
  <tr><td>&copy;1995-2012 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
</table>

</BODY>
</HTML>