Welcome to the MP3Car.com forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. Registering will also remove advertisements. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact contact us.
|
02-18-2008, 01:23 PM
|
#1
|
|
Road Runner & Mp3car Gatherings Moderator
Join Date: Sep 2005
Location: West Palm Beach, Florida
Vehicle: 99 Mitsubishi Eclipse
Posts: 2,793
|
Retreiving Custom SLider value help needed
I am working on a script, that I need to get the slider value sent to. I have read there is a way to set a slider, then press a button, to get value of where the slider is.
If this were the way a volume slider worked, you would need to put the slider where you want, and then press a button to actually change the volume.
I am looking to do this in one step. Move the slider to the center for instance, and RR sends/stores a 50% command (or 0 to 255 whatever, I can have the script EVAL the range to get the correct value I need). I just need to then read that value after the slider has been moved without an extra "set" button to do it. Does anyone know of a way to do this?
|
|
|
02-18-2008, 01:37 PM
|
#2
|
|
FLAC
Join Date: Aug 2006
Location: Sun Diego
Vehicle: 2001 A4 1.8TQMS
Posts: 917
|
In ExecTBL.ini,
"ONSLD<SLIDERVARNAME>","SENDMSG;<your script>;<cmd>"
Where <SLIDERVARNAME> is the CL slider var name. "ONSLD<SLIDERVARNAME>" is executed everytime you adjust the CL slider.
You can then tell your script to read the raw value of <SLIDERVARNAME> and evaluate it w/in the script.
EDIT: If you're just creating a custom VOLUME slider, the raw slider value can be evaluated w/in rr w/o the need of an external script:
Skin Custom Slider:
Code:
S03,...,H,03,"slider2.gif",30,"$RAWVOLUMEVAR$",""
.
ExecTBL.ini
Code:
"ONSLDRAWVOLUMEVAR","SETVOLUME;<LINE>;$RAWVOLUMEVAR$"
.
I think that might work...*shrugs*
Last edited by Sal R. : 02-18-2008 at 02:08 PM.
|
|
|
02-18-2008, 02:30 PM
|
#3
|
|
Road Runner & Mp3car Gatherings Moderator
Join Date: Sep 2005
Location: West Palm Beach, Florida
Vehicle: 99 Mitsubishi Eclipse
Posts: 2,793
|
Thanks! I will give it a shot now.
Actually, hahaha this is not for volume control..... Its to dim lights in the living room
EDIT:
Ok, I am pretty sure I have the exectbl.ini correct. What I am unsure of is the skin code. In your above example, I do not see where the slider name goes:
Code:
S03,...,H,03,"slider2.gif",30,"$RAWVOLUMEVAR$",""
I also have to pass 2 variables with the skin command(slider pressed), the device to control and the level to set it at. something like $device$ $dimlevel$. (The Device is hard coded, but the slider var needs to report where the slider is)
I have a vbscript that reads the 2 parameters passed to it. It then in turn sends that command over the network to the home automation server to carry out the command.
This is what I have in the exectbl.ini:
Code:
"ONSLD","RUNQW;wscript.exe" "$SkinPath$\scripts\vb.vbs|$device$ $dimlevel$"
Last edited by JohnWPB : 02-18-2008 at 03:02 PM.
|
|
|
02-18-2008, 05:11 PM
|
#4
|
|
RoadRunner Mastermind
Join Date: Nov 2004
Location: Vitória, ES - Brazil
Vehicle: 04/Mazda/RX-8
Posts: 8,028
|
"ONSLD" needs the variable name after... like "ONSLDRAWVOLUMEVAR"..
__________________
Road Runner,RR's Myspace
"Being happy is not about having what you want, it's about wanting what you have."
"The best things in life are always free - but that doesn't mean money can't buy you good things."
|
|
|
02-20-2008, 09:14 PM
|
#5
|
|
Newbie
Join Date: Jul 2007
Location: South Bend, Indiana
Vehicle: 2004 F-150
Posts: 1
|
[quote=JohnWPB;1178580]Thanks! I will give it a shot now.
Actually, hahaha this is not for volume control..... Its to dim lights in the living room
snip
I only hope that means there will be an x-10 skin in DFX 3. I'm keeping my fingers crossed.
|
|
|
02-21-2008, 02:28 PM
|
#6
|
|
FLAC
Join Date: Aug 2006
Location: Sun Diego
Vehicle: 2001 A4 1.8TQMS
Posts: 917
|
Quote: Originally Posted by JohnWPB 
Thanks! I will give it a shot now.
Actually, hahaha this is not for volume control..... Its to dim lights in the living room
EDIT:
Ok, I am pretty sure I have the exectbl.ini correct. What I am unsure of is the skin code. In your above example, I do not see where the slider name goes:
Code:
S03,...,H,03,"slider2.gif",30,"$RAWVOLUMEVAR$",""
In the case above, the slider name is the variable $RAWVOLUMEVAR$
Quote: Originally Posted by JohnWPB 
I also have to pass 2 variables with the skin command(slider pressed), the device to control and the level to set it at. something like $device$ $dimlevel$. (The Device is hard coded, but the slider var needs to report where the slider is)
I have a vbscript that reads the 2 parameters passed to it. It then in turn sends that command over the network to the home automation server to carry out the command.
This is what I have in the exectbl.ini:
Code:
"ONSLD","RUNQW;wscript.exe" "$SkinPath$\scripts\vb.vbs|$device$ $dimlevel$"
The slider above can only pass one numerical value that ranges from 0-65535, which is stored in the variable $RAWVOLUMEVAR$. To be able to pass 2 variables, you'll probably need two sliders, use a BYVAR command, or use and EVAL function if the variables are related somehow.
|
|
|
02-21-2008, 04:24 PM
|
#7
|
|
Road Runner & Mp3car Gatherings Moderator
Join Date: Sep 2005
Location: West Palm Beach, Florida
Vehicle: 99 Mitsubishi Eclipse
Posts: 2,793
|
Thanks for the help, I have it almost all working with the above code. 
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:45 AM.
|
|