Page 1 of 1
OSC: Activate/Deactive button
Posted: Wed Jan 13, 2016 2:42 pm
by joky
Hi,
is it somehow possible to evaluate the value of the OSC-message?
eg: /1/push1 ,i1 activates the button, /1/push1 ,i0 deactivates it.
If not, is there any workaround?
kind regards!
Re: OSC: Activate/Deactive button
Posted: Wed Jan 13, 2016 2:55 pm
by plugz
Hello,
Can you detail more what you're trying to achieve ?
Re: OSC: Activate/Deactive button
Posted: Wed Jan 13, 2016 3:01 pm
by joky
Hi,
I want to send OSC messages from various clients (eg. home automation, android-tablet) to the QLC+. For the tablet I'm ok with toggling', but for home automation I'm not.
I'd like to integrate a chaser and some effects (moonflower) to our home automation server (HS). There is a On/Off switch to turn on the chaser, the HS can send the value 1 or 0 to QLC.
Toggling work fine (by sending 1), but if any UDP packet is lost or if anyone else is turning on/off the button in qlc+ the HS is doing wrong.
thanks for your fast response!!
regards
Re: OSC: Activate/Deactive button
Posted: Wed Jan 13, 2016 4:27 pm
by plugz
Solution 1: Replacing your toggle button with a slider in should work.
But I just realized I kinda broke sliders in 4.10.2: using sliders may erase the fadein speed of your rgbmatrices. You may use 4.10.1 if you experience this issue.
Solution 2: If you don't want to use 4.10.1 and if you build QLC+ from sources, you can patch the VCButton so a zero value will un-toggle it.
Re: OSC: Activate/Deactive button
Posted: Wed Jan 13, 2016 5:36 pm
by plugz
plugz wrote:
Solution 2: If you don't want to use 4.10.1 and if you build QLC+ from sources, you can patch the VCButton so a zero value will un-toggle it.
(I can tell you what you have to change exactly)
Re: OSC: Activate/Deactive button
Posted: Wed Jan 13, 2016 5:42 pm
by joky
Solution 2 looks promising. I used the git-code anyway,..
Can you give me some instructions how to patch the vbutton?
Re: OSC: Activate/Deactive button
Posted: Wed Jan 13, 2016 5:53 pm
by joky
hmm... I think i found the code,..
trying to recompile,..
Code: Select all
diff --git a/ui/src/virtualconsole/vcbutton.cpp b/ui/src/virtualconsole/vcbutton.cpp
index 853fe9d..9560236 100644
--- a/ui/src/virtualconsole/vcbutton.cpp
+++ b/ui/src/virtualconsole/vcbutton.cpp
@@ -525,21 +525,12 @@ void VCButton::slotInputValueChanged(quint32 universe, quint32 channel, uchar va
if (checkInputSource(universe, (page() << 16) | channel, value, sender()))
{
- if (m_action == Flash)
- {
- // Keep the button depressed only while the external button is kept down.
- // Raise the button when the external button is raised.
- if (isOn() == false && value > 0)
- pressFunction();
- else if (isOn() == true && value == 0)
- releaseFunction();
- }
- else if (value > 0)
- {
- // Only toggle when the external button is pressed.
- // Releasing the button does nothing.
+ // Keep the button depressed only while the external button is kept down.
+ // Raise the button when the external button is raised.
+ if (isOn() == false && value > 0)
pressFunction();
- }
+ else if (isOn() == true && value == 0)
+ releaseFunction();
}
}
Re: OSC: Activate/Deactive button
Posted: Wed Jan 13, 2016 6:04 pm
by plugz
Nope, this won't do it
Try this:
Code: Select all
if ((isOn() && value == 0) || (!isOn() && value > 0))
pressFunction();
(releaseFunction() is for buttons in flash mode only)
Re: OSC: Activate/Deactive button
Posted: Wed Jan 13, 2016 6:28 pm
by joky
works

thank you!
Re: OSC: Activate/Deactive button
Posted: Fri Jan 15, 2016 4:21 pm
by budblinkin
Without changing any of the code, I managed to get this going with using a 'stop all functions' fade out string first, (triggered in a solo frame) then sending the function command that you want shortly after. Though I admit this isn't ideal as dropped packets or packets sent from other sources could change things, but the command sent from the automation panel has essentially turned into an, 'only on' button.