On 27 Jul 2007, at 19:48, Michael Williams wrote:

> Note:  This is a repost per Joe Strout's suggestion to post to the
> "plugins" list.  Joe has replied, but I'd also like to get the list's
> thoughts.
>
>
>
>
> Hi All,
>
> I'm currently developing a program that requires the use of a few odd
> file formats (e.g. FITS, etc.). Obviously RB doesn't support opening
> or manipulating this file format (does it?). Therefore I need to
> incorporate the functionality of an existing C/C++ library (as a
> plugin or otherwise) into my RB project.
>
> I need this to be cross-platform.

It's annoying and awkward. A lot of work to set up!

I'll tell you my setup.

One MacBookPro. Parallels. Linux and WinXP installed on Parallels.

I use CodeWarrior to cross-compile for Win32 on MacOSX. I use gcc on  
Linux, with a makefile I wrote myself. For Mac, I use Xcode.

Then, I compile the plugin on each platform, and the results go into  
an "ElfData" folder on the Mac! With linux, I've set up file-sharing  
so it goes into the right folder on the Mac side. Then I turn that  
into an RB plugin using plugin converter. Yes it's all one plugin.  
The RB plugin format is a "virtual volume" so you can put multiple  
files in one plugin.

I mostly test on the Mac, but I test at least once for all. I had to  
write a long big testing suite, that auto-tests my plugin! As long as  
my "unit test" app works, I'm fine!

Phew. What an effort.

If you want to make it easier... just do it for one platform, and  
then port the plugin to the others ;)

> Will I need to create separate
> plugins for each? I'd prefer the MBS approach in having only one
> plugin that is cross-platform. How, exactly, is this achieved?

RB plugin converter, as mentioned above.

> Will I
> need to map each and every function manually or is the plugin system
> intuitive enough to expose functionality?

Nope. You gotta map each one individually! :) Nice eh?

> I've been looking through the SDK documentation but it doesn't seem
> very well organized or up to date.

I think it's up to date. Organised.... not so sure what you are  
after. Certainly it doesn't leave us with a simple job ahead of us.  
But then we are plugin developers, not REALbasic developers.

> If possible, I'd appreciate a tutorial or some information that
> provides direction from beginning to end in a *clear*, *concise*
> manner

I just gave one? :P

> on how to include an entire existing C/C++ library into an RB
> project.

Just add the source code to your project. In Xcode you drag the files  
to the files area....

The tricky bit is letting RB know about the classes. For that, you  
must create REALclassDefinitions, REALpropertyDefinitions, and all  
the rest of it.

You'll probably need to wrap each C++ library class with your own  
classes.

I think Frank's portaudio plugin may be of example help! Take a look  
there, it's supposedly a very good plugin. (I never had much time to  
test audio stuff ;( )


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to