18 May '13 - 07:44 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: Cross Platform Libraries with Firemonkey  (Read 9436 times)
Iván Juárez
Guest
« on: 8 Sep '11 - 07:52 »
Reply with quoteQuote

I've been trying to use the bass library with the new Rad Studio XE2 and Firemonkey, so far no look. Can anyone point me to the right direction to sucessfully import  dylib and dll libraries using conditional directives from Delphi? I'm looking for something like this: http://code.google.com/p/multiinstalledit/source/browse/MI+Skinnable/dynamic_bass.pas?r=1e2b7412d8fcd6712af5a0f39bb8d2ac16bf9cce but to make it work with Delphi in Windows and to be Cross Platform so I can deploy it to OSX.
Logged
Bert B.
Posts: 103


« Reply #1 on: 8 Sep '11 - 08:10 »
Reply with quoteQuote

Checkout this website and the forums, start reading the Bass documentation.
The latest version of the dynamic link libraries can be found here:
http://www.un4seen.com/stuff/bass24-delphidyn.zip
Logged
fellz
Posts: 25


« Reply #2 on: 12 Sep '11 - 14:28 »
Reply with quoteQuote

Same problem here...

A Delphi XE2 FireMonkey Demo using BASS would really help a lot...
I'm not sure if the current dynamic link library for Delphi supports OSX?! And the documentation doesn't help either.

Chris
« Last Edit: 14 Sep '11 - 15:46 by fellz » Logged
Czar
Guest
« Reply #3 on: 23 Sep '11 - 21:06 »
Reply with quoteQuote

any advancement on this? Has someone got xe2 and bass working on MacOS (& iOS) - I would also be very keen for a solution.
Logged
Iván Juárez
Guest
« Reply #4 on: 27 Sep '11 - 10:52 »
Reply with quoteQuote

Here's a demo that works with Delphi XE2 and Firemonkey. https://forums.codegear.com/message.jspa?messageID=396602#396602 Cheers!
Logged
3delite
Posts: 623


« Reply #5 on: 27 Sep '11 - 17:41 »
Reply with quoteQuote

Thanx for the link! Just tried here and works!

I had to copy some dylib files to the folder though.
Logged
Nikolai
Posts: 10


« Reply #6 on: 27 Oct '11 - 08:40 »
Reply with quoteQuote

Hi
What is the best approach for this?
I see that Ivan has a working demo so it is possible.
I guess we would all like to use Bass.pas
Do I need to translate the files in the OSX release of Bass to delphi, and use that to compile to OSX?
Simply cross compiling bass.pas wount work as it uses hwnd, the Windows-unit. etc
Has anyone done any research on this. I'm willing to put in some work for all of us, if someone points me in the right direction.  Cheesy
Logged
3delite
Posts: 623


« Reply #7 on: 28 Oct '11 - 11:07 »
Reply with quoteQuote

Ian is working on an updated BASS.pas. I tested it and compiled and worked fine.
He will probably post an updated version soon. Smiley
Logged
Nikolai
Posts: 10


« Reply #8 on: 29 Oct '11 - 17:03 »
Reply with quoteQuote

Ian is working on an updated BASS.pas. I tested it and compiled and worked fine.
He will probably post an updated version soon. Smiley

Ahh, if the grand master him self is working on it, I will just wait and see.
Great news!
Thank you
Logged
Ian @ un4seen
Administrator
Posts: 15244


« Reply #9 on: 31 Oct '11 - 14:54 »
Reply with quoteQuote

Please feel free to continue with your research on the matter Smiley

The issue seems to be getting Delphi/FireMonkey to handle the fact that library function names are prefixed with an underscore on OSX, eg. "BASS_Init" is "_BASS_Init". 3delite found this solution...

function BASS_Init(device: LongInt; freq, flags: DWORD; win: HWND; clsid: PGUID): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll {$IFDEF MACOS}name '_BASS_Init'{$ENDIF};

I'm hoping there is a simpler solution that doesn't require adding a "name" directive to each function, or some way to automate that.

In the meantime, I have put an updated BASS.PAS file in the BASS package that should support Linux as well as Windows.
Logged
psycodad
Posts: 1


