|
|
|
Philips Pronto Professional Forum - View Post
|
|
|
|
|
|
|
The following page was printed from RemoteCentral.com:
[PS] Prontoscript Volume control
| |
|
Topic: | [PS] Prontoscript Volume control This thread has 5 replies. Displaying all posts. |
|
Post 1 made on Saturday January 3, 2009 at 09:57 |
electroteam Lurking Member |
|
|
Well guys I’ve got a problem with my pronto script. Beneeth the volume buttons I’ve put a pronto script that depending on the value of “VOL” sends a different IR command. In total there are 3 different volumes to be controlled. The code under the hardbutton Vol +: onHold = function() { if(System.getGlobal("VOL") == "TV") { if(System.getGlobal("LR") == "Links") { CF.widget("TV+","Volume_Zone_L","Script_Links").executeActions(); } else { CF.widget("TV+","Volume_Zone_R","Script_Links").executeActions(); } } else { if(System.getGlobal("VOL") == "Speaker") { if(System.getGlobal("LR") == "Links") { CF.widget("Speaker+","Volume_Zone_L","Script_Links").executeActions(); } else { CF.widget("Speaker+","Volume_Zone_R","Script_Links").executeActions(); } } else { if(System.getGlobal("LR") == "Links") { CF.widget("Yamaha+","Volume_Zone_L","Script_Links").executeActions(); } else { CF.widget("Yamaha+","Volume_Zone_R","Script_Links").executeActions(); } } } }; onHoldInterval = 30; // msec
When I go to the page “script_Links” an push the buttons, they all work fine. When I press and hold the TV+ button, the volume of the TV goes up like a butterfly ;)
But when I push the hardbutton Vol+ it doesn’t work. The TV steps once or twice, but the command doesn’t seem to repeat. On top of that is that the pronto does send IR, as my telephone camera shows …
I’ve also tried to vary onHoldinterval from zero til 250. Didn’t work.
So the question seems, whats the different between my pronto script and actually pressing the button my self ?
Any suggestions ?
( if anyone knows how to display the code above right, please let me know )
|
|
Post 2 made on Saturday January 3, 2009 at 12:54 |
Rusty Fobe Long Time Member |
Joined: Posts: | December 2008 47 |
|
|
Hi Electroteam,
I cannot solve your problem as I am not knowledgeable enough yet in that matter, but I tried to simplify your programming. I did not test it with the simulator though. Other members, please correct me if I'm wrong, I'm a Javascript beginner.
Nested if's are complicated and difficult to read, so try to avoid them if you want to keep your code readable. Next, it is not always necessary to use if's to solve a logic. Since you standardized naming ("TV" and "TV+"), ("Speaker" and "Speaker+") and probably ("Yamaha" and "Yamaha+), you can simplify your code to a high extent:
onHold = function() { Vol=System.getGlobal("VOL"); LR=System.getGlobal("LR"); Zone=((LR=="Links")?"L":"R"); // if LR = "Links" then Zone="L" else Zone= "R"
{CF.widget(Vol+"+","Volume_Zone_"+Zone,"Script_Links").executeActions();} }; onHoldInterval = 30; // msec
Rusty
|
|
OP | Post 3 made on Tuesday January 6, 2009 at 10:04 |
electroteam Lurking Member |
|
|
Well thanks, i'm more C++ programmer that javascript so i'm more confident with if/else :P
But unfortunally it didn't solve my problem.
Someone a idea ?
|
|
Post 4 made on Tuesday January 6, 2009 at 10:55 |
Lyndel McGee RC Moderator |
Joined: Posts: | August 2001 12,992 |
|
|
Depending on the IR code data for your equipment, you may or may not be able make this work properly using a single button. This thread discusses the only available solution at the moment. [Link: remotecentral.com]
|
Lyndel McGee Philips Pronto Addict/Beta Tester
|
|
OP | Post 5 made on Saturday January 10, 2009 at 05:12 |
electroteam Lurking Member |
|
|
well this thread is about one year old.... didn't get any one a sollution ?
|
|
Post 6 made on Monday January 19, 2009 at 22:27 |
Lyndel McGee RC Moderator |
Joined: Posts: | August 2001 12,992 |
|
|
Nope. Nothing more as of yet.
|
Lyndel McGee Philips Pronto Addict/Beta Tester
|
|
|
Before you can reply to a message... |
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now. |
Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.
|
|
|
|