Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 57 made on Thursday January 3, 2013 at 19:30
Lowpro
Select Member
Joined:
Posts:
March 2004
2,081
I recently purchased an Onkyo TX-NR818 which allows for control over IP and RS-232. Presently I'm controlling the receiver using RS-232 exclusively. Spent some time this past weekend implementing a volume widget which is located on the system page of my configuration file. The volume widget will indicate whether the receiver is powered on or not, and if powered on will display the mute status and current volume level. Works extremely well. For those of you with Integra/Onkyo receivers I thought I'd post the simple ProntoScript I've implemented for doing this which is shown below.

Setting the volume widget...
Each page of my configuration file invokes a function stored at the device (activity) level which sets the volume widget on my system page. Said ProntoScript is shown below. Should be noted that I'm only executing the below ProntoScript one time when a given page is shown. I'm not having the below ProntoScript repeat at regular intervals as I prefer to have the remote completely idle unless actively being used by someone. In my case it's also on very rare occassion that another remote other than my primary remote would ever control the receiver as it's only used in my main listening room. If that happened worse case senario the volume widget would update automatically on my primary remote once the page changed or the mute hard button or volume up/down hard buttons were used.

//
function doGetStatus() {
var e = CF.extender[4];
var s = e.serial[0];
s.bitrate = 9600;
s.databits = 8;
s.parity = 0;
s.stopbits = 1;
prePWR = s.match("!1PWRQSTN\r",100); //Asks receiver for power status.
preAMT = s.match("!1AMTQSTN\r",100); //Asks receiver for mute status.
preMVL = s.match("!1MVLQSTN\r",100); //Asks receiver for volume status.
hexMVL = preMVL.substring(5, 9); //Parses answer from receiver regarding volume status to only include hex value of volume level, i.e. 41 versus !1MVL41\x1A.
postMVL = parseInt(hexMVL, 16); //Converts hex value to a decimal as would be seen on the receiver itself, i.e. 65 instead of 41.
if(prePWR=="!1PWR00\x1A") { //If receiver is powered off set volume widget with greyed out volume graphic and don't display volume level within text label.
CF.widget("Speaker","PS_SYSTEM","PS_SYSTEM").setImage(CF.widget("MuteNA","Macros (Resources)","Macros (Bridge)").getImage(0),0);
CF.widget("Speaker","PS_SYSTEM","PS_SYSTEM").label = " ";
}
else { if(preAMT=="!1AMT01\x1A") { //If receiver is muted set volume widget with muted volume graphic and display volume level within text label.
CF.widget("Speaker","PS_SYSTEM","PS_SYSTEM").setImage(CF.widget("MuteOn","Macros (Resources)","Macros (Bridge)").getImage(0),0);
CF.widget("Speaker","PS_SYSTEM","PS_SYSTEM").label = postMVL;
}
else { if(preAMT=="!1AMT00\x1A") { //If receiver is not muted set volume widget with unmuted volume graphic and display volume level within text label.
CF.widget("Speaker","PS_SYSTEM","PS_SYSTEM").setImage(CF.widget("MuteOff","Macros (Resources)","Macros (Bridge)").getImage(0),0);
CF.widget("Speaker","PS_SYSTEM","PS_SYSTEM").label = postMVL;
}
}
}
}

Once the volume widget is set for the page it is then updated whenever the mute and volume hard buttons are used or when remote displays a different page of course. The ProntoScript I'm using for each hard button is shown below which exists only under my system device. Each device (activity) which is used for the main listening room in my home is then set to use the system page actions for the mute and volume hard buttons. Should be noted as well that if my receiver is muted it will automatically unmute the moment it receives a volume command. As such, I do account for this in the below ProntoScript. Note also that I'm only updating the volume level displayed after releasing the volume up or down hard buttons. Once releasing the volume up or down hard buttons the volume level updates within the text label of the volume widget instantly. Found it complete overkill to have the volume level displayed actively change as I was holding down a volume hard button. Makes for far smoother volume ramping as a result I'd imagine. Happy to report as well that while the volume ramping isn't as fast as it was when I was sending just the volume command from a conventional action list, the volume ramping is still quite sufficient and perfectly smooth.

Prontoscript for "PS_MUTE":

