midi-communications-macos 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.version +6 -0
- data/.yardoc/checksums +9 -0
- data/.yardoc/complete +0 -0
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/.yardopts +6 -0
- data/LICENSE +159 -668
- data/README.md +6 -13
- data/doc/MIDICommunicationsMacOS/API/CF.html +124 -0
- data/doc/MIDICommunicationsMacOS/API/HostTime.html +124 -0
- data/doc/MIDICommunicationsMacOS/API/MIDIPacket.html +137 -0
- data/doc/MIDICommunicationsMacOS/API/MIDIPacketList.html +137 -0
- data/doc/MIDICommunicationsMacOS/API/MIDISysexSendRequest.html +137 -0
- data/doc/MIDICommunicationsMacOS/API.html +912 -0
- data/doc/MIDICommunicationsMacOS/Destination.html +1983 -0
- data/doc/MIDICommunicationsMacOS/Device.html +1102 -0
- data/doc/MIDICommunicationsMacOS/Endpoint.html +1665 -0
- data/doc/MIDICommunicationsMacOS/Entity.html +971 -0
- data/doc/MIDICommunicationsMacOS/Source.html +1784 -0
- data/doc/MIDICommunicationsMacOS/TypeConversion.html +393 -0
- data/doc/MIDICommunicationsMacOS.html +214 -0
- data/doc/_index.html +250 -0
- data/doc/class_list.html +54 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +503 -0
- data/doc/file.README.html +275 -0
- data/doc/file_list.html +59 -0
- data/doc/frames.html +22 -0
- data/doc/index.html +275 -0
- data/doc/js/app.js +344 -0
- data/doc/js/full_list.js +242 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +542 -0
- data/doc/top-level-namespace.html +110 -0
- data/lib/midi-communications-macos/api.rb +7 -1
- data/lib/midi-communications-macos/destination.rb +86 -20
- data/lib/midi-communications-macos/device.rb +52 -18
- data/lib/midi-communications-macos/endpoint.rb +31 -5
- data/lib/midi-communications-macos/entity.rb +20 -6
- data/lib/midi-communications-macos/source.rb +79 -19
- data/lib/midi-communications-macos/type_conversion.rb +11 -4
- data/lib/midi-communications-macos/version.rb +2 -1
- data/lib/midi-communications-macos.rb +37 -0
- data/midi-communications-macos.gemspec +11 -9
- metadata +83 -4
|
@@ -0,0 +1,912 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>
|
|
7
|
+
Module: MIDICommunicationsMacOS::API
|
|
8
|
+
|
|
9
|
+
— MIDI Communications macOS API
|
|
10
|
+
|
|
11
|
+
</title>
|
|
12
|
+
|
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
|
14
|
+
|
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
|
16
|
+
|
|
17
|
+
<script type="text/javascript">
|
|
18
|
+
pathId = "MIDICommunicationsMacOS::API";
|
|
19
|
+
relpath = '../';
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
|
24
|
+
|
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
</head>
|
|
29
|
+
<body>
|
|
30
|
+
<div class="nav_wrap">
|
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
|
32
|
+
<div id="resizer"></div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div id="main" tabindex="-1">
|
|
36
|
+
<div id="header">
|
|
37
|
+
<div id="menu">
|
|
38
|
+
|
|
39
|
+
<a href="../_index.html">Index (A)</a> »
|
|
40
|
+
<span class='title'><span class='object_link'><a href="../MIDICommunicationsMacOS.html" title="MIDICommunicationsMacOS (module)">MIDICommunicationsMacOS</a></span></span>
|
|
41
|
+
»
|
|
42
|
+
<span class="title">API</span>
|
|
43
|
+
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div id="search">
|
|
47
|
+
|
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
|
49
|
+
href="../class_list.html">
|
|
50
|
+
|
|
51
|
+
<svg width="24" height="24">
|
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
|
55
|
+
</svg>
|
|
56
|
+
</a>
|
|
57
|
+
|
|
58
|
+
</div>
|
|
59
|
+
<div class="clear"></div>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<div id="content"><h1>Module: MIDICommunicationsMacOS::API
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
<span class="private note title">Private</span>
|
|
66
|
+
</h1>
|
|
67
|
+
<div class="box_info">
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
<dl>
|
|
73
|
+
<dt>Extended by:</dt>
|
|
74
|
+
<dd>FFI::Library</dd>
|
|
75
|
+
</dl>
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
<dl>
|
|
85
|
+
<dt>Defined in:</dt>
|
|
86
|
+
<dd>lib/midi-communications-macos/api.rb</dd>
|
|
87
|
+
</dl>
|
|
88
|
+
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<h2>Overview</h2><div class="docstring">
|
|
92
|
+
<div class="discussion">
|
|
93
|
+
<p class="note private">
|
|
94
|
+
<strong>This module is part of a private API.</strong>
|
|
95
|
+
You should avoid using this module if possible, as it may be removed or be changed in the future.
|
|
96
|
+
</p>
|
|
97
|
+
<p>Low-level FFI bindings to Apple's Core MIDI framework.</p>
|
|
98
|
+
|
|
99
|
+
<p>This module provides direct access to Core MIDI C functions via FFI.
|
|
100
|
+
Most users should use the higher-level <span class='object_link'><a href="Source.html" title="MIDICommunicationsMacOS::Source (class)">Source</a></span>, <span class='object_link'><a href="Destination.html" title="MIDICommunicationsMacOS::Destination (class)">Destination</a></span>, and
|
|
101
|
+
<span class='object_link'><a href="Device.html" title="MIDICommunicationsMacOS::Device (class)">Device</a></span> classes instead.</p>
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
<div class="tags">
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
</div><h2>Defined Under Namespace</h2>
|
|
110
|
+
<p class="children">
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="API/CF.html" title="MIDICommunicationsMacOS::API::CF (module)">CF</a></span>, <span class='object_link'><a href="API/HostTime.html" title="MIDICommunicationsMacOS::API::HostTime (module)">HostTime</a></span>
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="API/MIDIPacket.html" title="MIDICommunicationsMacOS::API::MIDIPacket (class)">MIDIPacket</a></span>, <span class='object_link'><a href="API/MIDIPacketList.html" title="MIDICommunicationsMacOS::API::MIDIPacketList (class)">MIDIPacketList</a></span>, <span class='object_link'><a href="API/MIDISysexSendRequest.html" title="MIDICommunicationsMacOS::API::MIDISysexSendRequest (class)">MIDISysexSendRequest</a></span>
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
</p>
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
<h2>
|
|
124
|
+
Constant Summary
|
|
125
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
|
126
|
+
</h2>
|
|
127
|
+
|
|
128
|
+
<dl class="constants">
|
|
129
|
+
|
|
130
|
+
<dt id="X86_64-constant" class="">X86_64 =
|
|
131
|
+
<div class="docstring">
|
|
132
|
+
<div class="discussion">
|
|
133
|
+
<p class="note private">
|
|
134
|
+
<strong>This constant is part of a private API.</strong>
|
|
135
|
+
You should avoid using this constant if possible, as it may be removed or be changed in the future.
|
|
136
|
+
</p>
|
|
137
|
+
<p>if osx is 10.6 or higher, there are some differences with 32 vs 64 bit handling</p>
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
<div class="tags">
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
</div>
|
|
146
|
+
</dt>
|
|
147
|
+
<dd><pre class="code"><span class='backtick'>`</span><span class='tstring_content'>uname -r</span><span class='tstring_end'>`</span></span><span class='period'>.</span><span class='id identifier rubyid_scan'>scan</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\d*\.\d*</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_to_f'>to_f</span> <span class='op'>>=</span> <span class='float'>10.6</span></pre></dd>
|
|
148
|
+
|
|
149
|
+
</dl>
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
<h2>
|
|
160
|
+
Class Method Summary
|
|
161
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
162
|
+
</h2>
|
|
163
|
+
|
|
164
|
+
<ul class="summary">
|
|
165
|
+
|
|
166
|
+
<li class="public ">
|
|
167
|
+
<span class="summary_signature">
|
|
168
|
+
|
|
169
|
+
<a href="#create_midi_client-class_method" title="create_midi_client (class method)">.<strong>create_midi_client</strong>(resource_id, name) ⇒ Object </a>
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
</span>
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
<span class="private note title">private</span>
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
184
|
+
|
|
185
|
+
</li>
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
<li class="public ">
|
|
189
|
+
<span class="summary_signature">
|
|
190
|
+
|
|
191
|
+
<a href="#create_midi_input_port-class_method" title="create_midi_input_port (class method)">.<strong>create_midi_input_port</strong>(client, resource_id, name, callback) ⇒ Object </a>
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
</span>
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
<span class="private note title">private</span>
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
206
|
+
|
|
207
|
+
</li>
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
<li class="public ">
|
|
211
|
+
<span class="summary_signature">
|
|
212
|
+
|
|
213
|
+
<a href="#create_midi_output_port-class_method" title="create_midi_output_port (class method)">.<strong>create_midi_output_port</strong>(client, resource_id, name) ⇒ Object </a>
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
</span>
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
<span class="private note title">private</span>
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
228
|
+
|
|
229
|
+
</li>
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
<li class="public ">
|
|
233
|
+
<span class="summary_signature">
|
|
234
|
+
|
|
235
|
+
<a href="#get_callback-class_method" title="get_callback (class method)">.<strong>get_callback</strong>(*args, &block) ⇒ Object </a>
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
</span>
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
<span class="private note title">private</span>
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
250
|
+
|
|
251
|
+
</li>
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
<li class="public ">
|
|
255
|
+
<span class="summary_signature">
|
|
256
|
+
|
|
257
|
+
<a href="#get_int-class_method" title="get_int (class method)">.<strong>get_int</strong>(resource, name) ⇒ Integer </a>
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
</span>
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
<span class="private note title">private</span>
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
272
|
+
|
|
273
|
+
</li>
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
<li class="public ">
|
|
277
|
+
<span class="summary_signature">
|
|
278
|
+
|
|
279
|
+
<a href="#get_midi_packet-class_method" title="get_midi_packet (class method)">.<strong>get_midi_packet</strong>(data) ⇒ Object </a>
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
</span>
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
<span class="private note title">private</span>
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
<span class="summary_desc"><div class='inline'><p>Pack the given data into a midi-communications-macos MIDI packet (used by Destination).</p>
|
|
294
|
+
</div></span>
|
|
295
|
+
|
|
296
|
+
</li>
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
<li class="public ">
|
|
300
|
+
<span class="summary_signature">
|
|
301
|
+
|
|
302
|
+
<a href="#get_midi_packet_list-class_method" title="get_midi_packet_list (class method)">.<strong>get_midi_packet_list</strong>(bytes, size) ⇒ Object </a>
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
</span>
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
<span class="private note title">private</span>
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
<span class="summary_desc"><div class='inline'><p>(used by Destination).</p>
|
|
317
|
+
</div></span>
|
|
318
|
+
|
|
319
|
+
</li>
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
<li class="public ">
|
|
323
|
+
<span class="summary_signature">
|
|
324
|
+
|
|
325
|
+
<a href="#get_string-class_method" title="get_string (class method)">.<strong>get_string</strong>(resource, name) ⇒ String </a>
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
</span>
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
<span class="private note title">private</span>
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
340
|
+
|
|
341
|
+
</li>
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
</ul>
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
<div id="class_method_details" class="method_details_list">
|
|
351
|
+
<h2>Class Method Details</h2>
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
<div class="method_details first">
|
|
355
|
+
<h3 class="signature first" id="create_midi_client-class_method">
|
|
356
|
+
|
|
357
|
+
.<strong>create_midi_client</strong>(resource_id, name) ⇒ <tt>Object</tt>
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
</h3><div class="docstring">
|
|
364
|
+
<div class="discussion">
|
|
365
|
+
<p class="note private">
|
|
366
|
+
<strong>This method is part of a private API.</strong>
|
|
367
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
368
|
+
</p>
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
</div>
|
|
372
|
+
</div>
|
|
373
|
+
<div class="tags">
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
</div><table class="source_code">
|
|
377
|
+
<tr>
|
|
378
|
+
<td>
|
|
379
|
+
<pre class="lines">
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
68
|
|
383
|
+
69
|
|
384
|
+
70
|
|
385
|
+
71
|
|
386
|
+
72
|
|
387
|
+
73
|
|
388
|
+
74
|
|
389
|
+
75
|
|
390
|
+
76
|
|
391
|
+
77</pre>
|
|
392
|
+
</td>
|
|
393
|
+
<td>
|
|
394
|
+
<pre class="code"><span class="info file"># File 'lib/midi-communications-macos/api.rb', line 68</span>
|
|
395
|
+
|
|
396
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_create_midi_client'>create_midi_client</span><span class='lparen'>(</span><span class='id identifier rubyid_resource_id'>resource_id</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
|
397
|
+
<span class='id identifier rubyid_client_name'>client_name</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="" title="MIDICommunicationsMacOS::API (module)">API</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="API/CF.html" title="MIDICommunicationsMacOS::API::CF (module)">CF</a></span></span><span class='period'>.</span><span class='const'>CFStringCreateWithCString</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Client </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_resource_id'>resource_id</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='int'>0</span><span class='rparen'>)</span>
|
|
398
|
+
<span class='id identifier rubyid_client_pointer'>client_pointer</span> <span class='op'>=</span> <span class='const'>FFI</span><span class='op'>::</span><span class='const'>MemoryPointer</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:pointer</span><span class='rparen'>)</span>
|
|
399
|
+
<span class='id identifier rubyid_error'>error</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="" title="MIDICommunicationsMacOS::API (module)">API</a></span></span><span class='period'>.</span><span class='const'>MIDIClientCreate</span><span class='lparen'>(</span><span class='id identifier rubyid_client_name'>client_name</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_client_pointer'>client_pointer</span><span class='rparen'>)</span>
|
|
400
|
+
<span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='id identifier rubyid_client_pointer'>client_pointer</span><span class='period'>.</span><span class='id identifier rubyid_read_pointer'>read_pointer</span>
|
|
401
|
+
<span class='lbrace'>{</span>
|
|
402
|
+
<span class='label'>error:</span> <span class='id identifier rubyid_error'>error</span><span class='comma'>,</span>
|
|
403
|
+
<span class='label'>resource:</span> <span class='id identifier rubyid_client'>client</span>
|
|
404
|
+
<span class='rbrace'>}</span>
|
|
405
|
+
<span class='kw'>end</span></pre>
|
|
406
|
+
</td>
|
|
407
|
+
</tr>
|
|
408
|
+
</table>
|
|
409
|
+
</div>
|
|
410
|
+
|
|
411
|
+
<div class="method_details ">
|
|
412
|
+
<h3 class="signature " id="create_midi_input_port-class_method">
|
|
413
|
+
|
|
414
|
+
.<strong>create_midi_input_port</strong>(client, resource_id, name, callback) ⇒ <tt>Object</tt>
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
</h3><div class="docstring">
|
|
421
|
+
<div class="discussion">
|
|
422
|
+
<p class="note private">
|
|
423
|
+
<strong>This method is part of a private API.</strong>
|
|
424
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
425
|
+
</p>
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
</div>
|
|
429
|
+
</div>
|
|
430
|
+
<div class="tags">
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
</div><table class="source_code">
|
|
434
|
+
<tr>
|
|
435
|
+
<td>
|
|
436
|
+
<pre class="lines">
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
79
|
|
440
|
+
80
|
|
441
|
+
81
|
|
442
|
+
82
|
|
443
|
+
83
|
|
444
|
+
84
|
|
445
|
+
85
|
|
446
|
+
86
|
|
447
|
+
87
|
|
448
|
+
88</pre>
|
|
449
|
+
</td>
|
|
450
|
+
<td>
|
|
451
|
+
<pre class="code"><span class="info file"># File 'lib/midi-communications-macos/api.rb', line 79</span>
|
|
452
|
+
|
|
453
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_create_midi_input_port'>create_midi_input_port</span><span class='lparen'>(</span><span class='id identifier rubyid_client'>client</span><span class='comma'>,</span> <span class='id identifier rubyid_resource_id'>resource_id</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_callback'>callback</span><span class='rparen'>)</span>
|
|
454
|
+
<span class='id identifier rubyid_port_name'>port_name</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="" title="MIDICommunicationsMacOS::API (module)">API</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="API/CF.html" title="MIDICommunicationsMacOS::API::CF (module)">CF</a></span></span><span class='period'>.</span><span class='const'>CFStringCreateWithCString</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Port </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_resource_id'>resource_id</span><span class='embexpr_end'>}</span><span class='tstring_content'>: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='int'>0</span><span class='rparen'>)</span>
|
|
455
|
+
<span class='id identifier rubyid_handle_ptr'>handle_ptr</span> <span class='op'>=</span> <span class='const'>FFI</span><span class='op'>::</span><span class='const'>MemoryPointer</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:pointer</span><span class='rparen'>)</span>
|
|
456
|
+
<span class='id identifier rubyid_error'>error</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="" title="MIDICommunicationsMacOS::API (module)">API</a></span></span><span class='period'>.</span><span class='const'>MIDIInputPortCreate</span><span class='lparen'>(</span><span class='id identifier rubyid_client'>client</span><span class='comma'>,</span> <span class='id identifier rubyid_port_name'>port_name</span><span class='comma'>,</span> <span class='id identifier rubyid_callback'>callback</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_handle_ptr'>handle_ptr</span><span class='rparen'>)</span>
|
|
457
|
+
<span class='id identifier rubyid_handle'>handle</span> <span class='op'>=</span> <span class='id identifier rubyid_handle_ptr'>handle_ptr</span><span class='period'>.</span><span class='id identifier rubyid_read_pointer'>read_pointer</span>
|
|
458
|
+
<span class='lbrace'>{</span>
|
|
459
|
+
<span class='label'>error:</span> <span class='id identifier rubyid_error'>error</span><span class='comma'>,</span>
|
|
460
|
+
<span class='label'>handle:</span> <span class='id identifier rubyid_handle'>handle</span>
|
|
461
|
+
<span class='rbrace'>}</span>
|
|
462
|
+
<span class='kw'>end</span></pre>
|
|
463
|
+
</td>
|
|
464
|
+
</tr>
|
|
465
|
+
</table>
|
|
466
|
+
</div>
|
|
467
|
+
|
|
468
|
+
<div class="method_details ">
|
|
469
|
+
<h3 class="signature " id="create_midi_output_port-class_method">
|
|
470
|
+
|
|
471
|
+
.<strong>create_midi_output_port</strong>(client, resource_id, name) ⇒ <tt>Object</tt>
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
</h3><div class="docstring">
|
|
478
|
+
<div class="discussion">
|
|
479
|
+
<p class="note private">
|
|
480
|
+
<strong>This method is part of a private API.</strong>
|
|
481
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
482
|
+
</p>
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
</div>
|
|
486
|
+
</div>
|
|
487
|
+
<div class="tags">
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
</div><table class="source_code">
|
|
491
|
+
<tr>
|
|
492
|
+
<td>
|
|
493
|
+
<pre class="lines">
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
90
|
|
497
|
+
91
|
|
498
|
+
92
|
|
499
|
+
93
|
|
500
|
+
94
|
|
501
|
+
95
|
|
502
|
+
96
|
|
503
|
+
97
|
|
504
|
+
98
|
|
505
|
+
99</pre>
|
|
506
|
+
</td>
|
|
507
|
+
<td>
|
|
508
|
+
<pre class="code"><span class="info file"># File 'lib/midi-communications-macos/api.rb', line 90</span>
|
|
509
|
+
|
|
510
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_create_midi_output_port'>create_midi_output_port</span><span class='lparen'>(</span><span class='id identifier rubyid_client'>client</span><span class='comma'>,</span> <span class='id identifier rubyid_resource_id'>resource_id</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
|
511
|
+
<span class='id identifier rubyid_port_name'>port_name</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="API/CF.html" title="MIDICommunicationsMacOS::API::CF (module)">CF</a></span></span><span class='period'>.</span><span class='const'>CFStringCreateWithCString</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Port </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_resource_id'>resource_id</span><span class='embexpr_end'>}</span><span class='tstring_content'>: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='int'>0</span><span class='rparen'>)</span>
|
|
512
|
+
<span class='id identifier rubyid_port_pointer'>port_pointer</span> <span class='op'>=</span> <span class='const'>FFI</span><span class='op'>::</span><span class='const'>MemoryPointer</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:pointer</span><span class='rparen'>)</span>
|
|
513
|
+
<span class='id identifier rubyid_error'>error</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="" title="MIDICommunicationsMacOS::API (module)">API</a></span></span><span class='period'>.</span><span class='const'>MIDIOutputPortCreate</span><span class='lparen'>(</span><span class='id identifier rubyid_client'>client</span><span class='comma'>,</span> <span class='id identifier rubyid_port_name'>port_name</span><span class='comma'>,</span> <span class='id identifier rubyid_port_pointer'>port_pointer</span><span class='rparen'>)</span>
|
|
514
|
+
<span class='id identifier rubyid_handle'>handle</span> <span class='op'>=</span> <span class='id identifier rubyid_port_pointer'>port_pointer</span><span class='period'>.</span><span class='id identifier rubyid_read_pointer'>read_pointer</span>
|
|
515
|
+
<span class='lbrace'>{</span>
|
|
516
|
+
<span class='label'>error:</span> <span class='id identifier rubyid_error'>error</span><span class='comma'>,</span>
|
|
517
|
+
<span class='label'>handle:</span> <span class='id identifier rubyid_handle'>handle</span>
|
|
518
|
+
<span class='rbrace'>}</span>
|
|
519
|
+
<span class='kw'>end</span></pre>
|
|
520
|
+
</td>
|
|
521
|
+
</tr>
|
|
522
|
+
</table>
|
|
523
|
+
</div>
|
|
524
|
+
|
|
525
|
+
<div class="method_details ">
|
|
526
|
+
<h3 class="signature " id="get_callback-class_method">
|
|
527
|
+
|
|
528
|
+
.<strong>get_callback</strong>(*args, &block) ⇒ <tt>Object</tt>
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
</h3><div class="docstring">
|
|
535
|
+
<div class="discussion">
|
|
536
|
+
<p class="note private">
|
|
537
|
+
<strong>This method is part of a private API.</strong>
|
|
538
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
539
|
+
</p>
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
</div>
|
|
543
|
+
</div>
|
|
544
|
+
<div class="tags">
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
</div><table class="source_code">
|
|
548
|
+
<tr>
|
|
549
|
+
<td>
|
|
550
|
+
<pre class="lines">
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
54
|
|
554
|
+
55
|
|
555
|
+
56</pre>
|
|
556
|
+
</td>
|
|
557
|
+
<td>
|
|
558
|
+
<pre class="code"><span class="info file"># File 'lib/midi-communications-macos/api.rb', line 54</span>
|
|
559
|
+
|
|
560
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_get_callback'>get_callback</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
561
|
+
<span class='const'>FFI</span><span class='op'>::</span><span class='const'>Function</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:void</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
562
|
+
<span class='kw'>end</span></pre>
|
|
563
|
+
</td>
|
|
564
|
+
</tr>
|
|
565
|
+
</table>
|
|
566
|
+
</div>
|
|
567
|
+
|
|
568
|
+
<div class="method_details ">
|
|
569
|
+
<h3 class="signature " id="get_int-class_method">
|
|
570
|
+
|
|
571
|
+
.<strong>get_int</strong>(resource, name) ⇒ <tt>Integer</tt>
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
|
|
577
|
+
</h3><div class="docstring">
|
|
578
|
+
<div class="discussion">
|
|
579
|
+
<p class="note private">
|
|
580
|
+
<strong>This method is part of a private API.</strong>
|
|
581
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
582
|
+
</p>
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
</div>
|
|
586
|
+
</div>
|
|
587
|
+
<div class="tags">
|
|
588
|
+
<p class="tag_title">Parameters:</p>
|
|
589
|
+
<ul class="param">
|
|
590
|
+
|
|
591
|
+
<li>
|
|
592
|
+
|
|
593
|
+
<span class='name'>resource</span>
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
<span class='type'>(<tt>FFI::Pointer</tt>)</span>
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
|
|
600
|
+
—
|
|
601
|
+
<div class='inline'><p>A pointer to an underlying struct</p>
|
|
602
|
+
</div>
|
|
603
|
+
|
|
604
|
+
</li>
|
|
605
|
+
|
|
606
|
+
<li>
|
|
607
|
+
|
|
608
|
+
<span class='name'>name</span>
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
<span class='type'>(<tt>String</tt>, <tt>Symbol</tt>)</span>
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
—
|
|
616
|
+
<div class='inline'><p>The property name to get</p>
|
|
617
|
+
</div>
|
|
618
|
+
|
|
619
|
+
</li>
|
|
620
|
+
|
|
621
|
+
</ul>
|
|
622
|
+
|
|
623
|
+
<p class="tag_title">Returns:</p>
|
|
624
|
+
<ul class="return">
|
|
625
|
+
|
|
626
|
+
<li>
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
</li>
|
|
634
|
+
|
|
635
|
+
</ul>
|
|
636
|
+
|
|
637
|
+
</div><table class="source_code">
|
|
638
|
+
<tr>
|
|
639
|
+
<td>
|
|
640
|
+
<pre class="lines">
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
118
|
|
644
|
+
119
|
|
645
|
+
120
|
|
646
|
+
121
|
|
647
|
+
122
|
|
648
|
+
123</pre>
|
|
649
|
+
</td>
|
|
650
|
+
<td>
|
|
651
|
+
<pre class="code"><span class="info file"># File 'lib/midi-communications-macos/api.rb', line 118</span>
|
|
652
|
+
|
|
653
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_get_int'>get_int</span><span class='lparen'>(</span><span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
|
654
|
+
<span class='id identifier rubyid_property'>property</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="" title="MIDICommunicationsMacOS::API (module)">API</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="API/CF.html" title="MIDICommunicationsMacOS::API::CF (module)">CF</a></span></span><span class='period'>.</span><span class='const'>CFStringCreateWithCString</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='comma'>,</span> <span class='int'>0</span><span class='rparen'>)</span>
|
|
655
|
+
<span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='const'>FFI</span><span class='op'>::</span><span class='const'>MemoryPointer</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:pointer</span><span class='comma'>,</span> <span class='int'>32</span><span class='rparen'>)</span>
|
|
656
|
+
<span class='const'><span class='object_link'><a href="" title="MIDICommunicationsMacOS::API (module)">API</a></span></span><span class='op'>::</span><span class='const'>MIDIObjectGetIntegerProperty</span><span class='lparen'>(</span><span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='id identifier rubyid_property'>property</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
|
657
|
+
<span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_read_int'>read_int</span>
|
|
658
|
+
<span class='kw'>end</span></pre>
|
|
659
|
+
</td>
|
|
660
|
+
</tr>
|
|
661
|
+
</table>
|
|
662
|
+
</div>
|
|
663
|
+
|
|
664
|
+
<div class="method_details ">
|
|
665
|
+
<h3 class="signature " id="get_midi_packet-class_method">
|
|
666
|
+
|
|
667
|
+
.<strong>get_midi_packet</strong>(data) ⇒ <tt>Object</tt>
|
|
668
|
+
|
|
669
|
+
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
</h3><div class="docstring">
|
|
674
|
+
<div class="discussion">
|
|
675
|
+
<p class="note private">
|
|
676
|
+
<strong>This method is part of a private API.</strong>
|
|
677
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
678
|
+
</p>
|
|
679
|
+
<p>Pack the given data into a midi-communications-macos MIDI packet (used by Destination)</p>
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
</div>
|
|
683
|
+
</div>
|
|
684
|
+
<div class="tags">
|
|
685
|
+
|
|
686
|
+
|
|
687
|
+
</div><table class="source_code">
|
|
688
|
+
<tr>
|
|
689
|
+
<td>
|
|
690
|
+
<pre class="lines">
|
|
691
|
+
|
|
692
|
+
|
|
693
|
+
59
|
|
694
|
+
60
|
|
695
|
+
61
|
|
696
|
+
62
|
|
697
|
+
63
|
|
698
|
+
64
|
|
699
|
+
65
|
|
700
|
+
66</pre>
|
|
701
|
+
</td>
|
|
702
|
+
<td>
|
|
703
|
+
<pre class="code"><span class="info file"># File 'lib/midi-communications-macos/api.rb', line 59</span>
|
|
704
|
+
|
|
705
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_get_midi_packet'>get_midi_packet</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
|
706
|
+
<span class='id identifier rubyid_format'>format</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>C</span><span class='tstring_end'>'</span></span> <span class='op'>*</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span>
|
|
707
|
+
<span class='id identifier rubyid_packed_data'>packed_data</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_pack'>pack</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span>
|
|
708
|
+
<span class='id identifier rubyid_char_size'>char_size</span> <span class='op'>=</span> <span class='const'>FFI</span><span class='period'>.</span><span class='id identifier rubyid_type_size'>type_size</span><span class='lparen'>(</span><span class='symbol'>:char</span><span class='rparen'>)</span> <span class='op'>*</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span>
|
|
709
|
+
<span class='id identifier rubyid_bytes'>bytes</span> <span class='op'>=</span> <span class='const'>FFI</span><span class='op'>::</span><span class='const'>MemoryPointer</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_char_size'>char_size</span><span class='rparen'>)</span>
|
|
710
|
+
<span class='id identifier rubyid_bytes'>bytes</span><span class='period'>.</span><span class='id identifier rubyid_write_string'>write_string</span><span class='lparen'>(</span><span class='id identifier rubyid_packed_data'>packed_data</span><span class='rparen'>)</span>
|
|
711
|
+
<span class='id identifier rubyid_bytes'>bytes</span>
|
|
712
|
+
<span class='kw'>end</span></pre>
|
|
713
|
+
</td>
|
|
714
|
+
</tr>
|
|
715
|
+
</table>
|
|
716
|
+
</div>
|
|
717
|
+
|
|
718
|
+
<div class="method_details ">
|
|
719
|
+
<h3 class="signature " id="get_midi_packet_list-class_method">
|
|
720
|
+
|
|
721
|
+
.<strong>get_midi_packet_list</strong>(bytes, size) ⇒ <tt>Object</tt>
|
|
722
|
+
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
|
|
727
|
+
</h3><div class="docstring">
|
|
728
|
+
<div class="discussion">
|
|
729
|
+
<p class="note private">
|
|
730
|
+
<strong>This method is part of a private API.</strong>
|
|
731
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
732
|
+
</p>
|
|
733
|
+
<p>(used by Destination)</p>
|
|
734
|
+
|
|
735
|
+
|
|
736
|
+
</div>
|
|
737
|
+
</div>
|
|
738
|
+
<div class="tags">
|
|
739
|
+
|
|
740
|
+
|
|
741
|
+
</div><table class="source_code">
|
|
742
|
+
<tr>
|
|
743
|
+
<td>
|
|
744
|
+
<pre class="lines">
|
|
745
|
+
|
|
746
|
+
|
|
747
|
+
102
|
|
748
|
+
103
|
|
749
|
+
104
|
|
750
|
+
105
|
|
751
|
+
106
|
|
752
|
+
107
|
|
753
|
+
108
|
|
754
|
+
109
|
|
755
|
+
110
|
|
756
|
+
111
|
|
757
|
+
112
|
|
758
|
+
113</pre>
|
|
759
|
+
</td>
|
|
760
|
+
<td>
|
|
761
|
+
<pre class="code"><span class="info file"># File 'lib/midi-communications-macos/api.rb', line 102</span>
|
|
762
|
+
|
|
763
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_get_midi_packet_list'>get_midi_packet_list</span><span class='lparen'>(</span><span class='id identifier rubyid_bytes'>bytes</span><span class='comma'>,</span> <span class='id identifier rubyid_size'>size</span><span class='rparen'>)</span>
|
|
764
|
+
<span class='id identifier rubyid_packet_list'>packet_list</span> <span class='op'>=</span> <span class='const'>FFI</span><span class='op'>::</span><span class='const'>MemoryPointer</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='int'>256</span><span class='rparen'>)</span>
|
|
765
|
+
<span class='id identifier rubyid_packet_ptr'>packet_ptr</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="" title="MIDICommunicationsMacOS::API (module)">API</a></span></span><span class='period'>.</span><span class='const'>MIDIPacketListInit</span><span class='lparen'>(</span><span class='id identifier rubyid_packet_list'>packet_list</span><span class='rparen'>)</span>
|
|
766
|
+
<span class='id identifier rubyid_time'>time</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="API/HostTime.html" title="MIDICommunicationsMacOS::API::HostTime (module)">HostTime</a></span></span><span class='period'>.</span><span class='const'>AudioGetCurrentHostTime</span>
|
|
767
|
+
<span class='kw'>if</span> <span class='const'><span class='object_link'><a href="#X86_64-constant" title="MIDICommunicationsMacOS::API::X86_64 (constant)">X86_64</a></span></span>
|
|
768
|
+
<span class='const'><span class='object_link'><a href="" title="MIDICommunicationsMacOS::API (module)">API</a></span></span><span class='period'>.</span><span class='const'>MIDIPacketListAdd</span><span class='lparen'>(</span><span class='id identifier rubyid_packet_list'>packet_list</span><span class='comma'>,</span> <span class='int'>256</span><span class='comma'>,</span> <span class='id identifier rubyid_packet_ptr'>packet_ptr</span><span class='comma'>,</span> <span class='id identifier rubyid_time'>time</span><span class='comma'>,</span> <span class='id identifier rubyid_size'>size</span><span class='comma'>,</span> <span class='id identifier rubyid_bytes'>bytes</span><span class='rparen'>)</span>
|
|
769
|
+
<span class='kw'>else</span>
|
|
770
|
+
<span class='comment'># Pass in two 32-bit 0s for the 64 bit time
|
|
771
|
+
</span> <span class='const'><span class='object_link'><a href="" title="MIDICommunicationsMacOS::API (module)">API</a></span></span><span class='period'>.</span><span class='const'>MIDIPacketListAdd</span><span class='lparen'>(</span><span class='id identifier rubyid_packet_list'>packet_list</span><span class='comma'>,</span> <span class='int'>256</span><span class='comma'>,</span> <span class='id identifier rubyid_packet_ptr'>packet_ptr</span><span class='comma'>,</span> <span class='id identifier rubyid_time'>time</span> <span class='op'>>></span> <span class='int'>32</span><span class='comma'>,</span> <span class='id identifier rubyid_time'>time</span> <span class='op'>&</span> <span class='int'>0xFFFFFFFF</span><span class='comma'>,</span> <span class='id identifier rubyid_size'>size</span><span class='comma'>,</span> <span class='id identifier rubyid_bytes'>bytes</span><span class='rparen'>)</span>
|
|
772
|
+
<span class='kw'>end</span>
|
|
773
|
+
<span class='id identifier rubyid_packet_list'>packet_list</span>
|
|
774
|
+
<span class='kw'>end</span></pre>
|
|
775
|
+
</td>
|
|
776
|
+
</tr>
|
|
777
|
+
</table>
|
|
778
|
+
</div>
|
|
779
|
+
|
|
780
|
+
<div class="method_details ">
|
|
781
|
+
<h3 class="signature " id="get_string-class_method">
|
|
782
|
+
|
|
783
|
+
.<strong>get_string</strong>(resource, name) ⇒ <tt>String</tt>
|
|
784
|
+
|
|
785
|
+
|
|
786
|
+
|
|
787
|
+
|
|
788
|
+
|
|
789
|
+
</h3><div class="docstring">
|
|
790
|
+
<div class="discussion">
|
|
791
|
+
<p class="note private">
|
|
792
|
+
<strong>This method is part of a private API.</strong>
|
|
793
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
794
|
+
</p>
|
|
795
|
+
|
|
796
|
+
|
|
797
|
+
</div>
|
|
798
|
+
</div>
|
|
799
|
+
<div class="tags">
|
|
800
|
+
<p class="tag_title">Parameters:</p>
|
|
801
|
+
<ul class="param">
|
|
802
|
+
|
|
803
|
+
<li>
|
|
804
|
+
|
|
805
|
+
<span class='name'>resource</span>
|
|
806
|
+
|
|
807
|
+
|
|
808
|
+
<span class='type'>(<tt>FFI::Pointer</tt>)</span>
|
|
809
|
+
|
|
810
|
+
|
|
811
|
+
|
|
812
|
+
—
|
|
813
|
+
<div class='inline'><p>A pointer to an underlying struct</p>
|
|
814
|
+
</div>
|
|
815
|
+
|
|
816
|
+
</li>
|
|
817
|
+
|
|
818
|
+
<li>
|
|
819
|
+
|
|
820
|
+
<span class='name'>name</span>
|
|
821
|
+
|
|
822
|
+
|
|
823
|
+
<span class='type'>(<tt>String</tt>, <tt>Symbol</tt>)</span>
|
|
824
|
+
|
|
825
|
+
|
|
826
|
+
|
|
827
|
+
—
|
|
828
|
+
<div class='inline'><p>The property name to get</p>
|
|
829
|
+
</div>
|
|
830
|
+
|
|
831
|
+
</li>
|
|
832
|
+
|
|
833
|
+
</ul>
|
|
834
|
+
|
|
835
|
+
<p class="tag_title">Returns:</p>
|
|
836
|
+
<ul class="return">
|
|
837
|
+
|
|
838
|
+
<li>
|
|
839
|
+
|
|
840
|
+
|
|
841
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
842
|
+
|
|
843
|
+
|
|
844
|
+
|
|
845
|
+
</li>
|
|
846
|
+
|
|
847
|
+
</ul>
|
|
848
|
+
|
|
849
|
+
</div><table class="source_code">
|
|
850
|
+
<tr>
|
|
851
|
+
<td>
|
|
852
|
+
<pre class="lines">
|
|
853
|
+
|
|
854
|
+
|
|
855
|
+
128
|
|
856
|
+
129
|
|
857
|
+
130
|
|
858
|
+
131
|
|
859
|
+
132
|
|
860
|
+
133
|
|
861
|
+
134
|
|
862
|
+
135
|
|
863
|
+
136
|
|
864
|
+
137
|
|
865
|
+
138
|
|
866
|
+
139
|
|
867
|
+
140
|
|
868
|
+
141
|
|
869
|
+
142
|
|
870
|
+
143
|
|
871
|
+
144
|
|
872
|
+
145</pre>
|
|
873
|
+
</td>
|
|
874
|
+
<td>
|
|
875
|
+
<pre class="code"><span class="info file"># File 'lib/midi-communications-macos/api.rb', line 128</span>
|
|
876
|
+
|
|
877
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_get_string'>get_string</span><span class='lparen'>(</span><span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
|
878
|
+
<span class='id identifier rubyid_property'>property</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="API/CF.html" title="MIDICommunicationsMacOS::API::CF (module)">CF</a></span></span><span class='period'>.</span><span class='const'>CFStringCreateWithCString</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='comma'>,</span> <span class='int'>0</span><span class='rparen'>)</span>
|
|
879
|
+
<span class='kw'>begin</span>
|
|
880
|
+
<span class='id identifier rubyid_pointer'>pointer</span> <span class='op'>=</span> <span class='const'>FFI</span><span class='op'>::</span><span class='const'>MemoryPointer</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:pointer</span><span class='rparen'>)</span>
|
|
881
|
+
<span class='const'>MIDIObjectGetStringProperty</span><span class='lparen'>(</span><span class='id identifier rubyid_resource'>resource</span><span class='comma'>,</span> <span class='id identifier rubyid_property'>property</span><span class='comma'>,</span> <span class='id identifier rubyid_pointer'>pointer</span><span class='rparen'>)</span>
|
|
882
|
+
<span class='id identifier rubyid_string'>string</span> <span class='op'>=</span> <span class='id identifier rubyid_pointer'>pointer</span><span class='period'>.</span><span class='id identifier rubyid_read_pointer'>read_pointer</span>
|
|
883
|
+
<span class='id identifier rubyid_length'>length</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="API/CF.html" title="MIDICommunicationsMacOS::API::CF (module)">CF</a></span></span><span class='period'>.</span><span class='const'>CFStringGetMaximumSizeForEncoding</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="API/CF.html" title="MIDICommunicationsMacOS::API::CF (module)">CF</a></span></span><span class='period'>.</span><span class='const'>CFStringGetLength</span><span class='lparen'>(</span><span class='id identifier rubyid_string'>string</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='symbol'>:kCFStringEncodingUTF8</span><span class='rparen'>)</span>
|
|
884
|
+
|
|
885
|
+
<span class='id identifier rubyid_bytes'>bytes</span> <span class='op'>=</span> <span class='const'>FFI</span><span class='op'>::</span><span class='const'>MemoryPointer</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_length'>length</span> <span class='op'>+</span> <span class='int'>1</span><span class='rparen'>)</span>
|
|
886
|
+
|
|
887
|
+
<span class='kw'>if</span> <span class='const'><span class='object_link'><a href="API/CF.html" title="MIDICommunicationsMacOS::API::CF (module)">CF</a></span></span><span class='period'>.</span><span class='const'>CFStringGetCString</span><span class='lparen'>(</span><span class='id identifier rubyid_string'>string</span><span class='comma'>,</span> <span class='id identifier rubyid_bytes'>bytes</span><span class='comma'>,</span> <span class='id identifier rubyid_length'>length</span> <span class='op'>+</span> <span class='int'>1</span><span class='comma'>,</span> <span class='symbol'>:kCFStringEncodingUTF8</span><span class='rparen'>)</span>
|
|
888
|
+
<span class='id identifier rubyid_bytes'>bytes</span><span class='period'>.</span><span class='id identifier rubyid_read_string'>read_string</span><span class='period'>.</span><span class='id identifier rubyid_force_encoding'>force_encoding</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>utf-8</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|
889
|
+
<span class='kw'>end</span>
|
|
890
|
+
<span class='kw'>ensure</span>
|
|
891
|
+
<span class='const'><span class='object_link'><a href="API/CF.html" title="MIDICommunicationsMacOS::API::CF (module)">CF</a></span></span><span class='period'>.</span><span class='const'>CFRelease</span><span class='lparen'>(</span><span class='id identifier rubyid_string'>string</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_string'>string</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_string'>string</span><span class='period'>.</span><span class='id identifier rubyid_null?'>null?</span>
|
|
892
|
+
<span class='const'><span class='object_link'><a href="API/CF.html" title="MIDICommunicationsMacOS::API::CF (module)">CF</a></span></span><span class='period'>.</span><span class='const'>CFRelease</span><span class='lparen'>(</span><span class='id identifier rubyid_property'>property</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_property'>property</span><span class='period'>.</span><span class='id identifier rubyid_null?'>null?</span>
|
|
893
|
+
<span class='kw'>end</span>
|
|
894
|
+
<span class='kw'>end</span></pre>
|
|
895
|
+
</td>
|
|
896
|
+
</tr>
|
|
897
|
+
</table>
|
|
898
|
+
</div>
|
|
899
|
+
|
|
900
|
+
</div>
|
|
901
|
+
|
|
902
|
+
</div>
|
|
903
|
+
|
|
904
|
+
<div id="footer">
|
|
905
|
+
Generated on Tue Nov 25 11:37:07 2025 by
|
|
906
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
907
|
+
0.9.37 (ruby-3.4.7).
|
|
908
|
+
</div>
|
|
909
|
+
|
|
910
|
+
</div>
|
|
911
|
+
</body>
|
|
912
|
+
</html>
|