Einzelnen Beitrag anzeigen

Rollo62

Registriert seit: 15. Mär 2007
3.916 Beiträge
 
Delphi 12 Athens
 
#4

AW: Aktuelles Vorgehen für Vibration auf IOS

  Alt 14. Dez 2018, 16:23
Delphi-Quellcode:
Uses
    Macapi.CoreFoundation
  ;

Const
  libAudioToolbox = '/System/Library/Frameworks/AudioToolbox.framework/AudioToolbox';

type
    SystemSoundID = UInt32;

const
    CSnd_kSystemSoundID_vibrate = $FFF;

    CSnd_peek = SystemSoundID(1519);
    CSnd_pop = SystemSoundID(1520);
    CSnd_cancelled = SystemSoundID(1521);
    CSnd_tryAgain = SystemSoundID(1102);
    CSnd_failed = SystemSoundID(1107);



procedure AudioServicesPlaySystemSound( inSystemSoundID: integer ); Cdecl; External libAudioToolbox Name _PU + 'AudioServicesPlaySystemSound';

procedure DoVibrate(const ATimeMS: Integer);
begin
    AudioServicesPlaySystemSound( CSnd_peek );
end;

Geändert von Rollo62 (14. Dez 2018 um 16:25 Uhr)
  Mit Zitat antworten Zitat