It is currently June 30th, 2024, 7:51 am

[!Refreshapp] when skin loaded?

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

Re: [!Refreshapp] when skin loaded?

Post by Yincognito »

(RegExp powered) Substitute is your friend, if you want to "extract" only a part of that output. That being said, I have a few threads in that regard, so maybe using the Search button on the forum to look for those threads can both save you of some hassle and save me of potentially repeating the same things again... :lol:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
sl23
Posts: 1233
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: [!Refreshapp] when skin loaded?

Post by sl23 »

Sorry, I know I keep on about this one, I'm just too much of a perfectionist! :oops:

I have tried searching but haven't found anything useful. I tried all the links you posted in the long thread, some brief info, but again nothing I haven't gotten from manuals.

Reg ex is beyond me! Surely these nirsoft commands should work? Is it user error?
- MuLab -
User avatar
Yincognito
Rainmeter Sage
Posts: 7576
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [!Refreshapp] when skin loaded?

Post by Yincognito »

sl23 wrote: June 18th, 2024, 9:35 am Sorry, I know I keep on about this one, I'm just too much of a perfectionist! :oops:

I have tried searching but haven't found anything useful. I tried all the links you posted in the long thread, some brief info, but again nothing I haven't gotten from manuals.

Reg ex is beyond me! Surely these nirsoft commands should work? Is it user error?
Some links (some of them are about this, some are related):
https://forum.rainmeter.net/viewtopic.php?t=38135&start=110#p206843
https://forum.rainmeter.net/viewtopic.php?t=43135&start=20#p219420
https://forum.rainmeter.net/viewtopic.php?t=38000
https://forum.rainmeter.net/viewtopic.php?t=31930

They have some explanations, some links to Nirsoft, some Substitutes, etc., maybe they can be of use. The Nirsoft commands should mostly work, although from what I recall, not 100% perfectly or without a few hiccups.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
sl23
Posts: 1233
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: [!Refreshapp] when skin loaded?

Post by sl23 »

Thanks for the links :)
Tried first and fourth links, getting nothing back except: 〸〮഍
Using:

Code: Select all

Plugin=RunCommand
Program="#SKINSPATH#RM\Mic\svcl.exe"
Parameter=svcl /stdout /getpercent "USB Audio\Device\Microphone\Capture"
Will look closer at the second and third links, may help.

The thing I am having trouble with is knowing which parts go where. I noticed in one of those links that you specified no Program= but instead put path as a Parameter=#@#Addons\SoundVolumeView.exe /stab "" | #@#Addons\GetNir.exe "Muted" "Command-LineFriendlyID='Realtek High Definition Audio\Device\Microphone\Capture'"
Does it matter whether you use the Program= line? Or is it just another way of working?

Only issue I have is getting the values required.

Started looking at this page on RegEx, starts simple! ;-)
:thumbup:
- MuLab -
User avatar
Yincognito
Rainmeter Sage
Posts: 7576
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [!Refreshapp] when skin loaded?

Post by Yincognito »

sl23 wrote: June 18th, 2024, 2:49 pm Thanks for the links :)
Tried first and fourth links, getting nothing back except: 〸〮഍
Using:

Code: Select all

Plugin=RunCommand
Program="#SKINSPATH#RM\Mic\svcl.exe"
Parameter=svcl /stdout /getpercent "USB Audio\Device\Microphone\Capture"
Will look closer at the second and third links, may help.

The thing I am having trouble with is knowing which parts go where. I noticed in one of those links that you specified no Program= but instead put path as a Parameter=#@#Addons\SoundVolumeView.exe /stab "" | #@#Addons\GetNir.exe "Muted" "Command-LineFriendlyID='Realtek High Definition Audio\Device\Microphone\Capture'"
Does it matter whether you use the Program= line? Or is it just another way of working?

Only issue I have is getting the values required.

Started looking at this page on RegEx, starts simple! ;-)
:thumbup:
You repeated the "svcl" part in both the Program and the Paraneter options - a little care with it, it's no big deal! ;-)
For me and my laptop and headset mics, this works:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
OnUpdateAction=[!CommandMeasure GetPercentMic1 "Run"][!CommandMeasure GetPercentMic2 "Run"]

---Measures---

[GetPercentMic1]
Measure=Plugin
Plugin=RunCommand
Program=#@#Addons\svcl.exe
Parameter=/Stdout /GetPercent "Realtek(R) Audio\Device\Microphone Array\Capture"
State=Hide
OutputType=ANSI
Timeout=10000
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?:\s+|[.]\d+)":""
FinishAction=[]

