First of all, thanks for everyone for this thread. I've been using EG for a couple of years but for some reason I've been neglecting the OSD completely. Today I started to come up with a simple volume OSD.
bskchaos wrote:The new event (system.volume) seems to be accurate and I want to use it for a better volume bar.
Right now I need to convert the eg.event.payload to a number, need help with this.
That's what I also wanted to use (didn't actually know any other alternative). My problem with System.Volume was that the payload is a string, depicting a float/double with a comma as a decimal separator. Having the comma instead of a period is what seems to fail the type conversion, thus I simply split the string from the comma and take only the numbers before it:
Value only:
Volume: {eg.event.payload.split(",")[0]}%
Volume bar (100 characters long, made of | and .)
Volume: {"|"*int(eg.event.payload.split(",")[0])+"."*(100-int(eg.event.payload.split(",")[0]))}%
Shorter volume bar (20 characters long, made of | and .) with numerical value in the end
Volume: {"|"*((int(eg.event.payload.split(",")[0]))/5)+"."*((20-int(eg.event.payload.split(",")[0])/5))}%
Webdings bar (20 characters long, made of blocks), make sure you set font to Webdings!
{"g"*((int(eg.event.payload.split(",")[0]))/5)+"c"*((20-int(eg.event.payload.split(",")[0])/5))}
Webdings bar (50 characters long, made of blocks), make sure you set font to Webdings!
{"g"*((int(eg.event.payload.split(",")[0]))/2)+"c"*((50-int(eg.event.payload.split(",")[0])/2))}
Hope this helps. It could be a bit too heavy, I dunno, but I think I might be going with just the numerical display.