diff options
-rw-r--r-- | src/screens/UScreenSong.pas | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/screens/UScreenSong.pas b/src/screens/UScreenSong.pas index 95ccae83..9fc74aae 100644 --- a/src/screens/UScreenSong.pas +++ b/src/screens/UScreenSong.pas @@ -1619,13 +1619,20 @@ begin AudioPlayback.Stop; end; -function MusicPreviewTimerCallback(interval: UInt32; param: Pointer): UInt32; cdecl; +procedure StartMusicPreview(data: Pointer); var ScreenSong: TScreenSong; begin - ScreenSong := TScreenSong(param); + ScreenSong := TScreenSong(data); if (ScreenSong <> nil) then ScreenSong.StartMusicPreview(); +end; + +function MusicPreviewTimerCallback(interval: UInt32; param: Pointer): UInt32; cdecl; +begin + // delegate execution to main-thread + MainThreadExec(@StartMusicPreview, param); + // stop timer Result := 0; end; |