ffi-coremidi 0.3.7 → 0.3.8

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/coremidi.rb +4 -4
  3. data/lib/coremidi/api.rb +13 -10
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 78f0f4a2f28a88dbd7e30dd04170431576b8a2d2
4
- data.tar.gz: 3391e7c3b510ac72d803193c6d2c7985ab22beb1
3
+ metadata.gz: b89ec50ebb1e9fd6bca17f28dbfb065e85edb4ee
4
+ data.tar.gz: d213dd0c938562dab97afe5d262fec5fcb1b491d
5
5
  SHA512:
6
- metadata.gz: e0bb791847a60cdfa3b1d1e6e63382b2bfb650bb2777423626c4a5e46ac6edeba34a5daae5c4824ff0e3f1d4d53ff75bc33541dd60f625cbf59ed2bf32ec8308
7
- data.tar.gz: 951c94ece0cc49abec4170fb955a82977510a46a88980f1798acedb5757acbb9711b0784fe4350296919b39e1b0adf21f97a58dba0bd0c2275418ae636ee4f6a
6
+ metadata.gz: 810f3b9da5ec4e3bc9f85962fc82e56fa6e41fb022bae10364bdf57285b3a8d448a770eac869955f522f23fb6a6ded6c314eb6a924d5453eabad8cdbfd840323
7
+ data.tar.gz: e7f2022a340fe38364d409e4c26cf30a5721cd367e9174a8b3c57f38bd1441f5e9ece9337a505a0aa2a775ae247e45832e1e1abb643e3b224a7b3701ebfc0adc
@@ -3,21 +3,21 @@
3
3
  # Realtime MIDI IO with Ruby for OSX
4
4
  # (c)2011-2015 Ari Russo
5
5
 
6
- # libs
6
+ # Libs
7
7
  require "ffi"
8
8
  require "forwardable"
9
9
 
10
- # modules
10
+ # Modules
11
11
  require "coremidi/api"
12
12
  require "coremidi/endpoint"
13
13
  require "coremidi/type_conversion"
14
14
 
15
- # classes
15
+ # Classes
16
16
  require "coremidi/entity"
17
17
  require "coremidi/device"
18
18
  require "coremidi/source"
19
19
  require "coremidi/destination"
20
20
 
21
21
  module CoreMIDI
22
- VERSION = "0.3.7"
22
+ VERSION = "0.3.8"
23
23
  end
@@ -77,7 +77,7 @@ module CoreMIDI
77
77
  handle_ptr = FFI::MemoryPointer.new(:pointer)
78
78
  error = API.MIDIInputPortCreate(client, port_name, callback, nil, handle_ptr)
79
79
  handle = handle_ptr.read_pointer
