some problems. I would like to know if it would be possible to get more informations
about some parameters of the function imported from the library.
1/ First, is it legal to traduce the header and to use it, as long as I respect the original licence terms ?
2/ As I only basically knows the syntax of C, are the imports correct in this form ?
- Code: Select all
readFromChannelsCallback = Function(var data: PSingle; numFrames: Integer; userData: Pointer): Integer ;cdecl ;
PreadFromChannelsCallback = ^readFromChannelsCallback;
Function DiracVersion:Byte; cdecl ; external 'DiracLE.dll' ;
Function DiracCreate(lambda,quality,numChannels: Integer; sampleRate: Single; arfcc: PReadFromChannelsCallback): Pointer; cdecl ; external 'DiracLE.dll' ;
Function DiracCreateInterlaced(lambda,quality,numChannels: Integer; sampleRate: Single;arfcc: PReadFromChannelsCallback): Pointer; cdecl ; external 'DiracLE.dll' ;
Function DiracSetProperty(selector:Integer; value:Double; dirac: Pointer): Integer; cdecl ; external 'DiracLE.dll' ;
Function DiracGetProperty(selector: Integer; dirac:Pointer): Double; cdecl ; external 'DiracLE.dll' ;
Procedure DiracReset(clear: Boolean; dirac: Pointer); cdecl ; external 'DiracLE.dll' ;
Function DiracProcess(audioOut: PSingle;numFrames: Integer; userData,dirac: Pointer):Integer; cdecl ; external 'DiracLE.dll' ;
Function DiracProcessInterlaced(audioOut: PSingle; numFrames: Integer; userData,dirac: Pointer):Integer; cdecl ; external 'DiracLE.dll' ;
Procedure DiracDestroy(dirac: Pointer); cdecl ; external 'DiracLE.dll' ;
Function DiracGetInputBufferSizeInFrames(dirac: Pointer): Integer; cdecl ; external 'DiracLE.dll' ;
Function DiracValidateStretchFactor(factor: Double):Double ; cdecl ; external 'DiracLE.dll' ;
3/ I'm particularly stucking on the callback procedure. As far as I'm understanding how it works,
- the address of 'data' gives me the plugin address where I have to copy my input datas.
( every 4 bytes, starting from 'data' address and for numframes iterations I write a single, is it correct ? )
. in the dll, is 'data' always the first array entry address or does it already include an offset
(should I includes an offset such as the sum of all the numframes: address to write = 'data' address + sizeof(single)*offset ) ?
. is it correct to use a var parameter instead of a copied parameter (otherwise I get some violation access errors) ?
4/ assuming everything is done in the right way in the callback, then I always get empty output buffers, so
in DiracProcess, how should be given the pointer to the out buffer
. simple pointer to buffer @MyOutBuffer ?
. simple pointer to the first buffer entry @MyOutBuffer[0] ?
. pointer to the next data to write @MyOutBuffer[NumBerOfAlreadyWrittenFrames+1] ?
. does DiracLE performing memory operations on the output buffer ( no need to size it from my part ) ?
. does the dll directly write on my output buffer or should I copy something ? ( in a radically different way )
