It is currently June 30th, 2024, 2:33 pm

[!Refreshapp] when skin loaded?

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 7580
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [!Refreshapp] when skin loaded?

Post by Yincognito »

sl23 wrote: June 22nd, 2024, 2:30 pm No way, you mean... you made a mistake? :rolmfao:
I thought you were infallable!!! :o
Got my hopes up then! :-(
Good point, everybody makes mistakes from time to time! Well, at least it's not often... :sly:
Yep, so it looks like you're entirely in the NirSoft boat then. :confused:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7580
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [!Refreshapp] when skin loaded?

Post by Yincognito »

sl23 wrote: June 22nd, 2024, 2:44 pm Back to my problem... :D

Code: Select all

[mMicdbLevel]
Measure=Plugin
Plugin=AudioLevel
Port=Input
ID=[mDeviceID]
How to separate the two inputs so I can measure each from separate bar meters?
If you're talking about the RMS (aka signal, not device volume) levels, make two measures like that, each with its own ID.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
sl23
Posts: 1236
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: [!Refreshapp] when skin loaded?

Post by sl23 »

This works, but would be best if it could monitor and set from a variable, is that possible? Is it simple or RexEx complex? :D

Code: Select all

[mMicdbLevel]
Measure=Plugin
Plugin=AudioLevel
Port=Input
ID={0.0.1.00000000}.{7fb35683-1fea-4fa1-be4a-a3e49b15aeeb}
RMSAttack=50
RMSDecay=300
RMSGain=10

[mLinedbLevel]
Measure=Plugin
Plugin=AudioLevel
Port=Input
ID={0.0.1.00000000}.{0633eb3a-04b7-4232-bc8f-5a95f6d9a8f5}
RMSAttack=50
RMSDecay=300
RMSGain=10
...and combine so it works across the board for easy changing from PC to PC, change one variable and the whole thing works would be the best solution I think. But I'm so utterly lost on this, my brain hurts!!! :rofl:
- MuLab -
User avatar
sl23
Posts: 1236
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: [!Refreshapp] when skin loaded?

Post by sl23 »

Tried this, but doesn't do anything, even though my text editor asks to reload due to changes!

Code: Select all

[mDeviceID]
Measure=Plugin
Plugin=AudioLevel
Parent=mMicdbLevel
Type=DeviceID
;RegExpSubstitute=1
;Substitute="{.*}\.":""
IfMatch="#Mic#"
IfMatchAction=[!UpdateMeter *][!Redraw]
IfNotMatchAction=[!WriteKeyValue Variable MicID "mDeviceID"][!Update][!Redraw]
If I use IfMatch="#MicID#" the percent meter doesn't display anymore.
- MuLab -
User avatar
sl23
Posts: 1236
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: [!Refreshapp] when skin loaded?

Post by sl23 »

Not sure if you're following or not?

My latest attempt seems to only work occasionally, any idea what's wrong?

Code: Select all

[mMicdbLevel]
Measure=Plugin
Plugin=AudioLevel
Port=Input
;ID=#MicID#
ID={0.0.1.00000000}.{7fb35683-1fea-4fa1-be4a-a3e49b15aeeb}
RMSAttack=50
RMSDecay=300
RMSGain=10

[mDeviceID]
Measure=Plugin
Plugin=AudioLevel
Parent=mMicdbLevel
Type=DeviceID
;RegExpSubstitute=1
;Substitute="{.*}\.":""
IfMatch=#MicID#
IfMatchAction=
IfNotMatchAction=[!SetVariable MicID [mDeviceID]] [!WriteKeyValue Variables MicID [mDeviceID]][!Update][!Redraw]
- MuLab -
User avatar
Yincognito
Rainmeter Sage
Posts: 7580
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [!Refreshapp] when skin loaded?

Post by Yincognito »

sl23 wrote: June 22nd, 2024, 3:43 pm Not sure if you're following or not?
I do. Patience, my friend, patience.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
sl23
Posts: 1236
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: [!Refreshapp] when skin loaded?

Post by sl23 »

Sorry, not my forte! :oops:

Found out why my editor asked to reload! lol I set the original as Variable not plural! :?
- MuLab -
User avatar
Yincognito
Rainmeter Sage
Posts: 7580
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [!Refreshapp] when skin loaded?

Post by Yincognito »

sl23 wrote: June 22nd, 2024, 3:43 pmMy latest attempt seems to only work occasionally, any idea what's wrong?
Here's a sample code - well, basically a skin in itself - that should do most of what you need, instead of asking a couple of questions at every step:

Code: Select all

[Variables]
MicID={0.0.1.00000000}.{1ef40053-eec3-46f1-9bfe-7e1f209407af}
MicZap=0
MicVol=0
MicAdd=0
Update=50
UpdateDivider=40

[Rainmeter]
Update=#Update#
AccurateText=1
DynamicWindowSize=1
BackgroundMode=2
SolidColor=0,0,0,255

---Measures---

[GetMicInfo]
Measure=Calc
UpdateDivider=#UpdateDivider#
OnUpdateAction=[!CommandMeasure GetMicZap "Run"][!CommandMeasure GetMicVol "Run"]

[GetMicZap]
Measure=Plugin
Plugin=RunCommand
Program=#@#Addons\svcl.exe
Parameter=/stdout /getmute "#MicID#"
State=Hide
OutputType=ANSI
Timeout=10000
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?:\s+|[.]\d+)":""
FinishAction=[!SetOption MicZap Formula [GetMicZap]][!UpdateMeasure MicZap]
DynamicVariables=1