80
- {
80
+ {
81
81
  :error => error,
82
82
  :handle => handle
83
83
  }
@@ -98,11 +98,12 @@ module CoreMIDI
98
98
  def self.get_midi_packet_list(bytes, size)
99
99
  packet_list = FFI::MemoryPointer.new(256)
100
100
  packet_ptr = API.MIDIPacketListInit(packet_list)
101
+ time = HostTime.AudioGetCurrentHostTime
101
102
  packet_ptr = if X86_64
102
- API.MIDIPacketListAdd(packet_list, 256, packet_ptr, 0, size, bytes)
103
+ API.MIDIPacketListAdd(packet_list, 256, packet_ptr, time, size, bytes)
103
104
  else
104
105
  # Pass in two 32-bit 0s for the 64 bit time
105
- API.MIDIPacketListAdd(packet_list, 256, packet_ptr, 0, 0, size, bytes)
106
+ time1 = API.MIDIPacketListAdd(packet_list, 256, packet_ptr, time >> 32, time & 0xFFFFFFFF, size, bytes)
106
107
  end
107
108
  packet_list
108
109
  end
@@ -160,7 +161,7 @@ module CoreMIDI
160
161
 
161
162
  # MIDIEndpointRef MIDIEntityGetDestination(MIDIEntityRef entity, ItemCount destIndex0);
162
163
  attach_function :MIDIGetDestination, [:int], :pointer
163
-
164
+
164
165
  #extern OSStatus MIDIEndpointDispose( MIDIEndpointRef endpt );
165
166
  attach_function :MIDIEndpointDispose, [:MIDIEndpointRef], :OSStatus
166
167
 
@@ -178,8 +179,8 @@ module CoreMIDI
178
179
 
179
180
  # MIDIDeviceRef MIDIGetDevice(ItemCount deviceIndex0);
180
181
  attach_function :MIDIGetDevice, [:ItemCount], :MIDIDeviceRef
181
-
182
- # extern OSStatus MIDIInputPortCreate( MIDIClientRef client, CFStringRef portName,
182
+
183
+ # extern OSStatus MIDIInputPortCreate( MIDIClientRef client, CFStringRef portName,
183
184
  # MIDIReadProc readProc, void * refCon, MIDIPortRef * outPort );
184
185
  attach_function :MIDIInputPortCreate, [:MIDIClientRef, :CFStringRef, :MIDIReadProc, :pointer, :MIDIPortRef], :OSStatus
185
186
 
@@ -188,7 +189,7 @@ module CoreMIDI
188
189
 
189
190
  # OSStatus MIDIObjectGetStringProperty (MIDIObjectRef obj, CFStringRef propertyID, CFStringRef *str);
190
191
  attach_function :MIDIObjectGetStringProperty, [:MIDIObjectRef, :CFStringRef, :pointer], :OSStatus
191
-
192
+
192
193
  # extern OSStatus MIDIOutputPortCreate( MIDIClientRef client, CFStringRef portName, MIDIPortRef * outPort );
193
194
  attach_function :MIDIOutputPortCreate, [:MIDIClientRef, :CFStringRef, :pointer], :int
194
195
 
@@ -210,11 +211,11 @@ module CoreMIDI
210
211
  #OSStatus MIDISendSysex(MIDISysexSendRequest *request);
211
212
  attach_function :MIDISendSysex, [:pointer], :int
212
213
 
213
- # extern MIDIPacket * MIDIPacketListAdd( MIDIPacketList * pktlist, ByteCount listSize,
214
- # MIDIPacket * curPacket, MIDITimeStamp time,
214
+ # extern MIDIPacket * MIDIPacketListAdd( MIDIPacketList * pktlist, ByteCount listSize,
215
+ # MIDIPacket * curPacket, MIDITimeStamp time,
215
216
  # ByteCount nData, const Byte * data)
216
217
  if X86_64
217
- attach_function :MIDIPacketListAdd, [:pointer, :int, :pointer, :int, :int, :pointer], :pointer
218
+ attach_function :MIDIPacketListAdd, [:pointer, :int, :pointer, :uint64, :int, :pointer], :pointer
218
219
  else
219
220
  attach_function :MIDIPacketListAdd, [:pointer, :int, :pointer, :int, :int, :int, :pointer], :pointer
220
221
  end
@@ -253,6 +254,8 @@ module CoreMIDI
253
254
 
254
255
  # UInt64 AudioConvertHostTimeToNanos(UInt64 IO)
255
256
  attach_function :AudioConvertHostTimeToNanos, [:uint64], :uint64
257
+ # UInt64 AudioGetCurrentHostTime()
258
+ attach_function :AudioGetCurrentHostTime, [], :uint64
256
259
  end
257
260
 
258
261
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi-coremidi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ari Russo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-03 00:00:00.000000000 Z
11
+ date: 2015-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  version: 1.3.6
151
151
  requirements: []
152
152
  rubyforge_project: ffi-coremidi
153
- rubygems_version: 2.2.2
153
+ rubygems_version: 2.4.6
154
154
  signing_key:
155
155
  specification_version: 4
156
156
  summary: Realtime MIDI IO with Ruby for OSX