Home AMX User Forum NetLinx Studio

Updating a volume bargraph

I have implemented my first volume preset (YAY it works!), but I am having difficulty getting my active bargraph to update accordingly. Here is my code:
BUTTON_EVENT[dvJVCLT37X898Tp,405] //vol preset 1

{
	HOLD[20]:    //If Button is Held for 2 seconds
	{
		nVolPre = nTVVOL
		SEND_COMMAND dvJVCLT37X898Tp,'ADBEEP' //double beeps panel
	}
	
	RELEASE:
	{
		SEND_COMMAND vdvJVCLT37X898, "'PASSTHRU-!',$82,$80,'VL',itoa(nVolPre),$0A"
		 
	}
	
	
}

LEVEL_EVENT[dvJVCLT37X898Tp,2]
{
	nTVVOL=LEVEL.VALUE
	SEND_COMMAND vdvJVCLT37X898, "'PASSTHRU-!',$82,$80,'VL',itoa(nTVVOL),$0A"
	

I was resisting doing 2 graphs (one transparent) at this time simply because I'm trying to take one concept at a time, so please tell me if I'm being a dork (or making things more difficult for myself) by not doing it.

Comments

  • you would need to send the level of nVolPre back to the bargraph in this case when recalling it (by the looks of things on the release of your button). In fact you probably dont even need to send another string to the device, just send the level - the level event will then handle the string.
    BUTTON_EVENT[dvJVCLT37X898Tp,405] //vol preset 1
    
    {
    	HOLD [20]:    //  If Button is Held for 2 seconds
    	{
    		nVolPre = nTVVOL
    		SEND_COMMAND dvJVCLT37X898Tp, 'ADBEEP'  //  double beeps panel
    	}
    	
    	RELEASE:
    	{
    		SEND_LEVEL dvJVCLT37X898Tp, 2, nVolPre
    		 
    	}
    	
    	
    }
    
    LEVEL_EVENT [ dvJVCLT37X898Tp, 2 ]
    {
    	nTVVOL = LEVEL.VALUE
    	SEND_COMMAND vdvJVCLT37X898, " 'PASSTHRU-!', $82, $80, 'VL', itoa ( nTVVOL ), $0A "
    
    

    you may want to consider renaming your TP Dev to something a bit easier to follow e.g. dvProjector or something! You can always put a comment after the DEFINE_DEVICE
    DEFINE_DEVICE
    dvPROJECTOR_01    =  5001:1:0  // JVC uberproj Mk IV
    
    dvTP_Main    =  10101:1:0 // General TP Button on Port 1
    dvTP_Proj_01    = 10101:2:0 // Pages for projector, all buttons for projector on Port 2
    dvTP_DVD_01    =  10101:3:0  // DVD pages, buttons on port 3.... etc etc etc
    
    
  • vegastechvegastech Posts: 369
    That worked beautifully, Thanks! I know, the dev name on my TV is long...I haven't changed it as I am working with the duet module for the tv at this time, and I don't want to confuse myself just yet. :)

    Gotta run before I can walk....or something like that.
  • Thanks

    Sweet! Nice to be a help :-)
Sign In or Register to comment.