CF.widget("PS_MUTE","PS_SYSTEM","PS_SYSTEM").executeActions(); //Executes action list for mute hard button which contains the RS-232 command for toggling the mute state.
var e = CF.extender[4];
var s = e.serial[0];
s.bitrate = 9600;
s.databits = 8;
s.parity = 0;
s.stopbits = 1;
prePWR = s.match("!1PWRQSTN\r",100);
preAMT = s.match("!1AMTQSTN\r",100);
if(prePWR=="!1PWR00\x1A") { //If receiver is powered off set volume widget with greyed out volume graphic and don't display volume level within the text label.
CF.widget("Speaker","PS_SYSTEM","PS_SYSTEM").setImage(CF.widget("MuteNA","Macros (Resources)","Macros (Bridge)").getImage(0),0);
CF.widget("Speaker","PS_SYSTEM","PS_SYSTEM").label = " ";
}
else { if(preAMT=="!1AMT01\x1A") { //If receiver is muted set volume widget with muted volume graphic.
CF.widget("Speaker","PS_SYSTEM","PS_SYSTEM").setImage(CF.widget("MuteOn","Macros (Resources)","Macros (Bridge)").getImage(0),0);
}
else { if(preAMT=="!1AMT00\x1A") { //If receiver is not muted set volume widget with unmuted volume graphic.
CF.widget("Speaker","PS_SYSTEM","PS_SYSTEM").setImage(CF.widget("MuteOff","Macros (Resources)","Macros (Bridge)").getImage(0),0);
}
}
}

Prontoscript for "PS_VOLUME_UP":

var e = CF.extender[4];
var s = e.serial[0];
s.bitrate = 9600;
s.databits = 8;
s.parity = 0;
s.stopbits = 1;
prePWR = s.match("!1PWRQSTN\r",100);
if(prePWR=="!1PWR00\x1A") { //If receiver is powered off set volume widget with greyed out volume graphic and don't display volume level within text label.
CF.widget("Speaker","PS_SYSTEM","PS_SYSTEM").setImage(CF.widget("MuteNA","Macros (Resources)","Macros (Bridge)").getImage(0),0);
CF.widget("Speaker","PS_SYSTEM","PS_SYSTEM").label = " ";
}
else { //If receiver is muted set volume widget to show as unmuted, then send volume up (+1db) command one time on a short press and continuously from there on an extended press.
CF.widget("Speaker","PS_SYSTEM","PS_SYSTEM").setImage(CF.widget("MuteOff","Macros (Resources)","Macros (Bridge)").getImage(0),0);
CF.widget("PS_VOLUME_UP","PS_SYSTEM","PS_SYSTEM").executeActions(); //Executes action list for volume up hard button which contains the RS-232 command for increasing volume +1db. On a short button press the command is sent only once.
onHold=function() {
CF.widget("PS_VOLUME_UP","PS_SYSTEM","PS_SYSTEM").executeActions(); //On an extended press the command continues to be sent until the hard button is released.
}
onHoldInterval = 1;
onRelease=function() { //When releasing the hard button the volume level displayed within the text label updates accordingly.
preMVL = s.match("!1MVLQSTN\r",100);
hexMVL = preMVL.substring(5, 9);
postMVL = parseInt(hexMVL, 16);
CF.widget("Speaker","PS_SYSTEM","PS_SYSTEM").label = postMVL;
}
}

Prontoscript for "PS_VOLUME_DOWN":

var e = CF.extender[4];
var s = e.serial[0];
s.bitrate = 9600;
s.databits = 8;
s.parity = 0;
s.stopbits = 1;
prePWR = s.match("!1PWRQSTN\r",100);
if(prePWR=="!1PWR00\x1A") { //If receiver is powered off set volume widget with greyed out volume graphic and don't display volume level within the text label.
CF.widget("Speaker","PS_SYSTEM","PS_SYSTEM").setImage(CF.widget("MuteNA","Macros (Resources)","Macros (Bridge)").getImage(0),0);
CF.widget("Speaker","PS_SYSTEM","PS_SYSTEM").label = " ";
}
else { //If receiver is muted set image on volume widget to show as unmuted, then send the volume down (-1db) command one time on a short press and continuously from there on an extended press.
CF.widget("Speaker","PS_SYSTEM","PS_SYSTEM").setImage(CF.widget("MuteOff","Macros (Resources)","Macros (Bridge)").getImage(0),0);
CF.widget("PS_VOLUME_DOWN","PS_SYSTEM","PS_SYSTEM").executeActions(); //Executes action list for volume down hard button which contains the RS-232 command for decreasing volume -1db. On a short button press the command is sent only once.
onHold=function() {
CF.widget("PS_VOLUME_DOWN","PS_SYSTEM","PS_SYSTEM").executeActions(); //On an extended press the command continues to be sent until the hard button is released.
}
onHoldInterval = 1;
onRelease=function() { //When releasing the hard button the volume level displayed within the text label updates accordingly.
preMVL = s.match("!1MVLQSTN\r",100);
hexMVL = preMVL.substring(5, 9);
postMVL = parseInt(hexMVL, 16);
CF.widget("Speaker","PS_SYSTEM","PS_SYSTEM").label = postMVL;
}
}

Last edited by Lowpro on December 5, 2013 08:46.
LP Related Links:
View my profile to access various
links to key posts and downloads.


Hosting Services by ipHouse