Quick question: player object callbacks still working?

Martin Koob mkoob at rogers.com
Sun Jun 28 12:01:01 EDT 2020


Hi

I have an app that uses player callbacks and I am now using LC 9.6 to work on it and the callbacks work fine.

The callbacks, duration, currentTime and other movie time properties are in timescale which is intervals/second as you said.


I just created a small stack and did a basic test of callbacks  and it worked.
-create a new stack
-drag a player to the card
-drag a single line field to the card
-put the following code in the card's script

---------------
local sMovieScale

on mouseup

put the timescale of player 1 into sMovieScale

set the callbacks of player 1 to (sMovieScale * 0), "secondcount" & CR & \

(sMovieScale * 1), "secondcount" & CR & \

(sMovieScale * 2), "secondcount" & CR & \

(sMovieScale * 3), "secondcount"

end mouseup


on secondcount pCallbackTime

put (pCallbackTime / sMovieScale) && "seconds" into field 1

end secondcount

---------------------
- click on the card to set the callbacks
- play the movie to see if the seconds are displayed in the field.

See if that works.

If it does then maybe it is something with how you create your callback list.

You can see if the callbacks are actually set by with the line ‘ in the message box

      put the callbacks of player “yourPlayer

> On Jun 28, 2020, at 11:22 AM, David Bovill via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> The message is not being sent. I set the callbacks of the payer and test it with:
> 	set the callbacks of player 1 to "0,soundNotes"
> 
> 	command soundNotes
> 	  — does not get sent
> 	  put the params
> 	end soundNotes
> 
> 	on currentTimeChanged theInterval
> 	  put theInterval
> 	end currentTimeChanged
> 
> 	on playPaused
> 	  put the currenttime of me
> 	endplayPaused
> 
> As I understand it the callback timing should be in “intervals"
> 
> • The duration of player 1= 4665600
> • The  timescale of player 1 = 90000
> 
> Setting the callbacks to a range of values between 0 and the duration seems to have no effect with regard to messages actually being sent. I’ve tried putting the “soundNotes” handler in various positions - card, stack and player. Still debugging...
> On 28 Jun 2020, 06:35 +0100, Peter Bogdanoff via use-livecode <use-livecode at lists.runrev.com>, wrote:
>> David,
>> 
>> Specifically what is not working? Setting the callbacks, the callbacks message not being sent or received?
>> 
>> Sometimes I’ve seen that the interval between callbacks is so great, that the message is never sent before the player ends. That is highly dependent on the timeScale of the player. Put in the message box after the file is loaded into the player:
>> 
>> put the timeScale of player “<player name>”
>> 
>> to see if the numbers make sense. Some files will have very different timeScales (a Mac file with 600/second may have a Windows equivalent of a number in the millions).
>> 
>> Peter Bogdanoff
>> 
>>> On Jun 27, 2020, at 1:41 PM, David Bovill via use-livecode <use-livecode at lists.runrev.com> wrote:
>>> 
>>> I’ve been testing an idea for an app - and I can’t get the callbacks property sending of messages. Does it still work with 9.6 MacOS?
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list