Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1487

Help: Rainmeter Skins • Re: [!Refreshapp] when skin loaded?

$
0
0
So I have the Mic skin ToolTip working correctly and when the Mic is connected/disconnected, the ToolTip now works perfectly. Adjusting it's name to match the Mic or Line In. Trouble is, no matter what I do, I can't get my other skin, Volume skin, to activate/deactivate the Mic skin when the name changes.

As a test, I made a temporary button on the Mic skin to change colour when the name changes. So if "Microphone" is in the name, it lights green, and red for not connected. But it just stays red! In the About window, the Mic skin shows [mDeviceName] and [mDeviceID] change with each connect/disconnect. But the [mDeviceList] always shows Line In Name and ID. How do I get that to change? But when I monitor the [mDeviceName] to change the colour of [TempButton] it doesn't work. Even though the ToolTip changes.

EDIT: After reading 10 pages of the original thread, I found out about the RegEx:
  • @Yincognito: The * are just wildcards, so *Microphone* can mean SomePrefixHere Microphone or Microphone SomeSuffixHere, or just plain Microphone without any pre- or post- additional characters. It's the simpler equivalent of .* from regex, basically.
But no matter what I tried, just the * alone never worked, until I used .* and RegExpSubstitute=1. Now the Button changes colour and the ToolTip works perfectly using:

Code:

Substitute="(Realtek(R) Audio)":"(R)","(USB Audio)":"USB",".*Microphone":"Mic"IfMatch="Mic"IfMatchAction=[!SetOption TempButton FillAlpha "FillColor #Green#"][!UpdateMeter *] [!Redraw]IfNotMatchAction=[!SetOption TempButton FillAlpha "FillColor #Red#"][!UpdateMeter *] [!Redraw]
This part of the problem finally solved!!! :D :D :D :great:
I'm also getting a problem now with the Mic volume percentage. It always shows zero. If you scroll to increase, it constantly resets to zero. It was working perfect until recent, I have no idea what's going on with it.
EDIT: I realised that the Mic skin I was working on was the old RoundVolume one which had both Input and Output combined into one skin and also the Powershell script. But now I've removed the Output code from the skin and script, all good with this! :D
In JSMorley's Input/Output skin, I am getting an output device shown as Speakers (USB Audio) when connecting Mic, why is this?

Thanks for your help. :thumbup:
Full Code
EDIT: Latest code after finding RegEx

Code:

[Rainmeter]Update=50AccurateText=1DynamicWindowSize=1[Metadata]Name=RoundVolumeAuthor=sl23Information=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 YincognitoVersion=2024.06.15License=CC BY 3.0[Variables]Aqua=0,255,255AquaDark=64,191,167,200AquaDark2=0,255,255,150Green=128,255,0,220Red=255,100,100Trans=0,0,0,1White=255,255,255,200White20=255,255,255,20White60=255,255,255,60Yellow=255,255,0,150BgFill=0,0,0,150VolBar=64,191,167,200VolLow=25VolMax=80NAME1=LowNAME2=MuteNAME3=Hi; CmdFriendlyID=Realtek(R) Audio\Subunit\Microphone BoostTimeout=300RunEach=10; For Mic Volume Control:FastUpdate=25SlowUpdate=1000InputVolume=0InputMute=0InputStep=5InputDevice=MicChanged=0========================================; Background========================================[Bg]Meter=ShapeShape=Rectangle 0,0,130,70,35 | FillColor #BgFill# | StrokeWidth 2 | Extend StrokeAlphaStrokeAlpha=Stroke Color #White60#DynamicVariables=1X=2Y=2[Bg1]Meter=ShapeShape=Ellipse 0,0,30,30 | FillColor 0,0,0,50 | StrokeWidth 2 | Extend StrokeAlphaShape2=Ellipse 0,0,21,21 | FillColor #Trans# | StrokeWidth 2 | Extend StrokeAlpha2Shape3=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=InfoToolTipTitle=[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=1X=37Y=37========================================; STYLES========================================[sAllText]FontFace=Trebuchet MSStringStyle=BoldStringAlign=CenterCenterFontSize=12FontColor=#White#AntiAlias=1DynamicVariables=1[sHighlight]MouseOverAction=[!SetOption #CURRENTSECTION# FontColor "#Green#"] [!UpdateMeter #CURRENTSECTION#] [!Redraw]MouseLeaveAction=[!SetOption #CURRENTSECTION# FontColor ""] [!UpdateMeter #CURRENTSECTION#] [!Redraw][sRoundBar]LineStart=22LineLength=28LineWidth=4StartAngle=(Rad(270))Antialias=1Solid=1========================================; Microphone Response========================================[mMicdbLevel]Measure=PluginPlugin=AudioLevelPort=InputRMSAttack=50RMSDecay=300;Set your desired Mic-response here--------------------RMSGain=10[mDeviceStatus]Measure=PluginPlugin=AudioLevelParent=mMicdbLevelType=DeviceStatusSubstitute="0":"Off","1":"On"[mDeviceList]Measure=PluginPlugin=AudioLevelParent=mMicdbLevelType=DeviceListSubstitute="}: ":"}"OnChangeAction=[!Refresh][mDeviceName]Measure=PluginPlugin=AudioLevelParent=mMicdbLevelType=DeviceNameRegExpSubstitute=1Substitute="(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=ShapeShape=Rectangle 0,0,10,10,5 | FillColor #Trans# | StrokeWidth 2 | Extend StrokeAlphaStrokeAlpha=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:soundX2MouseUpAction=[control mmsys.cpl]ToolTipIcon=InfoToolTipTitle=[mDeviceName] - [mDeviceStatus]ToolTipText=L - Copy Device List#CRLF#M - Refresh#CRLF#R - #CRLF#X1 - CP Sound Settings#CRLF#X2 - Main Sound SettingsDynamicVariables=1X=75Y=5[mDeviceID]Measure=PluginPlugin=AudioLevelParent=mMicdbLevelType=DeviceIDRegExpSubstitute=1Substitute="{.*}\.":""[mDeviceFormat]Measure=PluginPlugin=AudioLevelParent=mMicdbLevelType=Format[MicRoundBar]Meter=RoundlineMeasureName=mMicdbLevelMeterStyle=sRoundBarLineColor=#Yellow#X=37Y=37[MicIcon]Meter=StringMeterStyle=sAllTextFontFace=Segoe Fluent IconsFontSize=16Text=[\xE720]X=38Y=38========================================; Mic Volume Control via PS1========================================[DeviceVolume]Measure=PluginPlugin=PowershellRMScriptFile=DeviceVolume.ps1UpdateDivider=-1[SetAudio]Measure=StringString=#Changed#RegExpSubstitute=1Substitute="^0$":"","^1$":"Set-InputVolume -Volume #InputVolume#; Set-InputMute -State #InputMute#;"UpdateDivider=(#SlowUpdate#/#FastUpdate#)OnUpdateAction=[!SetVariable #CURRENTSECTION# [#CURRENTSECTION#]]DynamicVariables=1[GetAudio]Measure=PluginPlugin=PowershellRMParent=DeviceVolumeLine=#SetAudio#$(Get-InputVolume), $(Get-InputMute), "" -join "`n"UpdateDivider=(#SlowUpdate#/#FastUpdate#)DynamicVariables=1[InputVolume]Measure=StringString=[GetAudio]RegExpSubstitute=1Substitute="(?siU)^.*(\N*\R)(\N*\R).*$":"\1","^\\\d+$":"","^(\d+).*$":"\1","^\\\d+$":""UpdateDivider=(#SlowUpdate#/#FastUpdate#)OnUpdateAction=[!SetVariable #CURRENTSECTION# [#CURRENTSECTION#]][!SetVariable Changed 0]DynamicVariables=1MinValue=0MaxValue=100[InputMute]Measure=StringString=[GetAudio]RegExpSubstitute=1Substitute="(?siU)^.*(\N*\R)(\N*\R).*$":"\2","^\\\d+$":"","^(\d+).*$":"\1","^\\\d+$":""UpdateDivider=(#SlowUpdate#/#FastUpdate#)OnUpdateAction=[!SetVariable #CURRENTSECTION# [#CURRENTSECTION#]][!SetVariable Changed 0]DynamicVariables=1IfCondition=#InputMute# = 1IfTrueAction=[!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=PluginPlugin=PowershellRMParent=DeviceVolumeLine=Get-InputDeviceUpdateDivider=-1DynamicVariables=1=== Meters[SetInputVolumeText]Meter=StringMeterStyle=sAllText | sHighlightStringAlign=CenterFontColor=#White#Text=#InputVolume#Hidden=1Group=InputDynamicVariables=1X=37Y=27[SetInputVolRoundBar]Meter=RoundlineMeasureName=InputVolumeMeterStyle=sRoundBarLineColor=#Green#Solid=0X=37Y=37

Statistics: Posted by sl23 — Yesterday, 4:08 pm



Viewing all articles
Browse latest Browse all 1487

Trending Articles