[GetMicVol]
Measure=Plugin
Plugin=RunCommand
Program=#@#Addons\svcl.exe
Parameter=/stdout /getpercent "#MicID#"
State=Hide
OutputType=ANSI
Timeout=10000
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?:\s+|[.]\d+)":""
FinishAction=[!SetOption MicVol Formula [GetMicVol]][!UpdateMeasure MicVol]
DynamicVariables=1

[SetMicZap]
Measure=Plugin
Plugin=RunCommand
Program=#@#Addons\svcl.exe
Parameter=/stdout /switch "#MicID#"
State=Hide
OutputType=ANSI
Timeout=10000
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?:\s+|[.]\d+)":""
FinishAction=[!SetOption MicZap Formula #MicZap#][!UpdateMeasure MicZap]
DynamicVariables=1

[SetMicVol]
Measure=Plugin
Plugin=RunCommand
Program=#@#Addons\svcl.exe
Parameter=/stdout /setvolume "#MicID#" #MicVol#
State=Hide
OutputType=ANSI
Timeout=10000
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?:\s+|[.]\d+)":""
FinishAction=[!SetOption MicVol Formula #MicVol#][!UpdateMeasure MicVol]
DynamicVariables=1

[AddMicVol]
Measure=Plugin
Plugin=RunCommand
Program=#@#Addons\svcl.exe
Parameter=/stdout /changevolume "#MicID#" #MicAdd#
State=Hide
OutputType=ANSI
Timeout=10000
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?:\s+|[.]\d+)":""
FinishAction=[!SetOption MicVol Formula (Clamp(#MicVol#+#MicAdd#,0,100))][!UpdateMeasure MicVol]
DynamicVariables=1

[MicZap]
Measure=Calc
Formula=0
MinValue=0
MaxValue=1
OnUpdateAction=[!SetVariable MicZap [MicZap:]]
RegExpSubstitute=1
Substitute="^0$":"[\x2713]","^1$":"[\x2717]"
DynamicVariables=1

[MicVol]
Measure=Calc
Formula=0
MinValue=0
MaxValue=100
OnUpdateAction=[!SetVariable MicVol [MicVol:]]
DynamicVariables=1

[MicRms]
Measure=Plugin
Plugin=AudioLevel
Port=Input
ID=#MicID#
RMSGain=5
MinValue=0
MaxValue=1

---Meters---

[MicVolVal]
Meter=String
X=0
Y=0
FontFace=Consolas
FontSize=10
FontColor=255,255,255,255
SolidColor=0,0,0,128
AntiAlias=1
MeasureName=MicVol
Text=[MicZap] Microphone Volume = %1%
DynamicVariables=1

[MicVolBar]
Meter=Bar
X=0r
Y=0R
W=200
H=20
SolidColor=128,128,128,255
BarColor=0,255,0,255
BarOrientation=Horizontal
MeasureName=MicVol
LeftMouseUpAction=[!SetVariable MicVol $MouseX:%$][!UpdateMeasure SetMicVol][!CommandMeasure SetMicVol "Run"]
MiddleMouseUpAction=[!SetVariable MicZap (1-#MicZap#)][!UpdateMeasure SetMicZap][!CommandMeasure SetMicZap "Run"]
MouseScrollUpAction=[!SetVariable MicAdd 5][!UpdateMeasure AddMicVol][!CommandMeasure AddMicVol "Run"]
MouseScrollDownAction=[!SetVariable MicAdd -5][!UpdateMeasure AddMicVol][!CommandMeasure AddMicVol "Run"]
DynamicVariables=1

[MicRmsVal]
Meter=String
X=0r
Y=0R
FontFace=Consolas
FontSize=10
FontColor=255,255,255,255
SolidColor=0,0,0,128
AntiAlias=1
Percentual=1
MeasureName=MicRms
Text=[MicZap] Microphone Signal = %1%
DynamicVariables=1

[MicRmsBar]
Meter=Bar
X=0r
Y=0R
W=200
H=20
SolidColor=128,128,128,255
BarColor=0,255,0,255
BarOrientation=Horizontal
MeasureName=MicRms
MicManager.jpg
Feel free to adjust the MicID, the svcl.exe path, or any other visual details to your own. The code is not complicated and mostly regex free, so the manual should be enough to understand it. Everything has a purpose in it, so if you modify the functional part you should know what you're doing. "Zap" means the mute status, "Add" means the change amount, if you wonder - just my 3 letter synonyms. The [GetMicInfo] system of running the svcl.exe instances every 2 seconds might increase the CPU usage a little bit, so if you want, replace it with another approach.

For me, this one works well, apart from the CPU usage detail - but then I'm one that doesn't like more than 2.5% CPU usage at any given moment anyway. I only tackled the Mic part, will not touch the Line In one since I can't test it on my system. Yes, setting some variables leads to setting some measures which in turn set back those variables - this is intentional, since, unlike the measures, the variables have a different / temporary role in setting the measures, which represent the final value.

Hopefully this will give you some ideas, clear some things, or help you complete your skin.

EDIT: Oops, forgot to use the same = in the meters for alignment - oh, well... corrected, just not in the screenshot.
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
sl23
Posts: 1236
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: [!Refreshapp] when skin loaded?

Post by sl23 »

Wow! Thanks, you da man! I think your a man anyway, it's kinda hard to tell under that hoodie! :rolmfao:

Just to double check, does it read the device list and auto set the default device?
I was trying to figure that out but it 's beyond me why it's not even writing the variable even though it uses it???
I don't think there's a way to get a specific device other than default automatically, but as there's a way to easily get that info, it's not a great deal.

Thanks for the skin, I'll check it out now :D :welcome:
- MuLab -
User avatar
Yincognito
Rainmeter Sage
Posts: 7580
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [!Refreshapp] when skin loaded?

Post by Yincognito »

sl23 wrote: June 22nd, 2024, 5:39 pmJust to double check, does it read the device list and auto set the default device?
Nah, I don't care about that, you do. I sticked to the essentials, based on your last code. The rest is up to you. :D
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth