Registriert seit: 6. Apr 2011
Ort: Berlin
3.077 Beiträge
Delphi 10.4 Sydney
|
AW: Objektmethode als Objective-C Callback
30. Apr 2021, 17:18
Delphi-Quellcode:
var
KlugerVariablenName: TMyCallbackClass; //für diese Beispielzeilen lokal, ist aber wohl irgendwo eine Membervariable im übergeordneten Kontext sein!?
begin
KlugerVariablenName := TMyCallbackClass.Create;
outputcallbackStruct.inputProc := @TMyCallbackClass.OutputCallback;
outputcallbackStruct.inputProcRefCon := KlugerVariablenName // oder @KlugerVariablenName -> Compiler wirds dir sagen
end;
Delphi-Quellcode:
class function TMyCallbackClass.OutputCallback(inRefCon: Pointer; ioActionFlags: PAudioUnitRenderActionFlags; inTimeStamp: PInteger; inBusNumber, inNumberFrames: UInt32; ioData: PInteger): OSStatus;
var
Instance: TMyCallbackClass;
begin
if inRefCon <> nil then
begin
Instance := TMyCallbackClass(inRefCon);
Instance.RufeVUMeterEventAuf(); // Beispiel!
end;
end;
|
|
Zitat
|