[Buffalo-pm] Using a C API with Perl...

Kevin Eye eye at buffalo.edu
Thu Apr 6 14:02:21 PDT 2006


My suggestion would be that if what you're doing is just wrapping more of
the CoreMIDI API, I'd try to add it to the existing perl module. For one
thing, all the setup of the XS would be half done and there would be plenty
of examples to follow. For another, you could easily submit your additions.

If if makes more sense to keep it separate, I'd recommend the Inline suite
over XS. I've never used XS, but I've used Inline::C a lot and it couldn't
be easier (unless you're on Windows). However, are the OS X APIs available
in C, or do you have to use Objective C, which is quite different?

Also, you can look into two projects, "CamelBones" and "PerlObjCBridge" (man
PerlObjCBridge on your OS X box). I've never used Cocoa or Objective C
enough for them to make sense to me, but I think they intend to expose all
of Cocoa to Perl.

 - Kevin


On 4/6/06 3:38 PM, "DANIEL MAGNUSZEWSKI" <dmagnuszewski at mandtbank.com>
wrote:

> Cool, I'll check it out - I forgot about inline. Would Inline be the way
> to go if I wanted to write a Perl wrapper for the API, aka, writing a
> Perl API?
> 
> The API that I need to use is the CoreMIDI framework within the
> CoreAudio SDK
> (http://developer.apple.com/documentation/MusicAudio/Reference/CACoreMIDIRef/i
> ndex.html).
> The CoreMIDI framework vends C API for both discovering MIDI devices and
> sending MIDI data to those devices using the API.
> 
> There is currently a module out there called Mac::CoreMIDI
> (http://search.cpan.org/~crenz/Mac-CoreMIDI-0.04/lib/Mac/CoreMIDI.pm)
> that is a XS Interface for the Mac OS X CoreMIDI API, but it does not
> deal with sending out MIDI data to a destination - which is what I need
> it to do!
> 
> -Dan
> 
>>>> "Jim Brandt" <cbrandt at buffalo.edu> 04/06/06 3:09 PM >>>
> Does this help?
> 
> http://search.cpan.org/~ingy/Inline-0.44/
> 
> If you want to run other code from Perl programs, Inline is the way to
> go.
> 
> APIs to what?
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Buffalo-pm mailing list
> Buffalo-pm at pm.org
> http://mail.pm.org/mailman/listinfo/buffalo-pm

-- 
Kevin Eye
Web Applications Developer
Marketing and Creative Services
University at Buffalo
330 Crofts Hall
Buffalo, NY 14260
eye at buffalo.edu
phone (716) 645-5000 x1435
fax (716) 645-3765




More information about the Buffalo-pm mailing list