Code: Select all
[Rainmeter]
Update=50
AccurateText=1
DynamicWindowSize=1
[Metadata]
Name=RoundVolume
Author=sl23
Information=Adjust Mic volume.||Credits:||Adapted from "SimplyRound" Suite by Krzysztof "gronostaj" Smialek||Mouse plugin by NighthawkSLO.||Powershell cmdlet .dll by frgnca.||Powershell code by death.crafter.||Help via forum: JSMorley, death.crafter, Yincognito.||Thanks to JSMorley for the AudioDeviceList skin.
; Credit for the AudioDeviceCmdlets .dll module to frgnca - https://github.com/frgnca/AudioDeviceCmdlets
; Credit for the initial Powershell code to death.crafter - https://forum.rainmeter.net/viewtopic.php?f=5&t=38135#p195694
; Credit for the supplemental Powershell code to jsmorley - https://forum.rainmeter.net/viewtopic.php?t=38135&start=30#p195744
; Other adjustments and improvements to keep the AudioDeviceCmdlets memory leak under control by Yincognito
Version=2024.06.15
License=CC BY 3.0
[Variables]
Aqua=0,255,255
AquaDark=64,191,167,200
AquaDark2=0,255,255,150
Green=128,255,0,220
Red=255,100,100
Trans=0,0,0,1
White=255,255,255,200
White20=255,255,255,20
White60=255,255,255,60
Yellow=255,255,0,150
BgFill=0,0,0,150
VolBar=64,191,167,200
VolLow=25
VolMax=80
NAME1=Low
NAME2=Mute
NAME3=Hi
; CmdFriendlyID=Realtek(R) Audio\Subunit\Microphone Boost
Timeout=300
RunEach=10
; For Mic Volume Control:
FastUpdate=25
SlowUpdate=1000
InputVolume=0
InputMute=0
InputStep=5
InputDevice=Mic
Changed=0
========================================
; Background
========================================
[Bg]
Meter=Shape
Shape=Rectangle 0,0,130,70,35 | FillColor #BgFill# | StrokeWidth 2 | Extend StrokeAlpha
StrokeAlpha=Stroke Color #White60#
DynamicVariables=1
X=2
Y=2
[Bg1]
Meter=Shape
Shape=Ellipse 0,0,30,30 | FillColor 0,0,0,50 | StrokeWidth 2 | Extend StrokeAlpha
Shape2=Ellipse 0,0,21,21 | FillColor #Trans# | StrokeWidth 2 | Extend StrokeAlpha2
Shape3=Ellipse 0,0,25,25 | FillColor #Trans# | StrokeWidth 10 | StrokeColor #White20#
StrokeAlpha=StrokeColor #White60#
StrokeAlpha2=StrokeColor #White60#
LeftMouseUpAction=[!SetVariable InputVolume 25][!SetVariable Changed 1][!Update]
MiddleMouseUpAction=[!SetVariable InputMute (1-#InputMute#)][!SetVariable Changed 1][!Update]
RightMouseUpAction=[!SetVariable InputVolume 80][!SetVariable Changed 1][!Update]
TooltipIcon=Info
ToolTipTitle=[mDeviceName]
ToolTipText=L - #NAME1##CRLF#M - #NAME2##CRLF#R - #NAME3#
MouseOverAction=[!SetOption #CURRENTSECTION# StrokeAlpha "StrokeColor #AquaDark2#"][!SetOption MicdbLevel FontColor "#Green#"][!HideMeter MicIcon][!ShowMeterGroup Input] [!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# StrokeAlpha "StrokeColor #White60#"][!SetOption MicdbLevel FontColor "#White#"][!ShowMeter MicIcon][!HideMeterGroup Input] [!UpdateMeter *][!Redraw]
MouseScrollUpAction=[!SetVariable InputVolume (Clamp(#InputVolume#+#InputStep#,0,100))][!SetVariable Changed 1][!Update]
MouseScrollDownAction=[!SetVariable InputVolume (Clamp(#InputVolume#-#InputStep#,0,100))][!SetVariable Changed 1][!Update]
DynamicVariables=1
X=37
Y=37
========================================
; STYLES
========================================
[sAllText]
FontFace=Trebuchet MS
StringStyle=Bold
StringAlign=CenterCenter
FontSize=12
FontColor=#White#
AntiAlias=1
DynamicVariables=1
[sHighlight]
MouseOverAction=[!SetOption #CURRENTSECTION# FontColor "#Green#"] [!UpdateMeter #CURRENTSECTION#] [!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# FontColor ""] [!UpdateMeter #CURRENTSECTION#] [!Redraw]
[sRoundBar]
LineStart=22
LineLength=28
LineWidth=4
StartAngle=(Rad(270))
Antialias=1
Solid=1
========================================
; Microphone Response
========================================
[mMicdbLevel]
Measure=Plugin
Plugin=AudioLevel
Port=Input
RMSAttack=50
RMSDecay=300
;Set your desired Mic-response here--------------------
RMSGain=10
[mDeviceStatus]
Measure=Plugin
Plugin=AudioLevel
Parent=mMicdbLevel
Type=DeviceStatus
Substitute="0":"Off","1":"On"
[mDeviceList]
Measure=Plugin
Plugin=AudioLevel
Parent=mMicdbLevel
Type=DeviceList
Substitute="}: ":"} "
OnChangeAction=[!Refresh]
[mDeviceName]
Measure=Plugin
Plugin=AudioLevel
Parent=mMicdbLevel
Type=DeviceName
RegExpSubstitute=1
Substitute="(Realtek(R) Audio)":"(R)","(USB Audio)":"USB",".*Microphone":"Mic"
IfMatch="Mic"
IfMatchAction=[!SetOption Button StrokeAlpha "StrokeColor #Green#"][!UpdateMeter *] [!Redraw]
IfNotMatchAction=[!SetOption Button StrokeAlpha "StrokeColor #Red#"][!UpdateMeter *] [!Redraw]
[Button]
Meter=Shape
Shape=Rectangle 0,0,10,10,5 | FillColor #Trans# | StrokeWidth 2 | Extend StrokeAlpha
StrokeAlpha=StrokeColor #White60#
LeftMouseUpAction=[Play "#@#Volume\Copy.wav"][!SetClip "; Windows Default Input Device:#CRLF##CRLF#; Device Name: [mDeviceName]#CRLF#; Device ID: [mDeviceID]#CRLF#; Device Format: [mDeviceFormat]#CRLF#; Device Status: [mDeviceStatus]#CRLF##CRLF#; Device List:#CRLF##CRLF#[mDeviceList]"]
MiddleMouseUpAction=[!Refresh]
RightMouseUpAction=
X1MouseUpAction=ms-settings:sound
X2MouseUpAction=[control mmsys.cpl]
ToolTipIcon=Info
ToolTipTitle=[mDeviceName] - [mDeviceStatus]
ToolTipText=L - Copy Device List#CRLF#M - Refresh#CRLF#R - #CRLF#X1 - CP Sound Settings#CRLF#X2 - Main Sound Settings
DynamicVariables=1
X=75
Y=5
[mDeviceID]
Measure=Plugin
Plugin=AudioLevel
Parent=mMicdbLevel
Type=DeviceID
RegExpSubstitute=1
Substitute="{.*}\.":""
[mDeviceFormat]
Measure=Plugin
Plugin=AudioLevel
Parent=mMicdbLevel
Type=Format
[MicRoundBar]
Meter=Roundline
MeasureName=mMicdbLevel
MeterStyle=sRoundBar
LineColor=#Yellow#
X=37
Y=37
[MicIcon]
Meter=String
MeterStyle=sAllText
FontFace=Segoe Fluent Icons
FontSize=16
Text=[\xE720]
X=38
Y=38
========================================
; Mic Volume Control via PS1
========================================
[DeviceVolume]
Measure=Plugin
Plugin=PowershellRM
ScriptFile=DeviceVolume.ps1
UpdateDivider=-1
[SetAudio]
Measure=String
String=#Changed#
RegExpSubstitute=1
Substitute="^0$":"","^1$":"Set-InputVolume -Volume #InputVolume#; Set-InputMute -State #InputMute#;"
UpdateDivider=(#SlowUpdate#/#FastUpdate#)
OnUpdateAction=[!SetVariable #CURRENTSECTION# [#CURRENTSECTION#]]
DynamicVariables=1
[GetAudio]
Measure=Plugin
Plugin=PowershellRM
Parent=DeviceVolume
Line=#SetAudio#$(Get-InputVolume), $(Get-InputMute), "" -join "`n"
UpdateDivider=(#SlowUpdate#/#FastUpdate#)
DynamicVariables=1
[InputVolume]
Measure=String
String=[GetAudio]
RegExpSubstitute=1
Substitute="(?siU)^.*(\N*\R)(\N*\R).*$":"\1","^\\\d+$":"","^(\d+).*$":"\1","^\\\d+$":""
UpdateDivider=(#SlowUpdate#/#FastUpdate#)
OnUpdateAction=[!SetVariable #CURRENTSECTION# [#CURRENTSECTION#]][!SetVariable Changed 0]
DynamicVariables=1
MinValue=0
MaxValue=100
[InputMute]
Measure=String
String=[GetAudio]
RegExpSubstitute=1
Substitute="(?siU)^.*(\N*\R)(\N*\R).*$":"\2","^\\\d+$":"","^(\d+).*$":"\1","^\\\d+$":""
UpdateDivider=(#SlowUpdate#/#FastUpdate#)
OnUpdateAction=[!SetVariable #CURRENTSECTION# [#CURRENTSECTION#]][!SetVariable Changed 0]
DynamicVariables=1
IfCondition=#InputMute# = 1
IfTrueAction=[!SetOption MicIcon Text "[\xEC54]"][!SetOption MicIcon FontColor "#Red#"][!UpdateMeter *][!Redraw]
IfFalseAction=[!SetOption MicIcon Text "[\xE720]"][!SetOption MicIcon FontColor "#White#"][!UpdateMeter *][!Redraw]
IfConditionMode=1
;---Neasures Devices---
[InputDevice]
Measure=Plugin
Plugin=PowershellRM
Parent=DeviceVolume
Line=Get-InputDevice
UpdateDivider=-1
DynamicVariables=1
=== Meters
[SetInputVolumeText]
Meter=String
MeterStyle=sAllText | sHighlight
StringAlign=Center
FontColor=#White#
Text=#InputVolume#
Hidden=1
Group=Input
DynamicVariables=1
X=37
Y=27
[SetInputVolRoundBar]
Meter=Roundline
MeasureName=InputVolume
MeterStyle=sRoundBar
LineColor=#Green#
Solid=0
X=37
Y=37