[RESOLVED] API / VCButton in web doesn't behave as expected

The issues found when using the web interface
Post Reply
slaugie
Posts: 4
Joined: Sat May 14, 2016 5:34 pm
Real Name:

Hi guys,

I am currently developing a little program to control all the technical stuff around a TV-style game (you know, with candidates, questions, buzzers, sound, video and... light :D ). When having to deal with the light part came to our mind, I thought "It should be possible to do something with QLC+, it has built-in web access and API through WS...". So I tested to connect my program to QLC+, and it works well : I can get specific widgets from VC and map them to specific events of the game...

However (here comes the issue), I found a (very) little issue in the behaviour of the API used to activate/deactivate VCButtons.

QLC+ 4.11.1, W10 64b (but doesn't matter here :) )


The test page for API ( http://qlcplus.org/Test_Web_API.html ) says something like that :
High rate APIs > Basic widget value set wrote:The value to set depends on the widget type itself. Buttons and Audio triggers will only support values 0 (= off) and 255 (= on) while Sliders will accept all the values in the 0-255 range.
However, this is not true for Buttons : the value is not taken into account, so when you send your api call, it just presses the button. If it was On, it will be Off, and vice-versa, without looking at the value sent in the call. It might be useful in certains cases to keep the possibility to send an absolute state (ie. the 0/255 = off/on as said on the test page).

Of course I could not resist, and I looked at the code, all seem to take place here :
- Getting value of the API call : https://github.com/mcallegari/qlcplus/b ... s.cpp#L693
- Dealing the "Button" case without looking at the value : https://github.com/mcallegari/qlcplus/b ... s.cpp#L699

It seems to be nothing (just a few lines of code), I might be able to do it soon (in a few days, after our show :mrgreen: ), but I'd like to make sure I don't miss something. :)


Thanks again for the good work here, once again we'll be able to perform a great show with QLC+ ! ;)

Sylvain.
Last edited by slaugie on Sat Apr 14, 2018 12:01 pm, edited 2 times in total.
slaugie
Posts: 4
Joined: Sat May 14, 2016 5:34 pm
Real Name:

Hello,

Some news. I also identified that we can't use Flash buttons with WebAccess. The Flash button stays Active once it has been activated and cannot be set back to Inactive through the webaccess.

I am currently investigating how to deal with these issues in a clean way :)

edit: also correcting/enhancing some code (AudioTriggers capturing state is not updated in the webui when toggled in qlc+ ; + misc.)

edit2: i abandonned the idea to have the 0=off / 255=on for buttons, there is no method for that in vcbutton. Implementing that means checking the state before using pressFunction in webaccess and it becomes "dirty", all because my own code was dirty in the first place (I was not checking the state of a button). Anyway I pushed a PR for other issues and code enhancement.
Post Reply