1
0
mirror of https://github.com/RPCS3/soundtouch.git synced 2024-11-09 20:33:03 +01:00

Added BPM functions to Pascal interface of SoundTouch DLL

This commit is contained in:
oparviai 2017-11-26 09:10:41 +00:00
parent ec9ba968f5
commit 20e4bf0b04

View File

@ -423,6 +423,13 @@ var
SoundTouchLibHandle: HINST;
SoundTouchDLLFile: PAnsiChar = 'SoundTouch.dll';
// bpm detect functions. untested -- if these don't work then remove:
bpm_createInstance: function(chan: CInt32; sampleRate : CInt32): THandle; cdecl;
bpm_destroyInstance: procedure(h: THandle); cdecl;
bpm_getBpm: function(h: THandle): cfloat; cdecl;
bpm_putSamples: procedure(h: THandle; const samples: pcfloat;
numSamples: cardinal); cdecl;
procedure InitDLL;
begin
SoundTouchLibHandle := LoadLibrary(SoundTouchDLLFile);
@ -454,6 +461,11 @@ begin
Pointer(SoundTouchNumSamples) := GetProcAddress(SoundTouchLibHandle, 'soundtouch_numSamples');
Pointer(SoundTouchIsEmpty) := GetProcAddress(SoundTouchLibHandle, 'soundtouch_isEmpty');
Pointer(bpm_createInstance) :=GetProcAddress(SoundTouchLibHandle, 'bpm_createInstance');
Pointer(bpm_destroyInstance) :=GetProcAddress(SoundTouchLibHandle, 'bpm_destroyInstance');
Pointer(bpm_getBpm) :=GetProcAddress(SoundTouchLibHandle, 'bpm_getBpm');
Pointer(bpm_putSamples) :=GetProcAddress(SoundTouchLibHandle, 'bpm_putSamples');
except
FreeLibrary(SoundTouchLibHandle);
SoundTouchLibHandle := 0;