[GetPercentMic2]
Measure=Plugin
Plugin=RunCommand
Program=#@#Addons\svcl.exe
Parameter=/Stdout /GetPercent "Realtek(R) Audio\Device\Headset Microphone\Capture"
State=Hide
OutputType=ANSI
Timeout=10000
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?:\s+|[.]\d+)":""
FinishAction=[]

---Meters---

[Result]
Meter=String
FontFace=Consolas
FontSize=12
FontColor=255,255,255,255
SolidColor=0,0,0,128
AntiAlias=1
MeasureName =GetPercentMic1
MeasureName2=GetPercentMic2
Text=Mic 1 Volume: %1%#CRLF#Mic 2 Volume: %2%
LeftMouseUpAction=[!CommandMeasure GetPercentMic1 "Run"][!CommandMeasure GetPercentMic2 "Run"]
Mics.jpg
The paths and the friendly IDs are slightly different for me, but you get the idea. Tried placing both mics in the same command, but it didn't work and I didn't bother much either. Not sure how you'll detect the "active" mic, since for me, when I use the headset / headphones, both mics are active in SoundVolumeView (which you'd use to know which parameters to use for svcl). But who knows, maybe it's a slight overlook in my Windows settings from my part in that case. The update could be longer in principle, so that the svcl.exe instances don't overlap when running.

As for regex, one word I keep repeating to everyone: REGEXR.COM. Can't get simpler than that. This is how I became better at regex, after my eyes were being opened on the possibilities by jsmorley a long time ago (mainly on regex quantifiers, but that was enough to captivate my interest).

P.S. You can use Program or Parameter, or just Parameter, see here:
https://docs.rainmeter.net/manual/plugins/runcommand/#Program
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: 1233
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: [!Refreshapp] when skin loaded?

Post by sl23 »

Thanks, that sort of got me going in the right direction. Still playing with it, but that got it working so far. Just need to tune it. Still having some issues getting it working right, but that'll be something I can hopefully work on myself?! :D

Trouble I have is knowing what is needed and where! Believe me, I tried every combination I could think of, spent around 12 hours trying all sorts of different codes and researching what the correct syntax is, yes, I know it's in the manual, but it just wouldn't work. No doubt my fault, but when you don't know what you're doing wrong, you can't fix it in any other way than trial and error! :-(

I also didn't know I needed /Stdout. Didn't know what it was despite reading descriptions, as the descriptions are for those who know already what they are doing. :rofl:

Ok, I'll try that site for RegEx, I did quite like the one I looked at as it explained in simple terms what each symbol does.

One of the issues I have is that the StringAlign is set to CenterCenter, yet when the RunCommand is activated and sets the Meters to show the value, the StringAlign seems to set itself to just Center, would you know why? If not I'll change it, no biggie! :thumbup:

So I have to use one command per Run Measure? Ok, I thought you could do two at once, but I think I read that it has to be separated by a ; which then comments out the line.
- MuLab -
User avatar
sl23
Posts: 1233
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: [!Refreshapp] when skin loaded?

Post by sl23 »

So far it's working perfectly! Far better in fact than the powers he'll and cmdlet. Everything just works and is pretty instant, which is a great improvement and no memory leak to deal with!

Only problem I've run into is how to get the volume bar to set position that represents volume percent? I'll post code tomorrow then you can tell me what I'm doing wrong! Lol

Thank you so much for your help! :D
- MuLab -
User avatar
Yincognito
Rainmeter Sage
Posts: 7576
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [!Refreshapp] when skin loaded?

Post by Yincognito »

sl23 wrote: June 18th, 2024, 11:20 pm Only problem I've run into is how to get the volume bar to set position that represents volume percent?
https://docs.rainmeter.net/manual/variables/mouse-variables/
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
sl23
Posts: 1233
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: [!Refreshapp] when skin loaded?

Post by sl23 »

Thanks but I meant just visually. It's not working. Probably something simple! :)
- MuLab -
User avatar
Yincognito
Rainmeter Sage
Posts: 7576
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [!Refreshapp] when skin loaded?

Post by Yincognito »

sl23 wrote: June 19th, 2024, 7:11 am Thanks but I meant just visually. It's not working. Probably something simple! :)
Yeah, some !UpdateMeter and !Redraw in the RunCommands' FinishAction, or some DynamicVariables=1 in the right places...
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth