I've created a 'signal strength' type triangle to show my system volume in one charactor space.
Here's what it looks like when animated. In reality, it just moves up and down when I press my volume buttons.
My Dell multimedia keyboard has volume buttons on it. When pressed they raise and lower the system volume by exactly 4%. So, by using sandr.dll to detect volumes of 0%, 4%, 8%... etc. I can then have it replace those numerical percentages with a custom character.
Here's the code I'm using in smartie. Note that the volume is shown as +volwithleadingzero+.
Here's the omit.ini file I'm using with sandr.dll. The string "16" is contained in $CustomChar(8,0,0,0,0,0,0,0,16) so I had to put in a work around to stop 16 being replaced in the customchar when the volume was at 16%. I chose to wrap my volumes with + symbols.
Code: Select all
[Search1]
1=+00+
2=+04+
3=+08+
4=+12+
5=+16+
6=+20+
7=+24+
8=+28+
9=+32+
10=+36+
11=+40+
12=+44+
13=+48+
14=+52+
15=+56+
16=+60+
17=+64+
18=
19=
20=
[Replace1]
1=$CustomChar(8,0,0,0,0,0,0,0,0)
2=$CustomChar(8,0,0,0,0,0,0,0,0)
3=$CustomChar(8,0,0,0,0,0,0,0,16)
4=$CustomChar(8,0,0,0,0,0,0,24,16)
5=$CustomChar(8,0,0,0,0,0,0,24,16)
6=$CustomChar(8,0,0,0,0,0,24,24,16)
7=$CustomChar(8,0,0,0,0,0,24,24,16)
8=$CustomChar(8,0,0,0,0,28,24,24,16)
9=$CustomChar(8,0,0,0,0,28,24,24,16)
10=$CustomChar(8,0,0,0,28,28,24,24,16)
11=$CustomChar(8,0,0,0,28,28,24,24,16)
12=$CustomChar(8,0,0,30,28,28,24,24,16)
13=$CustomChar(8,0,0,30,28,28,24,24,16)
14=$CustomChar(8,0,30,30,28,28,24,24,16)
15=$CustomChar(8,0,30,30,28,28,24,24,16)
16=$CustomChar(8,31,30,30,28,28,24,24,16)
17=$CustomChar(8,31,30,30,28,28,24,24,16)
18=
19=
20=
It works well, but stops working if the volume goes to a value I'm not replacing, like 25%. That will only happen if I change the volume using something other than my keyboard.
Is there a rounding function in smartie I can use to round the volume %s to the nearest 5% say?