-
Notifications
You must be signed in to change notification settings - Fork 1
usine pointers
senso edited this page Jun 22, 2026
·
2 revisions
#example #data #array #advanced
Raw typed pointer data passing between modules.
| Module Name | pointer example |
| Type | mtSimple |
| Color | clArrayModuleColor |
| Source | examples/UsinePointers/ |
Demonstrates the ptPointer parameter type for passing raw typed pointer data between modules. Pointer parameters allow direct memory sharing between connected modules.
| # | Name | Type | I/O | Details | Callback |
|---|---|---|---|---|---|
| 0 | pointer in |
ptPointer |
Input | PointerDataType = usinePtrFloat |
None |
| 1 | pointer out |
ptPointer |
Output | PointerDataType = usinePtrFloat |
None |
-
Type check: Verifies input pointer type matches
usinePtrFloat -
Size sync: Gets input size with
getPointerDataSize(), sets output size withsetPointerDataSize() -
Data copy: Copies raw pointer data via
memcpy(getPointerData(), ...) -
Notification: Calls
setPointerDataChanged()to notify downstream modules -
Error handling: If type mismatch, logs error with
sdkTraceErrorChar()
// In onGetParamInfo:
pParamInfo->ParamType = ptPointer;
pParamInfo->PointerDataType = usinePtrFloat; // typed pointer
// In callback:
int type = inputPtr.getPointerDataType(); // check type
int size = inputPtr.getPointerDataSize(); // get size in bytes
void* data = inputPtr.getPointerData(); // get raw data
outputPtr.setPointerDataSize(size); // set output size
memcpy(outputPtr.getPointerData(), data, size); // copy data
outputPtr.setPointerDataChanged(); // notify downstream| Constant | Value | Description |
|---|---|---|
usinePtrFloat |
1 | Float array |
usinePtrInt |
2 | Integer array |
usinePtrString |
3 | String data |
usinePtrMidi |
4 | MIDI data |
usinePtrColor |
5 | Color data |
usinePtrAudio |
6 | Audio data |
usinePtrBitwise |
7 | Bitwise data |
usinePtrChunk |
8 | Chunk data |
-
ptPointerparameter type -
PointerDataTypespecification inTParamInfo -
Raw memory access via
getPointerData() - Size management and change notification
- Type safety with runtime type checking
onGetModuleInfo · onInitModule · onGetParamInfo · onCallBack
- GlobalArray — Higher-level data sharing
- UsineChunks — Chunk-based data sharing