Home AMX User Forum NetLinx Studio

Bargragh variable

Is there a command so I can tell a bargraph to change its range that can be sent to it via code?
We are working on a universal panel design for our rooms and the one variable that seems to always change depending on the audio hardware is the volume bar range.

Comments

  • Spire_JeffSpire_Jeff Posts: 1,917
    Why not switch the bar graph to display 0-100% and then do the calculations on the actual volume range to obtain the percentage? This way, the panel doesn't have to change and it is still accurate.

    Jeff
  • viningvining Posts: 4,368
    Yes, I think it's ^GLH or something. It in AMX_PI for the TPs. I use it to change the progress of currently playing songs.

    I looked in some code and found this:
    if (SoundBSent[1].SBCurLevelChannel != SoundB[1].SBCurLevelChannel)
    	  {
    	  SEND_COMMAND dvTPSoundBArray,"'^GLH-',itoa(SoundB[1].SBCurLevelChannel),',',itoa(nSBSongLength)"
    	  wait 1
    	       {
    	       SEND_COMMAND dvTPSoundBArray,"'^GLH-100,',itoa(nSBSongLength)"
    	       }
    	  SoundBSent[1].SBCurLevelChannel = SoundB[1].SBCurLevelChannel
    	  }
    
  • AMXJeffAMXJeff Posts: 450
    Change Slider Values
    //////////////////////////////////////////////////////////////
    // UI - SLIDER CONFIG FOR RANGE
    //////////////////////////////////////////////////////////////
    DEFINE_FUNCTION UI_SliderConfig(INTEGER nAddressID, INTEGER nMaxValue, INTEGER nLowValue, INTEGER nHiValue, INTEGER nInvert)
    {
    	STACK_VAR CHAR cMsg[100];
    	
    	cMsg = "'^BMF-',ITOA(nAddressID),',1&2,%GL',ITOA(nLowValue),','"
    	
    	IF (nHiValue > nMaxValue)
    		cMsg = "cMsg,'%GH',ITOA((nHiValue-nMaxValue)+1),','"	
    	ELSE
    		cMsg = "cMsg,'%GH',ITOA(nLowValue),','"
    
    	cMsg = "cMsg,'%GI',ITOA(nInvert)"
    	
    	SEND_COMMAND TPA, cMsg;
    }
    
  • Thomas HayesThomas Hayes Posts: 1,164
    Thanks all, I'll give these a try.
Sign In or Register to comment.