G GuyBooth Active Member Licensed User Longtime User Aug 21, 2013 #1 I have two options to obtain the status of a number of MediaPlayers which are running in a service called PlayService. From my main module I can use Code: Copy Dim bPlayState as boolean bPlayState = PlayService.MPP1.IsPlaying OR PlayService.MPP2.IsPlaying OR I can put that same code into a Sub in the service, and call it this way: Code: Copy ' In the main module Dim bPlayState as boolean bPlayState = CallSub(PlayService, "PlayStatus") ' In the PlayService module: Dim MPP1, MPP2 as MediaPlayer Sub PlayStatus() as Boolean Return (MPP1.IsPlaying OR MPP2.IsPlaying) End Sub My question is: Should I expect any difference in realtime response between these two methods?
I have two options to obtain the status of a number of MediaPlayers which are running in a service called PlayService. From my main module I can use Code: Copy Dim bPlayState as boolean bPlayState = PlayService.MPP1.IsPlaying OR PlayService.MPP2.IsPlaying OR I can put that same code into a Sub in the service, and call it this way: Code: Copy ' In the main module Dim bPlayState as boolean bPlayState = CallSub(PlayService, "PlayStatus") ' In the PlayService module: Dim MPP1, MPP2 as MediaPlayer Sub PlayStatus() as Boolean Return (MPP1.IsPlaying OR MPP2.IsPlaying) End Sub My question is: Should I expect any difference in realtime response between these two methods?
Erel B4X founder Staff member Licensed User Longtime User Aug 22, 2013 #2 The overhead of CallSub is small. You will most probably not see any difference in that case. However why not use MediaPlayer Complete event? Upvote 0
The overhead of CallSub is small. You will most probably not see any difference in that case. However why not use MediaPlayer Complete event?
G GuyBooth Active Member Licensed User Longtime User Aug 22, 2013 #3 Thanks for the info Erel - now I can comfortably keep my code compact. MediaPlayer_Complete is not appropriate for the fairly complex functions I am looking for, but I do use it. Erel said: However why not use MediaPlayer Complete event? Click to expand... Upvote 0
Thanks for the info Erel - now I can comfortably keep my code compact. MediaPlayer_Complete is not appropriate for the fairly complex functions I am looking for, but I do use it. Erel said: However why not use MediaPlayer Complete event? Click to expand...