It is currently April 27th, 2024, 12:11 pm

Volume Shape Meters.

Get help with creating, editing & fixing problems with skins
Aryx
Posts: 34
Joined: December 20th, 2023, 9:18 am

Volume Shape Meters.

Post by Aryx »

A rather simple question, but, how do I use shape meter instead of bar in case of 2 plugins - win7audio and nowplaying.
The Static Width and Height and X and Y can be set, but I wanted the Width to change as per the Volume Changes in Media Player/System.
How can achieve this?

Below is the relevant code:

Code: Select all

[Variables]
CMinWH=120
PlayerName=WINAMP
VolRate=5

[MeasureVolume]
Measure=Plugin
Plugin=Win7AudioPlugin

[MeasureVolumeMP]
Measure=Plugin
Plugin=NowPlaying
PlayerType=Volume
PlayerName=#PlayerName#


[MinVolume]
Meter=Bar
MeasureName=MeasureVolume
X=5
Y=(#CMinWH#-6)
W=(#CMinWH#-12)
H=3
BarColor=255,255,255
SolidColor=0,0,0,1
BarOrientation=Horizontal
MouseScrollUpAction=[!CommandMeasure "MeasureVolume" "ChangeVolume +#VolRate#"]
MouseScrollDownAction=[!CommandMeasure "MeasureVolume" "ChangeVolume -#VolRate#"]
DynamicVariables=1

[MinVolumeMP]
Meter=Bar
MeasureName=MeasureVolumeMP
X=([MinVolume:X])
Y=([MinVolumeMP:H])
W=([MinVolume:W])
H=3
BarColor=255,255,255
BarOrientation=Horizontal
MouseScrollUpAction=[!CommandMeasure "MeasureVolumeMP" "SetVolume +#VolRate#"][!UpdateMeasure "MeasureVolumeMP"]
MouseScrollDownAction=[!CommandMeasure "MeasureVolumeMP" "SetVolume -#VolRate#"][!UpdateMeasure "MeasureVolumeMP"]
DynamicVariables=1
Also, before anyone says: why use a variable in X and Y - The said variable is subject to changes in the skin.
User avatar
balala
Rainmeter Sage
Posts: 16176
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Volume Shape Meters.

Post by balala »

Aryx wrote: January 30th, 2024, 1:28 pm A rather simple question, but, how do I use shape meter instead of bar in case of 2 plugins - win7audio and nowplaying.
The Static Width and Height and X and Y can be set, but I wanted the Width to change as per the Volume Changes in Media Player/System.
How can achieve this?
It can easily be done, by adding those Shape meters. For instance add the following two meters ([MeterVolume] and [MeterVolumeMP]) right after [MinVolume] and [MinVolumeMP] accordingly:

Code: Select all

[MinVolume]
...

[MeterVolume]
Meter=Shape
X=0r
Y=10R
Shape=Rectangle 0,0,([MinVolume:W]*[MeasureVolume:]/[MeasureVolume:MaxValue]),10 | Extend MyModifiers1
MyModifiers1=Fill Color 191,237,239,255 | StrokeWidth 2 | Stroke Color 46,115,31,255
DynamicVariables=1

[MinVolumeMP]
...

[MeterVolumeMP]
Meter=Shape
X=0r
Y=10R
Shape=Rectangle 0,0,([MinVolumeMP:W]*[MeasureVolumeMP:]/[MeasureVolumeMP:MaxValue]),10 | Extend MyModifiers1
MyModifiers1=Fill Color 191,237,239,255 | StrokeWidth 2 | Stroke Color 46,115,31,255
DynamicVariables=1
Note the details:
The total width of both newly added meters ([MeterVolume] and [MeterVolumeMP]) is the same as the total width of the existing bar meters. Their actual / visible width is controlled by the third parameter of the two Shape options (([MinVolume:W]*[MeasureVolume:]/[MeasureVolume:MaxValue]) and ([MinVolumeMP:W]*[MeasureVolumeMP:]/[MeasureVolumeMP:MaxValue])).
You obviously can adjust the color, size and any other option of both meters as you want / need. If you try out the above meters and have and question related to them, please feel free to come back.
Hope you can get these meters to show what you want. Do you get them?
Aryx
Posts: 34
Joined: December 20th, 2023, 9:18 am

Re: Volume Shape Meters.

Post by Aryx »

Ahhh! I got it now..
All it was missing was:

Code: Select all

[MeasureVolumeMP:]
I had to do this in one of the tries earlier. :handtohead:
balala wrote: January 30th, 2024, 4:27 pm Hope you can get these meters to show what you want. Do you get them?
Yes. Thank you for explaining it neatly. :thumbup:
User avatar
balala
Rainmeter Sage
Posts: 16176
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Volume Shape Meters.

Post by balala »

Aryx wrote: January 30th, 2024, 6:00 pm Ahhh! I got it now..
All it was missing was:

Code: Select all

[MeasureVolumeMP:]
I had to do this in one of the tries earlier. :handtohead:
I'm glad. Hope you did realize that [MeasureVolumeMP:] means the numeric value of the [MeasureVolumeMP] measure, while [MeasureVolumeMP] is its string value. In many cases these two are the same, but not always. For instance a Win7AudioPlugin measure have different string and numeric values. The string value of such a measure is the name of the current sound device, while its numeric value represents the volume level, expressed as a percentage.
Aryx wrote: January 30th, 2024, 6:00 pm Yes. Thank you for explaining it neatly. :thumbup:
I didn't quite explain it neatly or extremely detailed, but am glad if you got the idea.