Hello everyone.
I want to implement the function of automatically reconnecting after a sound card abnormality.
See a routine.
Demonstrating the use of Bass_ The Init function, the last parameter, passes in the callback function.
However, in the header file of Delphi, the defined parameters are not callback functions.
So I want to ask how to implement callback. Or is it true that the header file in Delphi is incomplete and can be added again according to VC's method?
delphi
procedure BASS_DeviceCallback(handle: HDSP; event: DWORD); stdcall;
begin
if event = BASS_DEVICE_ERROR then
begin
BASS_Free;
BASS_Init(-1, 44100, 0, 0, nil);
end;
end;
begin
//===============
BASS_Init(-1, 44100, 0, 0, @BASS_DeviceCallback);
...
BASS_Free;
end;