I found out that by trying to implement the MIDI. iOS have very good support to play MIDI, but you can’t use it from the Delphi. But there is a way how you can add it.
XCode gives headers of all frameworks. They are stored at your Mac under /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/<version>
I created tool to convert the .h files to .pas.
To use each of the framework you need to do following:
1) Download the PAS code for framework that you want to use from my pages.
2) Copy the framework code from Mac to your PC where you has Delphi to path: c:\Users\your username>\Documents\RAD Studio\SDKs\<Version>\System\Library\Frameworks\ (the path can be different per installation and version of your OS, but you will find it).
You need the code from Mac only for deployment to real device. if you target the simulator, it’s not needed.
if you are missing some framework, please let me know, I’ll try build it for you. Once I’ll feel that my conversion tool is ready to be used by someone else, I’ll release it too.
I’m going to add more units as I’ll build them or as people will ask me.
|iOS/Mac Framework Name||Link to download||Converted||Tested|
|CoreAudio||iOSapi.CoreAudioTypes||P/J on 10. Dec 2013|
|CoreMidi||iOSapi.CoreMidi||P/J on 10. Dec 2013|
|AudioUnit||iOSapi.AudioUnit||P/J on 10. Dec 2013||works only on simulator!|
|AudioToolbox||iOSapi.AudioToolbox||P/J on 10. Dec 2013||Because of relation to AudioUnit works only on simulator!|
Now little bit about the conversion tool.
I write this tool as I didn’t want to convert the code manually. It would be lot of work and of course there will be lot of mistakes.
I was using two sources
1) the existing Delphi’s unit implementing iOS frameworks compared to the original .h files
2) This brilliant analyze describing how to convert from C to Delphi. Especially for conversion of the arrays and unions. Thank you Rudy!!
Currently I can convert the regular C code not the ObjectiveC because my target is the MIDI and those are written under .h.
My conversion tool is tested only on the Apple’s .h units so it does expect certain pattern. It may not work with any .h unit, but on other hand this can be added.
Enjoy my work.