Oh yeah, lol, what a din! I didn't notice the change there! It's because at first I had Text=[mVolume:] so I changed the last part by adding the 's' which didn't work. Then removed the [] and : which also didn't work. Now I know why!
Thanks Balala
It is currently April 26th, 2024, 1:48 pm
Help in programming
-
- Posts: 1140
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away
-
- Posts: 1140
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away
Re: Help in programming
Oh dear! It's broken other controls for Volume! MouseScroll and Left/Right click change the Bar but not the numerical value.
How do I know which Measure to use? Now that you've changed it.
This is all the Volume sections of the skin:
How do I know which Measure to use? Now that you've changed it.
This is all the Volume sections of the skin:
Code: Select all
[Rainmeter]
Update=25
BackgroundMode=2
SolidColor=0,0,0,1
SkinHeight=39
DynamicWindowSize=1
AccurateText=1
LeftMouseUpAction=[!ToggleMeter sTime][!ToggleMeter Time][!Redraw]
MouseOverAction=[!ShowMeterGroup Hover] [!UpdateMeterGroup *] [!SetOption VolLevel FontColor "128,255,0"] [!UpdateMeter *] [!Redraw]
MouseLeaveAction=[!HideMeterGroup Hover] [!UpdateMeterGroup *] [!SetOption VolLevel FontColor "175,175,175"] [!UpdateMeter *] [!Redraw]
MouseScrollUpAction=[!CommandMeasure "mVolume" "ChangeVolume 5"] [!UpdateMeasure mVolume] [!UpdateMeter VolBar] [!UpdateMeasure mVolume] [!UpdateMeter *] [!Redraw]
MouseScrollDownAction=[!CommandMeasure "mVolume" "ChangeVolume -5"] [!UpdateMeasure mVolume] [!UpdateMeter VolBar] [!UpdateMeasure mVolume] [!UpdateMeter *] [!Redraw]
MiddleMouseUpAction=[!CommandMeasure "mVolume" "ToggleMute"] [!UpdateMeasure mVolume] [!UpdateMeter VolBar] [!UpdateMeasure mVolume] [!UpdateMeter *] [!Redraw]
[Variables]
VolLow=25
VolMax=80
========================================
; VOLUME
========================================
[mVolume]
Measure=Plugin
Plugin=Win7AudioPlugin
[msVolume]
Measure=String
String=[mVolume:]
UpdateDivider=#UD1#
Substitute="-1":"MUTED"
[VolLevel]
Meter=String
MeasureName=msVolume
FontFace=Corbel
StringStyle=Bold
FontSize=12
FontColor=175,175,175
SolidColor=0,0,0,1
Text=%1
AntiAlias=1
DynamicVariables=1
LeftMouseUpAction=[!CommandMeasure "mVolume" "SetVolume #VolLow#"] [!UpdateMeasure mVolume] [!UpdateMeter *] [!Redraw]
RightMouseUpAction=[!CommandMeasure "mVolume" "SetVolume #VolMax#"] [!UpdateMeasure mVolume] [!UpdateMeter *] [!Redraw]
MiddleMouseUpAction=ms-settings:sound
X=2
Y=15
[VolBar]
Meter=Bar
MeasureName=mVolume
BarColor=255,128,0
SolidColor=60,60,60
LeftMouseUpAction=[!SetOption mVolume Formula "($MouseX:%$)"] [!UpdateMeasure mVolume] [!CommandMeasure "mVolume" "SetVolume [mVolume]"] [!UpdateMeasure mVolume] [!UpdateMeter *] [!Redraw]
BarOrientation=Horizontal
DynamicVariables=1
Hidden=1
Group=Hover
Y=36
W=180
H=2
- MuLab -
-
- Rainmeter Sage
- Posts: 16172
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Help in programming
The Text=[mVolume:] option has to be used when you want to force the String meter to show the numeric value of the [mVolume] measure. For instance [mVolume] being a Win7Audio plugin measure, as eclectic-tech described, it returns two different values: a numeric (the volume level) and a string (current sound device name) value. If you add a MeasureName=mVolume and a Text=%1 option, the meter will show the name of the current sound device. If you add Text=[mVolume:] option, it will show the volume level.
Additionally, you can even force the meter to show the volume level with defined number of decimals, adding the appropriate number after the colon. For instance the Text=[mVolume:2] option will show the value with two decimals.
If on the other hand the measure set through the MeasureName option returns a numerical value a similar behavior can be achieved adding a NumOfdecimals=2 option to the String meter (note that in this case the meter has to have a MeasureName=... and a Text=%1 option set). This way can you get the String meter to show the value returned by a Calc measure for example with defined number of decimals.
-
- Rainmeter Sage
- Posts: 16172
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Help in programming
The correct measure is appropriately set, not this is the issue. You've forgot to add a DynamicVariables=1 option to the [msVolume] measure. This is absolutely required, since the measure uses section variables ([mVolume:] is a such section variable) and these are requireing setting the dynamic variables.
-
- Posts: 1140
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away
Re: Help in programming
Thanks for the explanation balala.
I added DynamicVariables=1 and still it doesn't work corrrectly. There is a long delay between changing volume and the meter update.
I added DynamicVariables=1 and still it doesn't work corrrectly. There is a long delay between changing volume and the meter update.
- MuLab -
-
- Posts: 1140
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away
Re: Help in programming
It's ok, I used eclectic-tech's code and used a !SetOption bang to change it to Muted. Thanks to you both for the help
- MuLab -
-
- Rainmeter Sage
- Posts: 16172
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Help in programming
Could you please post the current code?
Note two more details, related to this code:
- Update=25? Why? No need to set the Update so low. Note that as less are you setting it, as more resources requires the skin. For skins showing the volume level, the default Update=1000 is usually completly enough.
- The [!SetOption mVolume Formula "($MouseX:%$)"] bang used into the LeftMouseUpAction option of the [VolBar] meter is completely wrong. [mVolume] is not a Calc measure, so you can't set a Formula to it. Later in the same LeftMouseUpAction option you have a [!CommandMeasure "mVolume" "SetVolume [mVolume]"] option, which is wrong as well. I suppose the first bang (which sets the Formula) has remaind there from a previously existing and later modified option, so you should remove it. The !CommandMeasure bang is wrong because you can't set the volume level of the [mVolume] measure, setting it to the value of [mVolume] itself. I'd replace this !CommandMeasure bang with the following one: [!CommandMeasure "mVolume" "SetVolume $MouseX:%$"]. This way when you click to the bar, the volume level is set to the appropriate value of the place where you clicked.
-
- Posts: 1140
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away
Re: Help in programming
Update=25 - This is due to using an audio meter in the skin.
I also have UpdateDivider=1000 which is used for the Volume parts of the skin.
I reverted the code back to the original as It was causing other problems.
It's not a problem not having Mute status shown correctly tbh, as I rarely Mute the system anyway.
Here's the code again with the removed section detailed in the post below:
I also have UpdateDivider=1000 which is used for the Volume parts of the skin.
I reverted the code back to the original as It was causing other problems.
It's not a problem not having Mute status shown correctly tbh, as I rarely Mute the system anyway.
Here's the code again with the removed section detailed in the post below:
Last edited by sl23 on November 10th, 2019, 12:18 am, edited 2 times in total.
- MuLab -
-
- Posts: 1140
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away
Re: Help in programming
I've removed it as it's no longer required for this skin. Thanks for pointing it out.The [!SetOption mVolume Formula "($MouseX:%$)"] bang used into the LeftMouseUpAction option of the [VolBar] meter is completely wrong. [mVolume] is not a Calc measure, so you can't set a Formula to it. Later in the same LeftMouseUpAction option you have a [!CommandMeasure "mVolume" "SetVolume [mVolume]"] option, which is wrong as well. I suppose the first bang (which sets the Formula) has remaind there from a previously existing and later modified option, so you should remove it. The !CommandMeasure bang is wrong because you can't set the volume level of the [mVolume] measure, setting it to the value of [mVolume] itself. I'd replace this !CommandMeasure bang with the following one: [!CommandMeasure "mVolume" "SetVolume $MouseX:%$"]. This way when you click to the bar, the volume level is set to the appropriate value of the place where you clicked.
- MuLab -
-
- Rainmeter Sage
- Posts: 16172
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Help in programming
Normally. You have the Update value set to Update=25 and on those meters UpdateDivider=1000. This means the meters are updated once per 25 x 1000 milliseconds = 25 seconds. Practically twice per minute.
To get one update per second, set the UD1 variable to UD1=40. This means the meters will be updated once per 25 x 40 miiliseconds = 1000 milliseconds = 1 second. Now it'll be ok.