Variable slider problem
I defined a variable slider to display the volume of car headunit. Also, I can adjust the headunit volume by clicking the silder. Now, the problem is that the slider can display the volume well just before clicking it. Once click the slider, it will always stay in the position mouse clicked.
I traced the ReturnSlider(). It was called but the slider just does not refect the ReturnSlider value.
-- ReturnSlider() in RRExtension
-- ProcessCommand() in RRExtension
Dim level As Integer = carVolume.getLevel()
ReturnSlider = Int(65535 / CarVolume.MAX_VOLUME * level)
If InStr(CMD, "SETCARVOL") <> 0 Then
'here is code to control car volume
I believe that your ReturnSlider Case "$car_master$" is not correct. You are also mixing two different methods. If you are gonna use a Ext PI, then you don't need any of the variable stuff, as that is mostly for creating a custom slider in a skin and be able to use it w/o using an ext pi. You can also use the setSlider() in RRExtention as well which is called when you click the slider ie...
-- SetSlider() in RRExtension
rrsdk.execute("SETCARVOL;" & Value")
totally NOT recomended!!, reuse code from setcarvol cmd or better yet make it a func and then both can use it to set the volume
Yeah, it works well. Thanks!
I have a little confuse about the SetSlider(). It seems that one click will invoke this method many times. The value in first call is correct, but the value in later calls has a value larger than 65535.
Added a msgBox in this method. After one mouse click on the slider, the first message box showed value 17308 which is correct, but the next msg box showed value 83180
Edit: SetSlider() works well, the code only execute once for one mouse click. Not sure why the msgbox comes
I would suggest saving a log (and not showing messageboxes) to display the values returned. The value should never be more than 65536 -- this could be very well happening because of the messagebox (hard to explain but has to do with the position of the mouse after the first messagebox is displayed).
Thanks guino! you are correct.
Originally Posted by guino