Permalink
Browse files

Merge branch 'snow-leopard-fix' of https://github.com/chubas/midiator

…into chubas-snow-leopard-fix
  • Loading branch information...
2 parents ab668aa + 117bdc6 commit cbfe71abd97a6b501b344b9dd88490ee091efb0e @bleything committed Jan 26, 2011
Showing with 14 additions and 2 deletions.
  1. +14 −2 lib/midiator/drivers/core_midi.rb
@@ -22,6 +22,10 @@
require 'midiator/driver_registry'
class MIDIator::Driver::CoreMIDI < MIDIator::Driver # :nodoc:
+
+ # Figure out if we have SnowLeopard
+ SNOW_LEOPARD = `uname -r` =~ /10\.\d\.\d/
+
##########################################################################
### S Y S T E M I N T E R F A C E
##########################################################################
@@ -35,7 +39,11 @@ module C # :nodoc:
extern "void* MIDIGetDestination( int )"
extern "int MIDIOutputPortCreate( void*, void*, void* )"
extern "void* MIDIPacketListInit( void* )"
- extern "void* MIDIPacketListAdd( void*, int, void*, int, int, int, void* )"
+ if SNOW_LEOPARD
+ extern "void* MIDIPacketListAdd( void*, int, void*, int, int, void* )"
+ else
+ extern "void* MIDIPacketListAdd( void*, int, void*, int, int, int, void* )"
+ end
extern "int MIDISend( void*, void*, void* )"
end
@@ -75,7 +83,11 @@ def message( *args )
packet_ptr = C.mIDIPacketListInit( packet_list )
# Pass in two 32-bit 0s for the 64 bit time
- packet_ptr = C.mIDIPacketListAdd( packet_list, 256, packet_ptr, 0, 0, args.size, bytes )
+ if SNOW_LEOPARD
+ packet_ptr = C.mIDIPacketListAdd( packet_list, 256, packet_ptr, 0, args.size, bytes )
+ else
+ packet_ptr = C.mIDIPacketListAdd( packet_list, 256, packet_ptr, 0, 0, args.size, bytes )
+ end
C.mIDISend( @outport, @destination, packet_list )
end

0 comments on commit cbfe71a

Please sign in to comment.