« Reply #10 on: 19 Dec '11 - 08:44 »
Reply with quoteQuote

Please feel free to continue with your research on the matter Smiley

The issue seems to be getting Delphi/FireMonkey to handle the fact that library function names are prefixed with an underscore on OSX, eg. "BASS_Init" is "_BASS_Init". 3delite found this solution...

function BASS_Init(device: LongInt; freq, flags: DWORD; win: HWND; clsid: PGUID): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll {$IFDEF MACOS}name '_BASS_Init'{$ENDIF};

I'm hoping there is a simpler solution that doesn't require adding a "name" directive to each function, or some way to automate that.

In the meantime, I have put an updated BASS.PAS file in the BASS package that should support Linux as well as Windows.


Hi folks,
Im new here. I try to make a little cross platform player in Delphi XE2 with Firemonkey as a proof of concept (Win64,Win32,MACOSX). Are there some "official" Dynamic_Bass.pas releases who support this?
Logged
ZeromusXYZ
Posts: 1


« Reply #11 on: 27 Aug '12 - 13:31 »
Reply with quoteQuote

First of all, sorry for digging up this post ..

I'm currently working on a game in Delphi XE2 Starter and using BASS for the audio.

It works nicely when I compile my Win32 Native version.
I also have a version using FireMonkey (has pretty much exactly the same code, but uses a FireMonkey 3D form instead of a normal TForm).

The problem is, the native version works perfectly fine in all aspects, but the FireMonkey version seems to work perfectly fine, but gives no sound output at all. I don't get any errors on initialization or loading or whatever. The function calls report no errors at all, it just gives no sound output.
I've also tried the above FMBassDemo, which gives me the same problem ...

I've also tried running the .exe on different PCs to no avail.
Anybody might have a idea as of why this could be ?

I'm trying to migrate the game to FireMonkey so I can later make it more easy to port to MacOS and/or iOS devices. For current work it's not all that important yet (as I can't afford the licenses atm :p )
Logged
GuTyKa
Guest
« Reply #12 on: 2 Dec '12 - 18:41 »
Reply with quoteQuote

Hi,

Is there any progress on the FireMonkey issue? I'd like to use BASS with Delphi + FireMonkey on Win32, MacOS and Linux. I've tried it with Win32 but no sound comes out at all Sad
Thanks!

Best,
GuTyKa
Logged
Ian @ un4seen
Administrator
Posts: 15244


« Reply #13 on: 3 Dec '12 - 14:43 »
Reply with quoteQuote

I'm not a Delphi/Firemonkey user myself, so I haven't tried it, but I think the standard BASS.PAS file is working on Win32 and Linux? It's just OSX that's a problem due to the way that exported functions are named there (leading underscores). But another user recently provided an updated BASS.PAS file to add support for OSX, and that is included in the OSX BASS package along with an example. So you could download the OSX package and give that a try.
Logged
GuTyKa
Guest
« Reply #14 on: 5 Dec '12 - 12:34 »
Reply with quoteQuote

Unfortunately it has the same result: compiles and runs perfectly but no sound at all. Tested on Win32 and MacOS with Delphi XE3 FireMonkey. I'm using the MacOS compatible bass.pas and included the dll and dylib files as well.
Cheers!
Logged
GuTyKa
Guest
« Reply #15 on: 5 Dec '12 - 13:43 »
Reply with quoteQuote

Sorry I've found that I have to use BASS_UNICODE and PWideChar when creating file streams. That solved the issue with the new MacOS version of bass.pas for either Win32 and MacOS platforms on Delphi XE3 FireMonkey.

Thanks! Smiley
Logged
Bert B.
Posts: 103


« Reply #16 on: 5 Dec '12 - 13:44 »
Reply with quoteQuote

Without seeing some real code, it's hard to tell where it's going wrong. Maybe you can post the code for a simple application.
Another option is to check the result of every call to Bass with BASS_ErrorGetCode. Which call fails and what is the error code?

My post was one minute too late. Fortunately the problem is solved.
« Last Edit: 5 Dec '12 - 13:46 by Bert B. » Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines