This is the issue I was having with a stack with a player that sends callbacks 
that a script handler doesn’t seem to respond to… LiveCode 7.1.0 dp1

An update. I was able to isolate the problem. SAVING the stack sets things 
aright, for awhile...

This is how my script should work:
1. I load an audio file from a remote server into a player
2. I set the callbacks of the player
3. In my application (an image of music notation with button borders marking 
specific parts of the music notation) I’m setting the showBorder of a series of 
card buttons to true when a callback is received from the player. So, I set the 
showBorder of the first button to true, and start the player
3. The player sends the first callback and the script sets the showBorder of 
the first button to false and sets the showBorder of the second button to true. 
The player sends the second callback and the 2nd button border is set to false 
and the 3rd border is set to true, and so on with each subsequent callback.

This works very nicely (for a while). Then I change the audio file in the 
player. Then things fail:
1. The player sends callbacks reliably, the handler is invoked to do the 
setting of the showBorders, but the lines in the script that set the 
showBorders are seemingly not performed. The first border is set (number 3 
above), but the subsequent borders are not.
2. I isolated it down to an issue of these lines:
        set the showBorder of card button tPrevButton to false
        set the showBorder of card button tNextButton to true

These buttons exist on the card, but the engine seems to not know about them. 
It neither turns the border off on the first or the border on on the second. 
There are no error warnings. In fact these lines SEEM to be skipped. So, I 
change the script to the following:

        if there is a card button tNextButton then
                set the showBorder of card button tNextButton to true
        else
                put “ERROR”
        end if

I click APPLY in the editor. I start the player and get the ERROR.

3. Now I SAVE the stack and start the player and I get NO error. The SAVING of 
the stack seems to fix the problem. It application works great again as I play 
the same audio file.

4. I load another audio file in, the error returns. I save the stack and it 
starts working. In fact I can save the stack while the player is playing and 
the borders are not working, and as soon as the save is finished, the borders 
start to work properly. Doing a SAVE always works, APPLYING script changes does 
not.

It’s a large stack, 179 MB, with over 3000 cards. The application has a total 
of 10 main stacks using 300 MB of memory that are loaded in. It worked in LC 
6.1.3 and LC 6.7.7, but fails in LC 7.

Memory issue???

I filed a bug report, 15689.

Peter Bogdanoff
UCLA


On Jul 25, 2015, at 11:27 PM, Peter Bogdanoff <bogdan...@me.com> wrote:

> Mark,
> 
> I tried it  in LC 6.7.7 RC1 and did NOT see the problem.
> 
> (The same stack works properly in 6.3.1.)
> 
> Doubting my sanity, I went back and tried the very same stack in 7.1. RC1 and 
> saw the problem immediately. The script just stops executing.
> 
> The player continues to send callbacks with apparently valid parameters (a 
> digit) that do invoke the handler, but that handler won’t continue. No 
> errors, no nada.
> 
> We really, really, really want to move to LC 7 for English/Chinese language 
> and Unicode (Chinese looks great in 7, bad in 6). People in China are begging 
> for us to make available our Music History program in China. We are happy to 
> see the improved player in the newest version of LC as all our audio is on a 
> remote server and the Chinese mostly use Windows.
> 
> As the Thermian Mathesar with fist over heart cries to Jason Nesmith in 
> Galaxy Quest, “You are our last hope!"
> 
> Peter Bogdanoff
> UCLA
> 
> 
> On Jul 24, 2015, at 9:42 AM, Mark Waddingham <m...@livecode.com> wrote:
> 
>> Hi Peter,
>> 
>> Do you see a similar thing in 6.7?
>> 
>> The reason I ask is that if the problem is only occurring in an a handler 
>> being invoked by the engine as part of callbacks set by the callback 
>> property on a player it could be something to do with that specific case.
>> 
>> The player implementation on Mac changed completely from 6.7 onwards...
>> 
>> Mark.
>> 
>> Sent from my iPhone
>> 
>>> On 24 Jul 2015, at 06:15, Peter Bogdanoff <bogdan...@me.com> wrote:
>>> 
>>> Using LC 7.1 dp1
>>> 
>>> Part of a script sometimes doesn’t function—sometimes it works just fine. 
>>> Sometimes it refuses to continue to execute the rest of a handler. This 
>>> refusal will happen over and over until some point in my testing it starts 
>>> working again beautifully.
>>> 
>>> It’s a group script with 35,655 characters. Is there a limit to the number 
>>> of characters?
>>> 
>>> I put in breakpoints that are sometimes reached, sometimes not.
>>> 
>>> It’s a handler that is being called by callbacks in a player as the media 
>>> plays, so it’s difficult to debug while the media is playing. So I put some 
>>> code in to put data into a field when those lines of the script are 
>>> reached. Then I can see the progression through the script in real time. 
>>> When it’s not working properly, while the handler IS receiving the callback 
>>> calls, that field stays empty.
>>> 
>>> Any ideas?
>>> 
>>> Peter Bogdanoff
>>> UCLA
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to