avaudioengine 1.0.13
AVAudioEngine binding for D.
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
d-avaudioengine-binding
Bindings for D for Apple's AVAudioEngine
This project uses the @ObjectiveC extern(C++) final
style, which makes the project compatible with any D project.
This is part of the group of projects to D Apple Game Development:
Note on Handling Objective-C Blocks (delegates)
- They were implemented by using @jacob-carlborg 's amazing clang_block, which made it compatible to use D delegates together with Objective-C blocks.
- Instead of passing D delegates, simply assign it to a variable:
import objc.runtime;
auto convFn = block((AVAudioPacketCount inNumberOfPackets, AVAudioConverterInputStatus* outStatus)
{
if(temp.frameLength > 0)
{
*outStatus = AVAudioConverterInputStatus._HaveData;
return cast(AVAudioBuffer)temp;
}
else
{
*outStatus = AVAudioConverterInputStatus._NoDataNow;
return null;
}
});
- After that, you will need to pass the address of this block to your target function:
converter.convertToBuffer(cast(AVAudioBuffer)buffer.avaudio, &err, &convFn);
- This is all that is needed
If you want to represent any type from Objective C in D, just write code.ns
. ns
will try to convert to a type representable in Objective C.
Generating the files
The files are a mix of automatic and manual work. Unfortunately I still don't keep comments inside the properties, classes and methods, so, no comments are available right now. Any contribution to get the comments in are welcomed.
Simply execute node AVAudioEngine.h
which will generate at source/avaudioengine.d.
- Registered by Marcelo Silva Nascimento Mancini
- 1.0.13 released 10 months ago
- MrcSnm/d-avaudioengine-binding
- MIT
- Copyright © 2023, Hipreme
- Authors:
- Dependencies:
- objc_meta
- Versions:
-
1.0.15 2024-Feb-12 1.0.14 2024-Feb-12 1.0.13 2024-Jan-14 1.0.3 2024-Jan-14 1.0.2 2023-Dec-13 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
3 downloads total
-
- Score:
- 0.6
- Short URL:
- avaudioengine.dub.pm