Posted by member 212670 on 2006-06-09 15:23:19 link

I think tnl was refering to the 8th line: {currentvol} should be %{currentvol} to expand your saved var.

Also, the !parseevars he was talking about goes here, and you need two more %s:

*script exec !ParseEvars !varset currentvol "%[volume()]%"

And, that will set the currentvol as a percentage of your volume, like "95%", so you'll probably want to get rid of the % there... so:

*script exec !ParseEvars !varset currentvol "%[remove(volume, '%')]%"

That will set currentvol to a number only, like "95"

Note the missing ' around volume. If you have the single quotes around it, it'll use the actual word, and not expand it to have the % removed.

This presents what is another problem. The volume bangs for dynamp/geekamp is a range from 0 to 255! Not a percentage, which is what xlabel exports. This probably also explains your volume level problem. So, you'll need to do a little math on the number to turn it to a value from 0 to 255.

You'll also want to be exporting the winamp volume, not the master volume, so you need volume('winamp').

So, finally...

*script exec !ParseEvars !varset currentvol "%[remove(volume('winamp'), '%')]%"
*script exec !varmul currentvol 255
*script exec !vardiv currentvol 100

That will make currentvol the variable that you finally want to use with !Amp_SetVolume %{currentvol}.