| Post 1 made on Sunday January 11, 2009 at 07:16 | ...it's new! |
mrashton Junior Member |
| |
With an iPod dock connected to a Yamaha RX-V3800 I want to use the rotary wheel to navigate the song list on the TV screen. Any ideas how I can mimic holding a button with more than 2 clicks of the rotary wheel (clicks > 2 or clicks < -2) until the rotary wheel stops (clicks = 0)? By holding a button, navigation of the list speeds up and I would like to use the rotary wheel to achieve this.
This message was edited by mrashton on Sunday January 11, 2009 at 13:29. |
| [ Reply | Quote & Reply |
| Post 2 made on Sunday January 11, 2009 at 19:44 | ...it's new! |
GuerillaBuild Junior Member |
| |
Rotary clicks are measured on a per second basis. That means if the wheel registers 3 clicks in one second; onRotary will report three. Using the Rotary wheel for a 'Hold' function seems a little bit impossible... It sounds like you are trying to scroll based on a key press: This is somewhat contrary to Rotary methods unfortunately.
Although I would prefer to take another route, you could try the following:
-The Rotary wheel scans for clicks every second and reports them to onRotary. -If you combine a timer mechanism with the rotary wheel report; you could look for a minimum of two clicks each second. -Combine all that with a While loop: While Click == 2 every second execute or maintain your Hold action.
Hope this helps!
Cheers // Jason
PS: Does your Yamaha take control of the iPod through the dock and are you able to send RS232 commands to the Yamaha effectively controlling the iPod indirectly? |
 You can hide almost anything until you have to put the drywall up! | [ Reply | Quote & Reply |
| Post 3 made on Monday January 12, 2009 at 08:00 | ...it's new! |
mrashton Junior Member |
| |
Thanks Jason. Now I understand the returning of number of clicks per second, is there a way of commanding a button to act as Button Hold instead of just a Button Press with immediate release? I understand the onHold and onHoldInterval functions but I want to mimic a button to be held which in turn will mimic the use of the iPod scroll wheel.
To answer your PS: The Yamaha takes control of the iPod but I don't think the iPod can be controlled indirectly using RS232 when attached to the Yamaha Dock.
Regards, Matthew
This message was edited by mrashton on Monday January 12, 2009 at 10:19. |
| [ Reply | Quote & Reply |
| Post 4 made on Tuesday January 13, 2009 at 11:31 | ...it's new! |
GuerillaBuild Junior Member |
| |
If the command is an IR command you could go into myDatabase and extend the command length for any given IR command such that it sends for 'x' number of milliseconds when pressed. Each function has a 'duration' that can be overriden to any number of milliseconds you need.
If the command is script related:
Put script into the button that turns it into a toggle that calls a function. The function will then repeat your command when in the on state and will do nothing when in the off state. The script example below is a quick and dirty and would require a little bit of additional work to 'get it working'.
Activity Script var PushMe = "Dont"; function HoldButton(Action) { // Code to hold down or repeat your button command }
Widget Script
if (PushMe =="Dont") { PushMe = "Do"; HoldButton("Push"); } else { PushMe = "Dont"; HoldButton("StopPush"); }
Cheers // Jason |
 You can hide almost anything until you have to put the drywall up! | [ Reply | Quote & Reply |
| Post 5 made on Tuesday January 13, 2009 at 15:25 | ...it's new! |
mrashton Junior Member |
| |
Thanks again!
It would be great to be able to adjust the IR code duration dynamically from within a script. Is this possible? I can't find any reference in the Developer Guide. If not, I will revert to extending the duration in the database for the specific button (or a copy thereof). |
| [ Reply | Quote & Reply |
| Post 6 made on Tuesday January 13, 2009 at 15:52 | ...it's new! |
judderod Junior Member |
| |
I'd like to know if you get the script to work - I'd like to be able to use this for controlling my Sky HD but I really haven't a clue about prontoscript. My code experience goes as far as programming BASIC on a BBC computer!
I use the scroll wheel to send up or down so I can navigate the program guide easily. It's also set to jump back and forth a page if you scroll quickly, but for just slow scrolling it seems that pressing and holding the actual up or down buttons makes the selector on screen scroll much quicker even though the IR code is the same. I'm sure it's a clean learn as I've tried out several different learn methods and this code is the shortest that works well. |
| [ Reply | Quote & Reply |
| Post 7 made on Tuesday January 13, 2009 at 17:56 | ...it's new! |
GuerillaBuild Junior Member |
| |
Hi Matthew, I would love to see Philips add a ton more properties and methods into Prontoscript from the generic javascript, but from what I've seen it's not likely in the near future. It's not a bad thing; you just have to use a different path. I have yet to be stopped by a lack of functionality in Prontoscript although I could do a lot of things a lot quicker if there was more functionality.
All that being said: I'm not aware of a property that would allow you to adjust IR duration during runtime. I think you've already found the solution by the looks of it. Creating two instances of the same IR function; one with an extended duration and the other at default would definitely address the issue.
Cheers // Jason |
 You can hide almost anything until you have to put the drywall up! | [ Reply | Quote & Reply |
| Post 8 made on Tuesday January 13, 2009 at 18:06 | ...it's new! |
GuerillaBuild Junior Member |
| |
Hi judderrod,
if you're able to program the rotary wheel, you've gotten a good taste of javascript already. If you're looking for syntax and structure information, try dialing up W3Schools on google. They have a pretty good reference and getting started section for Javascript. Considering you come from the Basic world, you'll find javascript to be seriously lacking in verbocity; other than that a loop is a loop and an if statement is still an if statement!
Regarding slow scrolling the rotary wheel: It can be done! Before jumping into velocity control for the wheel: The reason the scroll wheel accelerates is based on the fact that it reports how many clicks have passed each second. So if you get rotary happy and spin the little bugger quickly the first time it might skip forward as much as 4 clicks in one second; whereas if you give it a gentle nudge it may report 0 or 1. Put a governor in your onRotary function such that if (clicks >=1) {clicks = 1}. With the governor in place, no matter how fast you spin the rotary wheel it will always click forward one click at a time.
Hope this helps!
Cheers // Jason |
 You can hide almost anything until you have to put the drywall up! | [ Reply | Quote & Reply |