rbriddickk84 wrote: ↑November 9th, 2023, 9:02 pm
I will coment on this if i reach any new progress.
Yincognito wrote: ↑November 10th, 2023, 9:16 am
Personally I've not yet tested this in your scenario, though I might just do that today.
As promised, here's the (working) outcome:
Code: Select all
[Variables]
@include=sett.inc
dotL=100
dotR=100
outL=65535
outR=65535
[Rainmeter]
Update=15
AccurateText=1
DynamicWindowSize=1
OnRefreshAction=[!CommandMeasure GetVolL "Run"][!CommandMeasure GetVolR "Run"]
---Measures---
[GetVolL]
Measure=Plugin
Plugin=RunCommand
Program=#@#Addons\svcl.exe
Parameter=/Stdout /GetPercentChannel "Speaker" 0
State=Hide
OutputType=ANSI
Timeout=10000
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?:\s+|[.]\d+)":""
FinishAction=[!SetVariable dotL "[GetVolL]"][!SetVariable outL (([#dotL]/100)*65535)][!UpdateMeterGroup vis][!Redraw]
DynamicVariables=1
[GetVolR]
Measure=Plugin
Plugin=RunCommand
Program=#@#Addons\svcl.exe
Parameter=/Stdout /GetPercentChannel "Speaker" 1
State=Hide
OutputType=ANSI
Timeout=10000
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?:\s+|[.]\d+)":""
FinishAction=[!SetVariable dotR "[GetVolR]"][!SetVariable outR (([#dotR]/100)*65535)][!UpdateMeterGroup vis][!Redraw]
DynamicVariables=1
---Meters---
[SliderDetectorLeft]
Meter=Image
SolidColor=100,200,200,255
X=4
Y=0
W=100
H=12
LeftMouseUpAction=[!SetVariable dotL $MouseX$][!SetVariable outL (([#dotL]/100)*65535)][!UpdateMeterGroup vis][!Redraw]["#@#Addons\nircmd.exe" setvolume 0 [#outL] [#outR]]
MiddleMouseUpAction=[!SetVariable dotL 100][!SetVariable outL (([#dotL]/100)*65535)][!UpdateMeterGroup vis][!Redraw]["#@#Addons\nircmd.exe" setvolume 0 [#outL] [#outR]]
DynamicVariables=1
[SliderDetectorRight]
Meter=Image
SolidColor=200,100,200,255
X=4
Y=16
W=100
H=12
LeftMouseUpAction=[!SetVariable dotR $MouseX$][!SetVariable outR (([#dotR]/100)*65535)][!UpdateMeterGroup vis][!Redraw]["#@#Addons\nircmd.exe" setvolume 0 [#outL] [#outR]]
MiddleMouseUpAction=[!SetVariable dotR 100][!SetVariable outR (([#dotR]/100)*65535)][!UpdateMeterGroup vis][!Redraw]["#@#Addons\nircmd.exe" setvolume 0 [#outL] [#outR]]
DynamicVariables=1
[BalanceVolShapeLeft]
Meter=Shape
Shape=Ellipse 2,2,4,6
X=#dotL#
Y=4
UpdateDivider=-1
DynamicVariables=1
Group=vis
[BalanceVolShapeRight]
Meter=Shape
Shape=Ellipse 2,2,4,6
X=#dotR#
Y=20
UpdateDivider=-1
DynamicVariables=1
Group=vis
I let most of the code unchanged, except some needed nested syntax for the variables in the mouse action bangs, as already mentioned earlier (I also changed to left mouse up and middle mouse up, it was more comfortable for me during testing). That alone made the code work as it should have (didn't test the original code at all, just went with the proper implementation). In addition to that, I added two RunCommand measures to get the left and right channel volumes, so the skin starts from current values communicated by the system in that regard. Therefore, you'll need:
- NirSoft's
Sound Volume Command Line tool, placed in the @Resources\Addons folder of the skin (to get channel volumes)
- NirSoft's
NirCmd tool, placed in the @Resources\Addons folder of the skin (to set channel volumes)
to have it all working (I used the 64bit versions, but it's up to you which architecture you prefer to use).
Feel free to adjust whatever thing you need from the code above (e.g. the "Speaker" device, in case you have it differently, something you can see in the
SoundVolumeView utility from the same NirSoft).
P.S. In case it's unclear why two such tools have to be used, it's because the first tool couldn't set the left channel volume for me (only the right one), and the second tool doesn't seem to have parameters to get the channel volumes (or any volume, for that matter) at all.
