Page 1 of 1

Is this a bug? (booleans and isRepeat/isLoop)

Posted: 27 Feb 2011 13:17
by reD_Fox
Hello,

Maybe it's just me doing something stupid, but something seems funny here. I have two check-buttons, one to turn looping on and off, and the other to turn repeat on and off. I wanted these two to toggle so that when looping is enabled, the repeat button is greyed-out, and vise versa.

So I have
LoopButton:
- Condition: (playlist.isLoop) and (not playlist.isRepeat)
- Action (state 1): playlist.setLoop(true);playlist.setRepeat(false)
RepeatButton:
- Condition: (playlist.isRepeat) and (not playlist.isLoop)
- Action (state 1): playlist.setRepeat(true);playlist.setLoop(false)

Here's what happens: When I click on the LoopButton, looping is activated, but the RepeatButton is "activated" as well (yet the repeat functionality itself is not activated). After this, clicking on the RepeatButton does nothing to enable or disable the button state or the repeat functionality.
The really strange thing is that if I change the RepeatButton condition to:
false and (not playlist.isLoop)
(...which should always be false, no?)
then clicking on the LoopButton activates the RepeatButton!

I don't get it. Any help/ideas? Is this a bug?

Levi

Re: Is this a bug? (booleans and isRepeat/isLoop)

Posted: 27 Feb 2011 17:44
by Spyme
Find out such behavior on my playlist loop control too. I doesn´t really remember if it´s the repeat or random control, but one of them seems buggy.

Re: Is this a bug? (booleans and isRepeat/isLoop)

Posted: 28 Feb 2011 06:41
by reD_Fox
Update: This may be for all states (not just isLoop/isRepeat)--I tested it with isRandom and got the same results. Regardless, this has got to be a bug. When "false and (not playlist.isLoop)" is returning 'true', something is broken.

EDIT: I created a bug report - http://trac.videolan.org/vlc/ticket/4529

Levi

Re: Is this a bug? (booleans and isRepeat/isLoop)

Posted: 01 Mar 2011 14:39
by erwan10
There was indeed a bug with boolean composite variables (using 'and' or 'or'), that led the checkbox control into believing the state had toggled when it actually didn't

A patch has just being applied that should fix the problem (patch applied to both vlc1.1 and vlc1.2).
As usual, nightly builds available as soon as tomorrow for more testing, if you feel so.