I am running on Android 4.4.2, iViewer 4.0.201. I have a page with a two buttons, a slider - join a1, a static text field, and a text field that I have set the join to s10. I have the min value for the slider set to -161, and the max value set to 33. I am listening in javascript for the the slider pressed, slider dragged, and slider released events. I have 3 tags set for the slider "receiver", "vol", and "s10". When I get any one of those events, I add an extra tag to the tags array that comes through. For the on pressed and dragged events, the tag is "set". For the on released event, the tag is "get", but I am not using the "get" at the moment. I also have three tcp systems setup, one for receiver, one for LANBridge, and one for a custom service I have running on my android. I am not using the custom service in iViewer.
When I get the on pressed/dragged events I call a "ProcessCommand" function in a "true singleton", i.e., the singleton has a getInstance function, and in that "ProcessCommand" function, I get [sliderval] from the tokens array, convert it to a number, divide it by two, and then convert it to a string using .toFixed(1) so that it has one decimal place. I then set a command string to the volume command for my receiver, and I concat the value string to it. I then use the "receiver" tag to CF.send the command to my receiver appending \x0A\x0D to the string and using CF.UTF8. When the command returns to the on pressed / dragged / released event handlers, the "set" and "get" tags that I appended to the tags array are removed using array.splice(index of "get"/"set", 1)
As far as I can tell, this all works great - that is, my receiver gets the value and sets the volume level to the value sent.
As I understand the slider documentation on the wiki, sliders have an analog join who's value ranges from 0 to 65535 and this value is supposed to be independent of [sliderval].
Here is where I am confused: When I get the "set" command, I call CF.setJoin with s10 as the join, and a string which amounts to [sliderval] / 2 + the string " dB" to indicate the volume level that was sent to the receiver in text on the UI. However, even though I have explicitly set the join to "s10" (both with a hard-coded string and with the value passed in the tags array), the call somehow sets the value of the analog join "a1" which is attached to the slider to [sliderval] / 2, and the indicator on the slider disappears. The text field associated with this join does get set to "[sliderval] / 2 dB" as I would expect. I had searched this group for how to handle this situation, and I believe this approach has been suggested to others trying to do essentially the same thing. One time, iviewer crashed, and I did submit a bug report.
Note that if I comment out the call to CF.setJoin("s10", "volume string"), then the analog join stays at its current value, and the slider indicator stays fixed at its current value.
Am I doing something incorrectly? I do not see any indication in the properties for the controls that would give me the impression that the text field's serial join would somehow become bound to the slider and its analog join. So I am confused.
Here is the question I have which is independent of the above:
Would using CF.setToken("a1", "[sliderval]", value) be the correct approach to setting [sliderval] after querying my receiver for its current volume level?
Thanks.
Matthew