Igor Stasenko wrote
>> The better way is to subclass from NBExternalObject thenI made "NBExternalObject subclass: #FMOD_SYSTEM".
> which made exactly for such purposes, by holding an opaque handle to
> something (you don't care what is inside), and simplifies a lot of things.
I then tried to use it via:
�� �� �� �� system := FMOD_SYSTEM new.
�� �� �� �� err := self System_CreateNBExternalObject: system.
With callout:
�� �� �� �� ^ self nbCall: #(FMOD_RESULT FMOD_System_Create(NBExternalObject system)).
For the argument type in the signature, for good measure I tried:
1. NBExternalObject
2. FMOD_SYSTEM
3. NBExternalAddress
All three with zero, one, and two *'s after. The only one that didn't report
some variety of "An instance of Xyz expected" was
"FMOD_System_Create(FMOD_SYSTEM system)" for which the library returns an
invalid argument error code.
btw if anyone wants to play with it:
1.
�� �� Gofer it
�� �� �� �� smalltalkhubUser: 'SeanDeNigris' project: 'FMOD';
�� �� �� �� package: 'FMOD';
�� �� �� �� load.
2. Download the FMOD library for your platform:
- windows -
http://www.fmod.org/download/fmodstudio/api/Win/fmodstudioapi10208win-installer.exe
- Mac -
http://www.fmod.org/download/fmodstudio/api/Mac/fmodstudioapi10208mac-installer.dmg
3. Copy the library to "FileLocator imageDirectory / 'FMOD Programmers
API/api/lowlevel/lib/libfmod.dylib'"
The working example is:
| sound |
sound := FmodSound fromFile: '/path/to/file.mp3' asFileReference.
[ sound play ] fork.
The broken one described above is: "FMOD exampleNBExternalObject."
-----
Cheers,
Sean
--
View this message in context: http://forum.world.st/NativeBoost-Questions-while-wrapping-FMOD-tp4724116p4724192.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.