Recent

Author Topic: [SOLVED] Adding new audio Object to Cocoa Bindings for Objective-Pascal  (Read 3162 times)

lor

  • New Member
  • *
  • Posts: 26
I would like to add (for myself), or have the proper maintainer (for everyone) add the Mac OS X bindings to the new audio class "AVAudioPlayer".  I've written a unit in Objective Pascal which can/will use that class to provide a very simple audio player for Lazarus projects. However, it doesn't succeed linking due apparently to the lack of AVAudioPlayer presence in the Cocoa bindings. The two other classes used by the unit, NSData and NSError, do link okay, so I'm pretty sure my structure is 'sound' if you'll excuse the pun. If I am permitted to experiment for myself with the OS X API bindings on my own machine, I'd ask for directions to locate the library or code in which the bindings are implemented. AVAudioPlayer is a direct descendant of NSObject, and is quite simple as classes go, with only a few methods and properties to register, so the process might be relatively simple, especially in context of all the other bindings in that code. Thanks for any suggestions or assistance you can offer.
« Last Edit: March 08, 2015, 05:10:01 am by skalogryz »

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Adding new audio Object to Cocoa Bindings for Objective-Pascal
« Reply #1 on: March 08, 2015, 02:42:10 am »
I presume you just didn't add the instruction to link the framework.

try to add the following code to the beginning of the unit:
Code: [Select]
{$linkframework AVFoundation}
« Last Edit: March 08, 2015, 02:44:50 am by skalogryz »

lor

  • New Member
  • *
  • Posts: 26
Re: Adding new audio Object to Cocoa Bindings for Objective-Pascal
« Reply #2 on: March 08, 2015, 03:44:25 am »
Thank you. Indeed a hero. It now builds without a problem, so I can at least proceed to testing it!

And by the way, I realize the AVAudioPlayer is not exactly a Cocoa product, but I figured the binding could be done there anyway.  However, your suggestion eliminated the need for that. Let me proceed now to see how well it actually works.  Lots to learn in here! 

 

TinyPortal © 2005-2018